FreshRSS

Zobrazení pro čtení

Jsou dostupné nové články, klikněte pro obnovení stránky.

RaspPI 3.5 display not working

Hello there, I recently bought a RasPI 3.5-inch TTF touch module and am facing issues using it. The module, even after all drivers are installed, does not display any output. The guild on the website also does not go into detail on how to troubleshoot it and I was not able to find any useful info on debugging this issue.

I will list out everything I have done until now: - Reinstalled Raspbian Desktop image. - Configured the Xserver to work (even though the driver install script does it). - Tried to manually display an Image (this is interesting and I will further explain this below). - Used Python to try and display an image.

So at first, I thought while installing it, I followed the standard procedure and it did not display anything other than a black screen with an _ in it. next, I tried to delete everything and then reinstalled it, but still no luck. Next, I removed the image and used a fresh image, no use. then I tried using this command: ``` sudo fbi -T 1 -d /dev/fb1 -noverbose -a /home/pi/test_image.png

``` to forcefully display something and when I did this a terminal interface got printed but was not usable, then I figured the framerate was flicked so, I tried changing the refresh rate that also did not work.

Now I am lost on what to do. Any suggestions will be appreciated.

I am using a rasp pi zero 2 w for this.

submitted by /u/Ok_Quail_385 to r/RASPBERRY_PI_PROJECTS
[link] [comments]

PWM mosfet output does not correspond to pwm input

PWM mosfet output does not correspond to pwm input

My goal is to use the PWM signal of a raspberry pi to control the speed of a 12V 0,24A DC fan.

The drawing below shows how I've wired everything up.

https://preview.redd.it/q3hajn2igegd1.png?width=696&format=png&auto=webp&s=b7f9c7a46d9a186b513c4aae2346e2c07711fb6d

I purchased a cheap mosfet module off of aliexpress:

https://de.aliexpress.com/item/1005005625110568.html

Amazon carries them too:

https://www.amazon.de/gp/product/B07HBQZ9BK

The module uses a FR120N mosfet.

Link to datasheet: https://pdf1.alldatasheet.com/datasheet-pdf/view/1223399/VBSEMI/FR120N.html

I use the pigpio python library to control the duty cycle of the pwm signal at 20kHz. When using a multimeter the readings (RPi PWM - RPi GND) perfectly correspond to the duty cycle I set in the code.

The problem: The voltage readings across the fan do not match the duty cycle at all.

At 50% duty cycle I would expect 6V but I get almost the max voltage already. (See table below)

https://preview.redd.it/gkeewuljgegd1.png?width=193&format=png&auto=webp&s=e0943f62f52e10331250e1eb1cc709ac4650a733

In summary I am able to control the duty cycle of the PWM signal but the output of my mosfet module is not what I expected.

The subjective fan speed matches the measurements of VFan (meaning there is no observable change between a duty cycle of 50-100%)

I understand that a minimum average voltage to turn on the fan is needed but why does the fan get about 6 V at 20% duty cycle and not at 50%?

Why is there minimal voltage change across the fan from 50% to 100% duty cycle?

Why does the voltage across the fan not correspond to the duty cycle?

I guess it has sth to do with the mosfet module but I am unable to pinpoint the issue.

submitted by /u/JoeKongdeezNuts to r/RASPBERRY_PI_PROJECTS
[link] [comments]

2.8inch DPI LCD and WM8960 Audio HAT together, possible?

Hi,

for a project I bought a 2.8inch DPI LCD and WM8960 Audio HAT both from Waveshare. Since the audio hat has GPIO extension I thought it would it be possible to stack one on top of the other. THe idea is to give "comact" audio and video output to a Raspberry Pi Zero, as much pankake as possible with no wires going around. For speaker I'm using 2w 28 mm speakers, no need for hd audio.

Well, I followed the intsructuon to edit the config.txt and add the overlays for the LCD and all went ok, once I understood that the drivers works only with Legacy 32 full image. Then I installed the audio drivers and the display stopped working. I uninstalled the audio drivers and checked the config.txt file were clean and the display worked again.

Is there a way to make this happen? Can you suggest another compact way of bringing audio out for the rpi? Maybe by using a usb board, taking data and power from the testing pads?

submitted by /u/the_jeby to r/RASPBERRY_PI_PROJECTS
[link] [comments]

Troubleshooting IR Sensor Project: Seeking Guidance

Hi everyone,

I’m working on my first Raspberry Pi project and could use some guidance. I’m building a theremin-like digital instrument using two SHARP GP2Y0A51SK0F IR sensors. Each sensor is supposed to trigger one of five audio clips based on distance.

Here’s what I’ve done so far:

  • I’ve set distance thresholds for each audio clip (e.g., 14-15cm triggers Clip 1, 11-13cm triggers Clip 2, etc.).
  • I’ve written code to handle sensor input and play the clips accordingly.

However, I’m encountering a few issues:

  • Erratic Playback: The audio clips play erratically and seem to be cut off at the low and high ends of the distance range.
  • Persistent Playback: When no object is in front of the sensors, one clip plays continuously until something comes into range.

I’m wondering if:

  • There might be improvements or adjustments I can make in the code to address these issues.
  • The IR sensors might not be ideal for this application, and if alternatives like ultrasonic or Time-of-Flight sensors could be better (ideally want to solve with coding before buying new hardware)

Here’s my code for reference:

import RPi.GPIO as GPIO import time import spidev from subprocess import call import threading import statistics # Setup SPI spi = spidev.SpiDev() spi.open(0, 0) spi.max_speed_hz = 1350000 # MCP3008 channel configuration sensor1_channel = 0 sensor2_channel = 1 # Distance to audio mapping with updated intervals distance_ranges = [(14, 15), (11, 13), (8, 10), (5, 7), (2, 4)] audio_files_sensor1 = [f"/home/jss/audio_clips/s1_clip{i+1}.m4a" for i in range(len(distance_ranges))] audio_files_sensor2 = [f"/home/jss/audio_clips/s2_clip{i+1}.m4a" for i in range(len(distance_ranges))] # Smoothing parameters smoothing_window_size = 5 sensor1_data = [] sensor2_data = [] def read_adc(channel): adc = spi.xfer2([1, (8 + channel) << 4, 0]) data = ((adc[1] & 3) << 8) + adc[2] return data def get_distance(sensor_channel, sensor_data): adc_value = read_adc(sensor_channel) distance = (adc_value * 3.3 / 1024) * 30 # Smoothing the distance using a simple moving average sensor_data.append(distance) if len(sensor_data) > smoothing_window_size: sensor_data.pop(0) smoothed_distance = statistics.mean(sensor_data) print(f"Smoothed distance from sensor {sensor_channel}: {smoothed_distance}") # Debugging return smoothed_distance def play_audio(file): try: print(f"Playing audio file: {file}") # Debugging call(["mpv", file]) except Exception as e: print(f"Error playing audio file: {file}. Error: {e}") def handle_sensor(sensor_channel, audio_files, sensor_data): last_played_index = -1 while True: distance = get_distance(sensor_channel, sensor_data) for i, (low, high) in enumerate(distance_ranges): if low <= distance <= high: if i != last_played_index: play_audio(audio_files[i]) last_played_index = i break time.sleep(0.1) def main(): print("Script started...") # Debugging # Create and start threads for each sensor sensor1_thread = threading.Thread(target=handle_sensor, args=(sensor1_channel, audio_files_sensor1, sensor1_data)) sensor2_thread = threading.Thread(target=handle_sensor, args=(sensor2_channel, audio_files_sensor2, sensor2_data)) sensor1_thread.start() sensor2_thread.start() # Wait for both threads to finish (they won't in this case) sensor1_thread.join() sensor2_thread.join() if __name__ == "__main__": main()import RPi.GPIO as GPIO import time import spidev from subprocess import call import threading import statistics # Setup SPI spi = spidev.SpiDev() spi.open(0, 0) spi.max_speed_hz = 1350000 # MCP3008 channel configuration sensor1_channel = 0 sensor2_channel = 1 # Distance to audio mapping with updated intervals distance_ranges = [(14, 15), (11, 13), (8, 10), (5, 7), (2, 4)] audio_files_sensor1 = [f"/home/jss/audio_clips/s1_clip{i+1}.m4a" for i in range(len(distance_ranges))] audio_files_sensor2 = [f"/home/jss/audio_clips/s2_clip{i+1}.m4a" for i in range(len(distance_ranges))] # Smoothing parameters smoothing_window_size = 5 sensor1_data = [] sensor2_data = [] def read_adc(channel): adc = spi.xfer2([1, (8 + channel) << 4, 0]) data = ((adc[1] & 3) << 8) + adc[2] return data def get_distance(sensor_channel, sensor_data): adc_value = read_adc(sensor_channel) distance = (adc_value * 3.3 / 1024) * 30 # Smoothing the distance using a simple moving average sensor_data.append(distance) if len(sensor_data) > smoothing_window_size: sensor_data.pop(0) smoothed_distance = statistics.mean(sensor_data) print(f"Smoothed distance from sensor {sensor_channel}: {smoothed_distance}") # Debugging return smoothed_distance def play_audio(file): try: print(f"Playing audio file: {file}") # Debugging call(["mpv", file]) except Exception as e: print(f"Error playing audio file: {file}. Error: {e}") def handle_sensor(sensor_channel, audio_files, sensor_data): last_played_index = -1 while True: distance = get_distance(sensor_channel, sensor_data) for i, (low, high) in enumerate(distance_ranges): if low <= distance <= high: if i != last_played_index: play_audio(audio_files[i]) last_played_index = i break time.sleep(0.1) def main(): print("Script started...") # Debugging # Create and start threads for each sensor sensor1_thread = threading.Thread(target=handle_sensor, args=(sensor1_channel, audio_files_sensor1, sensor1_data)) sensor2_thread = threading.Thread(target=handle_sensor, args=(sensor2_channel, audio_files_sensor2, sensor2_data)) sensor1_thread.start() sensor2_thread.start() # Wait for both threads to finish (they won't in this case) sensor1_thread.join() sensor2_thread.join() if __name__ == "__main__": main() 
submitted by /u/sawyer000000 to r/RASPBERRY_PI_PROJECTS
[link] [comments]

Spotify telegram bot running on pi 0 2w

Spotify telegram bot running on pi 0 2w

So i got sick of the spotify shuffle bcoz it was not playing the old songs in my playlist. So i made python telegram bot to shuffle the playlist and also it can update a playlist with the songs from shazam and liked songs. It basically collects the uri id of songs from liked,main playlist and shazam and builds a database. From that can easily add or rearrange songs in the playlist. Now I'm really up for saving money for a decent pi 4/5 in future😙. https://github.com/jidukrishna/spotify_updater

submitted by /u/jiduk to r/RASPBERRY_PI_PROJECTS
[link] [comments]

BB1-zero update. Arms fine tuning and wire cleanups

BB1-zero update. Arms fine tuning and wire cleanups

Finally been cleaning up the wires and doing some fine tuning on smoothing out the arms. Unfortunately I’m pretty sure he pulled out one of the grounds (my fault ) at the end of this dance. It started doing that pulsing thing it does when a ground is lose. So another takedown and redo is in order. 🤦‍♂️😂. Still pretty happy with it tho.

submitted by /u/TheRealFanger to r/RASPBERRY_PI_PROJECTS
[link] [comments]

How to properly connect a bidirectional data line to Raspberry Pi 5 GPIO? [Project details & documentation inside]

How to properly connect a bidirectional data line to Raspberry Pi 5 GPIO? [Project details & documentation inside]

