Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

Using Aliyun MNS Service

Using Aliyun MNS Service

25 replies posted 10 replies posted 5 replies posted

Using Aliyun MNS Service

Aliyun is a cloud service provider that supports a messaging service called Aliyun MNS. Messages and commands are transmitted using RESTful HTTP methods. This blog provides an application and a guide to interfacing with the Aliyun MNS service.

Creating an Account:

  1. Create an account at http://intl.aliyun.com( for users outside of China ) by clicking on "Free Trial"
  2. 1.PNG
  3. After verifying your account and adding a payment method (MNS Service is free as of time of writing), log in to http://console.aliyun.com
  4. Click on the gear icon next to the "Products" drop down list and add the "Message Service"
  5. 2.PNG

Creating Account Settings:

  1. Click on the newly added "Message Service" tab or navigate to http://mns.console.aliyun.com
  2. The locations listed next to "Queue list" are the locations of the servers for the messaging service. Select one and click on "Get endpoint"
  3. 3.PNG
  4. The format of the public endpoint is (accountid).mns.(region).aliyuncs.com. Make note of the account ID and region
  5. Close the popup window and click on "AccessKeys" on the top menu bar or navigate to https://ak-console.aliyun.com
  6. A "Security Tips" popup will appear, click on continue to proceed
  7. 4.PNG
  8. Click on "Create Access Key", read the API Terms of Use, then "Agree and Create"
  9. Make note of the "Access Key ID" and the "Access Key Secret"

Running the Application:

  1. Download and unzip the application to your snip folder
  2. Open aliyun_common.h and fill in the previously noted information. ALIYUN_QUEUE_NAME is the name of the queue you want to create or work on
  3. Configure wifi_config_dct.h for your AP settings
  4. Build and download the application with the make target snip.aliyun_mns-<platform> download run
  5. Open a terminal application to view the output
  6. 5.PNG
  7. You can also send/receive messages on the web console (comment the call to delete queue to verifymessages sent from wiced board)
  8. 6.PNG

Aliyun API reference documents can be found here: https://intl.aliyun.com/help/product/27412.htm?spm=a3c0i.men.a1.3.3adntp