loading

In this Instructable we will see how to use MangoCube WiFi to upload data on to the website: Thingspeak

Things you will need;

1. MangoCube WiFi (or Arduino board with this WiFi-Board)

2. Wi-Fi access point(router) with Internet connection

First of all Configure your MangoCube WiFi so that it can connect to your Home Wi-Fi router/Access point.
Connect MangoCube WiFi to PC/Mac via USB cable
Select COM Port
Select Board type as Leonardo
Copy following code (also shown in the pic) and upload the sketch
//--------------------------------------------------------------------------------------------------
void setup() { pinMode(13, OUTPUT);
digitalWrite(13,LOW);
// initialize serial communication at 115200 bits per second:
Serial.begin(115200);
while (!Serial) { ;
// wait for serial port to connect. Needed for Leonardo only
}
Serial1.begin(115200);
delay(100);
// delay in between reads for stability
} void loop() {
// read from port 1, send to port 0
if (Serial1.available()) { Serial.write(Serial1.read()); }
// read from port 0, send to port 1
if (Serial.available()) { Serial1.write(Serial.read()); } }
//----------------------------------------------------------------------------------------------------

Once the Sketch is uploaded successfully Open Arduino Serial Monitor

Step 1: Command Mode

Open Arduino Serial Monitor at 115200 baud rate and No line Ending.

Now Input following;
+++

you should get following response;
a

now Input the following within 3 Second!
a

you should get following response;
a+ok

Now you are in command mode where you can useAT+Command to configure Wi-Fi parameters.
In next step we will see how to configure your MangoCube WiFi.

Step 2: Configure MangoCube WiFi

In Arduino Serial Monitorinput following command with Carriage return

AT+WMODE=STA
you should get the following response;
+OK

AT+WSSSID=Your router's SSID (e.g. Century as shown in pic)
you should get the following response;
+OK

AT+WSKEY=WPA2PSK,AES,yourWiFipassword
where AES is the network security type, your could be different. You should get the following response;
+OK

AT+Z
Once Input AT+Z the MangoCube WiFi module will restart and connect to your Wi-Fi network!

MangoCube WiFi will now work as Client (STA) in other words a Tiny computer that can connect to internet and Browse web page!!
We will see how to do that in next step...

Step 3: Connect to Thingspeak

Repeat Step: 1 in order to get in to Command Mode.

Once in Command mode Input following commands with carriage Return;

AT+HTTPURL=http://api.thingspeak.com,80

You should receive: +ok

AT+HTTPCN= keep-alive
You should receive: +ok

AT+HTTPPH=/update?key=E7FSORWU63FL9DL5&field1=5

where key=E7FSORWU63FL9DL5 is the key assigned to Megavizon's channel on Thingspeak. You can creat your own channel on Thingspeak and you will be given a key like the one above.
Also the last Digit 5 (i.e. field=5)is the Value that we want to upload to Thingspeak. You can change it to any other digit of your choice.

the following code actually does Data Transfer so whenever you need to send/receive data use it.
AT+HTTPDT
You should receive: HTTP/1.1 200 OK ....

Now check the graph at Megavizon's channel on Thingspeak!
You can try changing the last Digit 5 (i.e. field=5) to any other value and see how it reflects to the Graph.

Watch this video to see all the steps in actions!

Great that completes this Instructable!!


<p>Very easy to follow and implement. Thank you MangoCube for the amazing tutorial</p>

About This Instructable

819views

5favorites

License:

More by MegavizonLtd:Controlling LED by phone and MangoCube WiFi in AP mode MangoCube WiFi in AP(Access Point) Mode Getting Started with MangoCube BLE 
Add instructable to: