mapijs
January 3, 2024, 20:27

CORS Origin issues.

I'm trying to host one of my web applications on my raspberry but I keep running into CORS issues. I can reach the web application just fine from my computer, and I can input the url in the adress bar just fine (http:// ipadress :3000/getCards?cardName=dark%20magician ) and I get back the JSON that I'm expecting. But when using the web application itself which should send the request I keep running into CORS Origin issues. I tried: npm installing cors, requering it in my javascript and using app.use('cors') tried to explicitly declare the cors headers in my app.get route tried app.use(cors({ origin: '' })); tried
const corsOptions = {
  origin: 'http://ipadress:3000',
  methods: 'GET,HEAD,PUT,PATCH,POST,DELETE',
  credentials: true,
  optionsSuccessStatus: 204,
};

app.use(cors(corsOptions));
But nothing seems to work. these are the response headers in my browser:
GET /getCards?cardName=d undefined
Host: localhost:3000
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:121.0) Gecko/20100101 Firefox/121.0
Accept: /
Accept-Language: nl,en-US;q=0.7,en;q=0.3
Accept-Encoding: gzip, deflate, br
Referer: http://ipadress:3000/
Origin: http://ipadress*:3000
Connection: keep-alive
Sec-Fetch-Dest: empty
Sec-Fetch-Mode: cors
Sec-Fetch-Site: cross-site
I was hoping someone here might be able to help me who perhaps has run into these issues before.
omrs
January 3, 2024, 18:09

pi hotspot

So I’m thinking of making a hotspot that connects to a list of proxies I want to specify more than one proxy if possible Does anyone have an idea on how to do it
beanssi
January 3, 2024, 16:44

RPI5 Power Adapter

Hi all. Prob. a billion topics about this but i wanna know if this power adapter is suitable for the RPI 5? https://www.amazon.de/-/en/Charger-Charging-Mobile-Adapter-Samsung-black/dp/B0BTPLNNP3
itsrocketman.
January 3, 2024, 16:27

Firebase Storage upload from a Raspberry pi 4 with Code::Blocks and C++

