r/raspberryDIY

3d-printed privacy-first security camera powered by the Pi Zero 2 (early prototype)
▲ 930 r/raspberryDIY+1 crossposts

3d-printed privacy-first security camera powered by the Pi Zero 2 (early prototype)

Hey :)

I'm building a privacy-first home security camera called the ROOT Observer, and today I've finished the second prototype, although it's the first one that is presentable. This is printed in PLA on a Bambu P2s, I'll soon try out SLA to see if that looks more professional.

The last few months I've spent building the open-source firmware and app to power this device. It enables end-to-end encryption, on device ML for event detection, encrypted push notifications, OTA updates, health monitoring and more.

The camera is a standalone device that connects to a dumb relay server that cannot decrypt the messages that are sent across. This way, it works right out of the box.

I'll soon (fingers-crossed) send out the first pre-production units to testers on the waitlist :)

...if you're mainly interested in the software stack and have a Raspberry Pi Zero 2, you can build your own ROOT-powered camera using this guide. The firmware is very optimized so that you can stream video and audio, record, run ML, transfer recordings etc. simultaneously without crossing max. ~60% CPU utilization.

Happy to answer any questions and feedback is more than welcome!

u/CryptographicGenius — 2 days ago
▲ 13 r/raspberryDIY+1 crossposts

CRCs mismatches and timeouts on Modbus via RS485. May I ask for help in troubleshooting?

Hi guys. May I ask you for help since I have no one else in my surroundings to ask for it?

I am a farmer and I have build a seed dryer. I am not a professional PLC engineer. Since I like to tinker with linux, python and electronics in total I've equipped the dryer with a Danfoss FC302 vfd that is powering a 11kW blower and two XY-MD02 temperature/humidity sensors. These elements are controlled via modbus rs485 (9600 baud rate, the lowest I could set up) by a RaspberryPi 5 with a Waveshare Hat CAN/RS485. I have a remote access to it via LTE.

I have a problem with rs485 communication. When the Danfoss VFD is in standby, modbus works perfectly -- no crc mismatches, no timeouts. But when I command the VFD to power the blower, errors begin to appear. I have no access to any oscilloscope to analyze rs485 signal.

Topology of my rs485:
I have a logical daisy chain on cat6 ethernet cables. I am using orange twisted that goes into the VFD and green pair from the same cat6 cable that goes back to the switchboard. There the green twisted pair is connected with the orange twisted pair from the next cat6 cable that goes to the first XY-MD02 sensor. There the green pair comes back to switchboard, it is connected with orange twisted pair from the next cat6 cable and it goes 20 meters to the second XY-MD02 on the other side of the dryer. There the rs485 line ends on the XY-MD02 sensor and is terminated with 120 ohm resistor. Twisted pairs are connected on the switchboard with wago topjobs connectors.

I have to add that the XY-MD02 sensors are powered with 24V over brown pairs in cat6 cables and of course it runs in the same cables with rs485 on orange and green pairs.

On the last picture you can see two pipes. On the right side it is a 4x4mm2 line that connects VFD with blower. On the left side there is a cat6 cable that runs to the second XY-MD02 sensor.The lines are separated circa 60 cm from each other.

WHAT I HAVE TRIED SO FAR
Firstly, I have used cat7 cables because I was aware that vfd would create noise. But oh boy, I couldn't communicate with the devices, even that the cat7 cable shields were connected to the ground from DC. I have replaced cat7 with unshielded cat6 and now the communication works flawlessly when VFD is in standby.

I tried to bridge grounds from 5v and 24v dc and connect it to cat7 shields and 61 terminal on Danfoss (dedicated rs485 ground terminal, the XY-MD02 lack it). One of the power supplies didn't work, it was somehow overloaded. I had to separate grounds.

I have 120 ohm termination both on raspberrypi hat (start of the rs485 line) and by the second XY-MD02 sensor (logical end of the line).

I have added ferrite rings by the VFD and by the switchboard. Maybe it helped a little bit, but the change wasn't like day and night.

Here are some logs from the systemd unit that governs the modbus communication:

