The corrected version is available for download (download links are in the original post).
I am also attaching a wiring diagrams:
The corrected version is available for download (download links are in the original post).
I am also attaching a wiring diagrams:
@livs: Has there been any progress? I would also like to read some positive feedback...
If it works for you, can you write some experiences?
Was the effort worth it?
Hi LuRu,
I did some tests yesterday, it did not work.
I reflash LE10 today and install oledproc, setup and again it did not work.
My device is set as port=0 and dev=0, DC=18 (gpio24) and RST=22 (gpio25) as it was in a different software which it works. Settings file attached.
I am looking to logs and I see:
2022-07-27 13:58:27.693 T:802 INFO <general>: ####### [OLEDproc] - Service started
2022-07-27 13:58:27.698 T:802 WARNING <CSettingDependencyCondition>: missing setting for dependency
2022-07-27 13:58:27.698 T:802 DEBUG <general>: CBooleanLogicOperation: failed to deserialize implicit boolean value definition
2022-07-27 13:58:27.698 T:802 WARNING <CSettingInt>: error reading <dependency> tag of "ok"
2022-07-27 13:58:27.699 T:802 ERROR <CSettingInt>: error reading the default value of "ok"
2022-07-27 13:58:27.699 T:802 WARNING <CSettingGroup>: unable to read setting "ok"
2022-07-27 13:58:27.701 T:802 DEBUG <CSettingsManager>: requested setting (ok) was not found.
And
2022-07-27 13:58:27.784 T:802 ERROR <general>: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--
- NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
Error Type: <class 'IndexError'>
Error Contents: tuple index out of range
Traceback (most recent call last):
File "/storage/.kodi/addons/service.oled/service.py", line 477, in <module>
monitor = BackgroundService()
File "/storage/.kodi/addons/service.oled/service.py", line 428, in __init__
args = self.GetSettings()
File "/storage/.kodi/addons/service.oled/service.py", line 450, in GetSettings
rotate =int (addon().getSetting(('rotation4','rotation2','rotation2','rotation3' )[resol]))
IndexError: tuple index out of range
-->End of Python script error report<--
Display More
I'm not sure, but it looks like you previously had an older version installed that was still without SPI support. I forgot to write that in that case the old version must be uninstalled (including settings). Maybe it wasn't, but in any case I recommend doing a clean install. This means uninstalling the add-on (including settings) and only then installing the new version. And I would even recommend restarting Kodi after uninstalling the addon.
After a new installation of the add-on, the configuration dialog opens automatically. Make the necessary settings and confirm by pressing OK.
It's also a good idea to use the Dependencies button to check that all necessary plugins are installed.
If the installation succeeds and no error is reported, it should start working. The first sign that everything is fine is the LE logo on the display. If it appears, the data configured in the LCD.xml file should be visible in a moment. If it takes a while, it can be speeded up by disabling and re-enabling the XBMC LCDproc add-on.
Hi,
I did a fresh install like you suggest. Remove, reboot and install. Dependencies ok. No change, same errors.
I notice there is no line256 value registered by addon in settings.xml. As the oled that I have has 256x64 resolution, shouldn't be there?
I forgot to tell that my test are on CM4, but i think is not important as is the same as Pi4.
I can't see your device so I don't know what's going on. I would like to try your setup. Please write which driver chip your display uses.
Please attach the /.kodi/userdata/addon_data/http://service.oled/settings.xml file here. You can change the xml extension to txt (xml extension is not allowed in attachment).
Hi,
My device is based on SSD1322, what I have is on post #13.
My settings.xml is attached at post #21.
Please tell how I can help.
Thanks
My settings.xml is attached at post #21.
Sorry, I missed that.
Attached is the service.txt file. Please replace txt extension with py and replace the original service.py file with this file.
Hi,
I did change the file and a different error.
ERROR <general>: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--
- NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
Error Type: <class 'RuntimeError'>
Error Contents: BOARD numbering system not applicable on compute module
Traceback (most recent call last):
File "/storage/.kodi/addons/service.oled/service.py", line 477, in <module>
monitor = BackgroundService()
File "/storage/.kodi/addons/service.oled/service.py", line 430, in __init__
self.oled = Oled(*args)
File "/storage/.kodi/addons/service.oled/service.py", line 82, in __init__
GPIO.setmode(GPIO.BOARD)
RuntimeError: BOARD numbering system not applicable on compute module
-->End of Python script error report<--
Display More
Ah, so that's a surprise for me. And I also understood why you used BCM numbering (it's impractical for me - BOARD numbering still applies not only across versions, but even for Orange Pi). I have never seen CM and had no idea about this limitation. But never mind, we'll deal with it somehow. I'll probably have to make a special version for CM. Sorry, but this will take some time...
First I'll just do a test version where the DC and RES pins will be hardwired by software (other pins are HW controlled so it's always hardwired). Later I will add the option to choose DC and RES in the configuration dialog. Do you have any preferences as to which GPIO the DC and RES pins should be connected to in the first stage?
Hi,
I propose to use at first dc=pin18 (bcm24) and rst=pin22 (bcm25).
However, I think an editable conf file, like LCDd.conf is maybe better. Any combination could be there, and any user should do it for himself, considering the board, display and so on.
I like the interface, but I will do it once and no change later. It will be a minimal interface.
I know that this approach may change a lot your concept, but think about.
Thank you
Uninstall the old version of the add-on and install the new one.
It is very likely that there will be bugs. I'm on vacation and don't have an RPi4 available, so I don't have a chance to try it.
Hi,
Thank you, I will test it and give feedback.
Please enjoy your vacation, forget this problem, it is not a hurry.
Regards
Hi,
I will add here some results about tests to be available after vacation, if you prefer we can discuss in private.
I have a spare Pi3+ and make an install.
First, normal error like CM4:
2022-07-30 06:59:15.997 T:871 ERROR <general>: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--
- NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
Error Type: <class 'IndexError'>
Error Contents: tuple index out of range
Traceback (most recent call last):
File "/storage/.kodi/addons/service.oled/service.py", line 477, in <module>
monitor = BackgroundService()
File "/storage/.kodi/addons/service.oled/service.py", line 428, in __init__
args = self.GetSettings()
File "/storage/.kodi/addons/service.oled/service.py", line 450, in GetSettings
rotate =int (addon().getSetting(('rotation4','rotation2','rotation2','rotation3' )[resol]))
IndexError: tuple index out of range
-->End of Python script error report<--
Display More
Try to solve rotate error and declare value 0, as it should be. This error removed.
Next I have server.bind(server_address) error, I resolved by remove server_address and replaced with LOCALHOST, PORT declared as it should be.
After this XBMC LCDproc connect to Oledproc, but there are errors
2022-07-30 10:41:44.867 T:638 ERROR <general>: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--
- NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
Error Type: <class 'ValueError'>
Error Contents: images do not match
Traceback (most recent call last):
File "/storage/.kodi/addons/service.oled/service.py", line 479, in <module>
monitor = BackgroundService()
File "/storage/.kodi/addons/service.oled/service.py", line 432, in __init__
self.oled = Oled(*args)
File "/storage/.kodi/addons/service.oled/service.py", line 128, in __init__
self.device.display(self.image)
File "/storage/.kodi/addons/script.module.luma/lib/luma/oled/device/greyscale.py", line 126, in display
for _, bounding_box in self.framebuffer.redraw(image):
File "/storage/.kodi/addons/script.module.luma/lib/luma/core/framebuffer.py", line 76, in redraw
segment_bounding_box = ImageChops.difference(prev_segment, curr_segment).getbbox()
File "/usr/lib/python3.8/site-packages/PIL/ImageChops.py", line 102, in difference
ValueError: images do not match
-->End of Python script error report<--
2022-07-30 10:41:44.868 T:638 INFO <general>: CPythonInvoker(4, /storage/.kodi/addons/service.oled/service.py): waiting on thread 1464853120
2022-07-30 10:41:45.101 T:633 INFO <general>: SETTINGS: set_keyboard_layout # us
2022-07-30 10:41:45.101 T:633 INFO <general>: SETTINGS: set_keyboard_layout # loadkmap < `ls -1 /usr/lib/keymaps/*/us.bmap`
2022-07-30 10:41:46.588 T:633 INFO <general>: ## LibreELEC Addon ## updates::updateThread ## Started
2022-07-30 10:41:46.590 T:633 INFO <general>: ## LibreELEC Addon ## updates::set_auto_update ## auto
2022-07-30 10:41:46.750 T:676 INFO <general>: SETTINGS: run # Waiting
2022-07-30 10:41:52.163 T:631 INFO <general>: ### [XBMC LCDproc] - Connected to LCDd at 127.0.0.1:13666, Protocol version 0.4 - Geometry 16x4 characters (256x128 pixels, 16x32 pixels per character)
2022-07-30 10:41:52.164 T:631 INFO <general>: ### [XBMC LCDproc] - Driver information reply: OLEDproc
2022-07-30 10:41:52.199 T:653 ERROR <general>: Exception in thread
2022-07-30 10:41:52.199 T:653 ERROR <general>: Thread-6
2022-07-30 10:41:52.199 T:653 ERROR <general>: :
2022-07-30 10:41:52.199 T:653 ERROR <general>: Traceback (most recent call last):
2022-07-30 10:41:52.199 T:653 ERROR <general>: File "/usr/lib/python3.8/threading.py", line 932, in _bootstrap_inner
2022-07-30 10:41:52.207 T:631 INFO <general>: ### [XBMC LCDproc] - Loading settings from /storage/.kodi/addons/script.xbmc.lcdproc/resources/LCD.xml.defaults
2022-07-30 10:41:52.220 T:631 INFO <general>: ### [XBMC LCDproc] - Loading settings from /storage/.kodi/userdata/LCD.xml
2022-07-30 10:41:52.222 T:653 ERROR <general>: File "/usr/lib/python3.8/threading.py", line 870, in run
2022-07-30 10:41:52.223 T:653 ERROR <general>: File "/storage/.kodi/addons/service.oled/service.py", line 167, in runqueue
2022-07-30 10:41:52.224 T:653 ERROR <general>:
2022-07-30 10:41:52.224 T:653 ERROR <general>: self.processdata(task)
2022-07-30 10:41:52.224 T:653 ERROR <general>:
2022-07-30 10:41:52.224 T:653 ERROR <general>: File "/storage/.kodi/addons/service.oled/service.py", line 246, in processdata
2022-07-30 10:41:52.233 T:653 ERROR <general>:
2022-07-30 10:41:52.234 T:653 ERROR <general>: self.device.display(self.image)
2022-07-30 10:41:52.234 T:653 ERROR <general>:
2022-07-30 10:41:52.234 T:653 ERROR <general>: File "/storage/.kodi/addons/script.module.luma/lib/luma/oled/device/greyscale.py", line 126, in display
2022-07-30 10:41:52.234 T:653 ERROR <general>:
2022-07-30 10:41:52.234 T:653 ERROR <general>: for _, bounding_box in self.framebuffer.redraw(image):
2022-07-30 10:41:52.234 T:653 ERROR <general>:
2022-07-30 10:41:52.234 T:653 ERROR <general>: File "/storage/.kodi/addons/script.module.luma/lib/luma/core/framebuffer.py", line 76, in redraw
2022-07-30 10:41:52.235 T:653 ERROR <general>:
2022-07-30 10:41:52.235 T:653 ERROR <general>: segment_bounding_box = ImageChops.difference(prev_segment, curr_segment).getbbox()
2022-07-30 10:41:52.235 T:653 ERROR <general>:
2022-07-30 10:41:52.235 T:653 ERROR <general>: File "/usr/lib/python3.8/site-packages/PIL/ImageChops.py", line 102, in difference
2022-07-30 10:41:52.236 T:653 ERROR <general>: ValueError
2022-07-30 10:41:52.236 T:653 ERROR <general>: :
2022-07-30 10:41:52.236 T:653 ERROR <general>: images do not match
2022-07-30 10:41:52.236 T:653 ERROR <general>:
2022-07-30 10:41:52.332 T:638 INFO <general>: CPythonInvoker(4, /storage/.kodi/addons/service.oled/service.py): waiting on thread 1473245824
Display More
I have no idea about what means these.
For example,
### [XBMC LCDproc] - Connected to LCDd at 127.0.0.1:13666, Protocol version 0.4 - Geometry 16x4 characters (256x128 pixels, 16x32 pixels per character)
256x128 should be 256x64?
What else I did, I add to cmdline.txt this:
I attach the service file that i have now.
Can you try the corrected version?
This is the version for non-CM4 boards.
You can install normally, without uninstalling the original version. But check that the setting is valid.
This is what I have now:
2022-07-30 15:14:26.350 T:630 ERROR <general>: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--
- NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
Error Type: <class 'ValueError'>
Error Contents: images do not match
Traceback (most recent call last):
File "/storage/.kodi/addons/service.oled/service.py", line 479, in <module>
monitor = BackgroundService()
File "/storage/.kodi/addons/service.oled/service.py", line 432, in __init__
self.oled = Oled(*args)
File "/storage/.kodi/addons/service.oled/service.py", line 127, in __init__
self.device.display(self.image)
File "/storage/.kodi/addons/script.module.luma/lib/luma/oled/device/greyscale.py", line 126, in display
for _, bounding_box in self.framebuffer.redraw(image):
File "/storage/.kodi/addons/script.module.luma/lib/luma/core/framebuffer.py", line 76, in redraw
segment_bounding_box = ImageChops.difference(prev_segment, curr_segment).getbbox()
File "/usr/lib/python3.8/site-packages/PIL/ImageChops.py", line 102, in difference
ValueError: images do not match
-->End of Python script error report<--
2022-07-30 15:14:26.352 T:630 INFO <general>: CPythonInvoker(4, /storage/.kodi/addons/service.oled/service.py): waiting on thread 1464832640
2022-07-30 15:14:26.582 T:627 INFO <general>: SETTINGS: set_keyboard_layout # us
2022-07-30 15:14:26.583 T:627 INFO <general>: SETTINGS: set_keyboard_layout # loadkmap < `ls -1 /usr/lib/keymaps/*/us.bmap`
2022-07-30 15:14:28.075 T:627 INFO <general>: ## LibreELEC Addon ## updates::updateThread ## Started
2022-07-30 15:14:28.077 T:627 INFO <general>: ## LibreELEC Addon ## updates::set_auto_update ## auto
2022-07-30 15:14:28.223 T:669 INFO <general>: SETTINGS: run # Waiting
2022-07-30 15:14:29.150 T:625 INFO <general>: ### [XBMC LCDproc] - Connected to LCDd at 127.0.0.1:13666, Protocol version 0.4 - Geometry 32x4 characters (256x64 pixels, 8x16 pixels per character)
2022-07-30 15:14:29.152 T:625 INFO <general>: ### [XBMC LCDproc] - Driver information reply: OLEDproc
2022-07-30 15:14:29.242 T:646 ERROR <general>: Exception in thread
2022-07-30 15:14:29.243 T:646 ERROR <general>: Thread-6
2022-07-30 15:14:29.243 T:646 ERROR <general>: :
2022-07-30 15:14:29.243 T:646 ERROR <general>: Traceback (most recent call last):
2022-07-30 15:14:29.243 T:646 ERROR <general>: File "/usr/lib/python3.8/threading.py", line 932, in _bootstrap_inner
2022-07-30 15:14:29.248 T:646 ERROR <general>: File "/usr/lib/python3.8/threading.py", line 870, in run
2022-07-30 15:14:29.252 T:646 ERROR <general>: File "/storage/.kodi/addons/service.oled/service.py", line 166, in runqueue
2022-07-30 15:14:29.253 T:625 INFO <general>: ### [XBMC LCDproc] - Loading settings from /storage/.kodi/addons/script.xbmc.lcdproc/resources/LCD.xml.defaults
2022-07-30 15:14:29.254 T:646 ERROR <general>:
2022-07-30 15:14:29.254 T:646 ERROR <general>: self.processdata(task)
2022-07-30 15:14:29.254 T:646 ERROR <general>:
2022-07-30 15:14:29.255 T:646 ERROR <general>: File "/storage/.kodi/addons/service.oled/service.py", line 245, in processdata
2022-07-30 15:14:29.255 T:646 ERROR <general>:
2022-07-30 15:14:29.256 T:646 ERROR <general>: self.device.display(self.image)
2022-07-30 15:14:29.256 T:646 ERROR <general>:
2022-07-30 15:14:29.256 T:646 ERROR <general>: File "/storage/.kodi/addons/script.module.luma/lib/luma/oled/device/greyscale.py", line 126, in display
2022-07-30 15:14:29.256 T:646 ERROR <general>:
2022-07-30 15:14:29.256 T:646 ERROR <general>: for _, bounding_box in self.framebuffer.redraw(image):
2022-07-30 15:14:29.256 T:646 ERROR <general>:
2022-07-30 15:14:29.256 T:646 ERROR <general>: File "/storage/.kodi/addons/script.module.luma/lib/luma/core/framebuffer.py", line 76, in redraw
2022-07-30 15:14:29.257 T:646 ERROR <general>:
2022-07-30 15:14:29.257 T:646 ERROR <general>: segment_bounding_box = ImageChops.difference(prev_segment, curr_segment).getbbox()
2022-07-30 15:14:29.257 T:646 ERROR <general>:
2022-07-30 15:14:29.257 T:646 ERROR <general>: File "/usr/lib/python3.8/site-packages/PIL/ImageChops.py", line 102, in difference
2022-07-30 15:14:29.257 T:646 ERROR <general>: ValueError
2022-07-30 15:14:29.257 T:646 ERROR <general>: :
2022-07-30 15:14:29.257 T:646 ERROR <general>: images do not match
2022-07-30 15:14:29.257 T:646 ERROR <general>:
2022-07-30 15:14:29.271 T:625 INFO <general>: ### [XBMC LCDproc] - Loading settings from /storage/.kodi/userdata/LCD.xml
2022-07-30 15:14:29.313 T:630 INFO <general>: CPythonInvoker(4, /storage/.kodi/addons/service.oled/service.py): waiting on thread 1473225344
Display More
It looks like there is some problem with the luma.oled library, specifically with greyscale devices (SSD13xx). It's probably a glitch when we want to display the LE logo, which is only black and white. You can try commenting the lines in the service.py file according to the following code snippet.
Thread(target = self.runserver).start()
Thread(target = self.runqueue).start()
#logopath = join(images_dir, 'Logo%i.png' % self.h)
#logo = Image.open(logopath).convert("1")
#posn = ((self.device.width - logo.width) // 2, 0)
#self.image.paste(logo, posn)
#self.device.display(self.image)
Or you can try the following modification (I can't test it, I don't own a greyscale device):
logopath = join(images_dir, 'Logo%i.png' % self.h)
logo = Image.open(logopath)
logo = ImageOps.grayscale(logo)
posn = ((self.device.width - logo.width) // 2, 0)
self.image.paste(logo, posn)
self.device.display(self.image)
In case it works, I would also be interested in this modification:
I think the issue for ssd1322 is solved.
I added a new parameter and oled starts to work.
1322 required mode = '1' as per
luma.oled.device.greyscale.greyscale_device
I will come back to your last version for testing.