Advanced WGE100 Command-Line Tools

Accessing Imager Registers: access_register

For experimentation purposes, the camera's imager registers can be viewed and modified using the access_register command. Unlike other commands, this command will never change the current IP address of the camera in order to avoid interrupting the image stream if the camera is currently running. Hence, if the camera is currently communicating on an IP address different from the one that is determined from the URL, communication will fail. Finally, the access_register tool will only work if the camera has previously been accessed by some other tool.

All values displayed and read by this tool are in hexadecimal. Depending on the arguments, it will dump all the registers

$ rosrun wge100_camera access_register name://my_camera
00:  1313 0001 0004 01e0 0280 0174 002f 0388 - 01bb 01d9 0164 01e0 0000 0320 0000 0011 
10:  0040 8042 0022 2d32 0e02 7f32 2802 3e38 - 3e38 2802 0428 0000 0002 0000 0000 0000 
20:  01d1 0020 0020 0010 0010 0020 0010 0010 - 0010 0010 0020 0004 0004 0004 0007 0004 
30:  0003 001d 0018 0015 0004 0010 0040 0000 - 0000 0000 0000 0001 0000 0000 0000 0000 
40:  0007 e00a 0020 0000 0000 0000 231d 8080 - 0010 0000 0000 0000 0002 0000 0000 0000 
50:  0000 0000 0000 0000 0000 0000 0000 0000 - 0000 0000 0000 0000 0000 0000 0000 0000 
60:  0000 0000 0000 0000 0000 0000 0000 0000 - c083 04ce 2910 6848 0000 0000 0000 0000 
70:  0034 0000 002a 02f7 0000 0000 0000 0000 - 0000 0000 0000 0000 0000 0000 0000 0000 
80:  00f4 00f4 00f4 00f4 00f4 00f4 00f4 00f4 - 00f4 00f4 00f4 00f4 00f4 00f4 00f4 00f4 
90:  00f4 00f4 00f4 00f4 00f4 00f4 00f4 00f4 - 00f4 0000 0096 012c 01c2 0258 02f0 0000 
a0:  0060 00c0 0120 0180 01e0 003a 0002 0000 - 0000 0002 0000 0002 0000 0000 0000 0003 
b0:  abe0 0002 0010 0010 0000 0000 0000 0000 - 0000 0000 0040 01f1 0006 01f1 0014 0016 
c0:  000a 0158 0840 0000 4416 4421 0000 0000 - 0000 0000 0000 0000 0000 0000 0000 0000 
d0:  0000 0000 0000 0000 0000 0000 0000 0000 - 0000 0000 0000 0000 0000 0000 0000 0000 
e0:  0000 0000 0000 0000 0000 0000 0000 0000 - 0000 0000 0000 0000 0000 0000 0000 0000 
f0:  0000 0000 0000 0000 0000 0000 0000 0000 - 0000 0000 0000 0000 0000 0000 beef 1313 

show the contents of a single register

$ rosrun wge100_camera access_register serial://12 fe
Reg fe read: beef

or set a single register

$ rosrun wge100_camera access_register name://my_camera 1 1
Reg 01 was: 0002 set: 0001 read: 0001

If the word stresstest precedes the register to read/write, the camera will repeatedly read/write that register until it is interrupted with CTRL+C.

Reflashing the Camera Firmware: upload_mcs

The camera's firmware is stored in a .mcs file that can be uploaded to the camera using the upload_mcs tool. This is a critical operation that could render your camera inoperable if the camera is reset while programming is in progress. If programming fails, immediately retry the operation as the camera's flash may be in an invalid state that will prevent the camera from turning on the next time it is reset. If you are worried that programming may fail, you can use the check_flash tool to exercise the flash reading and writing functionality of the camera without overwriting the camera's firmware. When programming and verification is complete, the camera is reset so that the new firmware goes into effect.

To reprogram the flash, upload_mcs needs the name of the .mcs file to read and a URL for the camera. Usually, the most up-to-date firmware can be found in wge100_camera/firmware_images/default.mcs

$ roscd wge100_camera/firmware_images
$ rosrun wge100_camera upload_mcs default.mcs any://
******************************************************************
Firmware file parsed successfully. Will start writing to flash in 5 seconds.
Hit CTRL+C to abort now.
******************************************************************
Writing to flash. DO NOT ABORT OR TURN OFF CAMERA!!
...........
Verifying flash.
...........
Success! Restarting camera, should take about 10 seconds to come back up after this.

In some cases, it is useful to convert a .mcs file to raw binary. For example, it could be desirable to compare the flash contents read using read_all_flash to the contents of an MCS file. If no camera URL is specified when running upload_mcs, the .mcs contents are dumped to standard output, from which they can be redirected to a file.

$ roscd wge100_camera/firmwares
$ rosrun wge100_camera upload_mcs default.mcs > default.bin

Checking Flash Programming: check_flash

The check_flash tool can be used to check that reading and writing to the camera's flash is reliable. Most users will not need to use this tool. Its only argument is the URL of the camera to test.

Warning: This program will erase any user settings from the flash memory.

$ rosrun wge100_camera check_flash serial://15
Unable to create ARP entry (are you root?), continuing anyway

*************************************************************************
Warning, this will overwrite potentially important flash memory contents.
You have 5 seconds to press CTRL+C to abort this operation.
*************************************************************************
....................
....................
Check completed, 0 errors.

Dumping the Flash Contents: read_all_flash

The read_all_flash tool can be used to dump the complete camera flash contents. The output goes to standard output, and should usually be redirected to a file. The single argument to read_all_flash is the camera's URL

$ rosrun wge100_camera read_all_flash any:// > flashdump.bin

Wiki: wge100_camera/AdvancedCommandLine (last edited 2010-01-22 09:02:01 by BlaiseGassend)