I am new to the Pi community and my head is spinning from learning all about GPIO pins, voltages, and communication protocols. Though it has been fun learning all these new concepts.

I am struggling to properly connect a bidirectional data wire from an external machine [coin hopper] to my Raspberry Pi 5. When I use my Pi to send a request to the hopper, I get no response. I'm not sure if I am setting up this data wire correctly, so I would love insights from the community.

High-level Project Details and Objective

  • My project is an automated coin identifier & sorter. I am using a Raspberry Pi 5

https://preview.redd.it/haj0u0tc6cfd1.png?width=720&format=png&auto=webp&s=32dbe2ed85517b33461accfd85448970b0f9e0d8

  • Here is a video of the most recent project prototype [coin hopper has not been added to the system yet]
  • Have the Pi be able to transmit data to & receive data from a coin hopper
  • I am using Python
  • The coin hopper uses the ccTalk & UART serial interface protocol
  • Avoid frying my coin hopper and Pi
  • I am using a 16-gauge solid core copper wire [insulated] for the power supply and data wire

Details

I am trying to connect a Coin Hopper [Money Controls SCH 2 model] to my Pi 5. The SCH2 uses a 10-pin Moxel connection scheme and uses a bi-directional serial data line.

SCH2 Coin Hopper

10-pin Molex Serial Connector

Pin Configurations

SCH2 Online Manual/Documentation

SCH2 uses the serial interface ccTalk & UART protocol**. ccTalk** is a very old protocol which makes sense as the coin hopper was produced in 2005.

From Manual

From ccTalk Wikipedia page: https://en.wikipedia.org/wiki/CcTalk

The coin hopper is powered by a 24v power supply. Below is what the power supply looks like

Power Supply from Amazon: https://www.amazon.com/dp/B07VL8W6MQ

I am using a female terminal connector adapter to connect the 24v wire and ground wire from the coin hopper directly to the power supply. [Pins 4 & 6 on the hopper]

https://preview.redd.it/izfz20md3cfd1.jpg?width=4372&format=pjpg&auto=webp&s=687b11ebcf7062054fd895d12df19754a5cdc2fa

https://preview.redd.it/1k3y8y0e3cfd1.jpg?width=3046&format=pjpg&auto=webp&s=2eb38827f83b1dac8fa4daa5cddf2508fa943ee4

I read that since the coin hopper uses 24v, it could damage the Pi 5 as the Pi operates at 3.3v logic level. Even though the only connection from the coin hopper to the Pi is with the bi-directional data line. As such, I am using a 3.3V/5V to 3.6V/24V 4 Channel Voltage Converter Optocoupler board. The board is NOT bi-directional.

Voltage Converter from Amazon: https://www.amazon.com/dp/B07WFGTNQC

To better communicate with the Pi's GPIO, I am using this GPIO expansion board

GPIO Extenstion board from Amazon: https://www.amazon.com/dp/B08GKQMC72

This GPIO expansion board has a TXD and RXD port.

My current understanding

  • Pi5 GPIO structure does not allow for bi-directional data communication. As such I need to use my GPIO extension board which has a TXD [Transmit] and RXD [Receive] port. I can not connect the coin hopper's bi-directional data wire solely to the TXD or RXD port and expect bi-directional communication
  • Since the coin hopper operates at 24v, I assume it uses 24v logic level. As such, a voltage converter is needed. Though, I am unsure why as I would think a data wire is not powering anything, just sending data and thus very low voltage.
  • The ground wire from the coin hopper [Pin 6] should connect to the ground socket on the power supply female terminal.

Outstanding Questions

  • What do I need to consider to connect the coin hopper's bi-directional data wire to the Pi? Am I missing a key part/board?
  • Do I need to use the UART serial protocol? Is there a better alternative that will still work with the coin hopper?
  • Do I need a GPIO extension board? If so, is my current extension board appropriate?
  • Do I need a voltage converter board? If so, is my current converter board appropriate? Do I need to get a bi-directional converter board? [My current one is not bi-directional]
  • Should the ground wire from the coin hopper [Pin 6] connect to the ground socket on the power supply? Or should the ground wire from the coin hopper [Pin 6] connect to the ground socket on the GPIO extension board on the Pi?
  • Does it matter if my wires are solid or stranded copper?

