Emlidtool return code

This is more a request for an enhancement than anything else… but could the new emlidtool specify a return code (other than zero) to indicate that the command has failed? It makes it much easier to use for scripting, rather than having to parse the output.

For instance:

root@navio:/home/pi# emlidtool test
2017-10-16 11:21:12 navio root[714] INFO lsm9ds1: Passed
2017-10-16 11:21:12 navio root[714] ERROR ms5611: Failed
 -- Reason: No connection!
2017-10-16 11:21:12 navio root[714] INFO pwm: Passed
2017-10-16 11:21:12 navio root[714] INFO mpu9250: Passed
2017-10-16 11:21:12 navio root[714] INFO adc: Passed
2017-10-16 11:21:12 navio root[714] INFO rcio_status_alive: Passed
2017-10-16 11:21:12 navio root[714] INFO gps: Passed
root@navio:/home/pi# echo $?
0

This really should return with a non-zero code to indicate that something has failed.

Similarly:

root@navio:/home/pi# emlidtool rcio check
current: 0x793d141e
local: 0xcaec2284

You need to update. Please run:
emlidtool rcio update
root@navio:/home/pi# echo $?
0

Returning non-zero would make it much easier to check for this in a custom startup script, and automatically run the update.

Is this a feature that could be added?

(I’m still working through the MS5611 failure…)

Many thanks

Patrick

Yeah, sure. We’ll add it as soon as possible. Thanks for the feedback.

Thanks George! That would be amazing :slight_smile:

This topic was automatically closed after 100 days. New replies are no longer allowed.