felis/USB_Host_Shield_2.0

Usb.Task lockup with PS3 controller

Opened this issue · 1 comments

Hi, i seem to be experiencing the same issue as #495

most of the time, when I move my robot (lot of vibrations when getting to speed, as it uses omni wheels), the USB.Task seem to enter an infinite loop, which triggers the arduino whatchdog an resets it (i've got it on 1s)
on top of that, i'm not able to reconnect the controller unless I powercycle the entire robot (reseting either the shield or the arduino doesn't help)

I'm using an arduino mega to talk to the host shield mini trough a level shifter

programs can be found here : https://github.com/Fizzi1470/CDFR_Jr_GameTeam/tree/main/RobotV5_PS3
(note that there is a lot of commented lines and stuff here and there/code missing as i'm trying to get the controller to work reliably for now)

also note that i would rather not powercycle the bluetooth dongle as

  • it gets its power from a PCB, on whitch the host shield is soldered, hiding the 5v rail that it is connected to, making it (almost) impossible to add a transistor or something
  • the fact that the entier arduino board resets in the first place is not great, as I lose time during matches, especially since the PS3 controller takes a while to realize that it is not longer connected

i don't exclude my code being the problem here, but I really don't see anywhere that could be locking up in such circumstances

Also: i ditched the SwitchPro controller as it was disconnecting randomly after 1-5 minutes (without the robot moving or anything) if i added any of my code to the example for the controller, that's why i switched to a PS3 controller, that doesn't seem to randomly disconnect as the switch controller was doing