alarm@suszarnia ~> journalctl -f -u suszarnia
May 19 16:46:15 suszarnia python3[681]: >>>>> Repeating....
May 19 16:46:15 suszarnia python3[681]: >>>>> recv: 0x1 0x10 0xa 0xf9 0x0 0x2 0x92 0x21 extra data:
May 19 16:46:15 suszarnia python3[681]: >>>>> send: 0x14 0x4 0x0 0x1 0x0 0x2 0x22 0xce
May 19 16:46:15 suszarnia python3[681]: >>>>> recv: 0x14 0x4 0x4 0x0 0xd6 0x1 0xa6 0xdf 0x57 extra data:
May 19 16:46:15 suszarnia python3[681]: >>>>> send: 0x15 0x4 0x0 0x1 0x0 0x2 0x23 0x1f
May 19 16:46:15 suszarnia python3[681]: >>>>> Repeating....
May 19 16:46:15 suszarnia python3[681]: >>>>> send: 0x15 0x4 0x0 0x1 0x0 0x2 0x23 0x1f
May 19 16:46:15 suszarnia python3[681]: >>>>> send: 0x15 0x4 0x0 0x1 0x0 0x2 0x23 0x1f
May 19 16:46:15 suszarnia python3[681]: WARNING | Modbus read error: Modbus Error: [Input/Output] No response received after 3 retries, continue with next request
May 19 16:46:15 suszarnia python3[681]: INFO | Manual set to off
May 20 09:51:47 suszarnia python3[681]: INFO | Manual set to on
May 20 09:52:00 suszarnia python3[681]: ERROR | No response received after 3 retries, continue with next request
May 20 09:52:00 suszarnia python3[681]: >>>>> send: 0x14 0x4 0x0 0x1 0x0 0x2 0x22 0xce
May 20 09:52:00 suszarnia python3[681]: >>>>> recv: 0x14 0x4 0x4 0x0 0xae 0x2 0x29 0x1e 0x1a extra data:
May 20 09:52:00 suszarnia python3[681]: >>>>> send: 0x15 0x4 0x0 0x1 0x0 0x2 0x23 0x1f
May 20 09:52:00 suszarnia python3[681]: >>>>> recv: 0x15 0x4 0x4 0x0 0xbb 0x2 0x15 0x1f 0xf extra data:
May 20 09:52:00 suszarnia python3[681]: >>>>> send: 0x1 0x3 0xb 0x5d 0x0 0x13 0x97 0xf1
May 20 09:52:00 suszarnia python3[681]: >>>>> Repeating....
May 20 09:52:00 suszarnia python3[681]: >>>>> recv: 0x1 0x3 0x26 0xe 0x7 0x6 0xcb 0x0 0x8d 0x0 0x2d 0x1 0xcb 0x0 0x35 0x3 extra data:
May 20 09:52:00 suszarnia python3[681]: >>>>> extra:  unexpected data: 0x1 0x3 0x26 0xe 0x7 0x6 0xcb 0x0 0x8d 0x0 0x2d 0x1 0xcb 0x0 0x35 0x3
May 20 09:52:00 suszarnia python3[681]: >>>>> recv: 0x63 0x6 0x22 0x0 0xdb 0x0 0x9f 0x0 0x0 0x0 0x1e 0x2 0x55 0x0 0x0 0x0 extra data: 0x1 0x3 0x26 0xe 0x7 0x6 0xcb 0x0 0x8d 0x0 0x2d 0x1 0xcb 0x0 0x35 0x3
May 20 09:52:00 suszarnia python3[681]: >>>>> extra:  unexpected data: 0x1 0x3 0x26 0xe 0x7 0x6 0xcb 0x0 0x8d 0x0 0x2d 0x1 0xcb 0x0 0x35 0x3 0x63 0x6 0x22 0x0 0xdb 0x0 0x9f 0x0 0x0 0x0 0x1e 0x2 0x55 0x0 0x0 0x0
May 20 09:52:00 suszarnia python3[681]: >>>>> recv: 0x0 0x0 0x0 0x0 0x0 0x0 0x4f 0x0 0x7b 0x90 0xf2 extra data: 0x1 0x3 0x26 0xe 0x7 0x6 0xcb 0x0 0x8d 0x0 0x2d 0x1 0xcb 0x0 0x35 0x3 0x63 0x6 0x22 0x0 0xdb 0x0 0x9f 0x0 0x0 0x0 0x1e 0x2 0x55 0x0 0x0 0x0
May 20 09:52:00 suszarnia python3[681]: >>>>> send: 0x1 0x10 0xa 0xf9 0x0 0x2 0x4 0x4 0x7c 0x9 0xd 0x45 0x5c
May 20 09:52:00 suszarnia python3[681]: >>>>> Repeating....
May 20 09:52:00 suszarnia python3[681]: >>>>> recv: 0x1 0x10 0xa 0xf9 0x0 0x2 0x92 0x21 extra data:
May 20 09:52:00 suszarnia python3[681]: >>>>> send: 0x14 0x4 0x0 0x1 0x0 0x2 0x22 0xce
May 20 09:52:00 suszarnia python3[681]: >>>>> recv: 0x14 0x4 0x4 0x0 0xae 0x2 0x29 0x1e 0x1a extra data:
May 20 09:52:00 suszarnia python3[681]: >>>>> send: 0x15 0x4 0x0 0x1 0x0 0x2 0x23 0x1f
May 20 09:52:00 suszarnia python3[681]: >>>>> Repeating....
May 20 09:52:00 suszarnia python3[681]: >>>>> send: 0x15 0x4 0x0 0x1 0x0 0x2 0x23 0x1f
May 20 09:52:00 suszarnia python3[681]: >>>>> send: 0x15 0x4 0x0 0x1 0x0 0x2 0x23 0x1f
May 20 09:52:00 suszarnia python3[681]: WARNING | Modbus read error: Modbus Error: [Input/Output] No response received after 3 retries, continue with next request
May 20 09:52:33 suszarnia python3[681]: INFO | Reference set to 10867
May 20 09:52:39 suszarnia python3[681]: ERROR | No response received after 3 retries, continue with next request
May 20 09:52:39 suszarnia python3[681]: >>>>> send: 0x14 0x4 0x0 0x1 0x0 0x2 0x22 0xce
May 20 09:52:39 suszarnia python3[681]: >>>>> recv: 0x14 0x4 0x4 0x0 0xae 0x2 0x25 0x1e 0x1f extra data:
May 20 09:52:39 suszarnia python3[681]: >>>>> send: 0x15 0x4 0x0 0x1 0x0 0x2 0x23 0x1f
May 20 09:52:39 suszarnia python3[681]: >>>>> recv: 0x15 0x4 0x4 0x0 0xbb 0x2 0x15 0x1f 0xf extra data:
May 20 09:52:39 suszarnia python3[681]: >>>>> send: 0x1 0x3 0xb 0x5d 0x0 0x13 0x97 0xf1
May 20 09:52:39 suszarnia python3[681]: >>>>> Repeating....
May 20 09:52:39 suszarnia python3[681]: >>>>> recv: 0x1 0x3 0x26 0xf 0x7 0x9 0xc 0x0 0x8d 0x0 0xa 0x1 0x9b 0x0 0x47 0x1 extra data:
May 20 09:52:39 suszarnia python3[681]: >>>>> extra:  unexpected data: 0x1 0x3 0x26 0xf 0x7 0x9 0xc 0x0 0x8d 0x0 0xa 0x1 0x9b 0x0 0x47 0x1
May 20 09:52:39 suszarnia python3[681]: >>>>> recv: 0xa3 0x8 0x36 0x0 0x1d 0x0 0xd4 0x0 0x0 0x0 0x3 0x2 0x4f 0x0 0x0 0x0 extra data: 0x1 0x3 0x26 0xf 0x7 0x9 0xc 0x0 0x8d 0x0 0xa 0x1 0x9b 0x0 0x47 0x1
May 20 09:52:39 suszarnia python3[681]: >>>>> extra:  unexpected data: 0x1 0x3 0x26 0xf 0x7 0x9 0xc 0x0 0x8d 0x0 0xa 0x1 0x9b 0x0 0x47 0x1 0xa3 0x8 0x36 0x0 0x1d 0x0 0xd4 0x0 0x0 0x0 0x3 0x2 0x4f 0x0 0x0 0x0
May 20 09:52:39 suszarnia python3[681]: >>>>> recv: 0x0 0x0 0x0 0x0 0x0 0x0 0x4f 0x0 0x7b 0x95 0xd7 extra data: 0x1 0x3 0x26 0xf 0x7 0x9 0xc 0x0 0x8d 0x0 0xa 0x1 0x9b 0x0 0x47 0x1 0xa3 0x8 0x36 0x0 0x1d 0x0 0xd4 0x0 0x0 0x0 0x3 0x2 0x4f 0x0 0x0 0x0
May 20 09:52:39 suszarnia python3[681]: >>>>> send: 0x1 0x10 0xa 0xf9 0x0 0x2 0x4 0x4 0x7c 0x2a 0x73 0xdc 0x4c
May 20 09:52:39 suszarnia python3[681]: >>>>> Repeating....
May 20 09:52:39 suszarnia python3[681]: >>>>> recv: 0x1 0x10 0xa 0xf9 0x0 0x2 0x92 0x21 extra data:
May 20 09:52:39 suszarnia python3[681]: >>>>> send: 0x14 0x4 0x0 0x1 0x0 0x2 0x22 0xce
May 20 09:52:39 suszarnia python3[681]: >>>>> recv: 0x14 0x4 0x4 0x0 0xae 0x2 0x25 0x1e 0x1f extra data:
May 20 09:52:39 suszarnia python3[681]: >>>>> send: 0x15 0x4 0x0 0x1 0x0 0x2 0x23 0x1f
May 20 09:52:39 suszarnia python3[681]: >>>>> Repeating....
May 20 09:52:39 suszarnia python3[681]: >>>>> send: 0x15 0x4 0x0 0x1 0x0 0x2 0x23 0x1f
May 20 09:52:39 suszarnia python3[681]: >>>>> send: 0x15 0x4 0x0 0x1 0x0 0x2 0x23 0x1f
May 20 09:52:39 suszarnia python3[681]: WARNING | Modbus read error: Modbus Error: [Input/Output] No response received after 3 retries, continue with next request
May 20 09:52:44 suszarnia python3[681]: ERROR | No response received after 3 retries, continue with next request
May 20 09:52:44 suszarnia python3[681]: >>>>> send: 0x1 0x10 0xa 0xf9 0x0 0x2 0x4 0x4 0x7c 0x2a 0x73 0xdc 0x4c
May 20 09:52:44 suszarnia python3[681]: >>>>> recv: 0x1 0x10 0xa 0xf9 0x0 0x2 0x92 0x21 extra data:
May 20 09:52:44 suszarnia python3[681]: >>>>> send: 0x14 0x4 0x0 0x1 0x0 0x2 0x22 0xce
May 20 09:52:44 suszarnia python3[681]: >>>>> recv: 0x14 0x4 0x4 0x0 0xae 0x2 0x25 0x1e 0x1f extra data:
May 20 09:52:44 suszarnia python3[681]: >>>>> send: 0x15 0x4 0x0 0x1 0x0 0x2 0x23 0x1f
May 20 09:52:44 suszarnia python3[681]: >>>>> Repeating....
May 20 09:52:44 suszarnia python3[681]: >>>>> send: 0x15 0x4 0x0 0x1 0x0 0x2 0x23 0x1f
May 20 09:52:44 suszarnia python3[681]: >>>>> send: 0x15 0x4 0x0 0x1 0x0 0x2 0x23 0x1f
May 20 09:52:44 suszarnia python3[681]: WARNING | Modbus read error: Modbus Error: [Input/Output] No response received after 3 retries, continue with next request
May 20 09:53:02 suszarnia python3[681]: ERROR | No response received after 3 retries, continue with next request
May 20 09:53:02 suszarnia python3[681]: >>>>> send: 0x14 0x4 0x0 0x1 0x0 0x2 0x22 0xce
May 20 09:53:02 suszarnia python3[681]: >>>>> recv: 0x14 0x4 0x4 0x0 0xae 0x2 0x27 0x9f 0xde extra data:
May 20 09:53:02 suszarnia python3[681]: >>>>> send: 0x15 0x4 0x0 0x1 0x0 0x2 0x23 0x1f
May 20 09:53:02 suszarnia python3[681]: >>>>> recv: 0x15 0x4 0x4 0x0 0xbb 0x2 0x12 0x5e 0xcd extra data:
May 20 09:53:02 suszarnia python3[681]: >>>>> send: 0x1 0x3 0xb 0x5d 0x0 0x13 0x97 0xf1
May 20 09:53:02 suszarnia python3[681]: >>>>> Repeating....
May 20 09:53:02 suszarnia python3[681]: >>>>> recv: 0x1 0x3 0x26 0xf 0x7 0x2a 0x73 0x2 0x97 0x1 0x4 0x8 0x33 0x1 0x4c 0x3 extra data:
May 20 09:53:02 suszarnia python3[681]: >>>>> extra:  unexpected data: 0x1 0x3 0x26 0xf 0x7 0x2a 0x73 0x2 0x97 0x1 0x4 0x8 0x33 0x1 0x4c 0x3
May 20 09:53:02 suszarnia python3[681]: >>>>> recv: 0x71 0x26 0x95 0x0 0xec 0x3 0xe3 0x0 0x0 0x0 0x20 0x2 0x3b 0x0 0x0 0x0 extra data: 0x1 0x3 0x26 0xf 0x7 0x2a 0x73 0x2 0x97 0x1 0x4 0x8 0x33 0x1 0x4c 0x3
May 20 09:53:02 suszarnia python3[681]: >>>>> extra:  unexpected data: 0x1 0x3 0x26 0xf 0x7 0x2a 0x73 0x2 0x97 0x1 0x4 0x8 0x33 0x1 0x4c 0x3 0x71 0x26 0x95 0x0 0xec 0x3 0xe3 0x0 0x0 0x0 0x20 0x2 0x3b 0x0 0x0 0x0
May 20 09:53:02 suszarnia python3[681]: >>>>> recv: 0x0 0x0 0x0 0x0 0x0 0x0 0x4f 0x0 0x7b 0x5f 0xe5 extra data: 0x1 0x3 0x26 0xf 0x7 0x2a 0x73 0x2 0x97 0x1 0x4 0x8 0x33 0x1 0x4c 0x3 0x71 0x26 0x95 0x0 0xec 0x3 0xe3 0x0 0x0 0x0 0x20 0x2 0x3b 0x0 0x0 0x0
May 20 09:53:02 suszarnia python3[681]: >>>>> send: 0x1 0x10 0xa 0xf9 0x0 0x2 0x4 0x4 0x7c 0x2a 0x73 0xdc 0x4c
May 20 09:53:02 suszarnia python3[681]: >>>>> Repeating....
May 20 09:53:02 suszarnia python3[681]: >>>>> recv: 0x1 0x10 0xa 0xf9 0x0 0x2 0x92 0x21 extra data:
May 20 09:53:02 suszarnia python3[681]: >>>>> send: 0x14 0x4 0x0 0x1 0x0 0x2 0x22 0xce
May 20 09:53:02 suszarnia python3[681]: >>>>> recv: 0x14 0x4 0x4 0x0 0xae 0x2 0x28 0xdf 0xda extra data:
May 20 09:53:02 suszarnia python3[681]: >>>>> send: 0x15 0x4 0x0 0x1 0x0 0x2 0x23 0x1f
May 20 09:53:02 suszarnia python3[681]: >>>>> Repeating....
May 20 09:53:02 suszarnia python3[681]: >>>>> send: 0x15 0x4 0x0 0x1 0x0 0x2 0x23 0x1f
May 20 09:53:02 suszarnia python3[681]: >>>>> send: 0x15 0x4 0x0 0x1 0x0 0x2 0x23 0x1f
May 20 09:53:02 suszarnia python3[681]: WARNING | Modbus read error: Modbus Error: [Input/Output] No response received after 3 retries, continue with next request
May 20 09:53:06 suszarnia python3[681]: ERROR | No response received after 3 retries, continue with next request
May 20 09:53:06 suszarnia python3[681]: >>>>> send: 0x1 0x10 0xa 0xf9 0x0 0x2 0x4 0x4 0x7c 0x2a 0x73 0xdc 0x4c
May 20 09:53:06 suszarnia python3[681]: >>>>> recv: 0x1 0x10 0xa 0xf9 0x0 0x2 0x92 0x21 extra data:
May 20 09:53:06 suszarnia python3[681]: >>>>> send: 0x14 0x4 0x0 0x1 0x0 0x2 0x22 0xce
May 20 09:53:06 suszarnia python3[681]: >>>>> recv: 0x14 0x4 0x4 0x0 0xae 0x2 0x28 0xdf 0xda extra data:
May 20 09:53:06 suszarnia python3[681]: >>>>> send: 0x15 0x4 0x0 0x1 0x0 0x2 0x23 0x1f
May 20 09:53:06 suszarnia python3[681]: >>>>> Repeating....
May 20 09:53:06 suszarnia python3[681]: >>>>> send: 0x15 0x4 0x0 0x1 0x0 0x2 0x23 0x1f
May 20 09:53:06 suszarnia python3[681]: >>>>> send: 0x15 0x4 0x0 0x1 0x0 0x2 0x23 0x1f
May 20 09:53:06 suszarnia python3[681]: WARNING | Modbus read error: Modbus Error: [Input/Output] No response received after 3 retries, continue with next request
May 20 09:53:11 suszarnia python3[681]: ERROR | No response received after 3 retries, continue with next request
May 20 09:53:11 suszarnia python3[681]: >>>>> send: 0x1 0x10 0xa 0xf9 0x0 0x2 0x4 0x4 0x7c 0x2a 0x73 0xdc 0x4c
May 20 09:53:11 suszarnia python3[681]: >>>>> recv: 0x1 0x10 0xa 0xf9 0x0 0x2 0x92 0x21 extra data:
May 20 09:53:11 suszarnia python3[681]: >>>>> send: 0x14 0x4 0x0 0x1 0x0 0x2 0x22 0xce
May 20 09:53:11 suszarnia python3[681]: >>>>> recv: 0x14 0x4 0x4 0x0 0xae 0x2 0x28 0xdf 0xda extra data:
May 20 09:53:11 suszarnia python3[681]: >>>>> send: 0x15 0x4 0x0 0x1 0x0 0x2 0x23 0x1f
May 20 09:53:11 suszarnia python3[681]: >>>>> Repeating....
May 20 09:53:11 suszarnia python3[681]: >>>>> send: 0x15 0x4 0x0 0x1 0x0 0x2 0x23 0x1f
May 20 09:53:11 suszarnia python3[681]: >>>>> send: 0x15 0x4 0x0 0x1 0x0 0x2 0x23 0x1f
May 20 09:53:11 suszarnia python3[681]: WARNING | Modbus read error: Modbus Error: [Input/Output] No response received after 3 retries, continue with next request
May 20 09:53:15 suszarnia python3[681]: ERROR | No response received after 3 retries, continue with next request
May 20 09:53:15 suszarnia python3[681]: >>>>> send: 0x1 0x10 0xa 0xf9 0x0 0x2 0x4 0x4 0x7c 0x2a 0x73 0xdc 0x4c
May 20 09:53:15 suszarnia python3[681]: >>>>> recv: 0x1 0x10 0xa 0xf9 0x0 0x2 0x92 0x21 extra data:
May 20 09:53:15 suszarnia python3[681]: >>>>> send: 0x14 0x4 0x0 0x1 0x0 0x2 0x22 0xce
May 20 09:53:15 suszarnia python3[681]: >>>>> recv: 0x14 0x4 0x4 0x0 0xae 0x2 0x28 0xdf 0xda extra data:
May 20 09:53:15 suszarnia python3[681]: >>>>> send: 0x15 0x4 0x0 0x1 0x0 0x2 0x23 0x1f
May 20 09:53:15 suszarnia python3[681]: >>>>> Repeating....
May 20 09:53:15 suszarnia python3[681]: >>>>> send: 0x15 0x4 0x0 0x1 0x0 0x2 0x23 0x1f
May 20 09:53:15 suszarnia python3[681]: >>>>> send: 0x15 0x4 0x0 0x1 0x0 0x2 0x23 0x1f
May 20 09:53:15 suszarnia python3[681]: WARNING | Modbus read error: Modbus Error: [Input/Output] No response received after 3 retries, continue with next request
May 20 09:53:21 suszarnia python3[681]: INFO | Manual set to off
^C⏎                                              
u/cociludzie — 1 day ago
▲ 123 r/raspberryDIY+1 crossposts

