Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MQTT service does not start after reboot in demo #76

Open
raymar9 opened this issue Jan 8, 2025 · 3 comments
Open

MQTT service does not start after reboot in demo #76

raymar9 opened this issue Jan 8, 2025 · 3 comments

Comments

@raymar9
Copy link
Contributor

raymar9 commented Jan 8, 2025

Hi,
I’m experiencing an issue with Meter. When I reboot the Raspberry Pi (RPI), the MQTT service doesn’t work. To fix this, I have to log in to the web interface and manually press "Restart Data Collector." After that, MQTT starts working again. However, the problem reoccurs every time I reboot the RPI. It is the demo image.

Best regards,
Miha

Originally posted by @TTNIdrija in #70 (comment)

@raymar9
Copy link
Contributor Author

raymar9 commented Jan 8, 2025

Do you mean with "MQTT service" the smartmeter-datacollector service or mosquitto, the MQTT broker?

Could you check whether the systemd services for python3-smartmeter-datacollector and mosquitto are enabled when you access the RPi via SSH?

systemctl status python3-smartmeter-datacollector
systemctl status mosquitto

You can enable a service with systemctl enable python3-smartmeter-datacollector or systemctl enable mosquitto.
Enabling means that it starts during boot up.

@TTNIdrija
Copy link

I solved it by creating a restart service that runs 10 seconds after the Raspberry Pi boots.

sudo nano /etc/systemd/system/reset-smartmeter.service

content:


[Unit]
Description=Reset Smartmeter Data Collector Service
After=network.target

[Service]
Type=oneshot
ExecStart=/bin/bash -c "sleep 10 && /usr/bin/systemctl restart python3-smartmeter-datacollector"

[Install]
WantedBy=default.target

sudo systemctl daemon-reload

sudo systemctl enable reset-smartmeter.service

sudo reboot

Probably not the ideal solution, but it works :)

@raymar9
Copy link
Contributor Author

raymar9 commented Jan 9, 2025

Nice! But why didn't systemctl enable python3-smartmeter-datacollector suffice? Did the service start but didn't produce any output or did the service just not start after booting?

I will check the startup behavior again the next time I use the demo image. However, I'm pretty sure that after configuration the demo automatically started and worked after rebooting, the last time I used the demo.

@raymar9 raymar9 closed this as completed Jan 9, 2025
@raymar9 raymar9 reopened this Jan 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants