Home of the Squeezebox™ & Transporter® network music players.
Results 1 to 10 of 10
  1. #1
    Junior Member
    Join Date
    Jan 2022
    Posts
    16

    Need help with Oled Screen

    Hello everybody,
    I made a satellite for Squeezebox with a raspberry zero 2W running Picoreplayer.
    Everything works correctly: the two rotary knobs and the OLED SSH1106 screen.

    For the OLED screen I use LMSMonitor which is very good, but written in C.
    It is not a language that I master. I prefer Python.

    And so I can not modify the proposed display.

    I have been desperately looking for a way to drive the OLED display in Python for a week.

    I tried a lot of things and did a lot of research. I even tried to install Blinka without success.

    Anyone can help ???
    Thanks.

  2. #2
    Senior Member paul-'s Avatar
    Join Date
    Jan 2013
    Posts
    4,973
    What screen do you have?

    Perhaps you should say what lmsmonitor does not do for you that you are trying to change.

    Adafruit has a lot of python libraries.....https://github.com/adafruit
    piCorePlayer a small player for the Raspberry Pi in RAM.
    Homepage: https://www.picoreplayer.org

    Please donate if you like the piCorePlayer

  3. #3
    Junior Member
    Join Date
    Jan 2022
    Posts
    16
    Quote Originally Posted by paul- View Post
    What screen do you have?

    Perhaps you should say what lmsmonitor does not do for you that you are trying to change.

    Adafruit has a lot of python libraries.....https://github.com/adafruit
    My screen is a SSH1106 from AZDelivery, I2C 128x64 pixels with four pins (VDD, GND, SCK, SDA).
    LMSMonitor is fine, but i can't modify it the way I want. That is to say manage precisely what is show on the screen. It's also a matter of "doing it myself"....
    To modify it, I would need to change C code, and compile ....and that is far behond my knowledge. Python is ok for me.
    I would like to have a very simple screen with title and artist and also be able to send some custom message to the screen depending of time and weather.

    I had a deep look to adafruit. I tried to install Blinka (because PCP have micropython) and it was a fail. I tried the python SSD driver also. Same fail.
    It seems to me that all othes lib/drivers are circuitpython. I can manage circuitpython but I don't know if install is possible on PCP.
    Thanks for reading me.

  4. #4
    Senior Member
    Join Date
    May 2021
    Posts
    132
    Have you looked at this driver?

    Also, I have a couple of repositories for driving LCD displays with LMS data in Python, which you may find of some use. They use PIL and the framebuffer.

    https://github.com/retired-guy/Squeezebox-3.5

    https://github.com/retired-guy/Squeezebox
    piTouchÖ w/JustBoom DigiHat -> RME ADI-2 DAC FS -> JBL 305P MkII monitors; LMS 8.2 on piCorePlayer/Pi 4; Material Skin.

  5. #5
    Junior Member
    Join Date
    Jan 2022
    Posts
    16
    Quote Originally Posted by chicks View Post
    Have you looked at this driver?

    Also, I have a couple of repositories for driving LCD displays with LMS data in Python, which you may find of some use. They use PIL and the framebuffer.

    https://github.com/retired-guy/Squeezebox-3.5

    https://github.com/retired-guy/Squeezebox
    Yes I saw the driver. But sudo pip3 install ssd1306 fail (no matching distribution).
    And sudo pip3 install luma.oled result is :

    Running setup.py install for spidev ... error
    ERROR: Command errored out with exit status 1:
    command: /usr/local/bin/python3.8 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-dtl3gr_5/spidev/setup.py'"'"'; __file__='"'"'/tmp/pip-install-dtl3gr_5/spidev/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"' "', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-jjxg_61v/install-record.txt --single-version-externally-managed --compile --install-headers /usr/local/include/python3.8/spidev
    cwd: /tmp/pip-install-dtl3gr_5/spidev/
    Complete output (17 lines):
    running install
    running build
    running build_ext
    building 'spidev' extension
    creating build
    creating build/temp.linux-armv7l-3.8
    gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -O3 -pipe -march=armv6zk -mtune=arm1176jzf-s -mfpu=vfp -use-ld=gold -O3 -pipe -march=armv6zk -mtune=arm1176jzf-s -mfpu=vfp -use-ld=gold -fPIC -I/usr/local/include/python3.8 -c spidev_module.c -o build/temp.linux-armv7l-3.8/spidev_module.o
    In file included from /tmp/tcloop/gcc/usr/lib/gcc/armv7l-unknown-linux-gnueabihf/10.2.0/include-fixed/limits.h:195,
    from /tmp/tcloop/gcc/usr/lib/gcc/armv7l-unknown-linux-gnueabihf/10.2.0/include-fixed/syslimits.h:7,
    from /tmp/tcloop/gcc/usr/lib/gcc/armv7l-unknown-linux-gnueabihf/10.2.0/include-fixed/limits.h:34,
    from /usr/local/include/python3.8/Python.h:11,
    from spidev_module.c:28:
    /usr/lib/gcc/armv7l-unknown-linux-gnueabihf/10.2.0/include-fixed/limits.h:195:15: fatal error: limits.h: No such file or directory
    195 | #include_next <limits.h> /* recurse down to the real one */
    | ^~~~~~~~~~
    compilation terminated.
    error: command 'gcc' failed with exit status 1
    ----------------------------------------
    ERROR: Command errored out with exit status 1: /usr/local/bin/python3.8 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-dtl3gr_5/spidev/setup.py'"'"'; __file__='"'"'/tmp/pip-install-dtl3gr_5/spidev/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"' "', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-jjxg_61v/install-record.txt --single-version-externally-managed --compile --install-headers /usr/local/include/python3.8/spidev Check the logs for full command outpu

  6. #6
    Senior Member paul-'s Avatar
    Join Date
    Jan 2013
    Posts
    4,973
    Looks like your missing something, or possibly a bad compile flag. Pip normally will work, but then you have persistence issues. Sometimes you have to build it manually from source.

    python3.8-Pillow.tcz Is in our repo. But I know I have built luma before.
    Last edited by paul-; 2022-01-27 at 18:57.
    piCorePlayer a small player for the Raspberry Pi in RAM.
    Homepage: https://www.picoreplayer.org

    Please donate if you like the piCorePlayer

  7. #7
    Junior Member
    Join Date
    Jan 2022
    Posts
    16
    Quote Originally Posted by paul- View Post
    Looks like your missing something, or possibly a bad compile flag. Pip normally will work, but then you have persistence issues. Sometimes you have to build it manually from source.

    python3.8-Pillow.tcz Is in our repo. But I know I have built luma before.
    Thanks. Finally I get it working. Some dependency I had a hard time finding (compiletc was one of them).
    So everything is working and I can use Python to draw on my oled screen. I am happy with that.

    Concerning persistence issues I can confirm. I had to add the /usr/local/lib/python3.8/site-packages to /opt/.filetool.list. It raises warning about the size but.... I have no other solutions I can find out.
    I also add modprode i2c-dev to user command and my custom script also.

    To that point, I will enjoy my sounds and stop making white nights !

    Thanks again.

  8. #8
    Junior Member
    Join Date
    Jan 2022
    Posts
    16
    Quote Originally Posted by chicks View Post
    Have you looked at this driver?

    Also, I have a couple of repositories for driving LCD displays with LMS data in Python, which you may find of some use. They use PIL and the framebuffer.

    https://github.com/retired-guy/Squeezebox-3.5

    https://github.com/retired-guy/Squeezebox
    thanks chicks, finally luma.oled is ok on my picoreplayer. The problem was dependency issues.

  9. #9
    Senior Member paul-'s Avatar
    Join Date
    Jan 2013
    Posts
    4,973
    Quote Originally Posted by Wiking View Post
    Thanks. Finally I get it working. Some dependency I had a hard time finding (compiletc was one of them).
    So everything is working and I can use Python to draw on my oled screen. I am happy with that.

    Concerning persistence issues I can confirm. I had to add the /usr/local/lib/python3.8/site-packages to /opt/.filetool.list. It raises warning about the size but.... I have no other solutions I can find out.
    I also add modprode i2c-dev to user command and my custom script also.

    To that point, I will enjoy my sounds and stop making white nights !

    Thanks again.
    Make an extension

    https://web.archive.org/web/20200208...ing_extensions
    piCorePlayer a small player for the Raspberry Pi in RAM.
    Homepage: https://www.picoreplayer.org

    Please donate if you like the piCorePlayer

  10. #10
    Junior Member
    Join Date
    Jan 2022
    Posts
    16
    Quote Originally Posted by paul- View Post
    thanks Paul.
    this is what I finally did. Your link was far behond my knowledge.
    So what I did is compare what was installed with pip, and I made and extension with this files and repertories according this : https://docs.picoreplayer.org/inform...re_extensions/
    That's works well. Thanks again.

    Now I am shifting to my usecase. Can you have a look to this ?

    https://forums.slimdevices.com/showt...79#post1045879

    Regards

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •