firmware update by code #11487
-
Was looking around for the best practice for a single connected camera firmware update by code. In my scenario I have one camera connected and I would like to check if the firmware on that camera is a specific one. if not to update it. I noticed several things.
Will love it if someone can confirm all of these. Another open issue from my side is what is the difference between the rs2_update_firmware_unsigned_cpp() and rs2_update_firmware_cpp() functions (in the last link), it seems that in the high level code only rs2_update_firmware_unsigned_cpp is used by calling update_device.update() Code examples for other users. python: (tested on python 3.8 and pyrealsense2 2.53.1)
cpp: (tested on sdk 2.39.0)
|
Beta Was this translation helpful? Give feedback.
Replies: 7 comments 3 replies
-
Hi @avizipi You are correct about the similarity of the code for recovery and non-recovery firmware updates when examining rs-fw-update.cpp, as discussed at #11364 (comment) At #4416 (comment) a RealSense team member confirms that the procedure is to (1) set the camera as updatable, (2) call enter_update_state and then finally (3) update the camera, which can be done with as_update_device I note though that you had problems at #4416 (comment) with scripts that use that procedure. An unsigned firmware is one that is a backup of a firmware but cannot be used to firmware-update a camera, as discussed at #7093 (comment) Official documentation about rs2_update_firmware_unsigned_cpp() can be found at the link below. Its reference to rs2_update_firmware_unsigned_cpp() only working on an unlocked camera indicates to me that it is a function designed for use internally by Intel RealSense engineers with cameras that have access to advanced test and debug functions rather than by 'locked' retail cameras owned by end-users. If you scroll up the page slightly at the above documentation link then you will find the documentation for rs2_update_firmware_cpp() |
Beta Was this translation helpful? Give feedback.
-
I have a problem with the cpp code, it seems that the udp returns NULL
I am getting: |
Beta Was this translation helpful? Give feedback.
-
Hi @galikrosentalik Typically, the term dev is used in the 'for(auto&&' instruction instead of 'device'. For example:
|
Beta Was this translation helpful? Give feedback.
-
The part of the error messsage null pointer passed for argument "device" suggests that the problem may be related to your use of 'device' instead of 'dev' in for(auto&& device : devs) - though some people do use 'device too - so it may be worth trying to change device to dev to see whether it makes a difference. Also, try for(auto&& dev : ctx.query_devices(RS2_PRODUCT_LINE_DEPTH)); instead of substituting in ctx_query_devices with 'devs'. |
Beta Was this translation helpful? Give feedback.
-
Hi @MartyG-RealSense, following the code in realsense repo I now trying to use something like this:
But It seems that the condition variable is never triggered, and I miss something with the set_devices_changed_callback. EDIT: it seems that the line I tested this with one camera connected and the serial number didn't match... |
Beta Was this translation helpful? Give feedback.
-
I could only find one other example - at #931 - where rs2::event_information::get_new_devices has previously been used and that was in December 2017, back when the RealSense 400 Series cameras were first launched. ctx.query_devices is the usual way in which a list of all attached cameras and their serial numbers is automatically generated, like in the RealSense SDK's multiple camera example program rs-multicam. https://github.com/IntelRealSense/librealsense/blob/master/examples/multicam/rs-multicam.cpp#L23-L24 |
Beta Was this translation helpful? Give feedback.
-
Thanks very much for sharing your experience and solution with the RealSense community :) |
Beta Was this translation helpful? Give feedback.
Hi @avizipi You are correct about the similarity of the code for recovery and non-recovery firmware updates when examining rs-fw-update.cpp, as discussed at #11364 (comment)
At #4416 (comment) a RealSense team member confirms that the procedure is to (1) set the camera as updatable, (2) call enter_update_state and then finally (3) update the camera, which can be done with as_update_device
I note though that you had problems at #4416 (comment) with scripts that use that procedure.
An unsigned firmware is one that is a backup of a firmware but cannot be used to firmware-update a camera, as discussed at #7093 (comment)
Official documentation about rs2_update_firmware_unsigned_cpp() can be fo…