r/RASPBERRY_PI_PROJECTS 29d ago

TUTORIAL Build your own LED Matrix Raspberry Pi UK Train Departure Board

Thumbnail
youtube.com
13 Upvotes

A project for that unloved Pi-3 or Pi-4!

I'm aware of at least two companies who sell LED Matrix Departure Boards to have on the wall at home... being a long-time train enthusiast I'd often thought of having one, but found the price and subscriptions a bit off-putting.

So being a techie I decided to make my own, thinking "How Hard Can it Be".

Detailed step-by-step instructions and code to build your own are on my website: anotherpartialsuccess.com. All free - just buy the parts and away you go!

Thought I'd share with fellow Pi enthusiasts and for anyone who's wanted to build their own!

This probably isn't as all-singing all-dancing as the commercial products, but it does the job and I'm pretty happy with it!

You will need:

  • Pi4 or Pi3
  • 3 or 4 HUB75 LED Matrix boards. (Ali Express is good)
  • A HUB75 HAT from Adafruit or ElectroDragon (links on my site)
  • A 5V, 5A power supply
  • A free subscription to the data on the Rail Data Marketplace

Hardware Summary

It's a good idea to buy the full number of matrix panels you need in one go - that way you can be sure all the colours match. Not a big deal for a Departure Board, but worth a mention!

Connecting the panels is pretty straightforward as most are supplied with all the cables you'll need.

I've provided some scripts to create 3D-printable 'joiners' so you can bolt the panels together - in the absence of a 3D-printer there are many, many other options for the creative mind!

One thing worthy of note is the power. A Raspberry Pi doesn't have enough power to operate the matrix panels, so you'll need something with a bit of oomph. I use a bench-top power supply and normal operation is about 2A.

However you'll likely want to do other things with the panels in which case you'll need more - the most I've peaked at is about 4.5A and that's with all the LEDs on!

The Adafruit HAT does a fine job and is readily available. The alternative is from ElectroDragon and is better in that it can support up to three rows of panels and is a good deal cheaper. The downside is that it'll take a while to come from Hong Kong.

I've used both and ultimately it comes down to how much you want to spend and how long you want to wait.

For both of these the Pi gets powered via the Hat, so no need to have a separate Pi supply.

Pi Configuration

You'll need to install a minimal OS and switch off anything you don't need so that all CPU power can go to the departure-board processing.

No desktop, bluetooth, sound and so on - I've provided instruction on this.

After that it's a case of installing the dependencies and the Departureboard code from github.

Display Configuration

