Skip to content

Conversation

@maloel
Copy link
Contributor

@maloel maloel commented Sep 30, 2024

The last stage when running rs-fw-update is "Waiting for device to reconnect...".
I noticed this stage does not wait at all and exits right away.

Tracked on [RSDEV-2791]

@maloel maloel requested a review from Nir-Az September 30, 2024 05:46

std::cout << std::endl << "Waiting for device to reconnect..." << std::endl;
std::unique_lock<std::mutex> lk(mutex);
new_device = rs2::device(); // otherwise the wait will exit right away
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On which device did you see it?
I am not sure that's the case on all devices/platforms

How is
rs2::device new device;

different from
rs2::device new device = rs2::device() ;
?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

new_device is updated every time the callback sees a new device. If the fw-update saw a new device (which is likely, and does happen with D555), then it will be set and the wait will not wait.

I tested with D455 and D555.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It waited for a recovery device:
if (d.is<rs2::update_device>...

IMO your new code now can override the device the callback already set and we will not get a notification of a new device.
Just wait until timeout right?

Maybe DDS should be handled differently?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We just restarted the device... why does it not make sense to reset the device we're waiting on? Has nothing to do with DDS.
I tested on D455... it works

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tested on D455... it works
On your system, with current load, but it's not robust.

Add this line and you will see you will wait 15 seconds for timeout.
image

The original solution does work.
On D500 when it takes longer to enumerate we do wait.
If you wish to reset the 'new_device' you wait on (to solve DDS related issue) try doing it 1 line before the update call which cause a device reset when the update end

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think equating a 3-second wait with a few lines of code while a device is rebooting is stretching it, but ok:
I'll move the reset to above line 530, before we set done = true, ok?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not before the update?
Is it in use in this function?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Moved before the update and tested.

@maloel maloel merged commit 099e775 into realsenseai:development Oct 7, 2024
19 checks passed
@maloel maloel deleted the fw-update-wait branch October 7, 2024 12:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants