/r/raspberry_pi

3,204,606 Subscribers

5

Kiosk Chrome Script Erroring out

I have over 50 vanilla raspbian OS rp4's that auto boot to a single webpage; it worked great for about a year and recently started failing.

I use a startup service to call the script, which launches kiosk mode Chrome; when I check the status of the service I see a xset display error. If I leave the device for a few hours it'll magically start working again.

I'm not sure whats going on, but any thoughts would be helpful!!!!

error

The service that is throwing the error:

service

I think this might have started after an update: uname-a
Linux rotation-breakroom 6.1.0-rpi7-rpi-v8 #1 SMP PREEMPT Debian 1:6.1.63-1+rpt1 (2023-11-24) aarch64 GNU/Linux

3 Comments
2024/11/13
17:23 UTC

2

How to modify start menu in depth?

So both are Raspberry Pi 5 Model B 8GB. One is being used in the Sunfounder Pironman case, the other I have yet to begin my project. I opted for desktop/UI on both.

This is where things get weird. On the start menu, one says "Logout" and other shows "Shutdown", yet both give the same Shutdown Menu when pressed. Why are they different, and more importantly, can I edit this text?

4 Comments
2024/11/13
01:46 UTC

1

Official 7" touchscreen on Pi 4 with POE hat not accepting touch input.

I am trying to build a kiosk for a business application, so am trying to minimize one-off, unsupported hacks. I am using as much official hardware as possible--Pi 4, official 7" touchscreen, POE+ hat from adafruit. I had the kiosk application working in dev with the touchscreen on a Pi 3, but POE is a requirement for actual deployment. Upgraded to Pi 4 with the POE+ hat, which powers everything up, but the touchscreen functionality is not working. dmesg shows:

[ 9.406504] edt_ft5x06 10-0038: touchscreen probe failed

[ 9.406997] edt_ft5x06: probe of 10-0038 failed with error -5

Googling shows an I2C driver conflict from 2021, and an extremely current memory error. There is a github pull from Linus from 2024 11 03 (a week ago) into v6.12-rc5:

https://code.googlesource.com/linux/torvalds/linux/+/295ba6501d2e83b2e66729dc3a7726f80893c920%5E1..295ba6501d2e83b2e66729dc3a7726f80893c920/

Is anyone else using Pi4/official touchscreen/POE+ hat for a kiosk application successfully? Is there a stable OS release that works? Or a hardware solution? Is there a simple way to incorporate this patch without getting too in the weeds? I have 20years in IT admin, so I'm not afraid to get my hands dirty, but I am trying to solve a business problem, so I REALLY don't want to get into kernel hacking.

1 Comment
2024/11/12
17:21 UTC

1

RPI 4B w/Wayland, VNC and TigerVNC client, the | (pipe) shows up as ~ (Tilda)

In the USA.

If I ssh into my RPI 4B, everything works perfectly.

But when I use a VNC (TigerVNC client), pressing "|" key causes a "~" to show up.

I've dig into this, there's several posts but non help. I've got my locate set correctly.

altan@retriever:~ $ localectl status

System Locale: LANG=en_US.UTF-8

VC Keymap: (unset)

X11 Layout: gb

X11 Model: pc105

But I see the X11 layout is gb -- nothing seems to change that . Not sure if it's the cause. Yes, I've used the RPI config and set the local.

Any tips?

1 Comment
2024/11/12
01:14 UTC

1

Issues with Booting RPi4 from USB in 2.0 Port

To prepare, I updated the RPi’s firmware using `rpi-eeprom-update`, selected the 'NVMe/USB boot option' in `raspi-config`, and confirmed that `vcgencmd bootloader_config` shows `BOOT_ORDER=0xf14`.

The issue is that booting works well when I plug the USB into 3.0 ports, but not in 2.0 ports. I initially tried booting the RPi with the USB inserted in a 2.0 port, and after about 10 minutes, I tried connecting via SSH, only to see a 'No route to host' error. Then, when I switched the USB to a 3.0 port, the SSH connection worked immediately. So far, I haven’t noticed any issues with the 3.0 ports.

The most frustrating part is that after multiple attempts, I found that booting sometimes works with the USB in the 2.0 ports.

I may need more testing to clarify the issue, but what could be causing this? Could it be poor USB port or drive quality, or perhaps a software-related issue? Or could it just be temporary?

1 Comment
2024/11/12
07:09 UTC

4

Button activated videoplayer

Dear Reddit,

I am trying to make a button driven videoplayer. The scrypt should start when the pi boots. I have taken all the steps in tutorials and doing research, but I cant get the srypt started when booted.

If i check ''sudo systemctl status vlc_gpio_trigger.service'' It is running, but when the button is pushed nothing happens. If i manually start the scrypt everything works fine.

The error I see is that VLC shoud not be run as root. To get this working I tried the following:

I created: sudo nano /etc/systemd/system/vlc_gpio_trigger.service

In there i have put:

[Unit]

Description=VLC Video Player via GPIO 17 Trigger

After=multi-user.target

[Service]

ExecStart=/usr/bin/python3 /home/jcd/start1.py

User=jcd

Group=jcd

Restart=always

[Install]

WantedBy=multi-user.target

Although the steps above, it is not working. I am a novice regarding raspberries, but I really have done the research, and can't get it to work as it should.

Can someone see what I am doing wrong?

Kindest regards

2 Comments
2024/11/12
12:16 UTC

3

2024 Nov 11 Stickied -FAQ- & -HELPDESK- thread - Boot problems? Power supply problems? Display problems? Networking problems? Need ideas? Get help with these and other questions!

###Welcome to the r/raspberry_pi Helpdesk and Frequently Asked Questions!

Link to last week's thread

Having a hard time searching for answers to your Raspberry Pi questions? Let the r/raspberry_pi community members search for answers for you!^(†) Looking for help getting started with a project? Have a question that you need answered? Was it not answered last week? Did not get a satisfying answer? A question that you've only done basic research for? Maybe something you think everyone but you knows? Ask your question in the comments on this page, operators are standing by!

This helpdesk and idea thread is here so that the front page won't be filled with these same questions day in and day out:

  1. Q: What's a Raspberry Pi? What can I do with it? How powerful is it?

A: Check out this great overview 2. Q: Does anyone have any ideas for what I can do with my Pi?
A: Sure, look right here!^(‡) 3. Q: My Pi is behaving strangely/crashing/freezing, giving low voltage warnings, ethernet/wifi stops working, USB devices don't behave correctly, what do I do?
A: 99.999% of the time it's either a bad SD card or power problems. Use a USB power meter or measure the 5V on the GPIO pins with a multimeter while the Pi is busy (such as playing h265/x265 video) and/or get a new SD card 1 2 3. If the voltage is less than 5V your power supply and/or cabling is not adequate. When your Pi is doing lots of work it will draw more power. Higher wattage power supplies achieve their rating by increasing voltage, but the Raspberry Pi operates strictly at 5V. Even if your power supply claims to provide sufficient amperage, it may be mislabeled or the cable you're using to connect the power supply to the Pi may have too much resistance. Phone chargers, designed primarily for charging batteries, may not maintain a constant wattage and their voltage may fluctuate, which can affect the Pi’s stability. You can use a USB load tester to test your power supply and cable. Some power supplies require negotiation to provide more than 500mA, which the Pi does not do. If you're plugging in USB devices try using a powered USB hub with its own power supply and plug your devices into the hub and plug the hub into the Pi. 4. Q: I'm trying to setup a Pi Zero 2W and it is extremely slow and/or keeps crashing, is there a fix?
A: Either you need to increase the swap size or check question #3 above. 5. Q: I'm having a hard time finding a place to purchase a Raspberry Pi for an affordable price. Where's the secret place to buy one without paying more than MSRP?
A: https://rpilocator.com/ 6. Q: I just did a fresh install with the latest Raspberry Pi OS and I keep getting errors when trying to ssh in, what could be wrong?
A: There are only 4 things that could be the problem:
1. The ssh daemon isn't running 2. You're trying to ssh to the wrong host 3. You're specifying the wrong username 4. You're typing in the wrong password 7. Q: I'm trying to install packages with pip but I keep getting error: externally-managed-environment
A: This is not a problem unique to the Raspberry Pi. The best practice is to use a Python venv, however if you're sure you know what you're doing there are two alternatives documented in this stack overflow answer: * --break-system-packages * sudo rm a specific file as detailed in the stack overflow answer 8. Q: The only way to troubleshoot my problem is using a multimeter but I don't have one. What can I do?
A: Get a basic multimeter, they are not expensive. 9. Q: My Pi won't boot, how do I fix it?
A: Step by step guide for boot problems 10. Q: I want to watch Netflix/Hulu/Amazon/Vudu/Disney+ on a Pi but the tutorial I followed didn't work, does someone have a working tutorial?
A: Use a Fire Stick/AppleTV/Roku. Pi tutorials used tricks that no longer work or are fake click bait. 11. Q: What model of Raspberry Pi do I need so I can watch YouTube in a browser?
A: No model of Raspberry Pi is capable of watching YouTube smoothly through a web browser, you need to use VLC. 12. Q: I want to know how to do a thing, not have a blog/tutorial/video/teacher/book explain how to do a thing. Can someone explain to me how to do that thing?
A: Uh... What? 13. Q: Is it possible to use a single Raspberry Pi to do multiple things? Can a Raspberry Pi run Pi-hole and something else at the same time?
A: YES. Pi-hole uses almost no resources. You can run Pi-hole at the same time on a Pi running Minecraft which is one of the biggest resource hogs. The Pi is capable of multitasking and can run more than one program and service at the same time. (Also known as "workload consolidation" by Intel people.) You're not going to damage your Pi by running too many things at once, so try running all your programs before worrying about needing more processing power or multiple Pis. 14. Q: Why is transferring things to or from disks/SSDs/LAN/internet so slow?
A: If you have a Pi 4 or 5 with SSD, please check this post on the Pi forums. Otherwise it's a networking problem and/or disk & filesystem problem, please go to r/HomeNetworking or r/LinuxQuestions. 15. Q: The red and green LEDs are solid/off/blinking or the screen is just black or blank or saying no signal, what do I do?
A: Start here 16. Q: I'm trying to run x86 software on my Raspberry Pi but it doesn't work, how do I fix it?
A: Get an x86 computer. A Raspberry Pi is ARM based, not x86. 17. Q: How can I run a script at boot/cron or why isn't the script I'm trying to run at boot/cron working?
A: You must correctly set the PATH and other environment variables directly in your script. Neither the boot system or cron sets up the environment. Making changes to environment variables in files in /etc will not help. 18. Q: Can I use this screen that came from ____ ?
A: No 19. Q: I run my Pi headless and there's a problem with my Pi and the best way to diagnose it or fix it is to plug in a monitor & keyboard, what do I do?
A: Plug in a monitor & keyboard. 20. Q: My Pi seems to be causing interference preventing the WiFi/Bluetooth from working
A. Using USB 3 cables that are not properly shielded can cause interference and the Pi 4 can also cause interference when HDMI is used at high resolutions. 21. Q: I'm trying to use the built-in composite video output that is available on the Pi 2/3/4 headphone jack, do I need a special cable?
A. Make sure your cable is wired correctly and you are using the correct RCA plug. Composite video cables for mp3 players will not work, the common ground goes to the wrong pin. Camcorder cables will often work, but red and yellow will be swapped on the Raspberry Pi. 22. Q: I'm running my Pi with no monitor connected, how can I use VNC?
A: First, do you really need a remote GUI? Try using ssh instead. If you're sure you want to access the GUI remotely then ssh in, type vncserver -depth 24 -geometry 1920x1080 and see what port it prints such as :1, :2, etc. Now connect your client to that. 23. Q: I want to do something that has been well documented and there are numerous tutorials showing how to do it on Linux. How can I do it on a Raspberry Pi?
A: A Raspberry Pi is a full computer running Linux and doesn't use special stripped down embedded microcontroller versions of standard Linux software. Follow one of the tutorials for doing it on Linux. Also see question #1. 24. Q: I want to do something that has been well documented and there are numerous tutorials showing how to do it with an Arduino. How can I do it on a Raspberry Pi Pico?
A: Follow one of the tutorials for doing it on Arduino, a Pico can be used with the Arduino IDE. 25. Q: I'm trying to do something with Bluetooth and it's not working, how do I fix it?
A: It's well established that Bluetooth and Linux don't get along, this problem is not unique to the Raspberry Pi. Also check question #20 above.