I made my own PI-based GPS time server that's accurate to the nanosecond level

Spent the last few weekends building out a hardware time reference using a Pi 4 (could use any Pi really as it uses almost no cpu power and memory) and it's been a fun rabbit hole.

Hardware:

  • Pi 4 Model B 4GB
  • GT-U7 GPS module (~$10 on Amazon) wired to GPIO. VCC/GND to pins 4/6, RX/TX swapped onto the UART pins 8 and 10, and PPS on pin 12
  • Antenna sitting in a window

The PPS pin is where the accuracy comes from. NMEA serial data alone is good for ~50ms accuracy because of the variable lag between satellite reading and serial transmission. The PPS pulse is hardware-aligned to the actual GPS second within tens of nanoseconds, so chrony uses NMEA to figure out what time it is and PPS to figure out exactly when each second starts. Together you get sub-microsecond accuracy.

A few config things that helped:

  • Disabled bluetooth in /boot/firmware/config.txt to free up the primary UART (the Pi 4 has the bluetooth chip wired to the good UART by default)
  • Used isolcpus=3 nohz_full=3 rcu_nocbs=3 to dedicate one core to time-critical work and keep scheduler noise off it. (This is very much overkill but it will keep the core free if I want to run other services)
  • gpsd reads NMEA and pushes to chrony via shared memory, chrony grabs the PPS directly from /dev/pps0

Current state per chronyc tracking:

  • Stratum 1 (This is how many steps away you are from the gps source, NTP servers are usually 3 or 4)
  • Last offset typically in the 50-500 nanosecond range
  • RMS offset around 450ns
  • System time within 0-45ns of NTP time
  • Frequency stable around 9.7ppm fast (the Pi's crystal is consistently off but predictable)

I admittedly am more of a Pi programmer and not much of a web developer so I had help from Claude for the web portion. It looks way better and took way less time than what I couldn't came up on my own.

Disclaimer: This is a $10 GPS unit with an antenna sitting inside in a non-ideal window in my home. If you visit my site and it says it's not syncing to GPS and it's fallen back to NTP it happens sometimes but it recovers. This is for fun on my LAN and for nothing mission critical, just wanted to share.

The main lesson though: antenna placement matters way more than the GPS module quality. Spent more time moving the antenna around than doing anything else. Got from 1-2 satellites in a fix to consistently 8-11 just by finding a window with a clearer southern view.

Here is my repo for the project
https://github.com/BenLeikin/PiTime/

reddit.com
u/pilg0re — 3 days ago
▲ 67 r/raspberryDIY+2 crossposts

My bedside Thought Catcher has started recommending designers to me at 7AM, which wasn't the plan! TC-01 Updated

A few months ago I posted my Raspberry Pi “Thought Catcher”, a screenless device designed to let you record midnight ideas and tasks without opening a smartphone, helping to avoid screen time and infinite scrolling before sleep.

I’ve been quietly rebuilding the whole system since then.

The new version is much faster, smarter, and now has an 'AI Curator' mode that’s become my favourite feature!

When I capture an idea, the system goes off and finds 2-3 adjacent things: a designer, a movement, a concept; and leaves them sitting next to the idea by morning.

The thing I learned rebuilding it

Making the Pi faster wasn't just optimising it but to actually move the intelligence off it!

  • Whisper still transcribes locally on the Pi
  • Reasoning now runs on Groq's free tier (Llama 3.3 70B, under 1s per call)
  • The Pi is doing exactly one thing- capturing.

The result

  • captures are now ~3 seconds
  • the fan stays silent
  • no waiting around
  • still just: press, speak and zzzzzzz...

Attached a rough walkthrough of the current version because a few of you were asking whether I was still working on this thing.

Original post for context: https://www.anshtrivedi.com/post/tc-01-a-bedside-thought-catcher-capturing-ideas-without-opening-your-phone

u/AnshTrivedii — 3 days ago

Is Buying An 6 Months Old Raspberry Pi 5 8 GB A Good Idea?

Hello everyone(TLDR in the end of you don't wish to, Read), I'm an engineering student, just completed my first year and am looking to learn Raspberry Pi. For this I've decided to buy the pi 5 8 ​GB version. But the current prices have skyrocketed like crazy and it costs almost twice now. And I don't feel good to pay this much all due to the RAM shortage, so I looked for used options online, found and talked to a few they're offering a good price since they're making a profit anyways; but much lower than the price of new. So my question is,

As I plan to learn, make projects and keep the Pi ​using for long, should I buy a new one, or a used one is okay?

A seller is offering me the whole kit for about 150$(for ref, only new pi costs $200 here); the pi, its case, charger, active cooling fan, and sd card. And surprisingly, is ​also offering me his SSD HAT. He has given the reason of having bought all this to explore, but doesn't need it anymore.

So what I want to know is, what things should I ask him, or what should I be cautious about while buying a used Pi? Any programs to run, booting up etc.? Anything like that, pls suggest.

And as ​a ​side note wanted to get everyone's opinion on learning the Pico ​2 W before the Pi or directly Pi is also okay?(Will be following Mr. Paul McWhorter's tutorials)

TLDR questions;

Is getting used pi a good idea? What should I be asking the seller and take care of? And

Should I learn Pico 2 W first or directly the Pi also fine(taught by Mr. Paul McWhorter)?

reddit.com
u/Somigomi — 3 days ago
▲ 27 r/raspberryDIY+1 crossposts

RQuickShare Pi - my Raspberry Pi 5 can now use Android Quick Share

I wanted my Raspberry Pi to behave more like a normal desktop computer when moving files around, so I started working on RQuickShare Pi.

It is a Raspberry Pi OS ARM64 focused fork of RQuickShare that lets the Pi send and receive files with Android Quick Share devices.

Current status:

- Tested on Raspberry Pi 5

- Raspberry Pi OS 64-bit ARM64

- Desktop app with system tray support

- Android Quick Share send and receive

- Bluetooth discovery

- mDNS/network transfer

- Start-on-boot option

- Starts hidden in tray if configured

The part that took the most Pi-specific work was not just compiling it. I had to deal with Raspberry Pi OS desktop behavior, WebKitGTK rendering issues, BlueZ/Bluetooth discovery, mDNS, and Samsung Quick Share behavior where the phone was not seeing the Pi until the discovery path was adjusted.

It is alpha, but it works on my Pi now. I would love to hear from other Pi users who test it.

Project:

https://github.com/EladBG-code/rquickshare-pi

Website:

https://eladbg-code.github.io/rquickshare-pi

Releases:

https://github.com/EladBG-code/rquickshare-pi/releases

P.S: If you can't support with Ko-fi but still feel like you want to support this project (and me in general) just star the repository on GitHub! (both of these are completely fine).

https://preview.redd.it/b85372fnvn1h1.png?width=3840&format=png&auto=webp&s=0ad56c591603fa2ecea0b5c962f20ec2a1d04526

reddit.com
u/CryptographicGenius — 4 days ago
▲ 408 r/raspberryDIY+2 crossposts

Zero coding experience. Starting building custom inclinometer

I’ve always had this idea, but was never able to execute it because I don’t know how to code.

With AI, I was able to make my vision come to life and build a custom inclinometer!

The project was pretty easy.

I’ll share the link to the video if you want to see my concept, otherwise will hold to avoid spam here

u/notafilmmajor425 — 7 days ago

Student notes sharing and Chatting platform using Raspberry Pi as the server

Hey guys, I hope you're doing well! I'm a student and I recently got an idea to build a website that is used to upload student's notes and previous year question papers, and it also includes chatting and like discussions. The stack I'd like to use is React or Next.js for the frontend, Node.js + Express.js for the backend, Socket.IO for real-time chat, PostgreSQL for database, external SSD attached to Raspberry Pi for file storage, and Nginx used for reverse proxy. JWT tokens for Auth and Docker for deployment

And the important part, I want to host this website on the Raspberry Pi. I want to use the Raspberry Pi 4 4GB RAM as the server

Any suggestions please drop it down!

Thankyou!!

reddit.com
u/abhi6241 — 5 days ago
▲ 1.4k r/raspberryDIY+1 crossposts

The Companion: A portable Raspberry Pi 5-based "laptop" inspired by the TRS 80 Model 100

Hello everyone! After 9 months of hard work while staying in Canada for study purposes, I'm proud to finally introduce Companion! This is my homemade embedded PC based on the Raspberry Pi 5!

Companion is a portable cyberdeck designed to be a sleek, modern, distraction-free machine in a distinguishable yet usable form factor: you can write, program, do web browsing, 3D modelling... with this cool device!

Here are the detailed specs:

  • Pi 5B, 16 GB RAM version (but will certainly work with 4/8)
  • 256 GB SD card storage (because I don't need super fast SSD for 95% of the work that I'll do on it)
  • MJ64 mechanical RGB keyboard with AZERTY typewriter-style caps
  • 2880x864 tactile IPS ultra wide screen from BOE
  • Around 20 hours of battery life (148 Wh, 4 x 3.7V Li-Po cells) - haven't had the time to properly test it yet... with a BMS + INA219 for the gauge + DC DC converter
  • PCIe used for an internal USB hub to expose the Pi's ports externally
  • Running a derivative of ArchLinux ARM, with a custom kernel and some manually-compiled packages, with a custom Plasma-based layout + auto tiling window plugin
  • Most components screwed for the most part, AFAIK only the battery + screen are exclusively taped in

Only con is that the battery charging board is incredibly weak: 5V 1A for this kind of battery setup is painfully slow. I plan on changing that with a beefier one, and then I'll proceed on making a bill of materials :]

Not gonna lie, there were a lot of frustrating moments along the way, but holding a working product at the end makes it all worth it!

The GitLab organisation is still a work in progress, but you can already have a look here if you're curious: https://gitlab.com/companion-pc/

Happy to answer any questions!

(Also, not sure if I'm allowed to talk about this... bit of a long shot, but I'm currently looking for a job from May to August [remote-friendly, maybe longer!], mainly in game engine, network, low-level, embedded, or web development. If anyone knows of an opportunity, feel free to reach out!)

u/CryptographicGenius — 9 days ago

Low voltage power source?

I want to know if anyone has experience in providing power to the raspberry Pi with a low voltage source, I see a lot of 120v wall worts and 120v to 10vac converters, is it possible to come right off a 24Vac source? Any suggestions would be very helpful

reddit.com
u/Puzzleheaded_Loan169 — 5 days ago
▲ 16 r/raspberryDIY+3 crossposts

[BG] Dad trying to help my 11 year old son build his first his first pc so he can get into coding and gaming development [H] £100-150

I hope this kind of post is okay here.

My son is 11 years old and has become absolutely obsessed with PCs, coding, and game development.

He spends hours watching videos about building computers, learning how games are made, and talking about wanting to create his own someday. I’d really love to encourage that interest because he’s genuinely passionate about it.

The problem is that money is extremely tight for us at the moment, and I simply can’t afford to buy parts to help him build his first PC.

We’re based in the UK, and I wanted to ask if anyone in the community has any old or spare PC parts sitting around that they no longer need and would be willing to donate. Even older hardware would mean the world to him and would give him something to learn on and experiment with.

I’m more than happy to pay what I can and cover postage costs.

Even if nobody has spare parts, I’d really appreciate any advice on, cheap starter builds, beginner resources for coding/game development or anything else that could help him get started

Thank you for taking the time to read this.

reddit.com
u/silvagogo — 8 days ago
▲ 707 r/raspberryDIY+10 crossposts

Actuellement je suis en train de refaire l'enseigne de mon entreprise avec une nouvelle mascotte que je viens d'écrire dans mes machines à café

u/Ready_Crew7593 — 12 days ago
▲ 8 r/raspberryDIY+1 crossposts

Indicação Concerto de Placa SP

Oi pessoal!

Eu tenho Raspberry Pi que acabei parafusando errado e estragou duas trilhas. To buscando alguma indicação de alguém que mexa com esse tipo de coisa pra concertar em São Paulo capital. Eu moro na zona sul, mas posso ir mais longe se for o caso. Sei da Santa Efigênia mas não sei nenhum lugar específico que faça esse tipo de conserto. Alguém conseguiria ajudar?

u/patyrocks — 8 days ago
▲ 463 r/raspberryDIY+1 crossposts

Quick update on the BetterDash Pi build — GPS is live!

Hey all, following up on my previous post about the Raspberry pi dash — GPS is now connected and working great on the Tripper! 🎉

Map renders on the circular display with live position, heading, and speed — completely phone-free. Currently sitting a bit rough on my quad lock mount as you can see, but it does the job.

Next up:

  1. Navigation using the offical RE navigation bubble.
  2. Hiding the Pi under the seat for a clean install with automatic boot & connect on key turn.

I will keep you posted! Checkout the Github if you want to participate and discuss; it is still in early phase so if you want something ready to use wait a bit longer ;)

>>!Cost so far: Pi zero 2 WH 38€, Pi Cooling case 9€, 32Go SDCard Endurance 18€, GPS NEO-6M 13€, GPS Antenna 7€ so 85€ about 100$ USD or <10k INR in total. I haven't pick the cheapest parts and got what was in stock for quick delivery, so it should be cheaper especially if you are not in europe.!<

u/HimalayanRider450 — 13 days ago

Add 512 zram to my pi 3b+ 1.4ghz 1gb ram diet pi os

To add a 512MB zram swap device on your Raspberry Pi Pi 3B+ running DietPi, the easiest method is using DietPi’s built-in tools.
Open terminal and run:
sudo dietpi-config
Then:
Go to:
Select:
Find:
Enable ZRAM and set:
512
MB for swap size.

Save and reboot:
sudo reboot
After reboot, check it worked:
swapon --show
or:
free -h
You should see about 512MB compressed swap in RAM.
For a Pi 3B+ with 1GB RAM:
512MB zram is usually a good balance
helps Chromium tabs and GeForce NOW stability
reduces SD card wear compared to normal swap
can improve responsiveness when memory gets tight
You can also disable normal SD-card swap if zram is enough:
sudo swapoff -a
But on a Pi 3B+, keeping a small fallback swap file (like 256MB) is often safer for browser crashes.

reddit.com
u/Fun-Leek8010 — 7 days ago

Are there any easy to follow guides that can help me turn my raspberry pi 3 into an alarm clock while plugged into a monitor

I’m new to raspberry pi and doing any kind of diy project with coding and the like and thought a cool first project would be to turn my raspberry pi 3 into an alarm clock, hopefully I chose a simple project to start on lol

reddit.com
u/Demon_Axe87 — 9 days ago

Need ideas or recommendations for displays for Rpi 5

Hello all! I would like some recommendations on how to deal with the display part of my project. I don't need it yet as I am still developing the software. My wife wanted a skylight smart calendar so I told her that I can write the code and slap it in a pi lol anyway I'm looking for a touch capable display, but I cannot find anything that won't be a pain in the butt to frame to make it look nice.

I can't seem to find just a screen where I can run ribbon for it and most I have found require HDMI for display and USB for the touch part. I already own a spare 15.6" touch monitor, but the way the power and HDMI connect make it difficult to use and I still have to figure out what to do with the pi.

If nothing else maybe some ideas are welcome. I am just looking for a spark for when I get to the part of finishing and slapping it all together I somewhat have a direction to follow lol. Thanks in advance.

reddit.com
u/No_Walrus_3638 — 10 days ago
▲ 6 r/raspberryDIY+1 crossposts

