Open HumanSkunk opened 3 years ago
Yeah, this is a known issue at the moment. I've made quite a big update recently that's just waiting for me to have a bit more time to finish fixing the tests for, then I'll release a much more robust (hopefully!) version.
Ah thats good to hear. Will work with clunky workaround for now then. I will keep an eye out for the next release or if there is anything you want me to test in the meantime let me know. I spent so long trying to get something working before I realised your program did exactly what I needed. Thanks for the effort you have put in so far.
You can try the feature/trio
branch if you're able to get it installed with poetry. I don't currently have any 'developing' docs, but it should just be poetry install --no-dev
and then poetry run python -m mqtt_io config.yml
off the top of my head.
I'm running this branch on my own equipment and it's relatively stable compared to the released one!
Alternatively, you can use a docker image (that's what I'm doing). I'm periodically adding new tags when I update my own stuff, so you can use whatever the newest tag is if you'd like https://hub.docker.com/r/flyte/mqtt-io/tags?page=1&ordering=last_updated
I can't help you that much on instructions for this, since I'm only starting to get it working myself (without using --privileged
) but my command follows:
docker run -d \
--name mqtt-io \
-v /home/pi/mqtt-io.yml:/config.yml \
--device /dev/spidev0.0 \
-v /sys/devices/platform/soc/3f200000.gpio:/sys/devices/platform/soc/3f200000.gpio \
-v /sys/class/gpio:/sys/class/gpio \
--user root \
--restart always \
flyte/mqtt-io:78f1ea0
Can it be that I face the same issue "the other way round"?
I have a push button connected to a Piface, and when I press it I normally see the corresponding MQTT message. After some time, it just stops working, and I don't see the MQTT message any more. If I remember right, also I don't see the log message "Digital input value changed" any more. If I sudo supervisorctl restart mqtt-io
, everything starts working instantly again.
Is this the same issue or should I open a new one?
Hi @MTJoker, I can't see your issue on my installation, that is running for weeks. About what periods are you talking? Hours, Days, Weeks? Could it be a hardware issue? Maybe something with resistors and capacitors? When mqtt-io is restarted, maybe something on the pin configuration is changed via GPIO module (pullup/pulldown), that unloads e.g. the capacitor?
Hi @BenjiU,
About what periods are you talking? Hours, Days, Weeks?
It is days for sure, but I can't tell exactly (the button is my doorbell, so I don't notice immediately when it stops working... Currently it is running since 3 days).
Could it be a hardware issue? Maybe something with resistors and capacitors? When mqtt-io is restarted, maybe something on the pin configuration is changed via GPIO module (pullup/pulldown), that unloads e.g. the capacitor?
Could be, but I am quite sure that the same setup used to work in older versions, so I doubt it. I am not using the GPIO pins of the raspi directly, but my button is connected to a PiFace. The wire to the button is rather long (approx. 10m). It is a .8mm cable, normally the length shouldn't be an issue for this application.
Hmm, than you should more often use food delivery: you would faster notice, when the doorbell does not work :-D Maybe it's an issue with the piface module? Do you have outputs on your piface? Or may you add one? If you recognice, that the input (doorbell) does not work any longer, you may try to trigger the output via mqtt. Maybe that gives a better hint, if piface is still working... Or, if you are firm with that, you could add a _LOG in digital_input_poller(), and check, if the traces are still coming, when your doorbell does not work, or if the task crashed... I had that with my i2c temp sensor: when there was a problem reading the sensor, the old version (pi_gpio_mqtt?) crashed. In the new version (mqtt_io), I haven't noticed that issue yet.
Describe the bug
I have mqtt-io installed and managed through supervisor. I have found after an unknown amount of time mqtt-io fails to take action when an mqtt message is sent. I can see the messages being received on the MQTT broker and I can connect and see those messages from the Pi running mqtt-io however the GPIO pins are not being triggered. If I
sudo supervisorctl restart mqtt-io
then the actions will work perfectly. One solution is to run a cron job every night to restart the service but this is a clunky solution. I am unsure what the cause is and I dont know why restarting the supervisor service kicks it back into life. Runningsudo supervisorctl status
shows that the process is running without error and has had an uptime of since I last restarted the process.Expected behavior
When sending the MQTT publish command I expect the action governed by the .yml file to take action. Restarting the Supervisor service makes the program behave as expected.
Error messages and traceback
These are the only logger entries that appear under the supervisor logs. Nothing indicating there is a fault.
Config
Hardware
System:
Additional context Add any other context about the problem here.