Before posting your question think about if it's really about the Raspberry Pi or not. If you were using a Raspberry Pi to display recipes, do you really think r/raspberry_pi is the place to ask for cooking help? There may be better places to ask your question, such as:

Asking in a forum more specific to your question will likely get better answers!


See the /r/raspberry_pi rules. While /r/raspberry_pi should not be considered your personal search engine, some exceptions will be made in this help thread.
‡ If the link doesn't work it's because you're using a broken buggy mobile client. Please contact the developer of your mobile client and let them know they should fix their bug. In the meantime use a web browser in desktop mode instead.

25 Comments
2024/11/12
00:42 UTC

1

Error reading image data (Invalid argument) - Raspberry Pi Rev 1.3 connected to Raspberry Pi Zero 2W

I'm doing the software for a camera that will work as a client and send bytes of images to a server. The camera configuration is right, but, when I need to use the buffer to allocate the images and read the bytes, an error occurs:

Allocated buffers: 4

Request created successfully

Checking fd value:19

Failed to read image data: Invalid argument

Error reading image data. FD: 19, length: 307200

int SendFrames(){
        allocator = make_shared<
FrameBufferAllocator
>(cameraconnection.camera);
        for (StreamConfiguration &streamConfig : *cameraconnection.config){
            int ret = allocator->allocate(streamConfig.stream());
            if(ret<0){
                cerr << "Can't allocate buffers" << endl;
                return -ENOMEM;
            }
        }

        if(cameraconnection.camera->start() < 0){
            cerr << "Failed to start the camera" << endl;
            return EXIT_FAILURE;
        }

        while(running){
            const auto &buffers = allocator->buffers(cameraconnection.stream);
            cout << "Allocated buffers: " << buffers.size() << endl;

            if(buffers.empty()){
                cerr << "Allocated buffers are empty, waiting ..." << endl;
                usleep(100000);
                continue;
            }

            unique_ptr<Request> request = cameraconnection.camera->createRequest();
            if(!request){
                cerr << "Failed to create the request" << endl;
                continue;
            } else {
                cout << "Request created successfully" << endl;
            }
            
            FrameBuffer *frameBuffer = buffers[0].get();
            if(!frameBuffer){
                cerr << "Frame buffer is null" << endl;
                continue;
            }

            request->addBuffer(cameraconnection.stream, frameBuffer);
            if(cameraconnection.camera->queueRequest(request.get()) < 0){
                cerr << "Failed to queue request" << endl;
                continue;
            }

            request->status();

            const auto &planes = frameBuffer->planes();  // object plane to adquire   image data after the request
            if(!planes.empty()){
                const auto &plane = planes[0];
                if(plane.length <= 0){
                    cerr << "Invalid plane length: " << plane.length << endl;
                    continue;
                }

                vector<unsigned char> image_data(plane.length);  

                // GET THE IMAGE DATA
                int fd_value = plane.fd.get();
                cout << "Checking fd value:" << fd_value << endl;

                if(fd_value < 0){
                    cerr << "Invalid file descriptor (FD: " << fd_value << ")" << endl;
                    continue;
                }

                
ssize_t
 bytes_read = read(fd_value, image_data.data(), plane.length);
                if (bytes_read == -1) {
                    perror("Failed to read image data");
                    cerr << "Error reading image data. FD: " << fd_value
                        << ", length: " << plane.length << endl;
                    continue;
                }

                image_data.resize(static_cast<
size_t
>(bytes_read));

                if(bytes_read <= 0){
                    cerr << "No data read. Bytes read: " << bytes_read << endl;
                    continue;
                }
                
                if(!BytesToSend(socketconnection, image_data)){
                    cerr << "Failed to send image data" << endl;
                } else {
                    cout << "Data sent" << endl;
                }

            } else {
                cerr << "No planes available for frame" << endl;
            }
        }
        return 0;
    }

(OBS.: It's my first time using C++, so I'm kinda lost coding. I accept suggestions!)

1 Comment
2024/11/11
11:41 UTC

1

Unable to get Waveshare 7 Inch DSI LCD to work with CM4 and CM4IO Board

Hi, I recently bought myself a waveshare LCD from core electronics in Australia, the wiki in the product description gives me the steps to set it up with my CM4 and get straight to using it but I am having absolutely no luck. I have tried so many different steps I dont even remember what ive done and what I havent. I need some insights from a fresh mind because I think im going crazy. I have my FPC for the DSI interface connected to DISP1 and the power connected to 5V and GND on the CM4 GPIO. I am powering my CM4IO board with a 12V 2A power supply. All items are original and not clones. Any suggestions?

1 Comment
2024/11/11
11:56 UTC

9

Alternatives to WayVNC because of poor Unicode support

I often have to cut and paste non-ASCII Unicode text (specifically, Devnagari, the script used by many Indian languages) into and from my Raspberry Pi 5. I'm using wayvnc and connecting to it with RealVNC viewer. however, when I cut and paste non-ASCII text either to or from the Pi, I get a bunch of question marks (when going desktop -> Pi) or a bunch of gibberish (when going Pi -> desktop). After spending hours trying to figure this out I finally discovered that the problem is with wayvnc, which does not support UTF-8 encoding when copying and pasting.

There doesn't seem any way around this with wayvnc. Is there an alternative? I could just stop using Wayland, I know, but I have the sense - possibly wrong - that this will break other things, and more things over time?

2 Comments
2024/11/11
12:45 UTC

24

Voice Assistant like Alexa with RaspberryPi + ChatGPT

I have been working on a personal project to develop a home voice assistant with RaspberryPi and ChatGPT. In the current setup, the RPi listens to audio queries either via a microphone module (with hot-word detection) or via phone (via an audio recording app).

Details of the workflow: Home Voice Assistant.

Code available at suryatejadev/corgi_home_assistant: Home voice assistant using RaspberryPi

TL;DR: Once the RPi is setup and the code's running, the RPi will wait for an audio input either via microphone or from the phone. Once it gets an input, it transcribes it to text, gets ChatGPT response, converts it to audio and plays it out via the connected speaker.

Let me know what you think!

15 Comments
2024/11/11
08:43 UTC

1

How to use a keypad as a 'codepad' with a raspberry pi 3?

Hi all,

I'm pretty new to coding and was wondering how to use a keypad as a 'codepad' with my raspberry pi 3. I got the code from this website ( https://maker.pro/raspberry-pi/tutorial/how-to-use-a-keypad-with-a-raspberry-pi-4 ), but I continually get a "failed to add edge detection”.

Does anyone know how to fix this or change the code to something that works?

Thanks!

2 Comments
2024/11/10
23:47 UTC

2

Pi5 Composite Video - Use non square pixels??

Hello. I am using a pi5 to watch live TV, DVDs and steaming on my 27" CRT. Its the only TV I have, I'm very stubborn and don't like to replace things if they still work. Anyway, here is the problem I have.

NTSC video is 720x480, which is a 16:9 ratio, however it has non square pixels, so its actually a 4:3 ratio. Linux doesn't know this, so it outputs a standard 16:9 image with square pixels,. This creates a squashed image. My current work around in VLC, is to use a custom aspect ratio of 2:1 for 16:9 video. This works great for live TV, DVDs and other videos that i can play though VLC, but online streaming services, like amazon video and youtube, don't have this ability.

I don't see how it would be possible, but is there a way to make xorg or wayland handle non square pixels? Or is there any other work around to make the aspect ratio correct? like a 4:3 stretched ratio(i don't think this is possible on the pi5) or custom firmware or something? Maybe there is a way to set a custom aspect ratio in Prime Video or YouTube?

15 Comments
2024/11/10
20:59 UTC

3

4-to-1 Camera Module 3

Hi all,

For a project I would like to multiplex 4 Camera Module 3 cameras onto 1 single output. This output would then be connected to a Raspberry Pi to process the image data. I have 2 problems however:

  1. The Camera Module 3 doesn't natively support synchronous capture according to the documentation. The HQ and GS camera do, but since these are both more expensive, I would prefer avoiding them. Is there any way to still allow synchronous capture? Perhaps through software or custom hardware?

  2. I have searched a little bit online and can't really find a 4-to-1 multiplexer for CSI-2, D-PHY (used protocol). How would I go about doing this? put the captured images in a buffer and then multiplex them using time-division-multiplexing?

Any help is more than welcome, thanks!

6 Comments
2024/11/09
14:16 UTC

21

Configure Raspberry PI as hotspot/access point

Hello everyone!

I am trying to setup my Raspberry Pi 3B as an access point. I have prepared a fresh install and I am accessing it with SSH through a wired connection. After running sudo apt update && sudo apt ugprade -y, I followed this guide and I ran the first command, providing a network name and a password.

sudo nmcli device wifi hotspot ssid <example-network-name> password <example-password>

After executing that I could see the new network in my phone's list, in the available networks, but as I try connecting it simply doesn't connect. I have triple checked the password, thinking I may have fatfingered, but I didn't.

What could be the curlprit?

20 Comments
2024/11/09
13:06 UTC

1

Can't use PyAudio in a service

I have Python code that uses PyAudio to listen to the sound from the microphone on my Raspberry Pi. It runs fine in terminal in python3.

But when I try to run my program as a startup service, it fails while trying to execute:

pa = pyaudio.PyAudio()

_stream = pa.open(format=pyaudio.paInt16,

channels=1, rate=SAMPLING_RATE,

input=True,

frames_per_buffer=NUM_SAMPLES)

The error message is:

Nov 08 10:59:11 raspberrypi python3[7262]: File "/home/pi/laundry_alarm/laundry_alarm.py", line 125, in <module>

