0

Pairing a PS4 Controller to the HUZZAH32
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Pairing a PS4 Controller to the HUZZAH32

by novi on Mon May 23, 2022 11:01 am

I'm trying to pair a gen 1 PS4 controller to the HUZZAH32 ESP32 Feather. I'm using Arduino IDE. I'm getting no connection and I have no idea why. Also the serial.println under void setup does not show on the serial monitor.

Code: Select all | TOGGLE FULL SIZE
#include <PS4Controller.h>

void setup() {
  Serial.begin(115200);
  Serial.println("Initialization ready!");

  PS4.begin("01:01:01:01:01:01");
//example MAC address
 
  // put your setup code here, to run once:

}

void loop() {
  if(PS4.isConnected()) {
    Serial.println("Controller connected");
  }

  delay(1000);
  // put your main code here, to run repeatedly:
}

novi
 
Posts: 7
Joined: Wed May 04, 2022 1:39 pm

Re: Pairing a PS4 Controller to the HUZZAH32

by Franklin97355 on Mon May 23, 2022 11:26 am

You might try
Code: Select all | TOGGLE FULL SIZE
void loop() {
  if(PS4.isConnected()) {
    Serial.println("Controller connected");
  }
  else {
     Serial.println("Not Connected");
     PS4.begin("01:01:01:01:01:01");
  }   
   
  delay(1000);
to see if the program is cycling.
Which PS4 controller are you using and what library?

Franklin97355
 
Posts: 22663
Joined: Mon Apr 21, 2008 2:33 pm
Location: Lacomb, OR.

Re: Pairing a PS4 Controller to the HUZZAH32

by novi on Mon May 23, 2022 11:42 am

I'm using the dualshock 4 controller with this library I found on GitHub https://github.com/aed3/PS4-esp32

novi
 
Posts: 7
Joined: Wed May 04, 2022 1:39 pm

Re: Pairing a PS4 Controller to the HUZZAH32

by novi on Mon May 23, 2022 11:45 am

So I tried that code you sent, and the serial monitor repeats:

Not Connected
E (16518) PS4_GAP: ps4_gap_init_service Registering GAP service PS4-HIDC failed
E (16518) PS4_GAP: ps4_gap_init_service Registering GAP service PS4-HIDI failed

What does this mean?

novi
 
Posts: 7
Joined: Wed May 04, 2022 1:39 pm

Re: Pairing a PS4 Controller to the HUZZAH32

by Franklin97355 on Mon May 23, 2022 1:55 pm

We have not tried connecting to the PS4 but you might contact the author of the software to get help with the PS4.

Franklin97355
 
Posts: 22663
Joined: Mon Apr 21, 2008 2:33 pm
Location: Lacomb, OR.

Re: Pairing a PS4 Controller to the HUZZAH32

by novi on Mon May 23, 2022 2:03 pm

Ok thank you

novi
 
Posts: 7
Joined: Wed May 04, 2022 1:39 pm

Please be positive and constructive with your questions and comments.