lordchunky3
May 10, 2024, 22:49

RPI pico code breaks when I delete a comment

I have written code for my pico that allows a multiplexing 4x7 segment display i made to run on its own thread. Initially the code was not working so i wrote some test code which i then commented out. I got the main program to work but when I delete the comment the code stops working. After some troubleshooting ive determined thread is likely dying from some sort of memory issue and running collect() in the loop fixes this. Here is the code in its current state. I would love some help with why this happens and ideally a good method of managing memory import machine, utime, _thread from gc import collect, mem_free class Display: def __init__(self, seg_pins, cathode_pins): self.leds = [machine.Pin(pin, machine.Pin.OUT) for pin in seg_pins] self.cathodes = [machine.Pin(pin, machine.Pin.OUT) for pin in cathode_pins] def display_digit(self, digit): self.outputs = { '0' : [1,1,1,1,1,1,0], '1' : [0,1,1,0,0,0,0], '2' : [1,1,0,1,1,0,1], '3' : [1,1,1,1,0,0,1], '4' : [0,1,1,0,0,1,1], '5' : [1,0,1,1,0,1,1], '6' : [1,0,1,1,1,1,1], '7' : [1,1,1,0,0,0,0], '8' : [1,1,1,1,1,1,1], '9' : [1,1,1,1,0,1,1], 'none': [0,0,0,0,0,0,0] } for i in range(len(self.leds)): self.leds[i].value(self.outputs[digit][i]) def display_number(self, number): digits = list(str(number)) utime.sleep(0.00) for i in range(len(digits)): self.display_digit(digits[i]) self.cathodes[i].value(1) utime.sleep(0.002) self.cathodes[i].value(0) self.display_digit("none") display_output = 1234 seg_pins = [20, 19, 26, 27, 28, 22, 21] cathode_pins = [15, 14, 12, 13] display1 = Display(seg_pins, cathode_pins) def persistant_display(): utime.sleep(0.2) global display_output while True: display1.display_number(display_output) collect() _thread.start_new_thread(persistant_display, ()) utime.sleep(0.2) while True: utime.sleep(1) display_output+=1
pandorakim
May 10, 2024, 12:56

Raspberry Pi 4 Model B (I2C Range)

I'm trying to connect 125 units of ATTiny85 and I am not sure if it works within the available I2C address. Where can I check the starting address and the end address? I wanted to know if it will fit all of it. If it doesnt start at address 0 or 1, what address that it starts? Or is there anyway I can change the pre-reserved starting address? maybe change some config?
mikeymck
May 9, 2024, 23:26

need (paid?) help for my project

I’m trying to control something with a raspberry pi and can’t get the GPIO pins to turn on and off in Visual Studio Code. They aren’t registering as it only works with gpiochip0 and I no longer see it as an option. I don’t need much help other than that and am willing to pay for help as I got no answer last time.
skift_
May 9, 2024, 17:43

GPIO BUSY on Raspberry pi 3b+

I have written a code that moves a robot car with arrow keys and takes a picture on every key press. For controlling the robot car motors, I have a seperate file where I use the Motor function from gpio zero and assign the pins and define the directions (left, right, forward, backward). However, when I run my code for controlling the car and taking pictures I immediately get the error stated in the title. I have searched online a bit but found nothing useful. I'm suspecting its because I have the motor function defined on a seperate file which is then called to my main file. I'm running 64 bit bookworm os.
4.goose
May 9, 2024, 14:08

Urgent - Can’t get raspberry pi 4 to run a simple script on startup

