Posts by _PvD
-
-
-
Hello all,
I have written a service addon that covers partial code from here. The idea behind the development of a service addon is that it is easy to use, no further scripts are required and it runs ootB. The addon is now part of the Kodinerds repo, the source code you'll find on github: https://github.com/b-jesch/service.joy-it.fancontrol. The addon is primary written for the Joy-IT Multimedia case but runs with other cases and integrated fans connected to GPIO17 too.
Anyway: While this service addon runs perfect in normal circumstances, it throws an exception when the addon is disabled and enabled again by the user in addon settings.
Why it's throwing "GPIO busy"? Normally all GPIO should be unlocked (closed) by gpiozero when the service finished - and it does so.
Code
Display More2024-10-06 15:32:15.286 T:919 debug <general>: CAddonMgr: service.joy-it.fancontrol disabled 2024-10-06 15:32:15.350 T:1041 debug <general>: CServiceAddonManager: stopping service.joy-it.fancontrol. 2024-10-06 15:32:15.351 T:1041 debug <general>: CPythonInvoker(1, /storage/.kodi/addons/service.joy-it.fancontrol/fan.py): trigger Monitor abort request 2024-10-06 15:32:15.352 T:939 info <general>: [Joy-IT Fan Controller 1.0.9] Joy-IT fan control service finished 2024-10-06 15:32:15.352 T:939 debug <general>: CPythonInvoker(1, /storage/.kodi/addons/service.joy-it.fancontrol/fan.py): script successfully run 2024-10-06 15:32:15.352 T:939 info <general>: CPythonInvoker(1, /storage/.kodi/addons/service.joy-it.fancontrol/fan.py): waiting on thread 1496097344 2024-10-06 15:32:20.359 T:1041 error <general>: CPythonInvoker(1, /storage/.kodi/addons/service.joy-it.fancontrol/fan.py): script didn't stop in 5 seconds - let's kill it 2024-10-06 15:32:20.412 T:919 debug <general>: CGUIMediaWindow::GetDirectory (addons://user/xbmc.service) 2024-10-06 15:32:20.413 T:919 debug <general>: ParentPath = [addons://user/xbmc.service] 2024-10-06 15:32:20.414 T:1049 debug <general>: Thread waiting start, auto delete: false 2024-10-06 15:32:20.420 T:1049 debug <general>: CAddonDatabase: SELECT repo.id FROM repo .. took 1 ms 2024-10-06 15:32:20.484 T:1049 debug <general>: CAddonDatabase: query SELECT addons.*, repo.addonID AS repoID FROM addons JOIN addonlinkrepo ON addons.id=addonlinkrepo.idAddon JOIN repo ON repo.id=addonlinkrepo.idRepo WHERE addonlinkrepo.idRepo IN (1,2,3) ORDER BY repo.addonID, addons.addonID returned 1199 rows in 63 ms 2024-10-06 15:32:20.514 T:919 debug <general>: ------ Window Init (DialogBusy.xml) ------ 2024-10-06 15:32:20.771 T:1049 debug <general>: CAddonDatabase::GetAddons took 350 ms 2024-10-06 15:32:20.804 T:1049 debug <general>: CAddonMgr::GetAddonsWithAvailableUpdate took 388 ms 2024-10-06 15:32:20.845 T:1049 debug <general>: Thread waiting 1371533888 terminating 2024-10-06 15:32:20.854 T:919 debug <general>: ------ Window Deinit (DialogBusy.xml) ------ 2024-10-06 15:32:20.860 T:1050 debug <general>: Thread BackgroundLoader start, auto delete: false 2024-10-06 15:32:20.861 T:919 debug <general>: [threads] name: 'BackgroundLoader' priority: '1' 2024-10-06 15:32:20.863 T:1050 debug <general>: Thread BackgroundLoader 1454133824 terminating 2024-10-06 15:32:22.692 T:924 debug <general>: CLibInputKeyboard::ProcessKey - using delay: 500ms repeat: 33ms 2024-10-06 15:32:22.693 T:1051 debug <general>: Thread Timer start, auto delete: false 2024-10-06 15:32:22.694 T:919 debug <general>: Keyboard: scancode: 0x1c, sym: 0x0d, unicode: 0x0d, modifier: 0x0 2024-10-06 15:32:22.765 T:1051 debug <general>: Thread Timer 1603232320 terminating 2024-10-06 15:32:22.771 T:919 debug <general>: Keyboard: scancode: 0x1c, sym: 0x0d, unicode: 0x0d, modifier: 0x0 2024-10-06 15:32:22.771 T:919 debug <general>: HandleKey: return (0xf00d) pressed, window 10146, action is Select 2024-10-06 15:32:22.812 T:919 debug <general>: CAddonMgr: enabled service.joy-it.fancontrol 2024-10-06 15:32:22.813 T:1041 debug <general>: CServiceAddonManager: starting service.joy-it.fancontrol 2024-10-06 15:32:22.813 T:1053 debug <general>: Thread LanguageInvoker start, auto delete: false 2024-10-06 15:32:22.813 T:1053 debug <general>: initializing python engine. 2024-10-06 15:32:22.813 T:1053 debug <general>: CPythonInvoker(11, /storage/.kodi/addons/service.joy-it.fancontrol/fan.py): start processing 2024-10-06 15:32:22.862 T:919 debug <general>: CGUIMediaWindow::GetDirectory (addons://user/xbmc.service) 2024-10-06 15:32:22.862 T:919 debug <general>: ParentPath = [addons://user/xbmc.service] 2024-10-06 15:32:22.863 T:1054 debug <general>: Thread waiting start, auto delete: false 2024-10-06 15:32:22.869 T:1054 debug <general>: CAddonDatabase: SELECT repo.id FROM repo .. took 1 ms 2024-10-06 15:32:22.887 T:1053 debug <general>: -->Python Interpreter Initialized<-- 2024-10-06 15:32:22.887 T:1053 debug <general>: 2024-10-06 15:32:22.887 T:1053 debug <general>: CPythonInvoker(11, /storage/.kodi/addons/service.joy-it.fancontrol/fan.py): the source file to load is "/storage/.kodi/addons/service.joy-it.fancontrol/fan.py" 2024-10-06 15:32:22.919 T:1054 debug <general>: CAddonDatabase: query SELECT addons.*, repo.addonID AS repoID FROM addons JOIN addonlinkrepo ON addons.id=addonlinkrepo.idAddon JOIN repo ON repo.id=addonlinkrepo.idRepo WHERE addonlinkrepo.idRepo IN (1,2,3) ORDER BY repo.addonID, addons.addonID returned 1199 rows in 49 ms 2024-10-06 15:32:22.963 T:919 debug <general>: ------ Window Init (DialogBusy.xml) ------ 2024-10-06 15:32:23.203 T:1054 debug <general>: CAddonDatabase::GetAddons took 333 ms 2024-10-06 15:32:23.240 T:1054 debug <general>: CAddonMgr::GetAddonsWithAvailableUpdate took 374 ms 2024-10-06 15:32:23.280 T:1053 debug <general>: CPythonInvoker(11): full python path: 2024-10-06 15:32:23.280 T:1053 debug <general>: CPythonInvoker(11): custom python path: 2024-10-06 15:32:23.280 T:1053 debug <general>: CPythonInvoker(11): /storage/.kodi/addons/service.joy-it.fancontrol 2024-10-06 15:32:23.280 T:1053 debug <general>: CPythonInvoker(11): /storage/.kodi/addons/virtual.rpi-tools/lib/ 2024-10-06 15:32:23.280 T:1053 debug <general>: CPythonInvoker(11): default python path: 2024-10-06 15:32:23.280 T:1053 debug <general>: CPythonInvoker(11): /usr/lib/python311.zip 2024-10-06 15:32:23.280 T:1053 debug <general>: CPythonInvoker(11): /usr/lib/python3.11 2024-10-06 15:32:23.280 T:1053 debug <general>: CPythonInvoker(11): /usr/lib/python3.11/lib-dynload 2024-10-06 15:32:23.280 T:1053 debug <general>: CPythonInvoker(11): /usr/lib/python3.11/site-packages 2024-10-06 15:32:23.280 T:1053 debug <general>: CPythonInvoker(11): adding args: 2024-10-06 15:32:23.280 T:1053 debug <general>: CPythonInvoker(11): 2024-10-06 15:32:23.281 T:1053 debug <general>: CPythonInvoker(11, /storage/.kodi/addons/service.joy-it.fancontrol/fan.py): entering source directory /storage/.kodi/addons/service.joy-it.fancontrol 2024-10-06 15:32:23.281 T:1054 debug <general>: Thread waiting 1371533888 terminating 2024-10-06 15:32:23.282 T:1053 debug <general>: CPythonInvoker(11, /storage/.kodi/addons/service.joy-it.fancontrol/fan.py): instantiating addon using automatically obtained id of "service.joy-it.fancontrol" dependent on version 3.0.0 of the xbmc.python api 2024-10-06 15:32:23.304 T:919 debug <general>: ------ Window Deinit (DialogBusy.xml) ------ 2024-10-06 15:32:23.312 T:1055 debug <general>: Thread BackgroundLoader start, auto delete: false 2024-10-06 15:32:23.312 T:919 debug <general>: [threads] name: 'BackgroundLoader' priority: '1' 2024-10-06 15:32:23.316 T:1055 debug <general>: Thread BackgroundLoader 1454133824 terminating 2024-10-06 15:32:23.997 T:1053 debug <CAddonSettings[[email protected]]>: trying to load setting definitions from old format... 2024-10-06 15:32:23.998 T:1053 info <general>: [Joy-IT Fan Controller 1.0.9] Joy-IT fan control service started 2024-10-06 15:32:24.043 T:1053 error <general>: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<-- - NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS! Error Type: <class 'lgpio.error'> Error Contents: 'GPIO busy' Traceback (most recent call last): File "/storage/.kodi/addons/virtual.rpi-tools/lib/gpiozero/pins/pi.py", line 411, in pin pin = self.pins[info] ~~~~~~~~~^^^^^^ KeyError: PinInfo(number=11, name='GPIO17', names=frozenset({'J8:11', 17, 'BOARD11', 'GPIO17', 'WPI0', '17', 'BCM17'}), pull='', row=6, col=1, interfaces=frozenset({'', 'gpio', 'spi', 'dpi', 'uart'})) During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/storage/.kodi/addons/service.joy-it.fancontrol/fan.py", line 36, in <module> fan = PWMOutputDevice(int(addon.getSetting('gpio_pin')), initial_value=0, frequency=25) # PWM-Pin ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/storage/.kodi/addons/virtual.rpi-tools/lib/gpiozero/devices.py", line 108, in __call__ self = super().__call__(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/storage/.kodi/addons/virtual.rpi-tools/lib/gpiozero/output_devices.py", line 392, in __init__ super().__init__(pin, active_high=active_high, initial_value=None, File "/storage/.kodi/addons/virtual.rpi-tools/lib/gpiozero/output_devices.py", line 74, in __init__ super().__init__(pin, pin_factory=pin_factory) File "/storage/.kodi/addons/virtual.rpi-tools/lib/gpiozero/mixins.py", line 75, in __init__ super().__init__(*args, **kwargs) File "/storage/.kodi/addons/virtual.rpi-tools/lib/gpiozero/devices.py", line 553, in __init__ pin = self.pin_factory.pin(pin) ^^^^^^^^^^^^^^^^^^^^^^^^^ File "/storage/.kodi/addons/virtual.rpi-tools/lib/gpiozero/pins/pi.py", line 413, in pin pin = self.pin_class(self, info) ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/storage/.kodi/addons/virtual.rpi-tools/lib/gpiozero/pins/lgpio.py", line 126, in __init__ lgpio.gpio_claim_input( File "/storage/.kodi/addons/virtual.rpi-tools/lib/lgpio.py", line 755, in gpio_claim_input return _u2i(_lgpio._gpio_claim_input(handle&0xffff, lFlags, gpio)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/storage/.kodi/addons/virtual.rpi-tools/lib/lgpio.py", line 458, in _u2i raise error(error_text(v)) lgpio.error: 'GPIO busy' -->End of Python script error report<-- 2024-10-06 15:32:24.044 T:1053 info <general>: CPythonInvoker(11, /storage/.kodi/addons/service.joy-it.fancontrol/fan.py): waiting on thread 1371533888
-
Try the standard Estuary skin. There was some changes in GUI control handling (mover and resize): https://forum.kodi.tv/showthread.php…9146#pid3049146
I guess You use a different skin than Estuary and the changes in screen calibration wasn't adapted to that skin.
-
I don't have a RPi4. Maybe you could try this step by step (german only). Use a translator like deepl.com: https://www.kodinerds.net/thread/78714-k…3952#post753952
-
I'd guess there's something not updated in the skin for Omega final.
I'm the maintainer of the skin. As I can say the skin is up to date for omega . But the skin itself is indeed more memory invasive then the plain estuary. Maybe reducing the chunk size can solve this problem. The relevant code snippets from log are already posted here in this thread (#6, #10)
-
Skin section from Kodinerds repo disappears in last nightlies of LibreElec. They are showing fine on Windows, Ubuntu and CoreElec (all Omega). https://www.kodinerds.net/thread/78620-l…0311#post750311
-
Sorry for digging out this old thread but there are again issues with PIL on the last nightly builds regarding to Embuary helper:
Python
Display More2024-01-20 11:03:12.226 T:1267 error <general>: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<-- - NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS! Error Type: <class 'ImportError'> Error Contents: cannot import name 'ImageFilter' from 'PIL' (unknown location) Traceback (most recent call last): File "/storage/.kodi/addons/script.embuary.helper/plugin.py", line 10, in <module> from resources.lib.plugin_content import * File "/storage/.kodi/addons/script.embuary.helper/resources/lib/plugin_content.py", line 11, in <module> from resources.lib.image import * File "/storage/.kodi/addons/script.embuary.helper/resources/lib/image.py", line 12, in <module> from PIL import ImageFilter,Image,ImageOps,ImageEnhance ImportError: cannot import name 'ImageFilter' from 'PIL' (unknown location) -->End of Python script error report<-- 2024-01-20 11:03:12.354 T:1256 error <general>: GetDirectory - Error getting plugin://script.embuary.helper/?info=getnextup