aed3 / PS4-esp32

Use a ps4 controller with an esp32
328 stars 103 forks source link

Controller not connecting #29

Open lexirobins opened 2 years ago

lexirobins commented 2 years ago

I used my laptop to find the ps4 controller's mac address and run the demo with that. But even though it prints ready, it doesn't seem to be connecting while the controller is pairing. I have the sony controller if that matters.

JavadRah commented 2 years ago

Hi @lexirobins Just follow the instructions in the readme file.

MatthewKamran commented 2 years ago

Same thing is happening with me. I have changed my controllers MAC address to match the ESP32 using the sixaxispair tool to 03:03:03:03:03:03. The controller simply will not connect.

include

void setup() { Serial.begin(115200);

// Replace the "03:03:03:03:03:03" with the MAC address // the controller wants to pair to PS4.begin("03:03:03:03:03:03"); Serial.println("Ready."); }

void loop() { if (PS4.isConnected()) { Serial.println("Connected!"); }

delay(3000); }

JavadRah commented 2 years ago

Note that your MAC address must be UNICAST! So you can use 1a:2b:3c:01:01:01 !

Fasic commented 2 years ago

I try'd everythong,

Using: 01:01:01:01:01:01 1a:2b:3c:01:01:01 PC mac Android phone MAC PS4 MAC ESP32 MAC

Nothing seems to work! I used both modes of pairing (just PS button, and PS+Share button, with all combinations to restart esp), i try'd deleteng flash (esp tools), and start over, and it didn't work.

I get this on esp startup:

rst:0x1 (POWERON_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:2
load:0x3fff0030,len:1420
ho 0 tail 12 room 4
load:0x40078000,len:13512
ho 0 tail 12 room 4
load:0x40080400,len:3604
entry 0x400805f0
Ready.

is there a way to print error messages or state of connectiong? i can't debug it like this.

aramich100 commented 2 years ago

having the same issue..

spilz87 commented 2 years ago

having the same issue too :(

Arduino : 1.8.15 Build 2021/05/31 10:33 ESP32 : 2.0.1-RC1

if that can help

spilz87 commented 2 years ago

maybe it is relatted to #19 ...

@aramich100 : did you solve it ?

Supermelone commented 2 years ago

I had this issue too but if your read carefully it's simple...

The PS4 Controller and the ESP32 must have the same MAC-Adress!!!

You can read your ESP32 MAC-Adress with this Programm here:

` // Complete Instructions to Get and Change ESP MAC Address: https://RandomNerdTutorials.com/get-change-esp32-esp8266-mac-address-arduino/

ifdef ESP32

include

else

include

endif

void setup(){ Serial.begin(115200); Serial.println(); Serial.print("ESP Board MAC Address: "); Serial.println(WiFi.macAddress()); }

void loop(){

} `

And then you have to change the MAC-Adress of your Controller to the same Adress as the ESP32. You can do so by using "Sixaxis Pair Tool" for example.

For me it works fine, hope it helps. :)

spilz87 commented 2 years ago

I'm agree the ps4 gamepad has to have the MAC address of the ESP32

It works well with original gamepad, I tested it.

But it doesn't work with some non official gamepad :(

I bought 4 different non officiel PS4 gamepad, I changed their MAC address, only one is able to connect to ESP32 :(

So this library seems to work only with some controllers. I you want to be sure, buy an original one ...

In my case, as it was to control robots, I build my own electronics with ESP32 to replace the one in the gamepad.

Zwer2k commented 2 years ago

I could connect my original PS4 controller with 2 ESP32 without any problems at the beginning, at some point the controller could no longer be connected with one of the two ESP, later also with the second. I almost despaired, tried everything possible, nothing helped. Then I performed Erase Flasch on the ESP, since then it works again.

Supermelone commented 2 years ago

I could connect my original PS4 controller with 2 ESP32 without any problems at the beginning, at some point the controller could no longer be connected with one of the two ESP, later also with the second.

You shouldn't do this, I wonder that it worked at all. The controller stores the MAC-Address it wants to connect to. If you could connect two ESP's means, that you changed the MAC-Address of both ESP's to the same. But MAC-Addresses MUST be unique!!!

If you want the Controller-Data on both ESP's, you can connect the controller with one of them and then send the data with RFCOMM to the other ESP.