gateway.py loop seems to stop/start sporadically

Started by jamacaulay, May 24, 2018, 01:02:02 PM

jamacaulay

Hi all.  Been scratching my head for a long time on this one.  I have a sump pump sensor, temp/humidity sensor, and recently added motion sensor hooked up on moteinos around the house, sending the info to a moteino and Raspberry Pi, using a modified version of the gateway.py to process the data and store into a MySQL DB.  I ran the gateway.py script every 5 mins before via crontab.  However, now that I have the motion PIR sensor in the roster, would need to run gateway.py on boot and have it running all the time in an infinite loop to catch motion.

My problem is, that every so often at sporadic times, the python script would appear to hang..... then start again at random intervals.  I can tell because of timestamps in the MySQL DB, and I send myself a text if these sensors don't check in after so many minutes.  During one of these downtimes, running python -m serial.tools.miniterm /dev/ttyAMA0 115200 reveals that the gateway moteino is receiving the data from the sensors, so I don't know why the python script seems to stop and start like this.  Has anyone had this experience before?  Hard to catch in debug mode, because it happens so randomly.

Felix

The gateway.py is a very very old implementation, no longer supported in any way.
For the latest see http://lowpowerlab.com/gateway