If I execute a Python 3 script inside my Raspberry Pi 3 and it uses time.sleep(wait)
, it only works interactively. If I background the process using &
, the script doesn't seem to work at all and I don't see any output in my CSV file the script writes to. It stays at file size 0
forever.
I've tried this by running a script directly (read-sensor >/var/lib/envirophat/sensor.csv &
) and the same inside a Docker container (I'm using HypriotOS).
How can I read the sensor faster than once per minute (using crontab
) but not continuously without any kind of sleep
?