I am encountering challenges while attempting to upload a video to Firebase Storage. Specifically, I am using a Raspberry Pi 4, Code::Blocks, and implementing the code in C++. To clarify, I have tried to use the Firebase library but no chance. So i would like NOT to use it when possible. Facing a lot of issues with that and cant find a good doc how to use it on a desktop program instead of an android/ios app... The project involves the creation of a program for motion and object detection. When motion is detected, a video is recorded and saved to local storage. However, I am facing issues when attempting to send this video to Firebase Storage. New Error message:
<html><head>
<meta http-equiv="content-type" content="text/html;charset=utf-8">
<title>404 Page not found</title>
</head>
<body text=#000000 bgcolor=#ffffff>
<h1>Error: Page not found</h1>
<h2>The requested URL was not found on this server.</h2>
<h2></h2>
</body></html>
Thank you in advance! Sorry, there is not enough space for all my code. 😦 You can find it on Stackoverflow under the same title or ask and i can send more as comment ^^
void uploadToFirebaseStorage(const std::string&localFilePath,const 
std::string&firebaseStorageUrl,const std::string&firebaseApiKey){
    CURLcurl;
    CURLcode res;

    curl_global_init(CURL_GLOBAL_DEFAULT);
    curl=curl_easy_init();

    if(curl){
    std::ifstream file(localFilePath,std::ios::binary);
//...

int main(int argc,char*argv){
    //..
    std::string localFilePath="/media/raspi/videos/output_2024010315.avi ";
    std::string firebaseStorageUrl=" nameIcopyfromtheStorage.appspot.com/Video ";
    std::string firebaseApiKey="......";
    uploadToFirebaseStorage(localFilePath,firebaseStorageUrl,firebaseApiKey);
    //..
    if(video_writer.isOpened()){
    video_writer.release();
    }

    }
(And sorry for posting this again. Deleted the text and didnt know how can i add it again. Just wanted to fix it xD )
.hqnnah
January 3, 2024, 11:54

Emulate nintendo switch pro controller with pi 4

I am looking to be able to send inputs through my pi through a program or set of code that would be configurable like a macro, but am having trouble understanding projects and instructions. Just got a pi and dont have very much programming knowledge.
sanderzw
January 3, 2024, 10:44

Need Help with Bluetooth Connection Issues on Raspberry Pi

Hi everyone, I'm working on a project with a Raspberry Pi where I'm using Python to connect to cycling speed and cadence sensors via Bluetooth. The program uses asyncio and bleak for handling the Bluetooth connections. My script successfully connects to the sensors and reads data on the first attempt, but I encounter connection problems on subsequent tries. Here's a brief overview of what my code does: Connects to two cycling sensors using their Bluetooth addresses. Reads cycling speed and cadence data for 30 seconds. Disconnects from the sensors. On the first run, everything works as expected. However, when I try to run the program again, it fails to connect to the sensors. The error I receive is not very detailed, making it hard to diagnose the problem. I suspect the issue might be related to how the Bluetooth connection is being handled, or perhaps the sensors are not properly resetting after the first connection. I'm not sure if it's a problem with the Raspberry Pi's Bluetooth interface, an issue with the bleak library, or something else. Has anyone experienced similar issues or have any insights into what might be going wrong? Any help or suggestions would be greatly appreciated!
oops.se
January 2, 2024, 23:11

Firebase Storage on a Raspberry Pi 4 with Code::Blocks and C++

To format code in discord use 3 x backticks before and after the code block, see https://discord.com/channels/818384379197784084/1189386838788542464 for help
brickeater
January 2, 2024, 21:49

Pi2b wifi help

Is there anyway to either get a WNA3100 or a Netgear A6100 to work on Pi2B
k9t33n
January 2, 2024, 21:43

wireguard information

https://wireguard.how/server/raspbian/ just wanted to get a little info on this before i blindly follow the tutorial, this will be ran on a pi 4 with 2gb ram with pi hole. what will the performance be like? anything i should be aware of?
kelwin4598
January 2, 2024, 17:41

Flashing uf2 file into RP2040 PCB

Hey there, I have designed a keyboard PCB with RP2040, and created a uf2 file for the pcb to work with QMK firmware. However when I am uploading the file to the RPI-RP2 file, it repeatedly reopens itself instead of closing. Is there a solution to the problem? Thanks in advance
mega_destroyer
January 2, 2024, 09:57

Having difficulty flipping the screen horizontally, read on to see why I need to lol

Hi guys, I'm working on my own set of augmented reality glasses, and am using a raspberry pi 4 as the computer for it l. The thing works fine, but the display is horizontally flipped. Is there a way to change the orientation of the display with commands in the terminal or editing config.txt? Any help would be appreciated, couldn't find much info on this topic anywhere really 😅
Pantner
January 2, 2024, 07:38

Issues with Kiosk setup. Chrome Crashed and doubled menu bar on Desktop?

I've just set up a RPi4B (4GB) as a Kiosk to display a couple of webpages at home. I want it to flick between my CCTV dash and, at the moment, a Grafana Dashboard but that will likely change in the future. Fresh install of Bookworm on a new SD Card. New Pi powered by the v2 POE-Hat (connected to a unifi switch. Runs another Pi without issue) Used this tutorial, though installed 64-bit OS instead of 32bit as i got ahead of myself. https://www.raspberrypi.com/tutorials/how-to-use-a-raspberry-pi-in-kiosk-mode/ Set it up yesterday afternoon (~24 hours ago) and got it working reasonably quickly/easily. Went to check on it mid-morning today and Chrome (Chromium?) appears to have crashed as i was left sitting on the desktop. I also noticed the menubar at the top of the screen is doubled, I did notice this when i set it up but if it worked fine then i wasn't going to touch it. See Screenshot attached. Not sure if this is related to my main issue? Being Chrome, maybe ran out of memory? Worth trying Firefox or another browser instead? Nothing else has been installed/setup on it, except for SSH and VNC so i can remotely access it. I'm 'ok' with linux/pi's but am not really sure where to go from here? Any suggestions would be appreciated 🙂
baljeetoff
January 1, 2024, 19:54

Raspberry pi acting weird after power outage

Recently, my power went out for quite a bit, and when I came back, and turned my pi on, all my files became read only, and I am unable to download or update anything on the pi. Has anyone heard of this, and does anyone know what to do?
jaydeninja
January 1, 2024, 19:32

RPi Camera Face dedection issues.

Im doing a school project and im using a camera to detect faces but for some reason its giving me this long error. Also im deeply sorry but i can only take pictures of the code since its on my pi.
.zatara
January 1, 2024, 16:39

Glitched effect on browsers

Hello, yesterday the browsers were working but today when i opend it, they seem to have a glitched effect.
moajouz
January 1, 2024, 10:22

copy sd card

I wanted to know if there's any way I can just copy whatever i did with the system from the sd card so that if a problem occured, i would just flash the last backup on the sd card
wadegamer
January 1, 2024, 06:50

Raspberry Pi autonomous Drone

I am currently trying to implement a couple of Python packages called Dronekit: https://dronekit-python.readthedocs.io/en/latest/develop/installation.html It allows me to interact with the flight firmware for autonomous flight MAVproxy:https://ardupilot.org/dev/docs/raspberry-pi-via-mavlink.html Communication protocol that allows me to send commands from the flight computer(Raspberry Pi) to a flight controller The only issue is these libraries still only exist in Python 2.7. I tried using Legacy OS but it does not support Python 2.7 packages either. Any ideas?
brokeskill
January 1, 2024, 00:45

Python "Resource temporarily not available"

py
pi@ROS:~/Desktop $ python pl.py
Traceback (most recent call last):
  File "/home/pi/Desktop/pl.py", line 5, in <module>
    kit = ServoKit(channels=16)
          ^^^^^^^^^^^^^^^^^^^^^
  File "/home/pi/.local/lib/python3.11/site-packages/adafruit_servokit.py", line 92, in __init__
    self._pca.frequency = frequency
    ^^^^^^^^^^^^^^^^^^^
  File "/home/pi/.local/lib/python3.11/site-packages/adafruit_pca9685.py", line 176, in frequency
    old_mode = self.mode1_reg  # Mode 1
               ^^^^^^^^^^^^^^
  File "/home/pi/.local/lib/python3.11/site-packages/adafruit_register/i2c_struct.py", line 81, in __get__
    i2c.write_then_readinto(buf, buf, out_end=1, in_start=1)
  File "/home/pi/.local/lib/python3.11/site-packages/adafruit_bus_device/i2c_device.py", line 140, in write_then_readinto
    self.i2c.writeto_then_readfrom(
  File "/home/pi/.local/lib/python3.11/site-packages/busio.py", line 224, in writeto_then_readfrom
    return self._i2c.writeto_then_readfrom(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/pi/.local/lib/python3.11/site-packages/adafruit_blinka/microcontroller/generic_linux/i2c.py", line 98, in writeto_then_readfrom
    readin = self._i2c_bus.read_i2c_block_data(
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/pi/.local/lib/python3.11/site-packages/Adafruit_PureIO/smbus.py", line 264, in read_i2c_block_data
    ioctl(self._device.fileno(), I2C_RDWR, request)
BlockingIOError: [Errno 11] Resource temporarily unavailable
I get this error when trying to run my script which should move the servos connected with my pca9685
dylfer0
January 1, 2024, 00:33

raspberry pi 4 connect to the internet

It connects to the router via ethernet and can be accessed by ssh locally but can't access the internet. I set it up a few days ago with the dietpi OS , installed some stuff wich it must have had internet for then I moved it next to the router and connected to it via ssh to connect to it from my computer which is when I realised that it can't access the internet . I don't understand what the problem is, or if the problem is with the router or the raspberry pi.
sikewerld
December 31, 2023, 21:52

Can't interrupt Pi Pico

I'm trying to write a new program for my pi pico that I have not used in months, but Thonny is probably the worst software to ever exist and will not interrupt the program and I can't find any other button to stop the program. I can't open the files because it's "in use" or whatever. Any ideas?
willeishere
December 31, 2023, 21:29

External usb c port with pico as "Bad USB"

Hi i am new to using the pico but have used arduinos before, i want to make my own version of a flipper zero and im trying to make the Bad USB feature but i dont want to plug my pico into my computer while the battery is plugged in, so i was wondering if it would pe possible to control an external usb type c port that i can use my pico to send the Bad USB commands. Also to use the usb-c port as charging for the battery. I hope this made any sense, Any ideas are appreciated!
Xyler
December 31, 2023, 19:43

Feasibility of Pi 5 and Pico on quadcopter

Hi I'm relatively new to SBCs and microcontrollers. I'm currently working on programming a flight controller using a Pico W (running MicroPython) and Pi 5. The Pico will be running the flight control logic in an infinite loop taking accelerometer, gyroscope and RC data (from FS-iA6B) and sending out PWM signals to the ESCs. What the Pi 5 will be doing is partial autonomous control where my group plans to use a GCS (like QGroundControl) and wirelessly transmit messages (MAVLink?) to the Pi 5 via ~~WiFi~~ another RF transmitter and it controls the Pico based on what we do in the GCS. There will be an external GPS module connected to the Pi 5 so it can do the location processing and just send directions to the Pico, which then controls the ESCs/motors to move to the target. I don't really understand MAVLink (and a lot of these in general) and would like to appreciate some guidance/explanations. Also, is it possible to store multiple python files and have the Pi 5 re-flash the Pico on the go? I was thinking of something like having the Pi 5 store a whole bunch of programs like a calibration program, self-test program, flight program, etc. and whatever data from the prior programs (like gyro bias data from the calibration) to be stored in flash memory on the Pico or Pi 5, then load the flight program which grabs these values.
war_car
December 31, 2023, 19:39

How to fix motors jerking when changing directions with an Arduino and l298n?

I have an L298N motor that when used with delay() to switch the direction of the motors, it will jerk when changing the direction. The video attached shows the motors trying to change from left to right every 1 second, but also shows the jerking My code: https://pastebin.com/fYnawSvE

Warning: Undefined array key "author" in /var/www/html/index.php on line 102

Deprecated: htmlspecialchars(): Passing null to parameter #1 ($string) of type string is deprecated in /var/www/html/index.php on line 102
jackw_08
December 31, 2023, 14:19

Camera Module

Hello I am trying to get my camera module to work but am having a problem i do seem to have the option to enable it
fffeae
December 31, 2023, 11:20

Retropie gamepad not detected

I have retropie 4.8, Raspberry Pi zero 2 W, using Game hat waveshare for the gamepad I tried to install mk_arcade_joystick drivers to get the buttons to be recognised through gpio pins Connected via ethernet and when I tried to install it it failed and said "could not resolve host:file.retropie.org.uk" etc. If you have any other solutions get the buttons to be recognised or know how to fix the failure of installation of the drivers I would appreciate it thank you
ihaveaduck
December 31, 2023, 02:45

How do you fix"this environment is externally managed". I tried using venv but that didn't do eanny

I'm new to all this I got a raspberry pi 4 for Christmas
kutuptilkisi
December 30, 2023, 19:25

RPi4 Doesn't Boot

I got my Rpi4 and flashed my usb stick but it doesn't seem to boot at all. I tried both 2.0 and 3.0 usb ports. Doesn't work with either of them. Footage below
devmarcel
December 30, 2023, 18:27

Pi Pico in CLion Struggles

Hello fellow tinkerers! I've been trying to set up CLion to work with building ELF2 an UF2 files, but I've been having a bit of struggles. I'm trying to use the [Raspberry Pi Pico SDK]( https://github.com/raspberrypi/pico-sdk/tree/master ). My host machine is Windows 10 and I'm using the [GNU Arm Embedded Toolchain]( https://developer.arm.com/downloads/-/gnu-rm ) as shown in the image.
cmake
cmake_minimum_required(VERSION 3.26)

# Check if SDK exists, it not then fetch it from remote git
set(PICO_SDK_FETCH_FROM_GIT ON)

# Pull in Pico SDK
include(pico_sdk_import.cmake)

project(TestProject)

# Initialise Pico SDK
pico_sdk_init()

# Main source files
add_executable(TestProject
    src/main.c
)

# Add pico_stdlib library which aggregates commonly used features
target_link_libraries(TestProject pico_stdlib)

# Create map/bin/hex/uf2 file in addition to ELF.
pico_add_extra_outputs(TestProject)
My CMakeLists reloads perfectly fine and the Pico SDK is fetched into the build cmake-build-pico build directory. I've used the blink example to test if this setup works:
c
/
  Copyright (c) 2020 Raspberry Pi (Trading) Ltd.
 
  SPDX-License-Identifier: BSD-3-Clause
 /

#include "pico/stdlib.h"

int main() {
#ifndef PICO_DEFAULT_LED_PIN
#warning blink example requires a board with a regular LED
#else
    const uint LED_PIN = PICO_DEFAULT_LED_PIN;
    gpio_init(LED_PIN);
    gpio_set_dir(LED_PIN, GPIO_OUT);
    while (true) {
        gpio_put(LED_PIN, 1);
        sleep_ms(250);
        gpio_put(LED_PIN, 0);
        sleep_ms(250);
    }
#endif
}
When hovering over the import I get a syntax error "'pico/stdlib.h' file not found". When attempting to build I get the following:
====================[ Build | TestProject | Pico ]================================
C:\Users\Marcel\AppData\Local\JetBrains\Toolbox\apps\CLion\ch-0\232.9921.42\bin\cmake\win\x64\bin\cmake.exe --build C:\Users\Marcel\CLionProjects\TestProject\cmake-build-pico --target TestProject -j 10
[1/51] Performing configure step for 'ELF2UF2Build'
FAILED: elf2uf2/src/ELF2UF2Build-stamp/ELF2UF2Build-configure C:/Users/Marcel/CLionProjects/TestProject/cmake-build-pico/elf2uf2/src/ELF2UF2Build-stamp/ELF2UF2Build-configure 
cmd.exe /C "cd /D C:\Users\Marcel\CLionProjects\TestProject\cmake-build-pico\elf2uf2 && C:\Users\Marcel\AppData\Local\JetBrains\Toolbox\apps\CLion\ch-0\232.9921.42\bin\cmake\win\x64\bin\cmake.exe -DCMAKE_MAKE_PROGRAM:FILEPATH=C:/Users/Marcel/AppData/Local/JetBrains/Toolbox/apps/CLion/ch-0/232.9921.42/bin/ninja/win/x64/ninja.exe -GNinja -S C:/Users/Marcel/CLionProjects/TestProject/cmake-build-pico/_deps/pico_sdk-src/tools/elf2uf2 -B C:/Users/Marcel/CLionProjects/TestProject/cmake-build-pico/elf2uf2 && C:\Users\Marcel\AppData\Local\JetBrains\Toolbox\apps\CLion\ch-0\232.9921.42\bin\cmake\win\x64\bin\cmake.exe -E touch C:/Users/Marcel/CLionProjects/TestProject/cmake-build-pico/elf2uf2/src/ELF2UF2Build-stamp/ELF2UF2Build-configure"
-- The C compiler identification is unknown
-- The CXX compiler identification is unknown
CMake Error at CMakeLists.txt:2 (project):
  No CMAKE_C_COMPILER could be found.

  Tell CMake where to find the compiler by setting either the environment
  variable "CC" or the CMake cache entry CMAKE_C_COMPILER to the full path to
  the compiler, or to the compiler name if it is in the PATH.


CMake Error at CMakeLists.txt:2 (project):
  No CMAKE_CXX_COMPILER could be found.

  Tell CMake where to find the compiler by setting either the environment
  variable "CXX" or the CMake cache entry CMAKE_CXX_COMPILER to the full path
  to the compiler, or to the compiler name if it is in the PATH.


-- Configuring incomplete, errors occurred!
ninja: build stopped: subcommand failed.
Tracing back to the files it seems to attempt to use, things like .../cmake-build-pico/elf2uf2/src/ELF2UF2Build-stamp/ELF2UF2Build-configure cmd.exe which aren't present as shown in the 2nd image. What am I doing wrong? Any resources I can use?
Darklink
December 30, 2023, 15:29

bonjour j'ai un problème sur une application

I have install a razpberry pi apps and I have install 2 apps with pi apps and now I can no longer install any application with this software