Chat freely about anything...

User avatar
By adlwqlzqmp
#74826 I need to wirelessly monitor sensor data, but the data can't go out over the Internet. To accomplish this, I'm using a NodeMCU and sending the data to a Raspberry Pi server.

Here's a diagram of my setup:

Image

I'm using MQTT to send the sensor data from several NodeMCUs to the Raspberry Pi, storing the data in a MySQL database, and writing a Python server to show both realtime and historical data.

I'll be using Google charts to display the data, and using JavaScript to poll live data from the Raspberry Pi though a JSON API.

I'm still working on this project, but I'd like some feedback. Are there better or easier ways to accomplish this?
User avatar
By sej7278
#74847 not really, if you're not using the cloud then you need your own server.

its what i do too, the pi is more powerful than the esp8266 so it makes sense to do parsing, crypto etc. there.

i basically wrote a daemon to accept a serialised struct then process it, populate a database, tweet results, make graphs etc. it also accepts input from nrf24l01+'s from arduino's, otherwise i could have just used udp and it would have been easier.
User avatar
By kee
#75235 i have a similar one except i m using nodered in vm(pi in your case) and access the nodered UI from within LAN
User avatar
By PatrykW
#75328 I'm not sure if there are easier ways of doing that, but there definitely are cheaper ways.
The esp8266 is perfectly capable of running a web server, websocket server, reading sensors, doing sha1 digest on the go to secure stuff and handling communication at the same time. Most boards can be configured to use 3Mbits of flash for SPIFFS which is more than enough for logging data. 10,000 write cycles will last you years if you'll buffer the data in a smart way.
Personally I find it way more convenient to do scripting in Linux environment. But on the other hand, 30 bucks you spend for pi buys you 20+ esp-12F's on AliExpress, so...