epdos Reference Manual
epdos commands are operating system like commands generally used to access functions not avaiable in the menu system or to access menu system functions remotely. When connected via serial console, epdos commands are available from the main menu using the ! prefix or from the pdos> prompt accessed via the menu system (type pdos at any menu prompt). When operating autonomously, epdos commands can be executed by uploading the pdoscmds.bat file or using the $PDOSCMD cmdfile directive.
Filenames specified in commands are case-insensitive. Certain commands below admit the use of '?' and '*' as wildcard characters in glob patterns to match filenames. The '?' wildcard character matches any single character. Thus the pattern bathymap.0?? would match bathymap.004. The '*' wildcard character matches strings of characters in the file name. Thus the pattern SG0001*.A would match SG0001LZ.A, SG0001DZ.A, etc.
System commands
menu menuPath args ...
Execute a command from the menu system. menuPath is a / separated list of menu, sub-menu and menu options as described by the [name] strings displayed in the menu system.
menu hw/vbd/ad pos=2000
for example will move the VBD to 2000 counts. This is equivalent to navigating to the hardware menu (hw), VBD sub-menu (vbd) and choosing the AD option to manually move the VBD control.
quit
Exit the epdos system and return to the menu system.
pdos [/f]
Exit the glider program. Reboots the glider firmware. The /f flag forces the exit (skips the confirmation question).
reboot
Sets $RELAUNCH to indicate an epdos commanded reboot and restarts the glider program.
clock [mm/dd/yyyy HH:MM:SS]
Read or optionally set the main real-time clock. This does not set the supervisor RTC (use hw/super/setrtc from the menu) or any peripheral clocks.
flash backup a-f
Save currently flashed firmware to a file, backup_x.bin on microSD card, where x is one of a-f.
sysclk [speed] [hse]
Display system clock information. If speed is specified, set CPU operating clock to speed. Specify hse to use the high-speed external oscillator as the system clock (this is almost always what you want). Use with care. An incorrect speed specification could leave the glider in an inoperative state.
scuttle confirmation
Scuttle the glider. This pitches the glider full forward and opens the valve.
wipe confirmation
Wipe the microSD card by filling the entire card with a random sequence of bytes.
Scripting commands
stroke
Stroke the watchdog.
time command args ...
Run command with args. Report the execution time.
repeat count command args …
Run command with args count times. command can be a batch file.
abort_if 0|1
(only useful inside a batch file) Stop batch file execution if the previous command returned False (0) or True (1). Not all commands return useful values.
delay milliseconds
Pause execution for milliseconds. Does not enter low power sleep.
sleep seconds
Enter low power sleep for seconds.
print arg1 [arg2...] [> | >> dest]
Print (echo) strings to screen (and capture file) or file dest. Arguments are expanded using a similar syntax as logdev and serdev serial strings. See argument expansion below.
File transfer commands
yr
Receive files via YMODEM.
ys file
Send file via YMODEM. In online mode (during Iridium call, via pdoscmds.bat for example), file must be a single file. From the console to a computer connected via serial port, file can be glob (e.g., sg*dz.a) to send multiple files.
raw_r file
Receive file via raw protocol.
raw_s file
Send file via raw protocol.
File utility and shell-like commands
gzip originalFile compressedFile
Compress a file.
gunzip compressedFile uncompressedFile
Uncompress a file.
tar x|t[v][z] tarFile
Extract (x) or display contents (t) of tarFile.
tar c[v][z] tarFile glob [pathglob]
Create a tar file. Specify z to create a gzip compressed tar file. v to operate verbosely. path is optional. If specified it will be pre-prended to the the file pattern glob. path can itself be a glob. For example, "tar cvz eng.tgz sg0*dz.a dv00*", will search all directories matching dv00* for files matching sg0*dz.a and tar them into a single file.
md5 file
Compute and display MD5 hash of file.
mkdir directory
Create directory on the microSD card.
ren oldName newName
Rename a file.
mv glob1 [glob2 ...] directory
mv is a directory aware version of rename, similar to the Unix mv command. Multiple glob glob patterns/filenames can be specified. The destination directory must exist. If there are just two arguments and the second argument is not an existing directory than mv behaves exactly like rename.
cp file1 file2
Copy a file.
del [/v] glob1 [glob2 ...]
Delete files from microSD card.
rm glob [path]
Recursively delete files matching glob. Path is optional. If specified, it is the starting point (highest level) in the directory tree for the search for matching files.
dir [glob1] [glob2...]
Show directory entries for files matching a list of glob patterns. If no patterns are given, shows the entire root directory.
ls [glob] [path]
Recursively show directory entries for files matching glob, with optional starting path. If no arguments are given, lists the entire directory tree.
dirfile file [glob] [path]
Same as ls but results are saved to file rather than output to screen.
usage [glob1] [glob2...]
Count files and sum sizes for files matching a list of glob patterns. If not patterns are given, shows the entire root directory.
cat glob1 [glob2 ...] [> | >> dest]
Cat (output) files to console or optionally redirected to a file. Use > to overwrite dest. Use >> to append to dest.
trunc file length
Truncate file to length bytes.
grep /s string1 [/s string2 ...] [/b linesBefore] [/a linesAfter] [/v] [/c] [/or] glob1 [glob2...]
Search files matching a list of glob patterns line-by-line for matching string patterns. Files can be gzipped or plain text. Use /b and /a to control how many lines of context are printed before and after matched lines. /c specifies that only a count of matches will be returned. /v inverts the search - only non-matching lines are reported (or counted). By default multiple search conditions are and-ed together (i.e., a line in a file matches only if all strings are found on that line). Use /or to change this to logical or.
xargs pathspec filespec [commands] [args]
Similar to a unix pipeline consisting of find piped to xargs, builds a list of files by separately globbing paths and filenames. Searches for directories matching pathspec, and then within each matched directory searches for files matching filespec. With no additional arguments a list of matched files is printed. If command is specified (possibly with its own arguments) the list of files is appended as additional arguments. Valid commands are any that take a list of files or glob patterns as the final arguments (dir, usage, del, grep, cat (without redirection)). "xargs dv001? sg*kz.a grep /s ,C," for example searches dives 10-19 capture files for the string ,C,.
Capture system commands
capvec [subsystem level dest]
With no arguments, prints the current capture vector information. With arguments, sets debugging verbosity/level (DEBUG, NORMAL, CRITICAL) and destination (BOTH, FILE, SCREEN, NONE) for subsystem. subsystem is the system name prefixed with H (hardware) or S (software) to control the output for, .e.g, HCOMPASS or SUSR. Use capvec with no arguments to see all available subsystem names.
capflush
Flush memory buffered capture contents to disk.
capclose file [capFile]
Close the current working capture contents (or capFile if specified) to file and start a new empty capture file. In online mode (during an Iridium call via pdoscmds.bat), the capture file has already been moved to a temporary name to store the output of the commands in pdoscmds.bat. To close and reset the "regular" capture file (in which all of the offline results have been stored), specify thisdive.kap as capFile.
Glider control and data file commands
target [targetName]
Re-read targets file. With no arguments, displays current targets. With an argument, sets targetName as the active target.
science
Re-read and report science file contents.
resend_dive [/l | /d | /c] diveNumber [fragment1] [fragment2...]
Queue log (/l), eng (/d), capture (/c), or all (no specifier) files from diveNumber for re-transmission. A list of specific fragments to resend is optional. If not provided, all fragments will be sent.
split file
Split file into fragments according to $N_FILEKB.
resend_dive /f file [fragment1] [fragment2 ...]
Queue logger file file for re-transmission. A list of specific fragments to resend is optional. If not provided, all fragments will be sent.
Low-level filesystem and microSD commands
sdinfo
Report microSD card information (serial number, manufacturer info, capacity, etc.)
sdfree [/v]
Report microSD card free space. With the /v option, report verbose information about the filesystem (open files, etc.)
mem
Display memory (RAM) status.
format confirmation
Format the microSD card filesystem.
walkdsk [/v]
Recursively walk the entire filesystem to look for potential errors. /v turns on verbose reporting.
checkdsk [/v]
Recursively walk the entire filesystem and attempt to open and close every file.
fsck [/v]
Recursively walk the entire filesystem, opening and close every file. Tries to delete any file that cannot be opened.
Low-level nonvolatile memory commands
initnv page
Query the status of of nonvolatile storage page page. Page 0 is parameter memory. Page 1 is utility memory.
dumpnv page
Display low-level information about storage page page.
formatnv page confirmation
Format (erases all existing data) page. confirmation must be YES.
readnv var
Read value of utility variable var.
writenv var value
Write value to utility variable var.
Exec system commands
eval [conditionName]
If no conditionName is specified, evaluate all currently set conditions. If the condition evaluates true, execute the corresponding set number or pdos command.
clear conditionName
Delete conditionName from the list of active conditions.
condition name=conditionName [set=setNumber | pdos=command] expresssion="conditionalExpression" init="expression" [init="expression" ...]
Define a new condition and add it to the list of active conditions.
exec [setNumber]
If no setNumber is given, show all active conditions. If setNumber is given, execute it.