This post was last edited by Jacktang on 2019-10-10 14:40
The following describes how to connect CC3200 LaunchPad to Gizwits Cloud Server. Please refer to the attached PDF for specific operations.
Please note that this code is just a basic demonstration of how CC3200 connects to Gizwits Cloud and its heartbeat. Subsequent specific product-related protocols need to be developed by users themselves.
Anyone interested in adding features or fixing bugs, please attach your patches to this post in the spirit of open source sharing.
If it is suitable to be integrated into GitHub, I will integrate it.
1. Log in to Gizwits Cloud
Please make sure you have registered a Gizwits developer account before you start. If you do not have one, you can visit the Gizwits website to register.
2. Create a new device
- After logging in, add a CC3200 LaunchPad device, or create one from a template.
- Create a data point for CC3200 LaunchPad LED D7
- Follow the wizard and click Next. Finally, you can follow the demo APP or download the SDK to customize the APP.
3. Get the Product Key
- After the device is created, go to the personal project and get the Product Key
-
The CC3200 code is stored on github.com. Please download it from the following link:
https://github.com/yhpan0613/SimpleLink-CC3200/releases
-
Select a version and click zip to get the latest code
-
Modify CC3200 code
In SimpleLink-CC3200.git\example\getting_started_with_wlan_station\gagent\include's gagent.h, there is a macro definition: #define PRODUCT_KEY.
Please modify it to the product key of the device you created above.
-
Modify the SSID and password of the router you want to connect to in common.h.
5. Run the program to connect to Gizwits Cloud
- Open wlan_station.eww with IAR, then compile and download it to CC3200LP and run it
- Connecting to Gizwits Cloud consists of two steps. The first step is to obtain the IP address of the MQTT server by accessing the HTTP Server.
The second step is to send an MQTT heartbeat packet PING every 50 seconds, and the server will return a heartbeat packet response PONG.
If you see the following LOG, it means the heartbeat is normal:
INFO MQTT Send packet length=2
CRITICAL GAgent Cloud Ping ...
CRITICAL GAgent Cloud Pong ..
3. You can view the status information of your device on the Gizwits Cloud website:
6. You can generate an IOE demo app on the Gizwits website, install it on your phone, and then scan it to the CC3200 Launchpad for binding.
7. Add content to customize data interaction for your device.
References:
Connect_CC3200LP_to_Gizwits.pdf
(265.49 KB, downloads: 13)
Please refer to the latest CC3200 code of Gizwits:
CC3200 Code
|