RetroPie forum home
    • Recent
    • Tags
    • Popular
    • Home
    • Docs
    • Register
    • Login
    Please do not post a support request without first reading and following the advice in https://retropie.org.uk/forum/topic/3/read-this-first

    OLED Stats & Ledshim with Retropie

    Scheduled Pinned Locked Moved Help and Support
    raspberry pi 4oled displayneopixelledshim
    7 Posts 2 Posters 957 Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • B
      bobster316
      last edited by

      I have a micro desktop system with a Raspberry pi 4 8g, Neopixel led, ledshim and 0.96 OLED stats display.

      While using raspberry pi os 32 bit, i can start all the python scripts to start the components in the crontab, so when the Pi boots up everything is working.

      I tried the same with retropie os and none of the components work i.e. Neopixel led, ledshim and 0.96 OLED stats display

      Appreciate any help to configure correctly with retropie

      Thanks

      1 Reply Last reply Reply Quote 0
      • mituM
        mitu Global Moderator
        last edited by mitu

        RetroPie's image is based on Raspberry Pi Lite, so it should work. What Pi model/RetroPie version ? Please add more info.

        Are the python scripts working if you start them manually ? What scripts are you using (link/post on pastebin.com) ?

        1 Reply Last reply Reply Quote 0
        • B
          bobster316
          last edited by

          Raspberry Pi 4 8GB
          Retropie 4.7.1
          Linux 5.10.63-v7l+ armv7l GNU/Linux

          All the below scripts work if run manually

          OLED Display -
          sudo python3 /home/pi/OLED_Stats/stats.py

          Ledshim -
          sudo python3 /home/pi/Pimoroni/ledshim/examples/rainbow.py

          Neopixel Led Ring -
          sudo python3 /home/pi/rpi_ws281x//python/examples/strandtest.py

          Thanks

          1 Reply Last reply Reply Quote 0
          • mituM
            mitu Global Moderator
            last edited by mitu

            So add the scripts to autostart.sh (running in the background) and see if they'll run. Or better yet, create a service for each of them - see an example at https://gist.github.com/emxsys/a507f3cad928e66f6410e7ac28e2990f.

            B 1 Reply Last reply Reply Quote 0
            • B
              bobster316 @mitu
              last edited by

              @mitu said in OLED Stats & Ledshim with Retropie:

              o add the scripts to autostart.sh (running in the back

              Thanks Mitu, i created a service for each of them and it works fine.
              Thanks for your help

              B 1 Reply Last reply Reply Quote 0
              • B
                bobster316 @bobster316
                last edited by

                I have noticed an issue with the OLED stats display which still noot working when the Pi boots up.
                If the command to run the oled python script is run manually it works.
                Appreciate if anyone can help to fix, thanks

                OLED Setup

                sudo apt-get update
                sudo apt-get full-upgrade
                sudo reboot
                	Log back into the pi once its booted up again
                sudo apt-get install python3-pip (select Y to continue when prompted)
                sudo apt update (select Y to continue when prompted)
                sudo apt full-upgrade (select Y to continue when prompted)
                sudo reboot
                	Log back into the pi once its booted up again
                sudo apt-get install python3-pip 
                sudo pip3 install --upgrade setuptools
                cd ~
                sudo pip3 install --upgrade adafruit-python-shell
                wget https://raw.githubusercontent.com/adafruit/Raspberry-Pi-Installer-Scripts/master/raspi-blinka.py
                sudo python3 raspi-blinka.py (select  y to continue then Y to REBOOT NOW then login)
                sudo i2cdetect -y 1
                
                 
                
                If 3c has not shown up use command raspi-config 
                Interfaces
                I2c
                Enable
                Save
                Reboot
                Check again
                
                pip3 install adafruit-circuitpython-ssd1306
                sudo apt-get install python3-pil (select Y to continue when prompted)
                sudo pip3 install adafruit-blinka
                sudo pip3 install adafruit-circuitpython-ssd1306
                git clone https://github.com/mklements/OLED_Stats.git
                cd OLED_Stats
                python3 stats.py (the oled display should show stats)
                
                

                OLED Service

                cd /lib/systemd/system/
                sudo nano oled.service
                
                Enter the below in blue into the empty file and save/exit
                
                [Unit]
                Description=oled
                After=multi-user.target
                
                [Service]
                Type=simple
                ExecStart=/usr/bin/python3 /home/pi/OLED_Stats/stats.py
                Restart=on-abort
                
                [Install]
                WantedBy=multi-user.target
                
                sudo chmod 644 /lib/systemd/system/oled.service
                chmod +x /home/pi/OLED_Stats/stats.py
                sudo systemctl daemon-reload
                sudo systemctl enable oled.service
                sudo systemctl start oled.service
                
                
                mituM 1 Reply Last reply Reply Quote 0
                • mituM
                  mitu Global Moderator @bobster316
                  last edited by mitu

                  @bobster316 said in OLED Stats & Ledshim with Retropie:

                  I have noticed an issue with the OLED stats display which still noot working when the Pi boots up.

                  Without an actual display, it's difficult to diagnose. But, since you created a service unit for it, why not look at the error messages logged by the service to see what's the error printed by the script ?

                  1 Reply Last reply Reply Quote 0
                  • First post
                    Last post

                  Contributions to the project are always appreciated, so if you would like to support us with a donation you can do so here.

                  Hosting provided by Mythic-Beasts. See the Hosting Information page for more information.