#IoT :Network of two CC3200 sensor nodes through Internet.
Exploiting
the features of #dweet
and #Temboo and our Texas Instruments #CC3200 we can make
a sensor network over Internet. We can show each sensor node status by sending
some code to dweet server under a my-thing-name. To read the latest dweet for a thing, you can
go to the web address https://dweet.io/get/latest/dweet/for/my-thing-name . Note that dweet.io holds on to the last 500 dweets over a
24 hour period. If the thing hasn't dweeted in the last 24 hours, only its
history will be removed. We can’t identify if the node fails. By checking the
codes on thing we can easily identify whether the node fails. For HTTP Get
request we can use Temboo library. Each run of choreo on another CC3200 get
response from dweet through HTTP get request. The chunk response filtered for
codes. If one code is received and verified it checks for second code.
We
can design a network in which each node is sending its status to dweet and also
check for other node’s status by using Temboo HTTP choreo. We can visualise the
network by using #IoT visualisation tool #Freeboard.io.
Each node status on the network can be monitored from anywhere by following
Freeboard.io link for our sensor network.
Ø Dweeting
sensor network status from one node.
1. Include
necessary header files
//#include <SPI.h>
#ifndef __CC3200R1M1RGC__
#endif
#include <WiFi.h>
#ifndef __CC3200R1M1RGC__
#endif
#include <WiFi.h>
2.
Network parameters
char ssid[] = "Connectify-*****";
char password[] = "**********";
3.
Dweet Server address
IPAddress
server(54,88,231,110); // dweet
4.
// Dweet
parameters
#define thing_name "*******"
#define thing_name "*******"
5. int code1 =
****;
int code2 = ####;
6. void setup()
{
WiFi set up
}
7.
Next is the continuous running loop for
dweeting sensor node status.
void
loop(){
In the loop function we should dweet two codes with a interwal of 10 seconds,
so its better to call function for dweeting different codes Like dweet(code1);
7. Dweeting codes.
if
(client.connect(server, 80))
{ Serial.print(F("Sending
request... "));
client.print(F("GET /dweet/for/"));
client.print(thing_name);
client.print(F("GET /dweet/for/"));
client.print(thing_name);
client.print(F("?code1="));
//for the
next run code 2 is send
// client.print(F("?code2="));
client.println(F(" HTTP/1.1"));
client.println(F("Host: dweet.io"));
client.println(F("Connection: close"));
client.println(F(""));
// client.print(F("?code2="));
client.println(F(" HTTP/1.1"));
client.println(F("Host: dweet.io"));
client.println(F("Connection: close"));
client.println(F(""));
Ø
Subscribing to dweet of the node from other
sensor node.
As
we know that dweeted parameters will be there in the response on the link under
thing name by following https://dweet.io/get/latest/dweet/for/my-thing-name
.
For
this we can use HTTP Get choreo from Temboo like
String URLValue =
"https://dweet.io/get/latest/dweet/for/ thing-name ";
GetChoreo.addInput("URL",
URLValue);
For
exploring the Temboo logon to
“Create, Make,
Code the Internet of Everything. Start programming the connected world w/ 500
bonus @temboo credits http://bit.ly/1xBR7Ls
“
Comments
Post a Comment