-
Notifications
You must be signed in to change notification settings - Fork 2
online_check should do active query #23
Comments
Apparently you cannot query info2, the recommendation is to use status5. |
Yeah, the platformio messages in the middle have tripped me up before. That usually only happens once, but I agree building around that is a good idea. If querying status, need to make sure that the device 1) did just come online within the past minute or so, and 2) that it was flashed just prior to that. We can query status2 since that includes BuildDateTime so we can compare against that.
So I think it should be
|
Feature is added, accidentally included in commit d6697e7#diff-2c1c94d4c8d410c526a8bc27999ac770R345 |
Huh, I thought I said something about this a few days ago, but why not poll status2 as soon as we start watching for info2, so if it is online we don't wait for a timeout? |
Oh yeah. I thought about that, but if we run query_tas_status that can block for up to 3 seconds if it doesn't get a response, so if the device came online right after the status query but in that 3 second window we'd miss it. |
But if we do it after we've subscribed, we would still get the INFO2? |
I'm thinking
|
Should be status 2, not 5. How about this: 0f9c42b |
? |
Oh, sure, that works |
Looks good to me then. |
So there is a minor race condition I just hit testing this. Apparently there is a short time after you flash a device and before it reboots where it still responds to commands. So status 2 fired, the device replied, device started to reboot, and the script started sending commands that weren't received. This should only happen if you're flashing something for the second time within 2 minutes, but I do tend to do that sometimes, so maybe there should be a short delay before publishing status 2? |
That's super weird. |
pio spent a while telling me it should update after flashing, so the device came online before the online check started.
The text was updated successfully, but these errors were encountered: