puccioso33
July 10, 2024, 18:08

COLOR SENSOR PROJECT FOR ESCAPE ROOM

Hi everyone I am a 17 year old Italian boy. I found a summer job for an escape room and they asked me to build a circuit using a color detecting sensor. They just asked me to build something with this device and the idea that came to mind is to create a sequence of colors for the user to guess with cards. So if the sequence to guess is (I will decide it later) red, yellow, green, blue I will give small, plastic and colored cards to put in a sort of hole (similar to where the ATM inserts). If once inserted into the hole the sequence is correct, something with a servo motor will open, otherwise I have to tell the user that he made a mistake and have him repeat everything. The part of the working code that I have already done is taking the values ​​of the colors red, green, blue and yellow (there will be 4 colors to guess for the sequence) and by putting a range to the ifs and a delay (as I will show) I have detected colors. Now the sequence is missing but I don't know where to start and moreover I don't know if what I've done up to now is correct because if I don't have such a high delay the color I detect has similar values ​​to the others and red could be yellow . If you understand, can you help me? thanks


nicholaspcoldbloodedcreaturae
July 10, 2024, 16:07

How to Printf(); Message One Time at Beginning of Raspberry Pi Pico Serial Connection

Hello. I have an issue with Printf(); on my Raspberry Pi Pico W. I need a prompt printed out at the beginning outside of a while loop. When I try this and have the COM3 port open, it doesn't print, but it moves on to the next part of my code where it scans the input typed into the prompt. Any knowledge on how to fix this? The code is using C++.
c++
#include "stdio.h"
#include "pico/stdlib.h"
#include "pico/cyw43_arch.h"

int main() {
    // Initialize all standard IO
    stdio_init_all();

    // Assign pin as an unsigned integer for GPIO functions
    //const uint led_pin = 25;

    // Initialize LED pin
    //gpio_init(led_pin);
    // Set the GPIO pin as an output
    //gpio_set_dir(led_pin, GPIO_OUT);

    // Boot sequence
    printf("Please select what connection type is being used. USB (1) or LCD (2): ");
    char userInput;
    userInput = getchar();

    if(userInput == '1'){
        main_menu_serial();  // These functions have been excluded from the help post for simplicity sake
        boot_title_serial(); // These functions have been excluded from the help post for simplicity sake
        printf("Done.");
    }
    else if(userInput == '2'){
        printf("\n");
        printf("Why do you do this to me.\n");
    }
    else{
        printf("\n");
        printf("Input is invalid!\n");
    }
}
thundabeam
July 9, 2024, 20:57

Pi Zero, turns on but no ssh or video output

I originally just wanted to run headless ssh on my brand new pi zero 2 w. After hours of fiddling went and got a HDMI to Mini HDMI cable and found there was no display output either. I have tried a fair bit of fixes like modifying config files and different OS's but can't seem to get the pi to do anything. I'm thinking ill just have to get a new one unless someone thinks otherwise.
neng1
July 9, 2024, 05:14

i2c smbus2 BlockingIOError: [Errno 11] Resource temporarily unavailable

i was trying to control mini oled screen sh1106 using my raspberry pi 5 but i encounter this error does anyone has idea what does this means
 File "/home/nengyi/.local/lib/python3.12/site-packages/luma/oled/device/__init__.py", line 79, in __init__
    self.command(
  File "/home/nengyi/.local/lib/python3.12/site-packages/luma/core/device.py", line 48, in command
    self._serial_interface.command(*cmd)
  File "/home/nengyi/.local/lib/python3.12/site-packages/luma/core/interface/serial.py", line 93, in command
    self._bus.write_i2c_block_data(self._addr, self._cmd_mode,
  File "/home/nengyi/.local/lib/python3.12/site-packages/smbus2/smbus2.py", line 643, in write_i2c_block_data
    ioctl(self.fd, I2C_SMBUS, msg)
BlockingIOError: [Errno 11] Resource temporarily unavailable 
lr1729
July 9, 2024, 01:42

Pi camera freezes after around 10000 frames

I have an OV5647 camera module, which I'm streaming the data from. However, the rpicam-vid command always fails after around 10000 frames, and control c does not stop it, only a sigkill. Here is my command that sinks the output to test:
/usr/bin/rpicam-vid --width 2592 --height 1944 --denoise auto -q 95 --framerate 15 -t 0 --codec mjpeg -n --inline -o /dev/null -v 2
And here is when it failed:
Viewfinder frame 11795
FileOutput: output buffer 0x7f88206ee0 size 1286506
Viewfinder frame 11796
FileOutput: output buffer 0x7f84206ee0 size 1286495
FileOutput: output buffer 0x7f88206ee0 size 1285292
Viewfinder frame 11797
Viewfinder frame 11798
FileOutput: output buffer 0x7f88206ee0 size 1286986
FileOutput: output buffer 0x7f94206ee0 size 1287131
^CReceived signal 2
^CReceived signal 2
^CReceived signal 2
Terminated

thepurpleone
July 8, 2024, 14:57

Restart 8 different DMAs after they've finished their transferts On RP2040

I have 8 PIOs reading PWMs and each time they write into their FIFO, i need the DMA to copy the value into a memory buffer. and restart immediatly, always writing the last value into the buffer. I wanna use the least DMAs i can because i might need some for other stuff, How would i acheive the restarts? - I though about interrupts but i could miss some and i dont want the overhead. - I've seen people restart the channels with another channel, but i would need 8x2 DMA channels ? Any ideas?
yakupturksoy
July 8, 2024, 07:14

Servo control problem

Hello, I have an MG996R 360 servo motor. We are using it for our competition project and were planning to control it with a Raspberry Pi 5, but after testing, I couldn't control it with the RP5. I tried a code with Arduino Uno and it was successful. I uploaded the same code to the ESP32, but the motor didn't respond. When I replaced the MG996R with an SG90 servo, it started responding. The code and power supply are the same, but while the Uno can run both the SG90 and MG996R, the ESP32 and RP5 can only run the SG90. Is there a solution for this? I think esp32 and rp5 working same because they can run sg90 but cant mg996R. İn arduino ı just giving 1200ms for rotate, 1500ms for stop and works. in this video ı upload same code to esp32 and uno. ı just change the signal input. İn our project we dont have much space for extra card so ı want to use 2 servo with rp5.
ducky510984
July 8, 2024, 01:59

connecting to pi through terminal

so i need an eathernet cable to connect to my pi through the terminal (windows to the default pi os). when i try to ping the pi from my laptop the requests get blocked. now i know its connected to the internet because i could search stuff up the pi when i was connected with mouse and keyboard. now is there a way to fix this so i dont need a eathernet cable plugged in to the router
arastotle
July 7, 2024, 19:44

Home Security System Components for Raspberry Pi

Need to know how I can get all the components
louisandthecat
July 7, 2024, 17:03

Affixing microcontrollers

Hi all, Very noob question but if I am putting a few microcontrollers / maybe a raspberry pi zero in an old bit of kit, what’s the best way of affixing them securely? My current method was to get a flat bit of ply secured into the unit and then attach the boards to that I have standoffs but I can’t see how you attach standoofs to wood I bought some pcb feet but I can only find m3 ones and many things I want to attach are m2 I’m now thinking of screwing a bit of pcb board to the wood with screws and seeing if I can get the standoffs to screw into that I feel there must be a standard way to do this, what am I missing?
gamerlikegamer
July 7, 2024, 17:02

minecraft

im using a raspberry pi to make a minecraft server and i want to make a program that turns the server on automatically when the servers off or the raspberry pi reboots im using a raspberry pi 5
nael02546
July 7, 2024, 14:37

problème with wifi on raspberry 4

Hello everyone, sorry for my English I’m French. I just start to learn raspberry how it works. So I follow step by step with the wiki of raberry and I have a problème when I want to connect to my WiFi. Can you help my guys please ?
justaccsolol
July 7, 2024, 00:13

making a wi-fi hotspot (without internet access) with a rpi zero 2w

so i want to use my phone as a 'screen' using VNC over wifi as bluetooth is unreliable, my issue is that making the hotspot, any ideas? thanks in advance
sfpv
July 6, 2024, 23:51

need help finding camera

Where can I find a camera that is used on the raspberry pi camera? Just the standalone camera with the small connector
riothedev
July 6, 2024, 18:19

What does this blinking mean?

This is a pi zero w, and im getting this blinking when i plug it in, doesnt show up on the network either, any ideas?video
mantle778
July 6, 2024, 16:32

LED Striplight project

I'm trying to build a lighting system using a heap of LED strip lights - like those that are on a reel. Anyone have any experience with anything like this? I could do with 1 - knowing a reasonable price and place to source the LED strips 2 - knowing what i need to do to power these - are there any gotchas? 3 - knowing what i need to do to make this work from a lighting box for a stage I'm assuming this can be RPi driven
kaisers
July 6, 2024, 16:28

Pico W wifi scan with FreeRTOS

I'm trying to setup wifi scanning similar to the existing wifi scan example on the official repo (https://github.com/raspberrypi/pico-examples/tree/master/pico_w/wifi/wifi_scan). I've written some almost identical code to the functions written in the repo and the cyw43_wifi_scan function returns -4 whenever I call it. I can't find any documentation on this function regarding its error codes so I have no idea what that means. I suspect this issue is caused by the fact that I'm using the pico_cyw43_arch_lwip_sys_freertos library instead of the pico_cyw43_arch_lwip_threadsafe_background or pico_cyw43_arch_lwip_poll libraries used in the example. I need to use freeRTOS since using sockets without it is almost impossible so I'm kind of lost on how to get the cyw43_wifi_scan function to work with FreeRTOS. Has anyone else managed to achieve wifi scanning with the Pico W on FreeRTOS? Anyone have any suggestions on what to do? I've attached the code I'm running for those interested below (just prints "Failed to start scan: -4" repeatedly).
c++
int scanResult(void env, const cyw43_ev_scan_result_t result){
    if (result) {
        printf("ssid: %-32s rssi: %4d chan: %3d mac: %02x:%02x:%02x:%02x:%02x:%02x sec: %u\n",
            result->ssid, result->rssi, result->channel,
            result->bssid[0], result->bssid[1], result->bssid[2], result->bssid[3], result->bssid[4], result->bssid[5],
            result->auth_mode);
    }
    return 0;
}


bool WifiHelper::autoScan(){
    if (cyw43_arch_init()) {
        printf("failed to initialise\n");
        return 1;
    }
    cyw43_arch_enable_sta_mode();
    absolute_time_t scan_time = nil_time;
    bool scan_in_progress = false;

    while(true) {
        if (absolute_time_diff_us(get_absolute_time(), scan_time) < 0) {
            if (!scan_in_progress) {

                cyw43_wifi_scan_options_t scan_options = {0};
                int err = cyw43_wifi_scan(&cyw43_state, &scan_options, NULL, scanResult);
                
                if (err == 0) {
                    printf("\nPerforming wifi scan\n");
                    scan_in_progress = true;
                } else {
                    printf("Failed to start scan: %d\n", err);
                    scan_time = make_timeout_time_ms(10000); // wait 10s and scan again
                }
            } else if (!cyw43_wifi_scan_active(&cyw43_state)) {
                scan_time = make_timeout_time_ms(10000); // wait 10s and scan again
                scan_in_progress = false; 
            }
        }
    }
}
glitchchh
July 6, 2024, 15:57

Is my build good?

I looked up a few parts, its my first one, is it good and can it be better? I'm new, I dont need something like home entertaiment or lke this, I just want to have a project and something that I can customize how I want and like a mini (not powerful gaming) pc (https://pastebin.com/W8hVxXAB )
sykoreaper
July 6, 2024, 15:11

Camera Remote via WiFi

So I’ve got a project i need some help with for my girlfriend. End goal is a small hand held device with a screen and a capture button to control a canon 80D over WiFi with live view. Main question is can I code/configure the hand held to act as a dedicated program that only opens into the camera controls and takes a photo then the capture button is pressed. Ease of use and reliability are top priority due to this being for her work.
chis_
July 6, 2024, 14:43

Identifying Display connector

I am trying to find a connector for the display port and the touch screen monitor that I have. I counted the pins and it seems that it is a 15 pin to 15 pin connection, but i am only seeing this connector online as a camera connector. Am i right to buy a camera cable?
loufish
July 6, 2024, 07:47

Can I connect input AND output to the vsys?

So, I'm making a digital clock with a pi pico and a 16x2 LCD sceen. I'm reading everywhere that if you're going tp use batteries, you should use the VSYS pin, but my LCD is already connected to it to power it. To me it seems not right to connect both a power IN and a power OUT onto the same pin?
nate42272
July 4, 2024, 19:46

I can't install pi OS on the pi 5

Hey, I decided to try using a pi for the first time, so I bought a pi 5. I am trying to run it headless since I don't have a wired mouse and keyboard, but I am facing a couple of issues First off, using the imager, I can't seem to install the raspberry pi OS, directly from the imager, on the micro SD (specifically a Samsung 128 GB micro SD). Specifically I get the following error: "Error downloading: schannel: next InitializeSecurityContext failed: Unknown error (0x80092013) - The revocation function was unable to check revocation becsuse the revocation server was offline" I also tried downloading the image seperstely and installing the custom image with the imager. It does install now, but ssh does not work. I definitely had in enabled, but it does not connect Pls help if you can, I have been trying for 3 days to fix this but I can't figure out the issue
lavender1729
July 4, 2024, 16:26

How to drive 40 pin TFT LCD display with RP

I want to drive a 40 pin tft with a microcontroller. for now i'm considering using the rp zero 2. i have bought a hdmi to 40 pin controller, but I think that it would be nicer and less power hungry if I were able to drive the display from the pi. I also would like to avoid giving up all gpio, but am fine giving up most. would I be able to do this? it is an 800x480 display, but i'm not doing anything crazy graphical and I have a lot of overhead
pixelated_planco
July 4, 2024, 12:00

Raspberry PI4 as NAS and media player

Hello! I was wondering if someone might have some suggestions or advice. I want to use my raspberry pi 4 as a NAS as well as it being able to play videos itself. I've added a schematic of the situation. It would be great if I could put videos from my pcs and laptop to the External SSD making it able to play those files directly from the pi to the projector, but also my samsung tv to be able to play video files from the SSD attached to the Pi. I know that last thing is possible, because I've had it working before, by setting up a specific kind of NAS that the smart tv read as a media source, but I don't know if I can also add the possiblity for the pi to just be used as a media player and play the files from the external ssd attached to it. Preferably also while controlling the pi's media player by either the PC or my smart phone. Hope my question is clear 🙂 Any advice or suggestions are appreciated. Thanks in advance!
jellyfishmeal
July 3, 2024, 18:30

Pi Camera Breaks

Hi, I have a raspberry pi 4 and I am trying to connect a Camera Module 3 to the board. The Camera will work for a while, and then will stop working and will be bricked. The only time that I can see it happened right after I did a specific thing was when I installed some python libraries onto the pi. The only libraries that would interact with the camera were opencv and picamera2. This happened a few other times on some other boards, and they would just brick randomly and not work again. To test the cameras, I use libcamera-hello, and it says that there is no camera that is connected to the pi, when the camera is obviously plugged in. Does anyone have any ideas? I have run sudo apt-get update and upgrade, and that didn't fix anything.
keylon
July 2, 2024, 00:36

Best way to do moving graphics

What would be the best way to display something like this? the red dot in the middle moves around rapidly, and the numbers change rapidly. Would C# or Python be better? And what package should i use?
vidrazevasa
July 1, 2024, 23:07

Pi Zero 2 just craps out.

Hello, My new Rpi Zero 2 just... Dies over network. The light is on saying it has activity, but I cant SSH into it, and the mediatmx server running on it becomes unresponsive. It seems to happen faster if I unplug it, and then immediately plug it back in, and slower if I let it wait - which makes me think it's temperature, but I have a heatsink on it. I can't even ssh in to fix or reboot it.
oops.se
July 1, 2024, 13:51

PWM 12V Fan control using Pi5

moexrio
June 30, 2024, 19:35

CM4 PCB Design

Hello every one I am designing a very basic CM4 circuit. I need only one USB port for connecting camera or lte module. I am facing a problem to get the uart switch FSUSB42UMX its out of stock in my country and i dont have alot of time to finish my project so can i connect the USB_P and USB_N pins from the raspi CM4 (103 and 105 pins ) directly to USB A adding 5v and GND does that works any help plzzz.
nerf0
June 29, 2024, 18:36

How to use HID on arduino Mega2560

So basically im doing a school project and im doing a button box, for that i bought the arduino mega because it has more ports. I searched for a while to see like how would i do it, so basically only the arduino leonardo and the mini can use HID so when you connect the arduino to your pc it will recognize it as a keyboard or a gamepad. But the mega doesn't have HID so i saw on reddit a lot of guys using an app called Flip to change the firmware of the atmega16u2 chip so it works as an HID device. But im running into some problems, i already have the hex file but when i try to open a connection usb on the app it says that some .dll are missing and i installed the dll that was missing but i had the some problem still. Then i saw someone again on reddit saying that you need to put the arduino on DFU mode so the app can access the firmware, ive done that too but i think that my aduino is not going into DFU mode. when i try to put my arduino in DFU mode it shows like this on device manager i linked 2 photos the one called "1" is how i should show and the one called "image" is how it shows even after i put it on DFU mode.