Bluetooth Connection In Raspberry PI - linux

I want to create a python script so that when user wants pair with Raspberry PI's Bluetooth by phone I accept the request by pressing on a button connected to Raspberry PI's GPIO. Is this possible? How?

Related

Raspberry Pi 4 Bluetooth Weak Range

Context:
I have a Raspberry Pi 4 sitting directly next to my iPhone. I have a bluetooth multisensor ~3 rooms away that I am able to connect to from my phone but I cannot reach it from my Raspberry Pi (verified via bluetoothctl) for home automation purposes with Home Assistant. When I bring the sensor in the same room as the iPhone and Raspberry Pi 4 I am able to receive data on both devices, but when I place it in its ideal location for my purposes, I am only able to reach it via iPhone.
Questions:
Is there a way that I am able to extend the Raspberry Pi Bluetooth range via terminal in anyway? I've already disabled WiFi in case that was causing any issues.
If not, is there a dongle I can add to the RP4 where I would be able to get an extended range?

Port forwarding using Raspberry Pi

I installed a PPP (Point to Point Protocol) in my Raspberry pi in order to connect with another Linux based card using serial port (with USB-RS422 cable). The PPP is well installed and configured, so from the raspberry pi I can ping the Linux card, my goal is to access the Linux card through the raspberry pi, I active the port forwarding in my raspberry pi also I added a route in my PC (Windows based).
For information, my PC is under my company network, the raspberry is under an IoT device network managed also by my company. Please have a look at the below diagram to well understood the situation.
enter image description here
My Question is : Do you have any idea to how can I access the based Linux
Card through the raspberry pi? Should I use nftables for that? if yes how? any other suggestions?
To clarify more, I changed the design, which means I connect my raspberry pi to my pc using ethernet cable and tried to ping the based card through the raspberry pi, it works well, means that I could ping the based card from my pc. Please have a look at the below picture:
enter image description here

Two UART Devices (One for USB and one for Bluetooth)

I need to make the Raspberry Pi communicate with the Arduino via USB Cable. From this, I will use the port on the USB which supports Serial Communication. However I also need to make the Raspberry Pi communicate through Bluetooth in a Mobile App via Serial Communication as well. Since both Serial devices use different ports according the the Raspberry Pi 3 Model B documentation, can it communicate at the same time? (The Arduino to Raspberry Pi and Raspberry Pi to Mobile App). The Bluetooth uses the /dev/ttyAMA0 port then I will use an USB port to connect the Pi to the Arduino.
Example using pySerial library.
serialArduino = serial.Serial('/dev/ttyACM0', 9600)
serialBluetooth = serial.Serial('/dev/ttyAMA0', 9600)

How to setup a raspberry pi 3 with two bluetooth connections at the same time?

Hello my name is Edris,
I am looking to make a connection between a raspberry and 2 arduino's with bluetooth. So the raspberry pi 3 would be the master and the arduino's slaves.
But then I thought mayby is it easier to have two connections at the same time.
So one with the build in bluetooth chip
and the other
with a usb bluetooth stick.
The bluetooth chips are all BLUE LoW Energy. Also the build in chip in the raspberry pi 3
Looking forward to hear from someone.
Edris
here are a couple of ways to connect
my preference is bluetoothctl. you'll be able to control each dongle by it's ID, given its ID appears when you do scan on and a list of IDs prints

Raspberry pi 3 Model B no autoconnect wifi when I shutdown

I have a problem with my Raspberry Pi3, Model B connecting to Wi-Fi.
I have the Raspberry 3 display 7" where I can see if Wi-Fi is connected.
When I connect and disconnect the Raspberry with ethernet wire the Wi-Fi works, then when I reboot the Wi-Fi works perfectly too, and I can reboot whenever I want and Wi-Fi works.
But when the Raspberry Pi shuts down and wakes up Wi-Fi doesn't work.
The file /etc/wpa_supplicant/wpa_supplicant.conf:
network={
ssid="My_wifi_name"
psk="Password"
}
Some idea?
If you need another file say me please, I'm new here.

Resources