I’ve tried every single tutorial and forum post I could find to get it to just run a small script that I’ve written that launches a Processing sketch file. - The script is set to be executable - The path is /home/notions/startup.sh What I’ve tried already - Editing rc.local - Editing .bashrc (this works but I have to manual open the terminal first - I’ve tried autostarting the terminal with @lxterminal in the autostart file - Tried editing crontab -e - Tried systemd No matter what I try, whenever I reboot the Pi it just won’t autostart anything. Any advice or help would be hugely appreciated. I’m under time pressure for a project
acexd69420
May 9, 2024, 10:48

getting Raspberry Pi 3 OS onto Asus Tinker board

I'm trying to install Raspberry Pi 3 OS onto my Asus Tinker board and it doesn't work, any suggestions or what do i have to do to make it work?
kaku8757
May 9, 2024, 06:40

How To Use Python Selenium on Raspberry Pi

Hey, can you please help me running selenium web automation on raspberrypi
macac0prego
May 8, 2024, 17:42

Measuring shapes with Raspberi Pico cam(Drone competition(

It is for a students drone competition, we are allowed to get outside help. The challenge is measuring precisely a star-like shape using a drone camera, it must be more then 1,2 meters away from the ground. We are thinking of using rasp pico but we are struggling to find a way to get the scale of the picture, so we can calculate the area.
winikolo
May 8, 2024, 15:18

Run Python Script after 5mins from bootup

i want to run a python script home/winikolo/SnCBot/main.py around 5 minutes after bootup, how do i do this?
philip.2000
May 8, 2024, 12:38

Cannot flash UF2 on Linux but on Windows

Hello, I have a weird problem and do not know what to do. I have two Pi Pico Ws and I want to just flash an example UF2 file onto them. If I use my Windows PC, I can flash a blink.uf2 file and everything works. When I try to use my Linux machine, I cannot get the files to load properly (same UF2 file). What I do: lsblk sudo mount /dev/{thepicodev} /mnt sudo cp ~/file.uf2 /mnt Then... nothing happens. If I umount still nothing happens. However, lsblk still shows the pico. When I try to use picotool:
â–¶ sudo ./picotool load ~/Downloads/working_blink.uf2
Loading into Flash: [                              ]  1%
ERROR: The RP2040 device returned an error: <unknown>
I am running Arch (btw) but I have no idea why it doesn't work. Any tips would be appreciated. Thanks a lot and have a nice day 🙂
dodot_ryoka
May 8, 2024, 07:19

i wanna make my pi5 a server for storing my SQL data as a software dev. where to start?

The learinng of basic linux cammand is half way. but i just need some help to where i could start.
okindo_
May 7, 2024, 23:01

How to send float value from Pi to Arduino IDE through i2c

Hi guys, im pretty new to all this Pi stuff. Im currently doing a line following project and i need to send a float value from Pi to Arduino IDE. Ive searched everywhere but im stuck. Please help 😦 Ive attached below screenshots of the code im using to transmit, output of what i receive from the serial monitor and a screenshot of the console terminal of the actual value meant to be transmitted.



tarkaguy
May 7, 2024, 16:55

lacking GPIO pins

Hey, I'm working on a project and I need to integrate a Lux sensor module using 2 wire I2C but I happen to find myself to have only one pin available and thats 28 (GPIO 1). I can't interfere with other pins. If you ever experienced or know how to solve it please help me. Thank you.
kulaggin
May 7, 2024, 11:54

Resetting the password for a user if we don't know changed password

How can we reset the password or create new user on RPi and switch to it? I'm trying to help someone with their RPi issue, they got a ready project from someone else. They have custom user prototype and the password to this user is unknown. I'm trying to set up VNC connection on LAN network from their laptop to their RPi but we don't have the password for the user. Is there an easier way to solve this? Like creating a new user from the existing user and logging in using the new user? Or are we going to have to reinstall the whole system if they won't be able to contact the previous owner and get the password?
cheezumi
May 7, 2024, 09:22

Ultrasonic Sensor not working on raspberry pi 4b

I'm trying to follow this guide to get my ultrasonic sensor working: https://projects.raspberrypi.org/en/projects/physical-computing/12 However, i get the error
/usr/lib/python3/dist-packages/gpiozero/input_devices.py:855: PWMSoftwareFallback: For more accurate readings, use the pigpio pin factory.See https://gpiozero.readthedocs.io/en/stable/api_input.html#distancesensor-hc-sr04 for more info
  warnings.warn(PWMSoftwareFallback(
/usr/lib/python3/dist-packages/gpiozero/input_devices.py:978: DistanceSensorNoEcho: no echo received
  warnings.warn(DistanceSensorNoEcho('no echo received'))
ard.33
May 7, 2024, 08:50

max size micro sd card pi4 model B

I need to get a new micro SD for my raspberry pi, but it's a 128Gb one. Will this still work?
n9tro
May 6, 2024, 20:30

wpa_supplicant.conf syntax error?

My pi does not connect to wifi for some reason, i suspect the wpa_supplicant.conf file in the root directory of the sd card is malformatted: wpa_supplicant.conf
country=us
update_config=1
ctrl_interface=/var/run/wpa_supplicant

network={
    scan_ssid=1
    ssid="my ssid"
    psk="my pass"
}
astrydax
May 6, 2024, 19:55

Creating a heated climate controlled box

I do ant keeping and need to keep my ant testubes at consistent warm temperatures. I'm not sure how the 5v pins work on the raspi and how many 5v components I can attach if someone can point me in the right direction. I've not have much luck doing my own research. Let me know if this reddit post is viewable with its links detailing the parts I'm ordering. https://www.reddit.com/r/raspberry_pi/comments/1clejt4/trying_to_make_a_climate_controlled_box_will/
oexyz
May 6, 2024, 17:48

pi5 not booting

Hi! I just got an pi5 that's unable to boot. Already tried: Reflashing the firmware to boot first from SD card Reflashing the OS Using the official pi5 PSU
jjpp
May 6, 2024, 15:22

Remove voltage warning

I want to hide the message
mikeymck
May 6, 2024, 13:10

gpiochip0 not showing up

I’m trying to code stuff in visual studio code however when I usually load up my terminal gpiochip0 has been replaced by gpiochip512 and my code no longer works, stating that I’m unable to echo the original PIN numbers I used to echo out. I tried adding the number to the original number like online answers have given me however this doesn’t work. Anyone know how to fix it?
kulaggin
May 6, 2024, 11:58

What is the password on RPi 4?

kulaggin
May 6, 2024, 11:37

Error installing TeamViewer on RPi 4 Model B

_salqiu_
May 5, 2024, 20:47

Building a NAS with a Pi 5

hi, i'm trying to build a NAS with a pi 5 following the official tutorial on raspberrypi.com and I seem to be stuck on this step since the steps are a little vague https://www.raspberrypi.com/tutorials/nas-box-raspberry-pi-tutorial/
class='img rounded m-1' src='/assets/assets/1236781394764763156.webp'>
chrisks7z
May 5, 2024, 19:38

installations are just never succesful ig

I have this rasberry pi 4 and i was trying for a month day by day to install the software correctly, now 7 months later i found it and i am thinking that these 70 bucks i have for it shouldnt go to waste. Plus it will be a good upgrade for my 3d printer
kierbik
May 5, 2024, 19:03

Grove.py install problem

I used "curl -sL https://github.com/Seeed-Studio/grove.py/raw/master/install.sh | sudo bash -s -" and then, result was - Grove.py installation FAILED, FAILED, FAILED . Can someone help?
adde9882
May 5, 2024, 17:52

Raspberry pi 5 fails booting with raspbian

I should mention that it randomly succeeded booting once, and I could use SSH to view some files. But after doing startx, I got a permission error, and then the raspberry pi shut down (crashed?)
xemonhe
May 5, 2024, 14:29

Raspberry 4 not responding.

I will try to explain the best as i can. this only happens when my minecraft server is running. ( 1.20.4 paper) In the minecraft i got timed out and in the prompt of the server it just freezed. i am connecting to my rasp by ssh in the same network and when it "freezes" i cant login into it. Although when i ping the rasp it seems to work fine. I dont really know what to do. I tried changing the charger of the raspberry (i use the official) because i tought it was a voltage problem or something but it didnt work. If something wasnt clear pls tell me.
martzitgrt
May 5, 2024, 13:54

Calculator using pi

Hi
oui_
May 5, 2024, 13:49

Using a different screen from the tutorial for a pi zero 2 emulator

I tried to follow this "tutorial" : https://www.thingiverse.com/thing:1334253 , but had to replace the Adafruit display with a Waveshare display. https://uk.pi-supply.com/products/adafruit-oled-breakout-board-16-bit-color-1-5-wmicrosd-holder https://www.waveshare.com/1.5inch-rgb-oled-module.htm The driver is the same so I thought it would be the same. The original post on thingiverse isn't detailed at all so I followed this tutorial https://www.youtube.com/watch?v=E0IuDpsUiBU , which can be summed up with this txt file https://www.dropbox.com/s/65erp9ujegss8lq/Nanogameboy.txt?e=8&dl=0 What do I have to change ? I finished the software part but now I couldn't even get an output over the HDMI anymore and the screen isn't lighting up.