DIY CCTV (IP-based) camcorder

Inspired by u/Rottolo_Piknottolo I wanted to have a go at building my own CCTV camcorder. Here is my attempt (Raspberry Pi and IP-based rather than Mini DVR) 😄

Sanyo VCC HD2500P camera with Fujinon TV ZOOM lens (relatively naked)

Rather than go down the Mini DVR route, I was attracted to the potential of a Sanyo VCC HD2500P as it has an internal SD card reader.

Recording to the SD card is triggered by an alarm event (a dry connection such as a couple of wires and a switch) but the SD card functions on the camera are frustrating when mounting / unmounting regularly. So as its an IP camera, I decided to use a Raspberry Pi (an old Pi 3) connected to the camera via a small network cable and capturing the stream; acting as an NVR.

The camera is capable of quad-stream though there isn't much point as the utilisation gets pretty high with just one stream, so I am sticking with 1280 x 720 (max 16:9 is 1920 x 1080).

The lens is a Fujinon H16x10A-R11 with the servo removed and gives 16x zoom, 10–160mm, and f/2.5.

Screen grab of leaves at the end of the garden when zoomed in

The lens is a TV zoom and has the parfocal party trick of the shot to staying in focus across its range as well as a macro option for close-up.

Screen grab zoomed out (I need to fiddle with the lens / sensor distance)

