Skip to main content
FW version: Stable

Logging and scripting commands

log [data]

Can be called with or without arguments. When called without arguments, prints out the whole log. If [data] is present, [data] is logged to the device's internal flash memory. [data] can be multiple words (strings separated by whitespace).

If the log file is full, the oldest data will be overwritten.

Return value

Returns 0 if and only if the command was successfully executed.

Example

SC-felix#>log
AUX(err 1, run 8, 25 s): #16445, 46.4932V, 16.6112A, 40.4155C, 16.0112RPM, level E stage 0 pass 0 : phase C positive overcurrent
note

The log is different for each family (ESC vs BMS).


proclog [r/p/s]

Record or playback previously recorded plot activity.

  • proclog r starts recording data redirected to it with plot -l ... continuously.
  • proclog p playback the recorded data. You can view the data in scope. Playback will stop automatically when the data is fully transmitted.
  • proclog s stops the recording or playback.

Return value

Returns proclog's status number. 1 is recording or occupied, 0 is ready/idle and so on... #TODO


pmlog

Prints history of permanent variables. This command has no arguments.

On each power down, the device stores all the permanents into the permanent log. With this command, you can print out the history of the permanents.

Return value

Returns 0 when successfully executed, -1 when an error occurred.

Example output

Print of the permanents, using the pm command:

SC-felix#>pm -r
List of available permanents:
-> time uint32 : 188 [s]
-> totaltime uint32 : 22455 [s]
-> ttl uint32 : 0 [s]
-> run uint32 : 6
[single_run]
-> maxcurrent float : 0.109887 [A]
-> maxvoltage float : 53.7968 [V]
-> maxtemp float : 45.2354 [deg C]
-> mintemp float : 33.6975 [deg C]
-> minmotortemp float : 3.40283e38 [ohm]
-> maxmotortemp float : .nan [ohm]
-> maxerpm float : 0.0 [1/min]
-> energy int32 : 0 [J]
-> cap int32 : 0 [mAh]
[total]
-> maxcurrent float : 0.298930 [A]
-> maxvoltage float : 53.8146 [V]
-> maxtemp float : 50.5676 [deg C]
-> mintemp float : 33.6975 [deg C]
-> minmotortemp float : 0.0 [ohm]
-> maxmotortemp float : .nan [ohm]
-> energy int32 : 0 [J]
-> errcounter int32 : 0
-> odo uint32 : 15 [wheel revolutions]
-> trip uint32 : 15 [wheel revolutions]
-> pmap uint8 : 1
-> Cmax float : 3000.0 [mAh] max capacity
-> Cact float : 0.0 [mAh] actual capacity
-> consumption float : 0.5 [Ah/km] range estimator

The output of the pmlog command. The order of items in the output is the same as in the pm command:

SC-felix#>pmlog
History of permanent variables:
time: 2800 [s]; totaltime: 16121 [s]; ttl: 0 [s]; run: 2 ; maxcurrent: 0.0 [A]; maxvoltage: 47.1816 [V]; maxtemp: 45.8851 [deg C]; mintemp: 0.588048 [deg C]; minmotortemp: 0.0 [ohm]; maxmotortemp: 0.0 [ohm]; maxerpm: 0.0 [1/min]; energy: 1111601023 [J]; cap: 1111216463 [mAh]; maxcurrent: 0.0 [A]; maxvoltage: 0.0 [V]; maxtemp: 0.0 [deg C]; mintemp: 0.0 [deg C]; minmotortemp: 0.0 [ohm]; maxmotortemp: 0.0 [ohm]; energy: 0 [J]; errcounter: 0 ; odo: 0 [wheel revolutions]; trip: 0 [wheel revolutions]; pmap: 0 ; Cmax: 1.44465e-38 [mAh] max capacity; Cact: 3.34144e-37 [mAh] actual capacity; consumption: 1.31660e-36 [Ah/km] range estimator;
===
time: 809 [s]; totaltime: 16930 [s]; ttl: 0 [s]; run: 3 ; maxcurrent: 0.0 [A]; maxvoltage: 47.1656 [V]; maxtemp: 45.8532 [deg C]; mintemp: 0.283895 [deg C]; minmotortemp: 0.0 [ohm]; maxmotortemp: 0.0 [ohm]; maxerpm: 0.0 [1/min]; energy: 1111601023 [J]; cap: 1111216463 [mAh]; maxcurrent: 0.0 [A]; maxvoltage: 0.0 [V]; maxtemp: 0.0 [deg C]; mintemp: 0.0 [deg C]; minmotortemp: 0.0 [ohm]; maxmotortemp: 0.0 [ohm]; energy: 0 [J]; errcounter: 0 ; odo: 0 [wheel revolutions]; trip: 0 [wheel revolutions]; pmap: 0 ; Cmax: 1.44465e-38 [mAh] max capacity; Cact: 3.34144e-37 [mAh] actual capacity; consumption: 1.31894e-36 [Ah/km] range estimator;
===

script [p/h/r/s/q/e]

Tool for manipulating the internal script. If run without an argument will prompt the user to type the script and end it with quit. This action will overwrite the internal script if there is one present on the device.

Each device can hold only one internal script at a time, so if you want to run another script you have to overwrite the current one. A script is a list of YOS commands along with code flow operators.

Arguments

  • p - prints out the current script, its size, and hash. Hash is also returned.
  • h - prints out only the size of the script and its hash.
  • r - returns script rights. Non-zero if the script is running.
  • s - starts/restarts the script.
  • q - quits the script.
  • e - erase the current internal script.

Return value

Returned negative value stands for error either while executing or stopping the script or for passing an unknown argument. 0 is returned when executed successfully.

Example

AM-felix#>script           # create a new script and save it
enter internal script, type 'quit' to exit
echo ahoj
echo cus
quit # end the script with quit
total 20 bytes
AM-felix#>script p # print the currently saved script
echo ahoj
echo cus
# total 19 bytes, #F3E7 hash
AM-felix#>script s # run the internal script
ahoj
cus
AM-felix#>