Nov 08 10:59:11 raspberrypi python3[7262]: _stream = pa.open(format=pyaudio.paInt16,

Nov 08 10:59:11 raspberrypi python3[7262]: File "/usr/lib/python3/dist-packages/pyaudio.py", line 750, in open

Nov 08 10:59:11 raspberrypi python3[7262]: stream = Stream(self, *args, **kwargs)

Nov 08 10:59:11 raspberrypi python3[7262]: File "/usr/lib/python3/dist-packages/pyaudio.py", line 441, in __init__

Nov 08 10:59:11 raspberrypi python3[7262]: self._stream = pa.open(**arguments)

Nov 08 10:59:11 raspberrypi python3[7262]: OSError: [Errno -9996] Invalid input device (no default output device)

Nov 08 10:59:11 raspberrypi systemd[1]: laundry_alarm.service: Main process exited, code=exited, status=1/FAILURE

Nov 08 10:59:11 raspberrypi systemd[1]: laundry_alarm.service: Failed with result 'exit-code'.

Nov 08 10:59:11 raspberrypi systemd[1]: laundry_alarm.service: Consumed 2.341s CPU time.

My laundry_alarm.service file looks like this:

[Unit]

Description=Start laundry alarm application on boot

After=multi-user.target

[Service]

ExecStart=/usr/bin/python3 /home/pi/laundry_alarm/laundry_alarm.py

User=pi

[Install]

WantedBy=multi-user.target

Any help would be greatly appreciated. It's driving me crazy that it works in terminal but not in a service. Thank you.

9 Comments
2024/11/08
17:23 UTC

42

A project for my boat

https://preview.redd.it/dbjyf4yx2pzd1.jpg?width=4000&format=pjpg&auto=webp&s=09dac8933a83e7d12421352f080252169b451289

https://preview.redd.it/ait3izwx2pzd1.jpg?width=4000&format=pjpg&auto=webp&s=e3e2c7f2c1d1362dd1f7fb7c7f89cc773f3e1e71

https://preview.redd.it/twhrhzwx2pzd1.jpg?width=4000&format=pjpg&auto=webp&s=2d48d775f052d93bea173d999367172d7aa6fad0

For my boat, i'm running a RPI 5 with 4 gb ram.
NVMe base from pimoroni with a 2280, 250 GB nvme drive.
A SupTronics Technologies X1201 V1.1 UPS with 2x 18650 batteries
and finally, a PICAN-M, Rev-b NMEA board for the boat instruments.

The OS i'm running, is the OpenPlotter 4.x.x, with signal-k, zigbee2mqtt and a 4g modem.

I get power from the NMEA bus, but i'm still testing if the UPS board will get power from the PICAN-M card. If not, i need to get a buck converter to supply the UPS board with 5V.
I plan to have a 12v supply constantly connected to the "house" battery on the boat

The boat is mostly on shore power when not used. I will also have a LVDO connected, so i do not drain the "house" battery when not on shore power and the boat is not running.

7 Comments
2024/11/08
15:25 UTC

151

We wanted to save some money on GitHub Actions, so now we run builders on a Kubernetes cluster of Raspberry Pis alongside our main cloud infrastructure. I think we're onto something! Is anyone interested in trying it out and giving some feedback?

Hi all! I have an interesting story to share! 😊 I’m working as a software developer on a fairly large project that takes ages to build. We run GitHub Actions on every push, and some time ago, we were surprised by a bill from GitHub. Someone on the team joked that we’d save a ton of money if we just ran builds on Raspberry Pis at home, and we actually turned it into a fun side project!

My homelab setup

Here are some things we learned along the way:

  • The GitHub Runner application is open source and available on GitHub. Initially, we ran it directly on an RPI, and it seemed to work quite well. However, only one build could run in parallel, so the RPIs were underutilized. Fortunately, GitHub also provides an “autoscaler” for self-hosted runners based on Kubernetes: actions/actions-runner-controller.
  • We had 2 RPIs running Ubuntu, which we used to set up a Kubernetes cluster. We considered two options: microk8s and k3s, and ultimately chose k3s. The setup was as simple as running a few bash commands like `curl -sfL https://get.k3s.io | sh -`. The whole configuration took us just a couple of minutes. Here’s a good tutorial for a setup similar to ours: https://anthonynsimon.com/blog/kubernetes-cluster-raspberry-pi/
  • Once the cluster was ready, we installed Helm and then used it to install the GitHub Actions Runner Controller (ARC). To configure ARC, you’ll need a personal access token (which you can obtain from GitHub at https://github.com/settings/tokens) and a link to your GitHub repo/organization.

This setup worked great! We moved a few of our repositories to these runners and monitored them for a week. We couldn’t find an easy way to fall back to GitHub-managed runners, so whenever my home network had issues, the cluster became unresponsive. But for hobby or non-critical projects, it’s a great money-saver! We ran close to 6,000 minutes with this setup!

If you’d like to try it out yourself, I’m happy to answer any questions and help troubleshoot!

Since then, we’ve made some improvements to this setup: to avoid disruption, we moved the Kubernetes control plane from the RPIs to our cloud environment, mixing cloud instances with RPIs. This way, when the RPIs aren’t available, there’s always at least one node, and builds can fall back to cloud VMs.

I showed this setup to a friend, and he liked it so much that now my colleague and I are wondering if others might need something similar. If you’d like to try it out or just want to learn Kubernetes, let me know, and I can set up a cluster for you to experiment with. We’re looking for honest feedback at this stage! 😄

28 Comments
2024/11/08
13:21 UTC

1

Dollar Bill Acceptor (pulse) to Raspberrypi

Has anyone been successful rigging up a dollar bill acceptor to a pi? I see there are some pi hats available but is really like to not have to work with a hat if not needed. I’ve been working on this for the better part of the day and nothing I do with my python script seems to be helping. I think the issue is the speed of the pulse - probably under 5-6ms - the pulse is 12vdc - witch I have an adjustable step down set up to it stepping it down to 3.2v which the pi should handle from what I’ve read. Normally open to gpio pin and common ground to ground.

The real hitter is my script starts when unplugging and plugging back in the gpio, but not from the pulse of the dba when a dollar is inserted.

If anyone’s had any success with this could you please point me in the right direction? I’ve seen cereal usb set ups but don’t quite understand how I would go about using one.

Thank you

5 Comments
2024/11/08
03:57 UTC

1

Pico I2C clock signal problem

Im trying to read the SCL clock signal from a rasperry pi pico but the frequency of the signal seems to be really low. Im pulling both the SDA and SCL lines to 3.3V with 2.2k resistors. I also dont have a slave device connected as for now could that affect the signal speed? I tried setting the frequency to 400kHz then 100kHz and then only 10000Hz but I keep getting around 1.5kHz reading with an oscilloscope.

https://preview.redd.it/ke73bgz5bizd1.png?width=4032&format=png&auto=webp&s=61a91b5be7036dc3d2dae76247d57df916bd662c

1 Comment
2024/11/07
16:34 UTC

1

Trouble adding USB Wifi Adapter to Pi 4

I need to connect my Pi 4 to two separate Wi-Fi networks at the same time so if I read everything correctly, I need to add a USB Wi-Fi adapter to it.

I need to run a Tailscale connection on the internal wifi adapter wlan0 which is connecting to tailscale.

When I plug in the new adapter lsusb shows it as

Bus 001 Device 007: ID 0bda:818b Realtek Semiconductor Corp. RTL8192EU 802.11b/g/n WLAN Adapter which brings me to an old post at Realtek RTL8192EU WiFi drivers for Raspbian - Audio Gear Talk / Raspberry Pi - Roon Labs Community that leads to a dead link.

I then found [SOLVED] RTL8192EU 802.11b/g/n WLAN Adapter will not connect LM 21 - Linux Mint Forums and started instructions found on it and it fails with the following

Building module:

cleaning build area...

'make' all KVER=6.1.21-v8+...(bad exit status: 2)

Error! Bad return status for module build on kernel: 6.1.21-v8+ (aarch64)

Consult /var/lib/dkms/rtl8192eu/1.0/build/make.log for more information.

Any and all help will be appreciated.

8 Comments
2024/11/07
23:18 UTC

419

Automated Chess Board

Been working on this for some time using a raspberry pi some steppers and magnets, here is the website for it if you guys have any questions. All opinions appreciated thanks : https://readymag.website/u2481798807/5057562/

51 Comments
2024/11/07
08:15 UTC

1

Troubleshooting connecting M1 Macbook Pro to Raspberry Pi 4B

I have been trying to establish a serial or SSH connection from my M1 Macbook Pro to my Raspberry Pi(s), so far with no success. What could be going wrong?

  • I have tried:
    • USB C gadget mode ethernet (SSH)
      • Added the ssh file to boot with no extension
      • cmdline.txt with modules-load=dwc2,g_ether added after rootwait, no new line
      • config.txt with dtoverlay=dwc2
    • USB C gadget mode serial
      • cmdline.txt with console=serial0,115200 at the beginning and modules-load=dwc2,g_serial after rootwait, no new line
      • config.txt with enable_uart=1 and dtoverlay=dwc2
      • These commands (with or without sudo) resulted in a blank terminal:
      • screen /dev/tty.usbmodem2101 115200
      • minicom -D /dev/tty.usbmodem2101 -b 115200
    • USB C serial connection through GPIO pins with AA106 adapter
      • Set the jumper to 3.3V on the adapter
      • Connected the ground, RX and TX pins correctly
      • config.txt with enable_uart=1
      • cmdline.txt without console=serial0,115200 and without modules-load=dwc2,g_serial
      • These commands (with or without sudo) resulted in a blank terminal:
      • screen /dev/tty.usbserial-A5069RR4 115200
      • minicom -D /dev/tty.usbserial-A5069RR4 -b 115200
    • 3 different USB C ports on my Macbook
    • screen and minicom
    • 2 different USB C cables (One was the USB C cable for Apple airpods)
    • 2 different Raspberry Pi 4Bs (each with their own SD card)
    • Reflashing the OS onto the SD card
10 Comments
2024/11/06
11:35 UTC

151

Here's a cool project that I made from GitHub: Hope you like it!

10 Comments
2024/11/06
02:35 UTC

1

Possible to have RPI5 with 3 hats? m.2, vga666 and audio out?

I would like to upgrade my rpi3 to a pi5 using retropie. However, I'd like to:

  • continue to use the vga666 hat connected to my CRT
  • Add the m.2 hat+ to add an ssd
  • Add an audio hat since the pi5 no longer has a 3.5mm audio output.

If i understand correctly, you can only stack hats if they're all hat+. Otherwise you can only have one hat+ and one hat? Is that true? So I can't use 3 hats? Unless I use an audio hat that is also hat+?

Would I be able to use a combo hat+ with the vga666? So could I use the HatDrive! Piano for Raspberry Pi 5, which has both audio and m.2 and is a hat+?

Thanks

4 Comments
2024/11/05
19:39 UTC

765

Spotted at cancun airport

.

20 Comments
2024/11/05
14:51 UTC

5

2024 Nov 4 Stickied -FAQ- & -HELPDESK- thread - Boot problems? Power supply problems? Display problems? Networking problems? Need ideas? Get help with these and other questions!

###Welcome to the r/raspberry_pi Helpdesk and Frequently Asked Questions!

Link to last week's thread

Having a hard time searching for answers to your Raspberry Pi questions? Let the r/raspberry_pi community members search for answers for you!^(†) Looking for help getting started with a project? Have a question that you need answered? Was it not answered last week? Did not get a satisfying answer? A question that you've only done basic research for? Maybe something you think everyone but you knows? Ask your question in the comments on this page, operators are standing by!

This helpdesk and idea thread is here so that the front page won't be filled with these same questions day in and day out:

  1. Q: What's a Raspberry Pi? What can I do with it? How powerful is it?

A: Check out this great overview 2. Q: Does anyone have any ideas for what I can do with my Pi?
A: Sure, look right here!^(‡) 3. Q: My Pi is behaving strangely/crashing/freezing, giving low voltage warnings, ethernet/wifi stops working, USB devices don't behave correctly, what do I do?
A: 99.999% of the time it's either a bad SD card or power problems. Use a USB power meter or measure the 5V on the GPIO pins with a multimeter while the Pi is busy (such as playing h265/x265 video) and/or get a new SD card 1 2 3. If the voltage is less than 5V your power supply and/or cabling is not adequate. When your Pi is doing lots of work it will draw more power. Higher wattage power supplies achieve their rating by increasing voltage, but the Raspberry Pi operates strictly at 5V. Even if your power supply claims to provide sufficient amperage, it may be mislabeled or the cable you're using to connect the power supply to the Pi may have too much resistance. Phone chargers, designed primarily for charging batteries, may not maintain a constant wattage and their voltage may fluctuate, which can affect the Pi’s stability. You can use a USB load tester to test your power supply and cable. Some power supplies require negotiation to provide more than 500mA, which the Pi does not do. If you're plugging in USB devices try using a powered USB hub with its own power supply and plug your devices into the hub and plug the hub into the Pi. 4. Q: I'm trying to setup a Pi Zero 2W and it is extremely slow and/or keeps crashing, is there a fix?
A: Either you need to increase the swap size or check question #3 above. 5. Q: I'm having a hard time finding a place to purchase a Raspberry Pi for an affordable price. Where's the secret place to buy one without paying more than MSRP?
A: https://rpilocator.com/ 6. Q: I just did a fresh install with the latest Raspberry Pi OS and I keep getting errors when trying to ssh in, what could be wrong?
A: There are only 4 things that could be the problem:
1. The ssh daemon isn't running 2. You're trying to ssh to the wrong host 3. You're specifying the wrong username 4. You're typing in the wrong password 7. Q: I'm trying to install packages with pip but I keep getting error: externally-managed-environment
A: This is not a problem unique to the Raspberry Pi. The best practice is to use a Python venv, however if you're sure you know what you're doing there are two alternatives documented in this stack overflow answer: * --break-system-packages * sudo rm a specific file as detailed in the stack overflow answer 8. Q: The only way to troubleshoot my problem is using a multimeter but I don't have one. What can I do?
A: Get a basic multimeter, they are not expensive. 9. Q: My Pi won't boot, how do I fix it?
A: Step by step guide for boot problems 10. Q: I want to watch Netflix/Hulu/Amazon/Vudu/Disney+ on a Pi but the tutorial I followed didn't work, does someone have a working tutorial?
A: Use a Fire Stick/AppleTV/Roku. Pi tutorials used tricks that no longer work or are fake click bait. 11. Q: What model of Raspberry Pi do I need so I can watch YouTube in a browser?
A: No model of Raspberry Pi is capable of watching YouTube smoothly through a web browser, you need to use VLC. 12. Q: I want to know how to do a thing, not have a blog/tutorial/video/teacher/book explain how to do a thing. Can someone explain to me how to do that thing?
A: Uh... What? 13. Q: Is it possible to use a single Raspberry Pi to do multiple things? Can a Raspberry Pi run Pi-hole and something else at the same time?
A: YES. Pi-hole uses almost no resources. You can run Pi-hole at the same time on a Pi running Minecraft which is one of the biggest resource hogs. The Pi is capable of multitasking and can run more than one program and service at the same time. (Also known as "workload consolidation" by Intel people.) You're not going to damage your Pi by running too many things at once, so try running all your programs before worrying about needing more processing power or multiple Pis. 14. Q: Why is transferring things to or from disks/SSDs/LAN/internet so slow?
A: If you have a Pi 4 or 5 with SSD, please check this post on the Pi forums. Otherwise it's a networking problem and/or disk & filesystem problem, please go to r/HomeNetworking or r/LinuxQuestions. 15. Q: The red and green LEDs are solid/off/blinking or the screen is just black or blank or saying no signal, what do I do?
A: Start here 16. Q: I'm trying to run x86 software on my Raspberry Pi but it doesn't work, how do I fix it?
A: Get an x86 computer. A Raspberry Pi is ARM based, not x86. 17. Q: How can I run a script at boot/cron or why isn't the script I'm trying to run at boot/cron working?
A: You must correctly set the PATH and other environment variables directly in your script. Neither the boot system or cron sets up the environment. Making changes to environment variables in files in /etc will not help. 18. Q: Can I use this screen that came from ____ ?
A: No 19. Q: I run my Pi headless and there's a problem with my Pi and the best way to diagnose it or fix it is to plug in a monitor & keyboard, what do I do?
A: Plug in a monitor & keyboard. 20. Q: My Pi seems to be causing interference preventing the WiFi/Bluetooth from working
A. Using USB 3 cables that are not properly shielded can cause interference and the Pi 4 can also cause interference when HDMI is used at high resolutions. 21. Q: I'm trying to use the built-in composite video output that is available on the Pi 2/3/4 headphone jack, do I need a special cable?
A. Make sure your cable is wired correctly and you are using the correct RCA plug. Composite video cables for mp3 players will not work, the common ground goes to the wrong pin. Camcorder cables will often work, but red and yellow will be swapped on the Raspberry Pi. 22. Q: I'm running my Pi with no monitor connected, how can I use VNC?
A: First, do you really need a remote GUI? Try using ssh instead. If you're sure you want to access the GUI remotely then ssh in, type vncserver -depth 24 -geometry 1920x1080 and see what port it prints such as :1, :2, etc. Now connect your client to that. 23. Q: I want to do something that has been well documented and there are numerous tutorials showing how to do it on Linux. How can I do it on a Raspberry Pi?
A: A Raspberry Pi is a full computer running Linux and doesn't use special stripped down embedded microcontroller versions of standard Linux software. Follow one of the tutorials for doing it on Linux. Also see question #1. 24. Q: I want to do something that has been well documented and there are numerous tutorials showing how to do it with an Arduino. How can I do it on a Raspberry Pi Pico?
A: Follow one of the tutorials for doing it on Arduino, a Pico can be used with the Arduino IDE. 25. Q: I'm trying to do something with Bluetooth and it's not working, how do I fix it?
A: It's well established that Bluetooth and Linux don't get along, this problem is not unique to the Raspberry Pi. Also check question #20 above.

Before posting your question think about if it's really about the Raspberry Pi or not. If you were using a Raspberry Pi to display recipes, do you really think r/raspberry_pi is the place to ask for cooking help? There may be better places to ask your question, such as:

Asking in a forum more specific to your question will likely get better answers!


See the /r/raspberry_pi rules. While /r/raspberry_pi should not be considered your personal search engine, some exceptions will be made in this help thread.
‡ If the link doesn't work it's because you're using a broken buggy mobile client. Please contact the developer of your mobile client and let them know they should fix their bug. In the meantime use a web browser in desktop mode instead.

67 Comments
2024/11/05
00:20 UTC

Back To Top