Connect Raspberry Pi to PS4 as Controller [Python] - python

I know we can use ds4drv to pair and receive DualShock 4 inputs from Raspberry Pi, but I actually want to make Raspberry Pi act as a DualShock 4 controller and send outputs to PS4. I want to do that by Python. Is there any library or source code that helps me?!

Related

Can you recreate Cronus zen with a raspberry PI

Is it possible to recreate the Cronus zen with a Raspberry pi, since the Raspberry pi can send and receive data using Bluetooth id figure it has the power to do that, I’m curious. If it’s possible, how?
I’ve searched google and found a python package that can detect controller buttons on pressed and released but it doesn’t have a send data feature.

Accessing Raspberry Pi4 USB port with Python

I am using Raspberry Pi 4 which comes with 4 USB ports. For my project, I have two mics and both will be connected to Rsp via a USB port. I need to be able to choose which Mic needs to be ON. So basically I need to be able to switch/choose which USB port I want the sound to come in.
I need to be able to choose Mic1 or Mic2. I am writing my code in Python. Is there any library that gives me access to choose a specific UBS port? I really can't find anything.
Appreciate your help.
Regards

How do I connect to a Raspberry pi over the serial port without knowing the COM port (programming in Python)?

I am creating a product which requires sensor data to be sent from a Raspberry pi to the users computer. The Raspberry pi is supplied with the product but the computer is not. All software is written in Python.
The serial communication is setup by the computer using;
ser = serial.Serial('COM8', 115200,timeout=10,write_timeout = 1,)
My Raspberry pi always shows up as COM8 but presumably if I had a different Raspberry pi or laptop it could show up as a different port. Since this is for a product I hope to sell to others, what can I do so that the computer is always able to connect to the Raspberry pi without having to choose the correct COM port?
The only way I know how to do this it is through brute force, using 'try' on each port, sending a message and seeing if the correct response is returned. Is there a more elegant method than this?

How to move the robot using raspberry pi?

I used a raspberry pi 3 model B and a camera to make a robot detect fire, using https://www.youtube.com/watch?v=-ZyFYniGUsw However I am not sure how to make this robot move after it detects fire. The L298N motor driver (DC motors are connected to this motor driver) and a logitech camera of this robot are connected to the raspberry pi of this robot. I know that it maybe better to use fire sensors to detect fire, however for my project I decided to use a camera.
My last lines of code in the raspberry pi terminal are (these are similar to the lines of code at about 10:41 in the youtube link above except instead of using android.tflite, fire.tflite is used):
source tflite/bin/activate
cd examples/lite/examples/object_detection/raspberry_pi/
cp ~/Downloads/fire.tflite .
python detect.py --model fire.tflite
So is there a way to make the robot move using raspberry pi each time it detects fire?

How to send data to multiple raspberry pi's at a time from raspberry pi 4 via Bluetooth?

I was working on Bluetooth project and I connected two Raspberry pi4 successfully and they are exchanging the data, Referred from this.
Now I need to send sensor data to multiple raspberry pi's at a time and they should exchange message automatically.
I saw some articles, saying that we can connect up to 10 devices at a time. But how to create multiple clients for a single Bluetooth server?
Any help would be appreciated.
When an LE server accepts a connection, it stops advertising and so will not accept any more connections. (see Bluetooth Core Spec Vol 2 Part E 7.8.9). You need each Pi to connect, read, and then disconnect at separate times without tripping over each other, or one Pi connected to the LE server, and multiple Classic RFCOMM serial connections (which can be open simultaneously) from there to the other Pis to pass the data on.

Categories