caty
September 20, 2014, 9:09pm
1
Hi there!!
I’m using Ubidots to log the Internet latency on an Openwrt router, following your tutorial: http://blog.ubidots.com/how-to-monitor-your-internet-connection-using-openwrt-and-ubidots
I would like to log the wan IP Address, as a string, is this possible?
aguspg
September 20, 2014, 9:29pm
2
Hi caty,
Thank you for your message. Yes it is possible to send string information to Ubidots. This is what we call “context”. The context is an arbitrary set of “key”:“value” pairs, which can be strings.
In your case, the data payload would look something like this:
POST things.ubidots.com/api/v1.6/variables/{variable_id}/values
{“value”:320,“context”:{“ip_address”:“88.88.88.88”}}
You can find some examples here:
http://ubidots.com/docs/api/v1_6/data/post_variables_id_values.html#creating-a-value-with-a-context
Live Tracking the International Space Station (line 33 of the code snippet)
It should be easy to make this addition in the Lua code of our Openwrt example. If not, please let us know and we’ll assist you.
Please let us know if you need any further assistance.
Best,
–Agustin