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
Enabling MQTT write: works, but values do not stick #6
Comments
When I enable both That still leaves me confused about the logic of the configuration. Below is the original code. It seems that
I changed that to the code below, where
|
Are you using another RevPiModIO instance on the RevPi without the 'shared_procimg=True' flag? For example in the Shell or as control program? Your described behaviour will happen if another process is using the process image exclusively. I tested the system with MQTT |
I have not tested with RevPiCommander, only revpipyload. You seem to be using a slighly different scenario than I am. No other instances of RevPiModIO running (I found out about already). What is your config file, please? |
I'm so sorry!!! Now I understand! You are absolutely right with your investigation! If you enable Unfortunately, the call is missing in mqttserver.py. Could you test this change with the original revpipyload version?
Thank you for your patience with me! |
I can confirm that your patch solves my problem. I just tested it by removing my own patch and adding yours instead. Thank you for fixing this. If you have the time I would really like to see this get rolled into a release version, so I can stop running patched code on my systems. |
(and yeah, I am webmaster-contentis, in case you are wondering). |
Okay, perfect! You can download the actual developer version here: http://revpimodio.org/dnl/revpipyload_0.9.6d-1_all.deb and install it via
If we release the 0.9.7, your system will automatically update via |
What might be the time lines for an official release? |
This week 😃 And i believe Kunbus will put it to the contrib repository as soon as possible! |
This week I can wait for the official release. :-) |
@naruxde Can you please roll this into a release? I'd like to switch back to running release code and undo the monkey patches. :-) Is there anything I can do to help? |
This was rolled into a release and if you have this issue as I did, you can now solve this with 'apt update' followed by 'apt full-upgrade'. Thanks to @naruxde and others to fix and release this. |
I enabled MQTT write in the revpipyload configuration. Publishing a value of (for example) 1024 to
/revpi000/set/PwmDutycycle_1
causes the PWM output to go to 1024 for one cycle only, then it falls back to 0.I checked the logs: no errors. I checked that no other processes are active on
/dev/PiControl0
and there were none, at least not on the UNIX level.So writing works in principle, the value just gets reset to 0 in the next cycle.
After reading the code for
revpypiload
I traced the problem to revpipyload.py. The issue seems to be that it instantiates both an MQTT server and a something called theprocimgserver
. My theory is that if you enable MQTT writing (like I have) these both want to write the I/O ports and they end up overwriting each-other's value.For discussion, please see https://revolutionpi.com/forum/viewtopic.php?f=6&t=3320&sid=144746f6c08d0eba79aa1c622869e6ff
Assuming that this is the problem: I am not sure there is a trivial solution. If I were to pass the instance of
revpimodio2.RevPiModIO()
that the procimgserver creates to the MQTT server, that might not have the correct configuration for the MQTT server, and vise versa.If I were to make an instance of
revpimodio2.RevPiModIO()
and pass that into the__init__()
ofprocimgserver
and alsomqttserver
I end up exposing internal implementation details of both of these.At this point, I am not even 100% sure that my analysis of the problem is correct. :-( Not sure how to proceed, please advise.
The text was updated successfully, but these errors were encountered: