jvpernis / esp32-ps3

Control your ESP32 projects with a PS3 controller!
298 stars 81 forks source link

Incorrect operation when communication is lost. #29

Open Greeka67 opened 3 years ago

Greeka67 commented 3 years ago

Hello. Found a feature of the firmware behavior. For example: 1- download Ps3Demo 2- connect controller 3- take the controller far away or place it in a box or room where there is no communication. The ESP32 will not understand the moment of losing the controller and will be staggeringly sending commands, as well as "receiving" commands from the left stick "Moved the right stick: x = -1 y = -128". If the controller is brought closer to esp within range, it will connect and continue normal operation.

If the controller is out of communication long enough, then it may shut down, but esp will continue to send and receive commands.

Please inform me if I am not clear, I will try to explain it differently. The message was translated with the help of a translator.

13:40:24.751 -> Connected. 13:40:24.791 -> The controller battery is HIGH 13:40:26.780 -> Setting LEDs to player 1 13:40:28.780 -> Setting LEDs to player 2 13:40:30.777 -> Setting LEDs to player 3 13:40:32.780 -> Setting LEDs to player 4 13:40:34.780 -> Setting LEDs to player 5 13:40:36.780 -> Setting LEDs to player 6 13:40:38.780 -> Setting LEDs to player 7 // from this time the controller no longer receives commands 13:40:39.740 -> Moved the right stick: x=-1 y=-128 //This means that the controller is lost, but the ESP continues to work normally. 13:40:39.740 -> The controller battery is UNDEFINED // Processing once on controller loss 13:40:40.780 -> Setting LEDs to player 8 13:40:42.780 -> Setting LEDs to player 9 13:40:44.780 -> Setting LEDs to player 10 13:40:46.750 -> Setting LEDs to player 0 13:40:48.750 -> Setting LEDs to player 1 13:40:50.750 -> Setting LEDs to player 2 13:40:52.750 -> Setting LEDs to player 3 13:40:54.750 -> Setting LEDs to player 4 13:40:56.750 -> Setting LEDs to player 5 13:40:58.750 -> Setting LEDs to player 6 13:41:00.753 -> Setting LEDs to player 7 13:41:02.759 -> Setting LEDs to player 8 13:41:04.771 -> Setting LEDs to player 9 13:41:06.771 -> Setting LEDs to player 10 13:41:08.771 -> Setting LEDs to player 0 13:41:10.771 -> Setting LEDs to player 1 13:41:12.771 -> Setting LEDs to player 2 13:41:14.771 -> Setting LEDs to player 3 13:41:16.780 -> Setting LEDs to player 4 13:41:18.781 -> Setting LEDs to player 5 13:41:20.781 -> Setting LEDs to player 6 13:41:22.781 -> Setting LEDs to player 7 13:41:24.781 -> Setting LEDs to player 8 13:41:26.781 -> Setting LEDs to player 9 13:41:28.781 -> Setting LEDs to player 10 13:41:30.781 -> Setting LEDs to player 0 13:41:32.751 -> Setting LEDs to player 1 13:41:34.751 -> Setting LEDs to player 2 13:41:36.751 -> Setting LEDs to player 3 // Around this time, the controller fell asleep. 13:41:38.759 -> Setting LEDs to player 4 13:41:40.762 -> Setting LEDs to player 5 13:41:42.762 -> Setting LEDs to player 6 13:41:42.762 -> E (171412) PS3_L2CAP: [ps3_l2cap_send_hid] sending command: failed 13:41:44.762 -> Setting LEDs to player 7 13:41:44.762 -> E (173412) PS3_L2CAP: [ps3_l2cap_send_hid] sending command: failed 13:41:46.762 -> Setting LEDs to player 8 13:41:46.762 -> E (175412) PS3_L2CAP: [ps3_l2cap_send_hid] sending command: failed 13:41:48.762 -> Setting LEDs to player 9 13:41:48.762 -> E (177412) PS3_L2CAP: [ps3_l2cap_send_hid] sending command: failed

I noticed an interesting point, with the Ps3Demo firmware the controller has a communication radius larger than my firmware with this library. I use libraries #include "esp_system.h, #include . No complicated calculations are done.