This has been a confusing journey but I'm excited to get the coin hopper up and running. The idea is to automate my coin sorter so that I don't have to place a coin manually each time. The Pi will communicate with the hopper to queue up the next coin after a coin has gone through the sorter.

Edit: Clarification on what I have already done and tested

I have already attached the GPIO extension board and voltage convertor to the Pi

https://preview.redd.it/3u7k8y2k6efd1.png?width=683&format=png&auto=webp&s=ea358c61f93acddc69b68d87ebc58500697ff65d

https://preview.redd.it/fdisgigl6efd1.png?width=696&format=png&auto=webp&s=a9c7b61604c49e8ad1bb1fa509d80a99762537f1

On the voltage convertor there, on the left side in the picture, are ports indicating Input & Ground. On the right side is Voltage Output and Ground. I connected a 22-gauge wire from IN1 [Input 1] to the GPIO extension board [TXD]. I also connected the wire from the input ground port to the ground port on the GPIO extension board [next to the TXD port.

https://preview.redd.it/dy69vjm97efd1.png?width=553&format=png&auto=webp&s=bb9449eba777f728aecaba64adcf4a36a7fba5ff

https://preview.redd.it/2rz3oeb87efd1.png?width=562&format=png&auto=webp&s=25535bcc934c1d3d1997ea7dcf63a04a594c91c7

For the connection with the coin hopper, I connected the data cable wire from the hopper to V1 and a ground wire from the hopper in G.

https://preview.redd.it/xufskpgl7efd1.png?width=567&format=png&auto=webp&s=4f3ec1c81607a318c7a90118811a757ca8461233

I am trying to send a command from the Pi through to the GPIO extension board. That data then goes through the extension board to the data cable wire to the coin hopper.

However, the coin hopper does not send a response back confirming communication.

Below is what I have done to troubleshoot:

  • Testing Communication Protocols:
    • Verified ccTalk protocol uses UART for serial communication.
    • Ensured the correct baud rate (9600 8N1) for ccTalk messages.
    • Enabled the Pi serial port and confirmed the correct serial is online and avaliable
  • Software and Library Installations:
    • Installed and configured pyserial for serial communication.
submitted by /u/SomeGuyInDeutschland to r/RASPBERRY_PI_PROJECTS
[link] [comments]

Raspberry Pi 5 NAS using Argon Neo 5 NVME case

Hello all! I'm new to the Raspberry Pi scene; however, I have recently found my interest piqued by the tinkering possibilities of the Raspberry Pi. I am currently in the process of creating a NAS server that will be primarily used to maintain a photo library to offload from my phones. I am looking for suggestions, feedback, and any remarks on my build. The build will be as follows: - Raspberry Pi 5 - Argon Neo case with NVME support - 64GB Micro SD to download Pi OS Lite and Open Media Vault - 1 TB Crucial NVME

Additionally, I am also planning on buying a Black Shark phone cooler that I will stick above the Argon Neo's aluminum case with the theory that it will cool the metal down, which will cool the air within the case down, and therefore the fan's in the case will be circulating cold air to the Raspberry Pi.

I understand some of you might be asking me why I am not running RAID and multiple bays. Well, I don't want to increase the budget of this build anymore. It was supposed to be USD 250, and I'm already at USD 260.

submitted by /u/xVeranex to r/RASPBERRY_PI_PROJECTS
[link] [comments]

Need help picking parts for an autonomous car (Raspberry Pi 5)

Hi, Recently I bought a Raspberry Pi 5 so that I can use it in a project of mine, an autonomous car.

Unfortunately I'm not very experienced with electronics and I need help because I see that everybody online chooses different parts.

I want the car to be powered by a single LiPo battery with 11.1V and 2200mAh (with the XT60 plug). I want it to power the Raspberry Pi 5, a small 130 motor (3V) and a servomotor.

My question is, how do I power all of them from the same battery? I've searched and found that I can use a motor driver, I've seen more complex builds that use some additional parts. I'm just really unsure on how to connect all these so that they are powered by the Raspberry Pi only. I doubt the motor driver can power all 3 of them so I'm searching for either something else or something additional.

If anyone has some recommendations, articles that I can read, videos or anything to point me in the right direction, please send 'em my way.

submitted by /u/Popular-Remove-3536 to r/RASPBERRY_PI_PROJECTS
[link] [comments]

Mounting an NVMe on a Raspi 5 with Ubuntu server

Heyo everyone,

So this is quite frustrating..

I got myself a raspberry pi 5... A rasperry pi 5 pcie M.2 hat ( The pimoroni Duo )

The idea is to use proxmox on the PI. Just for fun.

My current problem is that the ubuntu server can't see nor mount the nvme.. And whenever I search for help I get loooots of sites helping me on how to boot from an nvme.. I do not want to boot from my nvmes.. I want the os to run from the SD card and then mount the nvmes into the os...

Does anyone here have any ideas how to accomplish that?

Thanks for reading.

P.S. I'm slightly triggered that there's no one just mounting an nvme.

submitted by /u/stoffel2107 to r/RASPBERRY_PI_PROJECTS
[link] [comments]

RuntimeError On My Raspberry Pi Code

I am using a very basic test code provided at the end of this video linked below (I'm basically trying to rebuild her robot with a few extra mods but I haven't even added the mods yet)

https://www.youtube.com/watch?v=Bp9r9TGpWOk

I keep getting this error:

RuntimeError: The GPIO channel has not been set up as an OUTPUT

It marks the error at the first line of my forward function.

I have tried googling the solution and this is the only link that comes close to solving my issue but not quite as I'm not using GPIO.cleanup(), so I have no idea what else my issue can be. I've reviewed the code a dozen times, and it should be working, as I'm essentially doing this but with some extra steps:

import time

import RPi.GPIO as GPIO

GPIO.setwarnings(False)

GPIO.setmode(GPIO.BOARD)

GPIO.setup[29, GPIO.OUT]

GPIO.setup[31, GPIO.OUT]

#30 GND

GPIO.setup[32, GPIO.OUT]

GPIO.setup[33, GPIO.OUT]

GPIO.output(29, True)

time.sleep(3)

GPIO.output(29, False)

GPIO.output(31, True)

time.sleep(3)

GPIO.output(31, False)

GPIO.output(32, True)

time.sleep(3)

GPIO.output(32, False)

GPIO.output(33, True)

time.sleep(3)

GPIO.output(33, False)

time.sleep(3)

exit()

And this code worked perfectly fine. I don't know why it shit the bed as soon as I brought classes into the equation. The pins all work, and they all respond to the pi calling them out exactly like this. I think it must be something in my syntax that's making it freak out and throw this error. I removed all the extraneous stuff I added in for my future mods (except for some of the imports), and nothing fixed it. I'm putting my code below.

#GPIO Settings

GPIO.setwarnings(False)

GPIO.setmode(GPIO.BOARD)

#labeling pins

GPIO.setup[29, GPIO.OUT]

GPIO.setup[31, GPIO.OUT]

#30 GND

GPIO.setup[32, GPIO.OUT]

GPIO.setup[33, GPIO.OUT]

class Robot:

def __init__(self, name, rwheel, lwheel):

self.name = name

self.rwheel = tuple(rwheel)

self.lwheel = tuple(lwheel)

self.rwheel_f = int(rwheel[0])

self.rwheel_b = int(rwheel[1])

self.lwheel_f = int(lwheel[0])

self.lwheel_b = int(lwheel[1])

def forward(self, sec):

GPIO.output(self.rwheel_f, True)

GPIO.output(self.lwheel_f, True)

#stop

time.sleep(sec)

GPIO.output(self.rwheel_f, False)

GPIO.output(self.lwheel_f, False)

def backward(self, sec):

GPIO.output(self.rwheel_b, True)

GPIO.output(self.lwheel_b, True)

#stop

time.sleep(sec)

GPIO.output(self.rwheel_b, False)

GPIO.output(self.lwheel_b, False)

def lturn(self, sec):

GPIO.output(self.rwheel_f, True)

#stop

time.sleep(sec)

GPIO.output(self.rwheel_f, False)

def rturn(self, sec):

GPIO.output(self.lwheel_f, True)

#stop

time.sleep(sec)

GPIO.output(self.lwheel_f, False)

#establishing ob

smelly = Robot("smelly", (29, 31), (32,33))

#test run

smelly.forward(3)

smelly.backward(3)

smelly.lturn(3)

smelly.rturn(3)

Again, I'm following her code exactly, so I'm not sure where I could have gone wrong on this. Again, I get the error attached to the first line of my forward function.

submitted by /u/ameerkatofficial to r/RASPBERRY_PI_PROJECTS
[link] [comments]

Wireless Mesh Project using Raspberry Pi 5 and Edimax adapters

Hi everyone!

I am trying to setup a wireless mesh network staring from this project. Everything works fine until I am in cabled client mode: the moment I try to build a wireless bridge it does not stay up for more than few seconds.

I did some research and tried different configurations on hostapd but I am figuring out why it is not working.

In case you have any suggestion it would be really really appreciated!

I am using Raspberry Pi 5 as devices, equipped with Edimax EW-7822ULC usb adapters.

submitted by /u/Few_Description5363 to r/RASPBERRY_PI_PROJECTS
[link] [comments]

BB1-Zero Update - Bigger Beefier Arms v3.0 + Anti Deer/Raccoon “BBBB Turret”

BB1-Zero Update - Bigger Beefier Arms v3.0 + Anti Deer/Raccoon “BBBB Turret”

Hello!

I have been working on trying to figure out the arms all week …have been running into problems but tackling them best I can.

Currently waiting on a servo to come in from Amazon to finish the work. But I figure I’d show ya BB1s “Anti Deer Raccoon BBBB turret” 🙏🏽 (it is functional! video coming soon )

The arms also mean having to change up how the power is handled so will probably have to add another voltage regulator and some other stuff 🤔. WIP 🙏🏽

submitted by /u/TheRealFanger to r/RASPBERRY_PI_PROJECTS
[link] [comments]

NFC (Lunch) MusicBox, finished!

NFC (Lunch) MusicBox, finished!

NFC (Lunch) Music Box !

Hi sub,

Here is the outcome of my long project to create a nice NFC Music Box for kids.

I started this project back in November, thinking I could finished it by Christmas. Big failure, time runs fast.

Pictures

Top view

Inside, lower part

Inside, upper part (the battery is under the black battery control card)

Front view with the volume and control switchs

Going into debug mode

From bottom view with a screw preventing opening

The back side, with power switch, USB female to charge battery and a small circle with holes for air flow.

TL;DR

  • What is this? A lunch box turned into a NFC music box. When you present a NFC card on the left side, It will load and play a specific album.
  • What is inside? a PI4 (4GB, 64GB A2 SDCARD), a battery (Sun Founder Pi Power), a multiplexing board, a screen, a audio module and speaker and two KI_040 rotary switchs.
  • Was it easy to do? Nop. Pain in the bottom, won't do that again =) But I learn how to use GPIO!
  • Does it work? Until the kid use this as proof of gravity's existence, yes.

In details

Components

  • A Lunch Box ("monbento - Lunch Box Enfant MB Tresor Fox" from amazon)
  • A PI 4GB
  • An A2 SD Card
  • Two Rotary encoders (KY_040)
  • A Screen (Waveshare 1.28 round screen, the standard version)
  • A sound card (SeeedStudio ReSpeaker_2_Mics_Pi_HAT_Raspberry)
  • A battery (SunFounder Pi Power)
  • A multiplexing board (EP-0123 by 52pi)
  • Wires (usb/dupont)
  • A speaker
  • A NFC reader (NFC 522)
  • 3D printed parts (battery switch, encoder knob (from JensW_2000 on thingiverse), small part to hold the screen from under).
  • A Strap (amazon again), screws, nuts, bolts...

Main software

  • Moc
  • PulseAudio
  • Python
  • Bash
  • Raspbian 11 (the installation of the sound card drivers fails on 12).

Logic

  • When scanning a card (check every second), "moc" (a music player) loads all the mp3 files on the folder whose name equals the card ID.
    • A special card enables wifi hotspot and ssh (no need to open the box again to load new songs or debug)
  • A service checks every half seconds the currently running (using moc again) track to adjust display.
  • Left rotary switch controls volume. Pushing control output between speaker and headphones.
  • Right rotary switch controls track (previous/next). Pushing toggle play/pause.

Security & Safety

  • Screen prevent kids for opening the box.
  • The volume has a maximum level, controlled and updated BEFORE switching output.

Problem I had

  • The sound card use i2c, claiming the spi0 CS. Screen went buggy when scanning a tag). I had to add an overlay (spi5 (with one cs) was fully free from screen or sound card claims/GPIO pins) for NFC reader.
  • Some library's functions you can find on github might not overwrite the settings as they should. Double check the pin assignment in the code.
  • Since I didn't use the IRQ pin on the NFC reader, I had issue "Failed to add edge detection". Setting the IRQ to "None" was the good solution, but my researches mislead me into thinking it was link to the RPI-GPIO library.
  • KY_040 encoder are impossible to use correctly using rpi-gpio. Use the rotary encoder and key overlays. Then, using evedev in python, use their full names ("by path"). The number assigned at boot may change from a boot to another.
  • Lost all my first version of the code due to SD card failure... don't postpone your backup. Did a new version (and a lot of backups) in few days, and it's better.
  • Sometimes the sound card changes it's ID on alsa/pulseaudio. I disable every other sound controller (internal sound card + hdmi) so the only available one is the sound hat.
  • Boot was slow and many of the tips I found were deprecated for the current PI OS.
  • Running pulseaudio as root. End up running it as user service (same for the other services I created after that).