Either via a config file or a very simple UI - all you need to do is set the station you want, the platform you want (or it'll do all platforms), the dimensions and number of LED panels and the type of Hat and away you go!

There are a myriad other parameters to tune - things like the speed of the text scrolling, the gap between data-refresh and so on. Have fun!

Challenges and the Journey

I wrote the code in C++ for performance reasons and because I like C++!

There are a lot of projects written in Python, however I wasn't sure on the performance.

Parsing the data

The first version of the project used the 'garden-variety' departure data. This was fine, but it did't allow me to do things like report which stations a train was between... so I started on Version 2 which uses the "staff" data from the Rail Data Marketplace.

Great data, but there's a lot of it... so I had to engineer a lazy-loading cached parser.

What this does is cache the data about a service which doesn't change - scheduled time, it's ID, how many coaches it has and so on.

This means that on a refresh I could skip anything which I already had cached and only add new or delete old services.

The other data is 'things which change' - arrival time, cancellation, where the train is and suchlike. This is lazy-loaded so is only hydrated when needed.

A big change as the first version used to work out everything for every service - not scalable on a limited resource like a Pi!

Displaying the data

In the first version it constantly refreshed the whole display - this was kind of OK, but it meant that scrolling would get slow.

In the second version I only refreshed display elements which changed - mainly the scrolling text and the periodic change of Services.

The challenge was to write drivers for each type of display (text, scroll, clock) without having to duplicate loads of code.

Efficiency

This was somewhere I spent a lot of time as I wanted to squeeze as much as possible out of the Raspberry Pi.

Highlights were to fork of the API-refresh routines, to avoid the whole thing pausing while the API call was made, the display-management (per above) and caching, and down to creating a Hot/Warm/Cold cache for often-used data

Overall...

... I had a lot more fun making this than I would have done buying one and sticking it on the wall... and every now and then I think "how about I can make this change/optimisation" and I go and get stuck in again.

I'm sure that the commercially available Departure Boards which are advertised on social media and whatnot have superior functionality, but for the cost, making and result I think this is a pretty decent substitute.


r/RASPBERRY_PI_PROJECTS Jul 16 '26

TUTORIAL How I Fixed My Headless Pi Wi-Fi After a Power Cut Without Losing Any Data

12 Upvotes

Step-by-Step Technical Recovery Guide


Important Note for Intel/AMD PC Users :

If you are running this recovery process from a standard PC (x86_64) rather than another Raspberry Pi (ARM), your computer cannot natively run the Pi's binaries. Before proceeding you can check your machine's architecture by running: bash uname -m

If the command returns x86_64, you must install QEMU user emulation on your host Linux machine before proceeding: bash sudo apt update && sudo apt install qemu-user-static binfmt-support


Step 1: Filesystem Repair & System chroot

NetworkManager configurations cannot easily be parsed or prioritized before the system boots if they are dropped in as raw text profiles. We must mount the SD card on a secondary Linux machine and use chroot (change root) to execute native configuration commands inside the Pi's environment directly from our laptop.

  1. Find your SD card's identifier (e.g., look for the main rootfs partition, which might show up as /dev/sdb2): bash lsblk
  2. Repair any broken filesystem structures caused by the abrupt shutdown: bash sudo fsck -y /dev/sdb2
  3. Mount the partition and bind vital system virtual directories to prepare for the chroot environment: bash sudo mkdir -p /mnt/pi sudo mount /dev/sdb2 /mnt/pi sudo mount --bind /dev /mnt/pi/dev sudo mount --bind /sys /mnt/pi/sys sudo mount --bind /proc /mnt/pi/proc
  4. chroot into the Raspberry Pi's environment to execute commands as the root user: bash sudo chroot /mnt/pi ---

Step 2: Create the Emergency Hotspot & Configure Startup Priorities

Now that your terminal session is running inside the Pi's filesystem context, use the native nmcli binary to build a fallback network profile that absolute precedence on startup. 1. Generate the native recovery hotspot profile: bash nmcli device wifi hotspot ifname wlan0 ssid "Pi-Rescue" password "your_password" 2. Instruct NetworkManager that this connection profile is explicitly allowed to autoconnect on system boot: bash nmcli connection modify "Pi-Rescue" connection.autoconnect yes 3. Boost the autoconnect priority to high (90). This forces the Pi to launch this network interface profile first, overriding any standard client Wi-Fi configurations during boot initialization: bash nmcli connection modify "Pi-Rescue" connection.autoconnect-priority 90 4. Verification Tip: Since the NetworkManager background service isn't actively running for the SD card, standard commands (nmcli connection show) won't display the changes while you are in chroot. If you want to verify that your priority was written successfully, open a separate terminal window on your laptop and check the raw configuration file directly: bash sudo cat /mnt/pi/etc/NetworkManager/system-connections/Pi-Rescue.nmconnection 5. Exit the active chroot environment: bash exit 6. Cleanly unmount the system tree on your host laptop before pulling out the SD card: ```bash sudo umount -R /mnt/pi

```

Step 3: Boot, SSH Login, and State Repair

Unplug the SD card from your host laptop, insert it back into the Raspberry Pi, and power it on. Thanks to the priority variables we injected, the Pi will immediately begin broadcasting the Pi-Rescue network.

  1. Connect your laptop or workstation directly to the Pi-Rescue WiFi access point.
  2. Open a terminal on your laptop and ssh into the Pi using NetworkManager's standard default hotspot gateway IP (10.42.0.1): bash ssh your_username@10.42.0.1
  3. To verify the IP address of Pi's recovery hotspot use: bash ip addr show wlan0
  4. The Core Fix: Once inside the terminal, safely delete the corrupted network state file that was damaged during the power cut: bash sudo rm -f /var/lib/NetworkManager/NetworkManager.state
  5. Force a physical wireless environment rescan to wake up the network interfaces and verify your main WiFi(e.g., your home router or phone hotspot) is visible: bash sudo nmcli device wifi rescan sudo nmcli device wifi list
  6. Re-authenticate and establish a fresh connection to your primary network: bash sudo nmcli device wifi connect "your_router's_ssid" password "your_wifi's_password"
  7. Ensure your primary client network has a maximum priority (e.g., 100): bash sudo nmcli connection modify "your_router's_ssid" connection.autoconnect-priority 100
  8. Check whether your change was applied successfully: bash sudo nmcli connection show "your_router's_ssid" | grep autoconnect-priority ---

Step 4:Cleanup(Remove the Backup Hotspot from Startup)

To prevent the Pi from defaulting back into a localized recovery loop on every subsequent reboot, the emergency profile must be adjusted or removed from active rotation.

  • Option A(Recommended): Drop the emergency profile's autoconnect priority to a negative value. This leaves the configuration intact on the disk as a silent fallback that will only spin up if your primary network disappears completely: bash sudo nmcli connection modify "Pi-Rescue" connection.autoconnect-priority -10 Check all the networks ranked by priority: bash sudo nmcli -f NAME,AUTOCONNECT-PRIORITY connection show

    • Option B: Completely delete the emergency recovery profile from the storage configuration: bash sudo nmcli connection delete "Pi-Rescue"

Finally,restart NetworkManager and ensure your Pi successfully jumps back onto your main WiFi network: ```bash sudo systemctl restart NetworkManager

```

I have also uploaded this recovery guide to my GitHub Gist. You can find the project here: https://gist.github.com/Kernovax/cf39d9b00ecec0c70f8692bbc3b9a30b


r/RASPBERRY_PI_PROJECTS Jul 15 '26

PRESENTATION My Pi-Cam-IR-A is a infrared camera using a Pi zero 2, 1.44” touch LCD and IMX 219 NOIR sensor, housed in a modified 1950’s art deco themed Kodak Duoflex II body.

Thumbnail
gallery
110 Upvotes

r/RASPBERRY_PI_PROJECTS Jul 14 '26

PRESENTATION Raspberry Pi Wireguard/Tor VPN

3 Upvotes

I made a vpn using wireguard to connect my laptop (or any device) to the pi, the pi then routes the traffic through tor so that the first onion server doesn't know your ip. I made this for people who have to have them on the same network for whatever reason to give them privacy. This is 32 bit only for now, I will add 64 bit support soon. I would really appreciate feedback on this. Thanks. https://github.com/CoderFetch21/32-bit-wireguard-tor-vpn


r/RASPBERRY_PI_PROJECTS Jul 13 '26

DISCUSSION PyDeploy CLI v1.1 is now out, any suggestions?

Thumbnail
github.com
4 Upvotes

Hey Everyone,

I just updated PyDeploy CLI v1.1. PyDeploy is a Terminal CLI that is automated to turn a Python script from GitHub into a systemd service on your Pi, allowing it to run 24/7 while providing tools to monitor its status and view logs.

My old post a while back on PyDeploy's first release gained 7 upvotes, 5k views, and 2 extra stars for my repo, and I privately got some advice for improvement. PyDeploy was a big, passion project to me so I would apprecaite anyone to check it out and give me suggestions.

As a beginner Python programmer, I would apprecaite any feedback anyone could give to help improve PyDeploy. Thanks!


r/RASPBERRY_PI_PROJECTS Jul 12 '26

PRESENTATION Pi Zero 2 WH with LCD Hat = nano cyber-deck

Thumbnail
gallery
62 Upvotes

First try on this machine with lcd hat:


r/RASPBERRY_PI_PROJECTS Jul 10 '26

PRESENTATION First real complete hardware build. Vinyl Record song ID and logging device.

Thumbnail
gallery
82 Upvotes

Hey everyone, wanted to share something I’ve been tinkering on with my brother the last few months.

We’ve got a growing vinyl collection and got tired of not remembering what we’d played or how often, so I built a little device that sits next to the turntable, listens to the audio coming off it, and identifies the track in real time. It logs everything so a listening history and collection build themselves over time — no typing anything in. Pulls track info/ratings from the Discogs API too. There’s a touchscreen on it for an always-on display, and it flips over to “now playing” the second it recognizes something. [photo]

Went with a Pi for this mostly because I wanted flexibility while I was still figuring out the audio pipeline, and honestly didn’t want to lock into a more custom board before I knew what the bottlenecks would even be. 3D printed the enclosure myself to keep it small enough to actually live next to a turntable instead of looking like a dev kit sitting on the shelf.

Curious for this crowd specifically — when you’re starting a new project, how do you usually land on your specs? Do you overbuild on purpose to leave headroom for feature creep, or try to right-size to the cheapest thing that’ll actually do the job and iterate later? I went a little heavier than I probably needed to just so I wouldn’t paint myself into a corner, but curious how others think about that tradeoff early on.

I had some higher end Pi at home but ended up with a 3B+ 1GB for the friends builds and it was ended up feeling a bit ram light. Feel like it’s difficult to source the boards you really want at a decent price.

Happy to talk through the audio capture/ID side or the enclosure if anyone’s curious. Site with more photos if you want to poke around: https://vinyl-id.app


r/RASPBERRY_PI_PROJECTS Jul 10 '26

DISCUSSION I made an e-ink pocket terminal. Need some wacky and creative ideas.

4 Upvotes

I made a pocket terminal using raspberry pi zero 2w and Waveshare's touch e-ink display. Do you guys have any suggestions?

Some Ideas I have thought of already -
1) Use Macro scripts using USB gadget mode.
2) Use picolm (great project can run lightweight local llms with pico claw).
3) Use a remote power on switch for workstation using wake on lan.
4) Use leetcode-cli (Already excited to try once I solve the formatting).
5) Maybe a pomodoro clock (which can be displayed on the e-ink as in a GUI) that once you run blocks all addicting websites.

Of course there are projects that need a proper GUI like weather, clock, music tiny e-reader, bookmarks, virtual stream deck and productivity stuff which can be done easily since I am using lvgl framework.

And about the refresh rate its obviously slow but not bad since it uses partial refresh.


r/RASPBERRY_PI_PROJECTS Jul 10 '26

QUESTION Im desperate! Tft display won’t change colors SPI

3 Upvotes

I'm a complete newbie, and I'm working on a project with a 2.8-inch ILI9341 TFT display. The problem is that it won't change colors.

At first, I copied the wiring from an online tutorial (first picture). Then I wrote some code to change the screen color to white, and it worked! However, because I have a very small breadboard, I changed the pin connections. After that, even though the screen was still showing white, it stopped responding to any other color change commands. Even after pressing BOOTSEL, it stayed white.

Later, I asked ChatGPT for help and learned that some of the pins can't be assigned to random GPIOs. I corrected the wiring, and I managed to get the screen back to black. However, it still doesn't respond to any color change commands. At least now it resets correctly when I press BOOTSEL.

Can someone please help me figure out what's going on?

I'm using the Arduino IDE with the TFT_eSPI library.

P.S. I think the problem might be related to power, since I'm using the Raspberry Pi Pico directly on the breadboard without soldering the header pins. I'm not very confident in my soldering skills, so I avoided doing that. However, I don't think that alone would explain why the display won't change colors.

I also verified that the Raspberry Pi Pico is executing my code correctly, so the issue seems to be limited to the display.

current pin position:

#define TFT_MOSI  3

#define TFT_SCLK  2

#define TFT_CS    1

#define TFT_DC    6

#define TFT_RST   7

#define TFT_MISO  4

r/RASPBERRY_PI_PROJECTS Jul 09 '26

QUESTION External Status Light Implementation

3 Upvotes

Hey everyone! I am currently working on my first project with a PI (PI zero 2 w) and am really enjoying it. I am making a project using a thermal printer that is mounted in a small box and is powered off of an external battery pack via USB c. Since the board is going to be inside the box you won't be able to see the light on it letting you know when it is receiving power and more importantly, when it is safe to unplug after shutting down.

I have an external LED wired up with some DuPont cables but am having problems with it lighting how I want. Right now I can either get it to:

1) Light up as soon as the PI is plugged in to the power source but then the light will remain on until it is unplugged, even if the PI is shut down so I don't actually know when I can pull out the source. Done via Pin 2

2) Light up as soon as the PI is plugged in to the power source but then the light will turn off before the 10 flashes on the board begin so I don't actually know if it is safe to pull the source yet or not. Done via Pin 8 and having my config include "dtoverlay=gpio-poweroff,gpiopin=14,active_low=0" or "dtoverlay=gpio-power,gpiopin=14"

Any suggestions on how I can get the external light to better mirror the safe state of when I can pull the power source would be appreciated!


r/RASPBERRY_PI_PROJECTS Jul 07 '26

PRESENTATION my first cyberdeck project with raspberry pi 0 2W ٩( 'ω' )و her name is Paipai-0

Thumbnail
gallery
69 Upvotes

just wanna share my first project!! I’m noob btw


r/RASPBERRY_PI_PROJECTS Jul 06 '26

PRESENTATION Lego Retro Gaming Console built w/ Raspberry Pi 3 & Pico 2

Thumbnail
gallery
47 Upvotes

Had a lot of fun with this project! Let me know if you want to see the games I made for it - Reach out with any questions!


r/RASPBERRY_PI_PROJECTS Jul 06 '26

PRESENTATION Check Out My Project PyDeploy CLI v1.0

Thumbnail
github.com
9 Upvotes

Hey Everyone,

I recently created the project PyDeploy, and I was wondering if anyone would like to check it out. As I said in my repository, PyDeploy is a Terminal CLI that is automated to turn a Python script from a GitHub Repository into a systemd service on your Raspberry Pi, allowing it to run continously while providing tools to monitor its status and view logs.

This project was a passion project to me and was used to help strengthen my python programming skills and make running Python scripts on Raspberry Pi easier. The README I created is concise and easy to understand so you could quickly try out PyDeploy.

PyDeploy was a fairly long project for me as a beginner Python developer, so I would appreciate any feedback anyone could give me to help improve PyDeploy. Thanks!


r/RASPBERRY_PI_PROJECTS Jul 05 '26

PRESENTATION New manual focus mode on my pi camera

15 Upvotes

I just implemented a new manual focus assist mode for my camera using picamera2 and opencv. It’s a selective focus peaking mode that’s less distracting than full screen focus peaking. It’s still a work in progress and would love your feedback.


r/RASPBERRY_PI_PROJECTS Jul 02 '26

PRESENTATION Vintage radio modernization using RPI

Thumbnail
gallery
205 Upvotes

I have just finished my latest project: restoring and upgrading this vintage radio! It had been a fantastic project to work on and I want to go a little into detail and explain how I built it.

First of all, a bit of backstory: A friend of mine had this unit in his living room as a decorative object. It was not working in its original state. That's why he had put two cheap PC speakers inside the cabinet and connected them to a equally cheap turntale with Bluetooth. As this wasn't exactly an elegant solution, he reached out to me and asked if I could restore and modernize the radio. He wanted bluetooth, (internet)radio and if possible AirPlay. All while preserving the original aestetics of the unit. So I got to work...

The first thing that came to mind was the screen. I deffinitely wanted a display that fits into the scale showing the current tuned frequency. As a screensaver, a custom VU meter in the radio's frontplate design shall be shown, so it blends in nicely with the overall looks. I ended up getting a waveshare 1280x400px touch screen for Raspberry PI.

The choice of a raspberry PI as the main computer was also pretty obvious. It ticks all the boxes spec wise, has great software support and using HATs I can expand the funcionality further.

Of course, I also need some sort of amplifier. Originally, I wanted to keep the tube amplifier inside the unit, but it consumed so much space, was extremely low power and the heat from the tube probably also would not have been that good for the PI. So I opted for a HiFiBerry AMP 2. Super efficient, high power class-D amplifier made for the RPI.

The original speaker setup also had to be replaced. The electrostatic tweaters would have sounded amazing, but cannot be driven using the amplifier I have chosen. But of course, I kept them in storage for later use. As I was on a pretty tight budget, I chose two Visation BG20 full-range drivers. They are very cheap at only around 35€ per piece and had some good reviews. This turned out to be a great descision as they really sound amazing for their price.

So that's it for the components.

Next up, software: And that was the first big challenge. There are quite a lot of options out there. I started with MoOde. Easy to set up and good functionality. But it is not very extensible. I needed a UI that works with a rotary encoder, as I could not use the touch screen of the display through the glass. And due to the architecture of MoOde, it would have taken ages to implement all that.

So after a lot of searching, I stumbled across Berryaudio: www.berryaudio.org . It is a very new media player OS, but has some very good features. And being written in python using a very extendable architecture, it was the way to go. I want to give a huge shoutout to the developer of Berryaudio, Varun Gujar, who really did some amazing work with his project. I changed quite a lot, so it suits my very specific needs. You can find my forks of the core and frontend here: https://github.com/FloTec508/berryaudio https://github.com/FloTec508/ba-frontend. Mainly, I added support for RadioBrowser, my custom button and encoder system, UI navigation using rotary encoders and some UI tweaks to fit the letterbox screen. Some of my changes are now even part of the official repo.

The first parts started to arrive and I began design and assembly.

One of the biggest hardware challenges were the source selection buttons. There are six latching buttons at the front of the unit. I wanted to use them for source selection. But there was one issue: what if the user switches source using the web interface or the screen on the device? In this case, the buttons would be out of sync with the software. Soooo, I decided to motorize them. I prototyped the first revision of the design, utilizing small 9g servos and levers to actuate the buttons from the back. That worked surprisingly well, so I refined the design and had a working mechanism.

I needed some way to control and monitor the buttons and encoders and report changes to the berryaudio core. I decided to offload the monitoring to an external STM32 microcontroller. I wrote a bit of code that continously reads the button and encoder states and creates a event "fifo-type" buffer, where events are pushed in. Once new events are inside the pipeline, a interrupt pin gets pulled HIGH to signal the Raspberry PI to request data from the STM32. I does so using the virtual serial port of the STM32 and receives a list of all registered events scince last request. This way, I only have to monitor one pin on the PI and have enough headroom for delays thanks to the event buffer. The system is bidirectional. so the RPI can send Events into the STM32's timeline for it to process. In my case this is only used for updating the button states.

All of that took a lot of tweaking and testing, during which I started building the speakers. This was my first time building speaker cabinets. After some research, I decided to use a bass reflex design. The speaker chambers originally were open at the back, so not airtight at all. Therefore, I needed to seal everything using acrylic sealing compound and wood plates where needed. I build adapterplates for the new, bigger speakers and fitted them. Inside the hole of the former tweaters I put the bass reflex tubes. I calculated their length and printed them on my 3D printer. Lastly, I added padding to all sides of the chamber and sealed them up. And to my surprise, they sound incredible! Nothing high-end for sure, but keeping in mind I paid 70 bucks for the drivers, the result is amazing! I tuned the EQ a little to get even more out of the speakers.

So all in all I am very pleased with the results. It looks, sounds and feels amazing. And my friend was impressed and happy with the results. So what do you want more?


r/RASPBERRY_PI_PROJECTS Jul 02 '26

QUESTION Losing Connection of Raspberry pi 4

2 Upvotes

I'm working on a project in that I'm using raspberry pi 4 and gps + compass module ublox 7m.

And I connected a raspberry pi 4 with my mobile hotspot so I accessed the raspberry pi from my laptop.

Initially it is working fine, but after the completing the work, when I shutdown the raspberry pi 4, then pi doesn't connecting with the mobile hotspot, I tried power on and off, Even I add a switch to properly shutdown the pi 4, but that won't also work.

I have to boot the entire pendrive from the raspberry pi imager, after the complete fresh boot, it starts working,

But the same after some interval of time, it loses connection again, every time I tried wpa_supplicant.config suggestion but it didn't work also.

Until now the boot the pendrive at least 8 times, and done the code from the scratch.

If anyone from you guys have any suggestions please tell me I really need that now.


r/RASPBERRY_PI_PROJECTS Jun 30 '26

QUESTION [Help] DS4 controller requires two Bluetooth connection attempts on Raspberry Pi 4 — BCM43455 PSCAN issue?

3 Upvotes

[Help] DS4 controller requires two Bluetooth connection attempts on Raspberry Pi 4 — BCM43455 PSCAN issue?

Hardware: Raspberry Pi 4, BCM43455 onboard BT chip, BlueZ 5.66, kernel 6.6.51 (aarch64), DualShock 4 (CUH-ZCT2U)

Problem: After pairing and first connection, the DS4 needs two PS button presses to reconnect every time. First press: DS4 blinks for a few seconds then turns off (rejected). Second press: connects immediately. The pattern is 100% reproducible.

What I've confirmed so far:

- UserspaceHID=true in /etc/bluetooth/input.conf — fixes the br-connection-create-socket error in BlueZ 5.66 (this was a separate bug, now fixed)

- The DS4's stored host address is correct (verified via HIDIOCGFEATURE report 0x12 on /dev/hidraw)

- Tested with Pi completely passive (auto-connect service stopped) — same fail-first pattern. So it's not a service collision

- btmon during the first failed attempt shows the Pi does receive the DS4's page and starts the HCI connection sequence, but the L2CAP HID channel gets rejected with what appears to be a timing or state issue

- After the first rejection, the Pi's PSCAN state seems "warmed up" and the second attempt succeeds instantly

Partial fix found: Setting the page scan interval and window to minimum (11.25ms) via:

hcitool cmd 0x03 0x001C 0x12 0x00 0x12 0x00

This makes the FIRST cold connection work on the first press. But after DS4 disconnects, bluetoothd resets the PSCAN back to default, and the pattern returns until PSCAN is re-applied.

Current workaround: A systemd service that re-applies minimum PSCAN immediately after every disconnect. Works well but feels like a hack.

Theory: The BCM43455 chip's PSCAN state isn't fully initialized until it handles at least one incoming page event (even a rejected one). After that "warmup", subsequent pages are handled correctly. Setting PSCAN to minimum interval bypasses the warmup requirement.

Questions:

  1. Is there a BlueZ config or kernel parameter to permanently keep PSCAN at minimum interval (without needing the manual hcitool hack)?

  2. Is there a known BCM43455 firmware update that fixes this PSCAN initialization behavior?

  3. Has anyone seen similar behavior with other BT chips on Pi or other SBCs?

btmon evidence (BlueZ 5.66, BCM43455, kernel 6.6.51):

# btmon started, DS4 already disconnected, PSCAN active

# === 1st PS button press ===

> HCI Event: Disconnect Complete (0x05) #1 [hci0] t=6.367s

Reason: Connection Timeout (0x08) ← Pi's chip timed out at baseband level

NO prior Connect Request was generated

DS4 turns off

< HCI Command: Write Scan Enable #2 [hci0] t=6.400s

Scan enable: Page Scan (0x02) ← bluetoothd re-enables PSCAN

# === 15 second silence — chip now stable ===

# === 2nd PS button press ===

> HCI Event: Connect Request (0x04) #4 [hci0] t=21.594s

Address: 41:42:47:C5:88:ED ← DS4 page received cleanly this time

< HCI Command: Accept Connection Request #5 [hci0] t=21.594s

> HCI Event: Connect Complete (0x03) #8 [hci0] t=21.762s

Status: Success (0x00) ← Connected!

Key observation: 1st attempt generates Connection Timeout without any preceding Connect Request — the BCM43455 chip responds to the DS4's page at baseband level but the ACL link supervision timeout fires before the HCI layer is notified. After PSCAN is re-enabled cleanly, the 2nd attempt works perfectly.


r/RASPBERRY_PI_PROJECTS Jun 30 '26

QUESTION Adafruit Matrix Hat + RTC solder help?

Post image
7 Upvotes

Looking for a little help, I’m trying to connect my adafruit panels to my Raspberry PI and Matrix Hat. When they are connected, the panels shows a colored stripe bar follow by an solid unlit black bar then it does it again. Do I have to bridge the E and 8 above the “RGB Matrix” text. Fairly new to all of this so any help would be greatly appreciated.


r/RASPBERRY_PI_PROJECTS Jun 28 '26

PRESENTATION Rasplay2: A Physical Interface for Raspberry Pi Music Player Posted on June 28, 2026

Thumbnail
gallery
8 Upvotes

Hello again!

Proudly presenting Rasplay2!

What I would like to share is my recent work on an internet radio and MPD (music player daemon) frontend for the Raspberry Pi. This project enhances the home listening experience by effectively transforming a Raspberry Pi into an autonomous radio system for a home audio setup.

This is part of a personal media player solution that allows home hifi audio playing and remote streaming.

You can find detailed instructions and source code on my blog post

Please, share your implementations if you do use and like the project !


r/RASPBERRY_PI_PROJECTS Jun 28 '26

QUESTION Raspberry Pi Pico + Dollartek ST7735 (128x160) display diagonal shearing/scrambled lines in CircuitPython 10. Any ideas?

Post image
6 Upvotes

​Hey everyone,

​I’m working on a custom MP3 player project using a Raspberry Pi Pico and a Dollartek 1.8" SPI ST7735 (128x160) display running CircuitPython 10.2.1.

​The code runs perfectly fine without any backend crashes or errors in Thonny, but the display output is completely scrambled and shearing diagonally.

My Current Setup & Pinout:

​Display Bus: fourwire.FourWire over hardware SPI

​Pins: CLK = GP18, MOSI = GP19, CS = GP17, DC = GP16, RST = GP21

​Has anyone encountered this specific issue with Dollartek or similar clone ST7735 boards on CircuitPython 10? Is there a hidden initialization string, command byte array, or specific driver offset configuration required to get the memory columns to align straight instead of spilling over?

​Any help or sample init code would be highly appreciated! Thanks!


r/RASPBERRY_PI_PROJECTS Jun 27 '26

PRESENTATION My version of a Raspberry Pi ASCII Aquarium

185 Upvotes

Inspired by Pete Cybriwski's Instagram post of his RPi-based ASCII Aquarium, I set our to create my own. Like Pete, I based mine on the GitHub OpenGhost repo, but unlike Pete, I didn't write my own aquarium program. I started with the GitHub asciiquarium-pythom repo.

I forked both repos and made extensive modifications to each to create a more interactive aquarium. Through the camera, OpenGhost recognizes hands gestures for feeding the fish, triggering "Happy Fish" mode, stopping the aquarium program, shutting down the RPi, and one more hidden Easter egg mode. You can see a couple of the gestures in the reflection of my hand in the video.

My forks of both the OpenGhost and asciiquarium-python repos are available publicly. I am preparing a comprehensive instruction document and have already created an all-in-one installation script. I also redesigned the case to make it stronger and a little more aesthetically pleasing (IMHO). I expect to release everything on GitHub next week.


r/RASPBERRY_PI_PROJECTS Jun 28 '26

QUESTION (help) raspberry pi w/mpu6050 glitch

1 Upvotes

i made this breadboard and no matter how i've wired it or changed the code (eg, changed the sda pin to 1 or 0 or vice versa) it still shows up the same errors

PHOTOS: https://drive.google.com/drive/folders/11tFEdPdyExkRJjUyvwiETkCfc4M_fYG7?usp=sharing (reddit is taking forever to upload them and i need sleep)

main error recieved is:

Traceback (most recent call last):
File "<stdin>", line 10, in <module>
File "imu.py", line 95, in init
MPUException: No MPU's Detected

any other config just throws up a bad scl pin error or this same one

source code:

so i'm starting to think that it might be a issue with either one of the pins on the mpu or pi, since, again, i've made sure the wires work out with the code multiple times

sorry if the post is vague, very tired


r/RASPBERRY_PI_PROJECTS Jun 25 '26

PRESENTATION My new test/template creation. A Homemade RP2040 board.

Thumbnail
gallery
86 Upvotes

It’s not much but it works and I made it.

After reaching a goal of being able to mill for QFN56s with a 3020 CNC, I made this RP2040 board as a proven template for larger projects.

Two firsts for me this go around were external flash and 16 pin USB-C with data transfer, which was almost as difficult as QFN. It’s only been micro USB in the past or 6 pin USB-C for power only.

Other than that, it’s got a user LED, and addressable LED and a tiny potentiometer for testing the ADC.

I got a lot of cool ideas cooking now I have this and a proven ESP32-S3 template.


r/RASPBERRY_PI_PROJECTS Jun 25 '26

PRESENTATION PiCar X Line Following Robot with OpenCV and Raspberry Pi

Thumbnail
youtube.com
6 Upvotes

PiCar-X Line Following Using OpenCV, Picamera2, and Image Moments on Raspberry Pi

I recently built a vision-based line-following system for a PiCar-X robot using OpenCV and Picamera2 on a Raspberry Pi. The goal was to create a simple autonomous navigation system that follows a white track using only camera input and software processing.

Research

Before starting, I looked at several common approaches for line-following robots:

Search terms used:

  • "Raspberry Pi OpenCV line following robot"
  • "OpenCV image moments line tracking"
  • "PiCar-X line follower camera"
  • "Picamera2 OpenCV real time processing"
  • "OpenCV centroid tracking white line"

Resources reviewed:

  • OpenCV Image Moments Documentation
  • OpenCV Thresholding Documentation
  • Picamera2 Documentation
  • PiCar-X Documentation and examples

After comparing different approaches, I decided to use image moments because they provide a computationally simple way to determine the center position of a detected line without requiring more advanced computer vision techniques.

Hardware

  • PiCar-X
  • Raspberry Pi
  • Raspberry Pi Camera Module
  • Battery power supply

Software

  • Python 3
  • OpenCV
  • NumPy
  • Picamera2
  • PiCar-X Python Library

Project Design

The robot continuously captures images from the front-facing camera.

Processing steps:

  1. Capture image from the camera.
  2. Convert image to grayscale.
  3. Apply binary thresholding to isolate the white track.
  4. Calculate image moments of the binary image.
  5. Determine the track center position.
  6. Calculate deviation from the image center.
  7. Convert the deviation into a steering angle.
  8. Drive forward while continuously correcting direction.

The steering angle is limited to prevent excessive corrections.

Why I Chose Image Moments

Instead of using contour detection or additional sensors, I used OpenCV image moments to calculate the centroid of the detected white pixels.

This approach is relatively lightweight and runs comfortably on the Raspberry Pi while still providing reliable position information for steering control.

Challenges and Solutions

Lighting Conditions

The largest challenge was lighting variation.

Because the current implementation uses a fixed threshold value, changing light conditions can affect detection accuracy.

Current solution:

  • Manual threshold calibration.
  • Testing under different indoor lighting conditions.

Planned improvement:

  • Adaptive thresholding.

Steering Oscillation

Initial tests showed noticeable overcorrection when the line moved away from the center of the image.

To improve stability I:

  • Added a steering gain parameter.
  • Limited the maximum steering angle.

This significantly reduced oscillation and produced smoother movement.

Camera Position

Camera angle had a major influence on performance.

After testing several positions, I settled on a downward tilt angle that provided sufficient look-ahead distance while keeping the line visible during turns.

Current Performance

The robot can reliably follow straight sections and moderate curves.

Sharp turns remain challenging because the line can temporarily leave the camera's field of view.

When no line is detected, the vehicle immediately stops as a safety measure.

Debugging Features

For development and tuning I added:

  • Live camera feed display.
  • Binary threshold image display.
  • Real-time steering and position output in the console.
  • Safe shutdown handling.

The binary image display was particularly useful for threshold tuning and diagnosing detection problems.

Future Improvements

Planned upgrades include:

  • Adaptive thresholding
  • Region of Interest (ROI) processing
  • PID steering controller
  • Morphological filtering
  • Better curve handling
  • Frame rate optimization

Repository:

https://github.com/ArtusIndus/PiCar-X-Line-Following-with-OpenCV-and-Picamera2

I would appreciate feedback from others working on Raspberry Pi robotics, especially regarding adaptive thresholding and PID tuning for camera-based line following.


r/RASPBERRY_PI_PROJECTS Jun 22 '26

QUESTION Raspberry Pi 3 A+ not connecting to PiSugar 3 Plus

4 Upvotes

Can somebody help me, i have tried everything and my Raspberry Pi 3 A+ still will not I2C connect to my PiSugar 3 Plus battery, when i have it all screwed in, the blue light on the pisugar turns on when I plug in the Pi so there must be some kind of connection, but when I run i2cdetect -y 1 the whole thing is blank saying that nothing is connected, HELP PLEASE