pimoroni / phat-beat

Python library for PHAT BEAT - A stereo DAC, AMP and VU for the Raspberry Pi
https://shop.pimoroni.com/products/phat-beat
MIT License
99 stars 28 forks source link

Integrate MQTT #27

Closed bjoernbusch closed 4 years ago

bjoernbusch commented 4 years ago

I'm trying to integrate MQTT messages into the phatbeatd service, so that I can change the station via MQTT messsages.

The MQTT can in general connect to the MQTT server, but only if I manually restart the service after boot. During boot, I always get a socket.error: [Errno 101] Network is unreachable.

I can't figure out how to make the service wait until a proper internet connection is established. I tried changing the service definition to wait for network, named or all, but I still get the same error. I changed the raspi-config settings to wait for network on boot, but still the same error.

Anybody have some advice?

bjoernbusch commented 4 years ago

Solved by doing the mqtt connect async and with retry.