-
-
Notifications
You must be signed in to change notification settings - Fork 81
pbio/port_lump: Fix ColorLightMatrix by sending initial NACK. #309
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
Conversation
|
Might need some testing to ensure that the extra NACK does not upset any other sensors. |
|
It looks like we had the allowance for 6 errors all the way back to the start ab61ffd since adapting it from ev3dev. // make sure we are receiving data
if (!data->data_rec) {
data->num_data_err++;
DBG_ERR(data->last_err = "No data since last keepalive");
if (data->num_data_err > 6) {
data->status = PBIO_UARTDEV_STATUS_ERR;
}
}@dlech, do you recall why it was there? EDIT: References: ev3dev/lego-linux-drivers@90878a4 |
This is working fine on SPIKE Medium motors, the Technic XL motor, the Force Sensor, the Color Distance Sensor, the Tilt Sensor, Boost motor, Color Sensor and Ultrasonic Sensor. Let's proceed and keep an eye on it as we go. |
|
PSA: @antonvh: We're making a slight update to the protocol by sending an extra keep-alive message right after syncing up. All LEGO sensors seem to be expecting this and it might work just fine on yours, but letting you know just in case you want to test it |
It turns out the ColorLightMatrix needs the NACK to get going at all, so make sure we always send one before we start waiting on the timeout. In b17e503, we removed grace period of 6 keep-alive messages to go unanswered, which was essentially masking this issue so the device worked before.
7c5fcf2 to
4a4714a
Compare
It comes from official LEGO EV3 code: |
It turns out the ColorLightMatrix needs the NACK to get going at all, so make sure we always send one before we start waiting on the keep-alive timeout. In b17e503, we removed grace period of 6 keep-alive messages to go unanswered, which was essentially masking this issue so the device worked before.