Skip to content
This repository has been archived by the owner on Jul 12, 2023. It is now read-only.

Controller not connecting #29

Open
lexirobins opened this issue Oct 14, 2021 · 11 comments
Open

Controller not connecting #29

lexirobins opened this issue Oct 14, 2021 · 11 comments

Comments

@lexirobins
Copy link

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
Copy link

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

@MatthewKamran
Copy link

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 <PS4Controller.h>

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
Copy link

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

@Fasic
Copy link

Fasic commented Dec 3, 2021

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
Copy link

having the same issue..

@spilz87
Copy link

spilz87 commented Dec 7, 2021

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
Copy link

spilz87 commented Dec 11, 2021

maybe it is relatted to #19 ...

@aramich100 : did you solve it ?

@Supermelone
Copy link

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 <WiFi.h>
#else
#include <ESP8266WiFi.h>
#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
Copy link

spilz87 commented Apr 13, 2022

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
Copy link

Zwer2k commented Jul 8, 2022

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
Copy link

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants