-
-
Notifications
You must be signed in to change notification settings - Fork 7
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
Move hub looses print data in a tight loop on windows #324
Comments
Windows reboot did not solve the problem. O,oh . . . |
It is possible it could cause some interference. Does does the Move hub improve with the SPIKE hub off? 2.4 GHz Wi-Fi (and other radios on the same frequency) can also interfere. The closer antennas are to each other, the more potential for interference. |
The spike hub was hidden behind a book, but within 20 cm from the move hub. Indeed the movehub misses less print data with the other hubs OFF. And off course there are phones and the like are in the area. |
The technic hub is less sensitive to radio interference. Was thinking of two hubs in a model like the Is it oke to close this issue as caused by radio interference |
Let's leave it open to make it easier for other people to find. If lots of people have this same issue, we may have to reconsider how we send data. |
When sending large amounts of data quickly, some data was being lost. Although we had a retry when BLE_STATUS_INSUFFICIENT_RESOURCES was received, it seems that repeated calls immediately after that lead to lost data (and sometimes duplicated data). It turns out, the BlueNRG chip has an event that says when it is ready again after a BLE_STATUS_INSUFFICIENT_RESOURCES, so we can use that event to wait instead of doing multiple failed retries. There are still some issues with data corruption/loss but this is a significant improvement nonetheless. Issue: pybricks/support#324
I was able to make a significant improvement here. However, I'm not sure we will ever be able to entirely fix this. As seen below, after the improvements, we still lose some data (counts 11 and 12). Bluetooth packet capture shows that this is really what the chip is sending, so the loss is on the Bluetooth chip on the Move hub. Also the fact that the
This loss at the beginning can be worked around by adding a |
For example, sometimes this program works just fine (running it while pressing and releasing buttons on the remote all of the time). Sometimes it eventually will show some similar data corruption/loss. Once it just stopped printing altogether which means we probably got stuck waiting for an event that never came, although pressing the stop button and starting the program again seemed to work. from pybricks.pupdevices import Remote
remote = Remote()
def count():
n = 0
while True:
yield n
n += 1
for n in count():
print("count:", n)
remote.light.off() |
🎉 |
If we comment out the line
|
After some more reworking of the BlueNRG driver, the missing data in #324 (comment) is no longer observed. The occasional missing data when the stop button is pressed as in #324 (comment) is still occasionally seen. But I think we can finally close this one since the original issue here seems to be fixed. |
Describe the bug
Running on win10 the program pybricks-micropython/tests/basic/count_forever.py
The print looses some data from time to time.
To reproduce
Steps to reproduce the behavior:
Expected behavior
Neat correct print.
Screenshots
None sofar
Environment
Win10
Microsoft Edge Versie 90.0.818.51
('movehub', '3.0.0b6', '7b3d1b42 on 2021-05-01')
Copied print data
From #320:
The text was updated successfully, but these errors were encountered: