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:
- Create an account at http://intl.aliyun.com( for users outside of China ) by clicking on "Free Trial"
- 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
- Click on the gear icon next to the "Products" drop down list and add the "Message Service"
Creating Account Settings:
- Click on the newly added "Message Service" tab or navigate to http://mns.console.aliyun.com
- The locations listed next to "Queue list" are the locations of the servers for the messaging service. Select one and click on "Get endpoint"
- The format of the public endpoint is (accountid).mns.(region).aliyuncs.com. Make note of the account ID and region
- Close the popup window and click on "AccessKeys" on the top menu bar or navigate to https://ak-console.aliyun.com
- A "Security Tips" popup will appear, click on continue to proceed
- Make note of the "Access Key ID" and the "Access Key Secret"
Running the Application:
- Download and unzip the application to your snip folder
- 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
- Configure wifi_config_dct.h for your AP settings
- Build and download the application with the make target snip.aliyun_mns-<platform> download run
- Open a terminal application to view the output
- You can also send/receive messages on the web console (comment the call to delete queue to verifymessages sent from wiced board)
Aliyun API reference documents can be found here: https://intl.aliyun.com/help/product/27412.htm?spm=a3c0i.men.a1.3.3adntp