ironsheep / lightning-detector-MQTT2HA-Daemon

Linux script to monitor AS3935 lightning detector and report detections to MQTT
GNU General Public License v3.0
34 stars 7 forks source link

Add systemd boot timer #15

Closed lightmaster closed 4 years ago

lightmaster commented 4 years ago

When someone is running the ISP-lightning-mqtt-daemon script on a RPi that is separate from the device that is running the MQTT server, there is currently nothing that prevents the script from starting on boot before the network is full initialized and capable of connecting to the MQTT server. This PR adds a 30 second timer that delays the script from starting too soon, and also adds a requirement for network-online.target so there's a valid IP before the script starts.

Also added VSCode config files to the .gitignore

Adds a README-SPI.md fix that was applied to README.md in c7f5aa47b6e628359106701f65af011f46e886f3, replacing ISP-RPi-mqtt-daemon with ISP-lightning-mqtt-daemon

ironsheep commented 4 years ago

@lightmaster thank you for this... but this again was my first script. I am backporting changes to the script itself to fix this startup issue. It's more correct and much less extra work (no extra service, etc.)

I'll make the corresponding changes to the README tho' that you point out are incorrect.

Thanks. Update forth coming...