What's new

Uploading IOT data via scripts

  • SNBForums Code of Conduct

    SNBForums is a community for everyone, no matter what their level of experience.

    Please be tolerant and patient of others, especially newcomers. We are all here to share and learn!

    The rules are simple: Be patient, be nice, be helpful or be gone!

gatorback

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

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

A cron job wass configured to execute 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

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 WRT and its abridged command set.

QUESTIONS
=========
1) What is the keyword search term that would quickly narrow down the IOT service providers and provide example of an API that allows the router to upload data from a command line script (UNIX instructions)? I think this is a RESTful API.

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 a measurement is well within the hardware's capability. The goal is to avoid re-inventing wheel: examples of routers configured to upload data to a IOT cloud service is appreciated. Any lessons-learned are also appreciated. Thank you.
 
Last edited:
The router is even capable of hosting the data and a webpage to display it.

I would take a look at storing the info in RRD format as it is easy to produce PNG graphs from that.
This project (https://github.com/kvic-z/goodies-asuswrt/wiki/Install-NTP-Daemon-for-Asuswrt-Merlin) stores NTP data in RRD and then levers it into the router web UI itself.

I run Lighttpd on mine to host a PHP/JavaScript driven web remote I developed for my Sky Q STB (saves me hunting for the TV remote when the kids have moved it!).

Just another angle if cloud storage is not a must. This way you keep your data and just VPN Home to view it remotely.


Sent from my iPhone using Tapatalk
 
Take a look at the "NTP Daemon" as suggested by @JDB. Actually it'll be quick and easy to adapt for your purpose.

It might be possible to run Netdata from Entware on your router and hook up the data collection with a script. Never looked at it before but I could imagine that's a possibility..

Or you can setup a Rasp Pi or a Linux server to host your data collector & visualization. Many packages available from small to glorified solutions.

Personally I run MRTG on Asus 56U. Since it'll be a support nightmare, I don't advertise nor advocate. Nevertheless, it serves me very well for over a year now.
 

Similar threads

Latest threads

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!
Top