From the recent email received from TI announcing their new Connected LaunchPad line, I noticed the free partner service offered to Exosite.
It is really cool to have the services of this kind, easy to configure for such a sophisticated communication platform.
My only problem is I don't have one of those new shinny Connected LP.. actually TI won't sell those to where I live. But that doesn't stop my drive to test out this new exciting cloud!
Firstly, an F5529LP with TI TMP006 temperature booster pack was selected as the test rig. This was a small project from last month that also with a 1602 LCD.
The coding is done in Energia. Although the LCD shows a lot of info, including sensor temperature and die temperature, together with their min / max, the data output from serial is currently limited to the sensor temperature only.
The F5529+TMP006+LCD package is connected to a TP-Link WR703N wireless router with OpenWRT. Every 4 seconds the LP send the sensor temperature through serial to the OpenWRT. This router is installed with ser2net package and a lua program is running to capture that value, and then send to Exosite. (Yes that is a Haagen Dazs behind the LP.. to make sure temperature below 0C worked as well as no shortage of dessert tonight..)
The whole Exosite experience is pretty nice. It only takes less than half hour from opening a new account to have the site ready to receive data, that already include reading the documentation on how to send data with their simple HTTP protocol.
For the 703N router, apart from the package ser2net, a small lua program that required the lua socket package (easily installed in the standard way - opkg install luasocket), included below is used to capture the output from ser2net, do some legwork, and finally send data to Exosite:
local host, port = "127.0.0.1", 2002
local socket = require("socket")
local tcp = assert(socket.tcp())
tcp:connect(host, port);
while true do
local s, status, partial = tcp:receive()
print(s or partial)
if status == "closed" then break end
local socket = require("socket")
local host = "m2.exosite.com"
local sock = assert(socket.connect(host, 80))
sock:send("POST /api:v1/stack/alias HTTP/1.1\r\n")
sock:send("Host: m2.exosite.com\r\n")
sock:send("Content-Type: application/x-www-form-urlencoded; charset=utf-8\r\n")
sock:send("X-Exosite-CIK: secret-exosite-token-here\r\n")
sock:send("Content-Length: 8\r\n\r\n")
sock:send("s=")
sock:send(s)
sock:send("\r\n\r\n\r\n")
repeat
local chunk, status, partial = sock:receive(64)
print(chunk or partial)
until status ~= "closed"
sock:close()
end
tcp:close()
It is quite an enjoyable experience to have little things connected to the Internet ![]()
In summary:
TMP006 -(I2C)-> LP5529 -(serial)-> 703N/ser2net -(socket)-> 703N/lua -(http)-> Exosite