import RPi.GPIO as GPIO import threading def led_test(): while true: PIO.output(led_one, GPIO.HIGH) button_state = GPIO.input(bt_pin) if button_state == GPIO.LOW: PIO.output(led_one, GPIO.LOW) led_thread = threading.Thread(target=led_test) led_one = 24 led_two = 18 bt_pin = 27 GPIO.setmode(GPIO.BCM) GPIO.setup(bt_pin, GPIO.IN, pull_up_down=GPIO.PUD_UP) GPIO.setup(led_one, GPIO.OUT) GPIO.setup(led_two, GPIO.OUT) PIO.output(led_two, GPIO.HIGH) led_thread.start()
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.
<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 )
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 unavailableI get this error when trying to run my script which should move the servos connected with my pca9685