6

A thermostat device returns JSON like data from the command line:

curl -s http://192.168.X.Y/tstat/humidity
{"humidity":51.00}

It would be interesting to setup a UNIX cron job to periodically script the upload of the data to a host so that it can be visualized (graphed). The command line device is an Asus router Configured with Merlin ASUS command set. A cron job executes a .sh UNIX script to save data to a USB memory stick.

The next step in the pedagogical exercise is to upload data to a cloud service and visualize data

QUESTIONS

  1. What is the keyword search term that would quickly narrow down the IOT service providers that have an API that allows the router to upload data from a command line script (UNIX instructions)

  2. If this is not possible, what are the leanest \ smallest options of API classes (Python MQTT etc). The better options have a small foot print because RAM is limited.

I realize that a router is not a raspberry pi, nor is it design for this purpose. That being said, I am speculating that the task to query and upload the result is well within its hardware capability.

2 Answers 2

5

If you already have curl to do the download there should be no reason not to use it to do a POST to push the data to another service.

So you need to search for HTTP APIs for any provider you want to use.

e.g. It's been a long time since I used it (back when they were called Pachube) but Xively have a HTTP POST API (https://developer.xively.com/docs/publishing-over-http)

0
5

Looks like flespi is the way to go in your case.

You may use flespi http channel to upload data in http with CURL (or alternatively use mqtt channel). The data you upload should be in format like: curl -X POST http://X.Y.Z.W:P/ -d {"ident":"123","humidity":51.00}, where ident is unique identifier for your sensor. Also you may pass "timestamp" with time of sensor value detection or any arbitary properties.

Then you need to create flespi device and specify correct device type (e.g. generic http) and same ident. After that posted messages will be accumulated in device and you may access them via REST, some other tools like TrackIt! or even simply visualize inside grafana.

1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.