broadcast cast/observe problems #1087
Replies: 2 comments 4 replies
-
Thanks for trying it out.
It would be helpful if you could log Bluetooth packets as describe at https://bleak.readthedocs.io/en/latest/troubleshooting.html#windows-10 so we can see what is going on.
This should never happen. It should always be possible to press and hold the main button to power off the hub even if it stops responding to everything else or if there was a really bad crash, the hub will reboot or power itself off.
Messages are sent every 100ms no matter how many times you call broadcast.
I have run the program both with and without the prints enabled and haven't been able to reproduce the hang. Tried while connected to Linux, connected to Windows and not connected.
Instead of trying to implement motor control with feedback over the Bluetooth connection, I would just send a state that you want the arms to be in and do the motor control/feedback loop on the same hub that the motor are connected to. It would help if you could describe the big picture of how you actually want the robot to behave. |
Beta Was this translation helpful? Give feedback.
-
If both prints and waits are removed on the Hub1 program, I did get the hub to crash (powers off unless connected to USB power supply) when pressing the stop button in Pybricks Code to stop the program. |
Beta Was this translation helpful? Give feedback.
-
Hello:
I am working on a Johnny 5 robot with two hubs. I have been having problems with using the broadcast/observe feature in the new beta pybricks version.
The program would hang on either the broadcast or observe when running. Sometimes even the hubs would not disconnect when this hangs. The only solution was to restart the laptop (Windows 10) and remove the battery from the hub.
I then thought that maybe there are too many messages being sent, both from the broadcast from each hub, and the print statement. So I put a wait statement (for now wait(100) is what I have set) after each of the broadcast statements for each hub. The code has been running for several minutes now. Two strange behaviors:
the arms would pause for several seconds before continuing again
after several minutes the arms are no longer synced, but move in opposite directions
The other problem I have is that the code only works if I have the print statements enabled. The code for both hubs is listed below. Any help or suggestions would be greatly appreciated.
Mike,
Beta Was this translation helpful? Give feedback.
All reactions