Yeah sorry about that, forgot to reset the timers.
You need the last sleep statement to prevent a "buys loop" (look it up) that uses all CPU time. Of course the pi only supports time.sleep, not time.sleep_ms.
Re internet: If you run a mqtt broker like mosquitto on your raspberry pi, you don't need to have internet access unless you want to access your local lan from the internet.
Re last will: You should read about mqtt. Last will is sent from the broker when the connection to the client is lost.
Wanting to send data with different intervals
-
- Posts: 969
- Joined: Sat Feb 03, 2018 7:02 pm
Re: Wanting to send data with different intervals
Kevin Köck
Micropython Smarthome Firmware (with Home-Assistant integration): https://github.com/kevinkk525/pysmartnode
Micropython Smarthome Firmware (with Home-Assistant integration): https://github.com/kevinkk525/pysmartnode