GPIO Monitor broken
nandbert opened this issue · 17 comments
Hi Matt,
sorry to file this ticket at the completely wrong place, but I did not find another way to contact you. Just wanted to let you know, that yesterday's update completely broke the GPIO Monitor Plugin functionality (see picture).
I do not have more details (yet), as it broke the kitchen radio of my wife, which made fixing the issue quickly the main priority :-)
Restoring a backup and disabling auto-update for the plugin solved the problem for now.
Cheers
Norbert
no, that should be all fine.
can you try the latest IPTV Merge again?
Try a reboot after installing.
If it still doesnt' work, please get me a debug log:
https://kodi.wiki/view/Log_file/Easy
Sorry, how exactly do I "try the latest IPTV Merge"? 😬
I meant. Update back to the latest and try again please. Try reboot after update. If still not work, could you please get me a debug log
@nandbert
Howd you go?
- I have now setup a second system for debugging with a pi4 ("productive" system was pi2). Same effect.
- reboot does not help
- log is here https://paste.kodi.tv/vakemorexe.kodi
And I have a question: I have added the SlyGuy repo that also contains your add-on as a local zip file. How can the plugin update itself automatically?
if the repo is installed, the add-on will automatically update itself
So, on this Pi4, if you install the below:
https://k.slyguy.xyz/.repo/plugin.program.gpio.monitor/plugin.program.gpio.monitor-0.1.2.zip
it suddenly starts working?
hold up, your not coping userdata from one device to another?
If you do that, it will think the service is already installed and not copy the required files...
Can you please just try 0.1.3 on a CLEAN install of libreelec.
Then click install service. it will reboot. then setup a button and test.
- I am not copying user-data directly, but I do restore backups that I took on another system. This is my technique to try new features or plugins on a test system, before I deploy them to the "productive systems" in the living room. My user base is small but quickly annoyed if TV or kitchen radio are not working ;-) This technique has been working quite well so far. Are you saying this is a bad idea?
- Even if it is, it does not explain why the kitchen radio broke from one day to the other, when it auto updated 0.1.2 to 0.1.3, right?
- For my understanding: I thought a zip repo is just a static collection of add-ons? From your answer it sounds, that its more like a new source file in /etc/apt/... Can you elaborate this a bit or point me to some explanation? I am a long time Linux/embedded/C developer but a NOOB in python and Kodi. Would love to improve my understanding, though 8-)
- What does "ERROR: plugin.program.gpio.monitor - 'NoneType' object has no attribute 'reserve_pins'" indicate?
- I am happy to do more experiments tomorrow
Please just try with a clean install before bringing in the backup. We can go from there :)
I think I have an idea. I think its the process of updating that killed it... I never tested that. A fresh install of latest version is all I tried.
I suspect on this 2nd device, it started with older version from backup and then updated?
Be interested in your result if starting clean from latest version. Do install service. Then setup a button.
That will confirm my theory
Done. 0.1.3 directly installed on a fresh LibreELEC works fine (as expected)
awesome. I'm back at work today so have a Pi4 to test with so I can figure out why upgrading the add-on is breaking it!
Looking forward to try out 0.1.4 then ;-) (no pressure from my side though, staying on 0.1.2 is a very viable workaround for me)
0.1.4 just pushed.
It will now be safe to update both 0.1.2 and 0.1.3 to 0.1.4
This is what was happening:
When the add-on does "Install Service", it copies the correct Python2 or Python3 binary for RPiGPIO into it's lib directory.
It then sets a flag in the user data that tells it that it has been installed.
When it gets updated - kodi just removes the entire addon directory and unzips the new version.
This new version won't have the RPiGPIO located where it should be.
But the add-on still thinks it has been installed as the flag is still set.
This explains Kitchen and your 2nd device as 2nd device had the same user data with the installed flag set.
This also explains the error you were getting. pin factory was set to None as it couldn't talk to RPiGPIO.
In the latest version, it now checks the RPiGPIO is there as well as checking its the right version.
If not, it copies it in again (so after updates it'll copy it again)
This also means no user data flag is needed anymore.
So copying the user data folder won't affect it.
It will always correctly detect if it's installed or not.
Even copying user data or even the addon itself from a Python2 to Python3.
It will detect the RPiGPIO is wrong and replace it with correct. YAH.
Otherwise, everyone upgrading to Kodi 19 would have had broken installs.
I've also added "Install Service" in the add-on settings. So worst case thats a backup to fix any issues.
As for your question #3.
See the "Why" here:
https://www.matthuisman.nz/2019/09/how-to-force-kodi-to-update-add-ons.html
Please test and confirm both installs are now OK.
Then please close this issue
0.1.4 is working fine now, as expected :-) Thanks Matt!