Sitting on top of the camera grip is huge (well 7" inch) monitor. I hadn't realised the camera would be so small compared.

Not a photo showing off the cable management

Fully loaded it has a 12v LiPo battery, 3-way DC barrel lead for the camera, monitor, and to a buck convertor with micro USB for 5v to the Raspberry Pi. The monitor is HDMI from the PI and RCA from the camera. When in use I duct tape the battery, buck convertor, and Pi to the back of the monitor. And yes the weight it all wrong at the moment!

The Raspberry Pi uses pygame for a UI with a cheap wireless shutter button to trigger the recording and a small wireless keyboard to change camera settings via the menu, such as white balance, gamma, and export the recordings to a USB stick (taking care of the mount / unmount, copy, and delete). There isn't an API to the camera however it has a HTTP interface so the Pi sends URL encoded requests to the camera that change the settings. The stream is recorded using ffmpeg without any conversion applied on the Pi as its a Pi 3 so not a lot of resource to be able to process on the fly.

Everything (camera, lens, grips, cables, monitor, battery, buck converter) came to under £100 / $130 (I already had the Pi).

reddit.com
u/Avantis90 — 8 days ago
▲ 175 r/raspberryDIY+1 crossposts

Introducing.... the PiMP3 - how did I do?

A Raspberry Pi based MP3 Player using some fairly inexpensive parts (cost me around $110CAD to make).

- Raspberry Pi Zero 2WH

- PiSugar Battery

- Wave Share V4 E-Ink Screen 2.13inch

- An edited copy of a Pwnagotchi case

Works with Bluetooth headphones/speakers and a wireless 8bitdo Zero2 controller (any Xbox controller will do) to navigate the menu's. Also, I included phone connectivity so you can use your phone to navigate the PiMP3 menu's, if a controller is out of reach.

As someone with mental illness that is learning to program, this is my first project that I'm really happy with. Let me know what you think of this :) - I'd be curious for any improvements to make! If you have any constructive criticism or feedback let me know as well :)

P.S. I hope the name gets some chuckles! :)

u/Historical-Problem-9 — 13 days ago