Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Paho » Paho MQTT and autorun(Problem with paho in autostart)
Paho MQTT and autorun [message #1835934] Wed, 16 December 2020 19:54
Roby Roby is currently offline Roby RobyFriend
Messages: 1
Registered: December 2020
Junior Member
Hi all,
I am trying to run a python script when RP starts.
The script controls the processor temperature and automatically adjusts the fan speed to generate more or less airflow.
I tried with crontab, in rc.local and now i'm trying to start services automatically using systemctl and the script is working well, but the only problem is that it doesn't publish via mqtt the fan speed.
If i try to launch script manually it works well and value will be published correctly, so i think that the problem is paho at startup that seems doesn't work.
I also put a time sleep before publishing starts but there is no way it works again.
Do you have any suggestion?

This is my service:

[Unit]
After=network.target mosquitto.service
Requires=mosquitto.service
Wants=network.target

[Service]
ExecStart=/usr/bin/python -u fan.py
WorkingDirectory=/home/pi/script
StandardOutput=inherit
StandardError=inherit
Restart=always
User=pi

[Install]
WantedBy=multi-user.target

Thank you
Previous Topic:Websockets with basic auth Paho C Client
Next Topic:multi-process message callback
Goto Forum:
  


Current Time: Fri May 03 07:10:58 GMT 2024

Powered by FUDForum. Page generated in 0.03277 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top