Wanting to send data with different intervals

General discussions and questions abound development of code with MicroPython that is not hardware specific.
Target audience: MicroPython Users.
kevinkk525
Posts: 745
Joined: Sat Feb 03, 2018 7:02 pm

Re: Wanting to send data with different intervals

Post by kevinkk525 » Fri Feb 22, 2019 10:01 pm

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.
Kevin Köck
Micropython Smarthome Firmware (with Home-Assistant integration): https://github.com/kevinkk525/pysmartnode

Post Reply