RPi 3 pybluez connetion timeout - raspberry-pi

On a Raspberry Pi 3, is there a way to set a timeout to bluetoothsocket.accept so that it will continue if there was no connection attempted instead of ending the code?
I've tried settimeout but it ends the code.

Related

Backend terminated or disconnected. Use 'Stop/Restart' to restart on Raspberrry Pi

I'm running an Optical Character Reading program on my raspberry pi 3 B+, after getting everything running, i decided to transfer to raspberry pi zero but start receiving "Backend terminated or disconnected. Use 'Stop/Restart' to restart" on running it. when i tried to run the code form the terminal, i received "Illegal Instruction"
First disconnect from the secondary power, that is, if it is within a circuit. Ensure that its only USB that is supplying power (of course when editing a code on your editor), this is how I solved similar problem on my rasberry pico pi.

How can I connecti Raspberry pi 4 to pixhawk?

I want to create a connection between pixhawk and raspberry pi 4 model B.
When I connect the Pixhawk to the usb port of raspberry via micro-usb, I can send commands to the pixhawk with the drone-kit scripts on raspberry.
However, when I connect the telemtry2 port to raspberry's 14th and 15th GPIO pins (rx-tx) in pixhawks, the same script gives a heartbeat error.
I have done the configuration of uart pins with rasp-config. The /boot/config.txt file is as follows. Also, when connecting from usb, I use the connection string value "/ dev / ttyACM0" and "/ dev / serial0" when the UART pins are connected.
Via mission planner:
SERIAL 2 PROTOCOL = 2 , SERIAL2 BAUD = 921
I followed this link: https://ardupilot.org/dev/docs/raspberry-pi-via-mavlink.html
Since there is no GPS installed, I set the GPS and compass control values ​​to 0 on the mission planner. That's why the pixhawk is in arm state. (blue light)
Thank you..
Have you set the following parameters?
MAV_1_CONFIG = TELEM 2 (MAV_1_CONFIG is often used to map the TELEM 2 port)
MAV_1_MODE = Onboard
SER_TEL2_BAUD = 921600 (921600 or higher recommended for applications like log streaming or FastRTPS)
Reference:
https://docs.px4.io/master/en/companion_computer/pixhawk_companion.html#companion-computer-setup
there is an easy way to connect raspberry pi with cube autopilot. the companion board lychee
https://dronee.aero/pages/lychee

PostgreSQL Connection to the server has been lost

I installed postgreSQL server on a raspberry pi 4 with raspbian buster. When I try to connect from local network i have no problems about idle time. When i try to connect from my static public ip I can send command but if I didn't send anything for more than 3 minutes, it appears this message "Connection to the server has been lost".
I tried to install ufw and disable it, I used DMZ, I tried to change keepalive_idle, but i have always the same problem. Please help me.
sometimes the error is
"ERROR: SSL SYSCALL error: Operation timed out"
(Note: always if I am connected from public IP)
If you don't have the same issue from within your local network I assume the connection is being terminated by a network device sitting between the client and the server (a router most likely).
There are routers with small TCP timeout settings (such as 300 seconds) which is close to what you're experiencing.
Try to check (and increase if needed) the TCP timeout settings on your router (and any other devices you might have in between).
Edit:
I tried to find some info on that device (seems to be Sercomm VD625) and it does not seem you can easily change TCP timeout settings (maybe via telnet/ssh if it supports it).
However, a simpler solution might be to avoid keeping an open connection to PostgreSQL if you will have large idle intervals; just connect when you need to and close the connection afterwards.

raspberry pi - canbus can-utils timeout?

I'm using raspberry PI with MCP2515 + the canbus-utils.
My raspberry pi is working on battery - so when I switch on the car&power up the PI - everything is working.
But when I switch off the car, then try to switch on after 1 hour I get no replay from the canbus-utils, and I need to restart the can service.
Any idea why?
Does the canbus-utils has some kind of TImeout? that can be change\ignore?
When the PI is the only member on the bus the controller switch to bus_off state, because nobody is acknowledging the messages send and the message will otherwise be send indefinitely, to protect for bus overload of the retransmissions.
Also there was a version of the kernel a couple of months ago wich not recovered from some error condition.
The latest version of the kernel has this fixed.
use sudo rpi-update to get the latest kernel.
Also at the initialisation script of your CAN bus add the following
ip link set can0 type can restart-ms 100

Configuring i2c on a Raspberry Pi2

I am trying to connect a Temp and Humi probe Adafruit AM2315 and it seams that the only thing I need to do is to get i2c running on my Pi2. I can't seams to find the proper instructions or command line to get it config and running ? Can someone help ?
did you connect it directly to the RPi2 I2C pins, or did you use the 10KOhm resistors too..?
It seems it needs two rapid connections to wake up first, before starting to send commands, see here:
http://raspberrypihobbyist.blogspot.it/2015/02/using-am2315-temperaturehumidity-sensor.html
David