What can be better

  • Box trimming, Might sand some part later.
  • Boot is "slow" (18-20 seconds). Acceptable for an adult, will taught patience to kids...
  • Battery life not tested but tried to limit power (disable Bluetooth, USB).
  • Air flow might not be sufficient, will see if a better solution is needed.
  • Bottom is ugly, visible bolts/nuts. Will see if can be covered by small plastics.
  • Hole for headphone is far from perfect.

What would I do differently if I can?

  • Using an USB speaker and jack extension. USB might use more power but would be easier than this hat...

post version 1.2 (2024/07/24 19:00)

submitted by /u/LouisXMartin to r/RASPBERRY_PI_PROJECTS
[link] [comments]

Error with getting UnetStack to run for the first time

Hey guys!

I've been trying to get UnetStack to run on a Raspberry Pi 3 A+ for the past couple of days. I followed the instructions shown here https://blog.unetstack.net/Project-Sabine-Low-cost-DIY-underwater-modem-using-COTS-components-and-Unet-audio (this is what I'm building) as well as tried other installation methods shown on their website. Whenever I get to the step to try to run UnetAudio using "bin/unet -c audio" or through one of the groovy files, I get the same error:

bin/unet: line 31: /usr/lib/jvm/java-8-openjdk-armhf/bin/java: cannot execute: required file not found

I have confirmed though this exact file path that the java file is located there, and am a bit lost as to what to do next. Any suggestions or prior experiences would be greatly appreciated, thanks!

submitted by /u/natthegnat6 to r/RASPBERRY_PI_PROJECTS
[link] [comments]
❌