Use this forum to chat about hardware specific topics for the ESP8266 (peripherals, memory, clocks, JTAG, programming)

User avatar
By lucasromeiro
#76495
Bonzo wrote:I currently have a Nodemcu in my greenhouse which transmits the sensor data to a Pi in my house on a request from some Python code on the pi. The pi uses Python to save the data to a csv file. The pi has a webserver and uses php to select the data ( each month is in a different file ) and send that to some jquery code to build an interactive graph.

The problem with this is the pi as it is not very reliable - the wireless stops every now and again and the pi seems to hang after a few days of running. Sometimes it will re start on its own other times I need to unplug it as it is un responsive to keyboard, mouse or wireless.

Options I have thought of:
    Wireless adaptor on the PC - The PC may not always be on and it uses a lot more energy than the pi
    Micropython on the Nodemcu - I doubt there will be enough memory to save the data after a while and probably not display it in the format I want
    A pi alternative - I have no idea what would be more reliable and most are way overspecked/expensive for what I need.
    If I have a wireless datalogger that may work as I can request the csv files from that and run it through Python/php/JavaScript on the PC.
    Use my spare Nodemcu and connect it to an SD card to save the data
I know there is a lot of hardware around these days and it is a matter of picking the right piece - I should also say the Nodemcu is running from a 3.7V battery charged from a solar panel which restricts the options at that end.

This project is not critical as I only started it as it gave me something to do and I would hopefully learn a bit of Python so I do not want to spend a lot more money on it. But it would be nice to see it through so any ideas would be useful.

Note: I am old fashioned and not a fan of the cloud but that may be a way to go?


maybe help you
see: https://github.com/lucasromeiro/DropboxManager
library manager: DropboxManager
User avatar
By btidey
#76504 I think your original choice of a Raspberry Pi was a good one.

There is nothing intrinsically unreliable about a Pi, quite the opposite. Millions of people use these for servers etc. I have several in use 24/7, some gathering data from ESP8266 IOT sensors and they have run for years with no unexpected downtime.

So I would spend a bit more time trying to find out what causes your issues.

Possibilities include

Power supply issues. Note that a common problem with Raspberry Pi's is using poor quality USB cables to feed the power. There are many cables that have high resistance and cause a significant voltage drop when feeding Raspberry Pi currents leading to instability.

Network issues. You mention you are using wifi. Is that with a Raspberry Pi with built in wifi or with USB dongle. Some dongles can get quite warm particularly when in marginal wifi areas and again lead to instability. It would be good to try for a period with a LAN cable to eliminate the wifi as the cause.

You could give more details on your network set up or try asking on the official Raspberry Pi forums which are very helpful.
User avatar
By picstart
#76506 I have a rasp pi running Mosquitto MQTT. All data transfers from sensors to switches are done via MQTT. The esps both 32 and 8266 publish and subscribe. It has worked without interruption even through several reboots due to mains power interruptions for a year or more. For data packets of 100 bytes or so it is a very effective way to do things. MQTT can store and forward also I haven't used this feature since all of my sensor nets transactions needed to be immediate or not at all ( failure) it wouldn't be good to have the failures resubmitted.
User avatar
By Bonzo
#76643 Sorry for not relying sooner; for some reason I did not see the replies in the view new posts.

I really like the current process I have but I spent quite a few hours trying to use SPIFFS and NTP which turned out to be a painful process and it still has problems.

While looking for a Pi alternative I found this:

When users started getting their Raspberry Pi 3 kits and trying them out, there many issues. Some of the devices began to heat up. Others froze or restarted in the middle of running a program. The wireless internet connections would have a weak signal or experience drop outs. Many brilliant minds puzzled over the problem to figure out what the issue could be. It turned out the solution was actually quite simple: People were using the wrong power supplies.

While the Raspberry Pi 2 might need up to 2A of current, the Pi3 always requires 2.5A. But this is not entirely correct. If you use a power supply designed for the Pi2, then your device will not work correctly.


I checked the PSU I have on the website I brought it from and it is "no longer stocked"; is marked up for a Pi 1 & 2 and is 2A. I have a Pi 3 and the one recommended on the site for a 3 is 2.5A They were not "official" Pi PSU's but were linked to the Pi when I brought it.
So it looks like my PSU is under specked and the article I quote above mentions both the WiFi problems and locking up. I should have a new PSU this evening and I will put all the code back to how it was and give it another go.

Thank you again for the suggestions and I am using UPD and will take a look at MQTT if I can find a Python tutorial for it. I am very new to Python and need to find tutorials to help me along.