I have a raspberry Pi 4 which is running emulation station, and I am attempting to use a micro controller functioning as a HID device as a custom input (the pi is running Outfox, and the custom controller is a home made dance mat). However, consistently when connecting the device to my Pi 4, the code seemingly arbitrarily presses keys that have been programmed to be pressed. In my case I have only programmed it to do up, down, left and right. The micro controller will only press up, down, left or right which indicates that the code is still executing and the drivers that drive the usb protocol are all still functioning. It seems to me then that somehow the micro controller is reading its digital pins as high (or low if programmed that way) when it shouldn't be. On another forum someone who is having a similar problem suggested that maybe the Pi 4 (Pi 5 in his case) is messing up the handshake somehow
Previously I had an Arduino Leonardo running as the keyboard, which I then changed to an Arduino Micro which has the same microprocessor. In both of the cases the digital pins were pulled low, and when a button was pressed, the pins were exposed to 5v triggering a read on the digital pin (I had a 10k ohm resistor between the digital pins and ground to prevent shorts when buttons were pressed). It was about as basic as it gets
I then switched to the raspberry pi pico. The drivers I was using let me wire the digital pins directly to ground with the physical switch in-between, and when the switch is closed it registers a press.
Both cases fail in exactly the same way, although it seemed like the pico was slightly less dramatic. When it is connected to the pi, when pressing a button it does hold down that button, so the code is still working, it just also presses all the other buttons intermittently (it's maybe around 2 random presses a second). Also, it seems that the longer I have the pico connected to the Pi 4 the worse the problem gets. I can have the pico connected to my windows laptop for a very long time though and it always works reliably. On the Pi 4 I have tried its USB 2 ports, USB 3 ports, and a powered USB connector, so it is definitely not a power draw problem.
Any thoughts or suggestions on things to look into would be appreciated. I did make a post about this when I was just trying the Arduino Leonardo, but I was met with 1 reply saying that the issue is known and has never been resolved.
Previously I had an Arduino Leonardo running as the keyboard, which I then changed to an Arduino Micro which has the same microprocessor. In both of the cases the digital pins were pulled low, and when a button was pressed, the pins were exposed to 5v triggering a read on the digital pin (I had a 10k ohm resistor between the digital pins and ground to prevent shorts when buttons were pressed). It was about as basic as it gets
I then switched to the raspberry pi pico. The drivers I was using let me wire the digital pins directly to ground with the physical switch in-between, and when the switch is closed it registers a press.
Both cases fail in exactly the same way, although it seemed like the pico was slightly less dramatic. When it is connected to the pi, when pressing a button it does hold down that button, so the code is still working, it just also presses all the other buttons intermittently (it's maybe around 2 random presses a second). Also, it seems that the longer I have the pico connected to the Pi 4 the worse the problem gets. I can have the pico connected to my windows laptop for a very long time though and it always works reliably. On the Pi 4 I have tried its USB 2 ports, USB 3 ports, and a powered USB connector, so it is definitely not a power draw problem.
Any thoughts or suggestions on things to look into would be appreciated. I did make a post about this when I was just trying the Arduino Leonardo, but I was met with 1 reply saying that the issue is known and has never been resolved.
Statistics: Posted by nm720bike — Sun Sep 01, 2024 9:19 pm — Replies 1 — Views 52