-
Notifications
You must be signed in to change notification settings - Fork 21
buildhat.exc.DeviceNotFound: No device found #122
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Firmware on the RP2040 basically can't handle what you're asking it to do. |
Dear mutesplash, Thank you for your response.
However, there are at least three issues with this workaround:
|
Unfortunately there is no way to block in the Python library because the firmware does not respond in the affirmative when you issue a command. |
Dear mutesplash, I understand that the UART protocol might be a bit slow to respond in the affirmative when a command is issued. My suggestion would be: Use a GPIO pin. Without the blocking functionality the buildhat cannot be used for reactive robots. |
The python library in this repo doesn't seem cover the BuildHAT firmware source change that would create an out-of-band feedback loop that you suggest. It would be nice if it did, though! I see where you're coming from and would suggest coming up with a more realistic test case to argue for this change. (I am not a committer) |
Dear mutesplash, Here is a minimal use case for controlling two motors with a game pad:
The importance of this test case becomes clearer when we start to use parallel processing. Here is an example with two communicating sequential processes that form a process network with the same functionality:
By now pycsp is a bit dated and the library code must be patched for python3, but the example shows the principle of building reactive process networks with blocking channels. |
Hm, I see. Without a patch to the closed-source firmware, the BuildHAT library would have to guess at a max input rate and throttle all write()s in the BuildHAT class. But, it seems you haven't been able to determine what that rate is. |
Dear mutesplash, It seems that the problem is nonlinear and a linear solution would reduce the system performance significantly. When the code, from my previous post, is running, the motors are reactive. That means, with my senses I feel that the motors react adequately to my input. Introducing a long delay, say |
When I tried to download python 3 library for build hat it didn't work |
You should use the RPi forums for this kind of support, not github issues, @tenderandshy |
@OliverFaust I think I see what you're trying to achieve with regards to using a gamepad and controlling the motor speed. Mutesplash mentioned some good points re. throttling the messages. I'll have a think about this. |
@chrisruk from a user perspective, throttling the messages is inevitable. The task is to find a solution which does not kill the performance. |
The devtimeout and disconnected BuildHAT errors actually are text that is sent from the firmware on the RP2040 that refer to a specific motor port, indicating that the motors themselves literally cannot handle the data rate you're sending. |
Unfortunately, there is no official documentation available. However, from what I understand, the H-bridge, which determines the motor speed, sits on the BuildHAT PCB. If this is the case, it might be possible to set the motor speed without communicating over the motor data interface. |
Closing now, thanks to @mutesplash for the pull request! |
Hi,
Writing to the device in a hard loop causes a `No device found' after some time. Here is the complete call trace:
The time delay, after which that error occurs, seems to be random. I have observed that error anywhere from 1 min to 5 min. That might indicate a runtime problem with the framework, such as a buffer overrun.
Here is a minimal example to reproduce the error:
Debugging revealed that BuildHAT.DEVTIMEOUT followed by BuildHAT.DISCONNECTED occurred in serinterface.py
The text was updated successfully, but these errors were encountered: