Comments (6)
If you've installed the project into a virtualenv, you need to make sure you're using the right python binary. Change the command
line to something like:
command=/path/to/your/virtualenv/bin/python -m pi_mqtt_gpio.server /home/pi/pi-mqtt-gpio-config.yml
I've updated the readme to contain a section about using supervisor. Try setting it up like that if it still doesn't work.
from mqtt-io.
Hey @someinternetguy thanks for saying so! I'm glad it's of use for you.
I tend to use supervisor to run my programs as services. You can tell it to save the output of the program as a log file, and handles the log rotation for you. I should probably add an example deployment really. I'll leave this issue open as a reminder of that.
Hope that helps.
from mqtt-io.
@flyte, an example would be most helpful... I have used supervisord before but the setup has always come prepackaged. Anyhow, thanks for the idea... I'll take a look and see if I can figure it out.
from mqtt-io.
@flyte I was able to get supervisord on raspbian running after monkeying with it for a bit, and I created a .conf file for pi-mqtt-gpio
under /etc/supervisor/conf.d/
:
[program:mqtt]
command=/usr/bin/python -m pi_mqtt_gpio.server /home/pi/pi-mqtt-gpio-config.yml
autostart=true
autorestart=true
stderr_logfile=/var/log/mqtt-stderr.log
stderr_logfile_maxbytes = 10MB
stderr_logfile_backups = 5
stdout_logfile=/var/log/mqtt-stdout.log
stdout_logfile_maxbytes = 10MB
stdout_logfile_backups = 5
However, when I try to run your program using supervisord it fails and I see the following in the stderr log:
$ cat /var/log/mqtt-stderr.log
/usr/bin/python: No module named pi_mqtt_gpio
/usr/bin/python: No module named pi_mqtt_gpio
/usr/bin/python: No module named pi_mqtt_gpio
/usr/bin/python: No module named pi_mqtt_gpio
I feel like I'm missing the full path for pi_mqtt_gpio.server
but not sure?
Your program works fine when I run it directly from the command line using /usr/bin/python -m pi_mqtt_gpio.server /home/pi/pi-mqtt-gpio-config.yml
Can you post your .conf file for supervisord?
from mqtt-io.
@flyte I followed your new readme.md supervisor instructions and it worked like a charm. Many thanks!!!
from mqtt-io.
Excellent! :)
from mqtt-io.
Related Issues (20)
- pip fails on pyyaml, poetry fails on requests.utils on a raspberry pi zero w HOT 8
- How to add and reuse values in config files? HOT 1
- Chip has no attribute 'OPEN_BY_NAME' - Orange Pi Zero HOT 2
- KeyError when trying to run on Orange Pi Zero 2W, Ubuntu 22.04 HOT 2
- Raspberry pi 5 support? HOT 1
- use RPIO instead of RPi.GPIO
- Separate Devices Running MQTT IO Are Recognized as a Single Device in Home Assistant HOT 1
- MQTT Io On OrangePi 5 HOT 1
- Issues with paho-mqtt 2.0 HOT 4
- Crash using gpiod
- Release version 2.3.0
- New version not working HOT 5
- Wont Connect to MQTT Broker and getting error in log from python script HOT 2
- DHT22 Adafruit_DHT problem HOT 2
- MCP23017 module not starting in mqtt-io Add-on HOT 1
- Crash on startup HOT 5
- Request support for Orange Pi CM4
- Incompatibility Python typing-extensions HOT 1
- adxl345 Module outdated and does not install HOT 1
- MQTT does not reconnect on authentication failure
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mqtt-io.