Administration with SMS

This page has been updated on the 6 April 2011.

You can download the SMS administration document here

How to set/check a parameter by SMS?

Set a parameter

Use the following command to set a parameter by SMS:
(set,‘p’,‘v’)
This sets a parameter ‘p’ to value ‘v’.
Parameter should be like ‘COMPONENT.PARAMETER_NAME’.

Example : How to set the server port?

  1. Send the SMS set,dataEmitter.port,1234.
  2. Send the SMS reset.
    In this example, modem is the component, cnfapn is the parameter and a2bouygtel.com is the value.

To handle multiple parameters, add a ‘#’ to the end of each command.
set,dataRecorder.fieldPeriod/[9/],30#modem.cnfapn,a2bouygtel.com

Check a parameter

Use the following command to check a parameter by SMS:
(get,‘p’)
This gets the value of a parameter ‘p’ ‘.
Parameter should be like ’COMPONENT.PARAMETER_NAME’
Here is an example of checking command: get,dataEmitter.fieldPeriod.3.
To check several parameters within the same request, add a ‘#’ between each command.

How to get hard and soft versions remotely

Available SMS

  1. getDB,MDI_SAV_XBOOT (sbsl)
  2. getDB,MDI_SAV_PCK (software package)
  3. getDB,MDI_SAV_KER (kernel)
  4. getDB,MDI_SAV_MOD (kernel modules)
  5. getDB,MDI_SAV_FS (system)
  6. getDB,MDI_SAV_COPROC (coproc)
  7. getDB,MDI_SAV_SYS (system – includes XBOOT, COPROC,KER, MOD, FS)
  • Note1: These SMS are available since releases 2.1.12.1 and 2.3.6.6 (patches/93_versionning.patch).
  • Note2: Command MDI_SAV_PCK only retrieve the main release. Use get,jvm.compilation_date to know the sub- version.

Expected answers (samples)

  1. MDI_SAV_XBOOT
    2.3.6.15 → DB:get:MDI_SAV_XBOOT=X-boot 0.0.0-r0 (svn r606)#
  2. MDI_SAV_PCK
    2.3.6.15 → DB:get:MDI_SAV_PCK=C4C-X4-C4CBoard-Release-2.3.6#
  3. MDI_SAV_KER
    2.3.6.15 → DB:get:MDI_SAV_KER=Kernel 0.0.0-r0 (svn r1222)#
  4. MDI_SAV_KER
    2.3.6.15 → DB:get:MDI_SAV_KER=Kernel 0.0.0-r0 (svn r1222)#
  5. MDI_SAV_SYS
    2.3.6.15 → DB:get:MDI_SAV_SYS=C11-A9-Xr606-Kr1222-Mr1222-Fr643#
  6. MDI_SAV_FS
    2.3.6.15 → DB:get:MDI_SAV_FS=Root FS 0.0.0-r0 (svn r643)#
  7. MDI_SAV_COPROC
    2.3.6.15 → DB:get:MDI_SAV_COPROC=11 _ 9#

SMS Administration

The commands below may be prefixed by ’ @ 1@’ or ‘@ 2@’ on two devices configurations.
‘@ 1@’ prefixed SMS will only be processed by the modem equipped device.
‘@ 2@’ prefixed SMS will only be processed by the other device.
If no prefix is specified, both devices will process the command.

Reset

  • Action
    Resets the device.
  • Return value
    None.

Rupd

  • Action
    Starts a remote update.
    First parameter is ‘rupd’, then the ‘login’, then the ‘server URL’, then the ‘server port’ and finally the ‘path’.
  • Return value
    A SMS to the sender that gives the status.
  • Example in
    rupd,testLogin,mobile-devices.dnsalias.com,6667,testDirectory
  • Example out
    Remote update started

Iupd

  • Action
    Gets the remote update status.
  • Return value
    A SMS to the sender with the current status.
  • Example in
    iupd
  • Example out
    Update finished

Supd

  • Action
    Stops remote update.
  • Return value
    None.
  • Example in
    supd

Restore

  • Action
    Restore to default some software part.
    First parameter is ‘restore’, then the part to restore.
    1. pdm, erase all the PDM ;
    2. db, erase the DB ;
    3. user, erase the user component configuration ;
    4. write, resets configuration and remote DB ;
    5. all, all of the above.
  • Return value
    None
  • Example in
    restore,all

Package

  • Action
    Fetch package production information.
  • Return value
    Returns a SMS with production package informations.
    Also tells about the updates done to the device :
    C : coproc update
    B : Bootloader update
    K : Kernel update
    R : Root FS update
    J : JVM update
    M : Core software update
    U : User software update.
    It returns ‘pck unknown’ if it was not a regualar package and had no update done.
  • Example in
    package
  • Example out
    MDI_PCK2007081201MCCJKUUU

Set

  • Action
    Set one or many config parameter.
    First parameter is ‘set’, then the component name point the parameter,then the value.
    If you need to set an array, add bracket index bracket after the parameter name, before the coma value.
    To handle multiple parameters just add ‘#’ to the end of the value and the new parameter.

Format Regexp: set,cpn.param(L_BRACKET INDEX R_BRACKET)?(,VALUE)?( #cpn.param(L_BRACKET INDEX R_BRACKET)?(,VALUE)? )*

  • Return value
    On success “CNF:set:cpn.param(L_BRACKET INDEX R_BRACKET)?=VALUE#(cpn.param(L_BRACKET INDEX R_BRACKET)?=VALUE#)*”.
    On error, returns “Unable to set config value” or when updating multiparam “CNF:set:(cpn.param(L_BRACKET INDEX R_BRACKET)?=VALUE#)*” followed by
    • “Unable to find cpn.param(L_BRACKET INDEX R_BRACKET)?=VALUE”
    • “Unable to set cpn.param(L_BRACKET INDEX R_BRACKET)?=VALUE”
  • Example in
    set,modem.cnfapn,internet (update one parameter)
    set,modem.cnfapn,internet#geoFencing.active,1 (update multi Parameter)
  • Example out
    CNF:set:modem.cnfapn=internet#
    CNF:set:modem.cnfapn=internet#geoFencing.active=1#

Get

  • Action
    Fecthes a config parameter value.
    First parameter is ‘get’, then the component name point the parameter to fetch. If you need to fetch an array, add bracket index bracket after the parameter name.
  • Return value
    A SMS with the value.
    On error, returns “Unable to fetch config value”.
  • Example in
    get,modem.cnfapn
    get,modem.cnfapn#geoFencing.active
  • Example out
    CNF:get:modem.cnfapn=internet#
    CNF:get:modem.cnfapn=internet#geoFencing.active=1#

GpsSwitchAntenna

  • Action
    Switch the antenna source for GPS in runtime until next reset.
    The first parameter is ‘gpsSwitchAntenna’, the second the desired source.
    ‘0’ is for internal antenna source, and ‘1’ is for external source.
  • Return value
    The status of the antenna.
    On error, returns “Unable to switch antenna”.
  • Example in
    gpsSwitchAntenna,0
  • Example out
    switched GPS antenna source to external

ApnSet

  • Action
    Changes immediately and save the new modem APN, then resets the device.
  • Return value
    On success, returns CNF:set:modem.cnfapn=value and resets.
    On error, returns “Unable to set config value” and abort reset.
  • Example in
    apnSet,internet
  • Example out
    CNF:set:modem.cnfapn=test.com

SetDB

  • Action
    Sets one or many DB parameter.
    First parameter is ‘setDB’, then the parameter, then the value.
    You can add parameters by adding # character.
    Regexp Format: setDB,param(,value)?(#param(,value)?)*
  • Return value
    On success “DB:set:param=value#”.
    On error, returns “Unable to set DB value”.
    or when updating multiparam “DB:set:(param=value#)*” followed with
    - “Unable to getKey param”
    - “Unable to set param”
  • Example in
    setDB,DB_NAME,DB_VALUE (update one parameter)
    setDB,DB_NAME1,DB_VALUE1#DB_NAME2,DB_VALUE2 (update multi parameter)
  • Example out
    DB:set:DB_NAME=DB_VALUE#
    DB:set:DB_NAME1=DB_VALUE1#DB_NAME2=DB_VALUE2#

GetDB

  • Action
    Fetches one or many DB parameter value.
    First parameter is ‘getDB’, then the DBNAME to fetch.
    To handle multiple parameters just add ‘#’ to the end of DBNAME, and add the new DBNAME wanted.
  • Return value
    A SMS with the value.
    On error, returns “Unable to fetch DB value”.
  • Example in
    getDB,DBNAME
    getDB,DBNAME1#DBNAME2
  • Example out
    DB:get:DBNAME=DBVALUE#
    DB:get:DBNAME1=DBVALUE1#DBNAME2=DBVALUE2#

GetIOS

  • Action
    Fetches the inputs and outputs states.
  • Return value
    A SMS with the value.
    ‘0’ is for ‘false’, ‘1’ is for ‘true’ and ‘-1’ for error.
    1. IG is ignition status ;
    2. AL is for alarm ;
    3. I1 is for input 1 ;
    4. I2 is for input 2 ;
    5. I3 is for input 3 ;
    6. O1 is for output 1 ;
    7. O2 is for output 2.
      On errors, returns unable to fetch ios state.
  • Example in
    getIOS
  • Example out
    IOS,IG:1,AL:1,I1:1,I2:1,I3:1,O1:0,O2:0

Seto

  • Action
    Sets an output status.
    First parameter is ‘setO’, then the output (‘1’ or ‘2’), then the value (‘0’ for ‘false’ or ‘1’ for ‘true’).
    On error, returns “Unable to set output”.
  • Return value
    None
  • Example in
    setO,1,0

ModemStats

  • Action
    Return modem statistics.
    Statistic description
    PC : PPP Connection
    PF : PPP Failed
    PD : PPP Deconnection
    GC : GSM data connection
    GF : GSM data failed
    GD : GSM data deconnection
    R : Modem hard reset
    The first value is value since boot, the second value is the total value.
  • Return value
    A SMS with statistics information.
    On error, returns “Unable to fetch modem stats”.
  • Example in
    modemStats
  • Example out
    PC=2|2,PF=1|1,PD=1|1,GC=0|0,GF=0|0,GD=0|0,R=0|0

ModemStateMachine

  • Action
    Return modem state machine.
    State description
    S : Library status (1:Init, 2:Runnig, 3:Stopping, 4:Stopped)
    M : Modem status (1:On, 2:Off, 3:Starting, 4:Stopping)
    TM : Transfert mode type (1:PPP, 2:GSM data, 3:None)
    P : PPP status (1:On, 2:Off, 3:Starting, 4:Stopping, 5:Cancelling)
    PN : PPP needed (1:Needed, 2:Not needed)
    G : GSM data status (1:On, 2:Off, 3:Starting, 4:Stopping, 5:Failed, 6:Terminated, 7:Terminating)
    MX : Multiplex status (1:On, 2:Off)
    MP : Modem power (1:Down, 2:Init, 3:Run)
    D : Dial status (1:Off, 2:On, 3:Answering)
    T : Transfert status (1:Off, 2:On, 3:Answering)
    H : HFK status (1:Off, 2:Ringing, 3:Answering, 4:Terminating, 5:Calling, 6:On)
    C : CREG status (1: Not reg no search, 2:Registered, 3:Not reg search, 4:Denied, 5:Unknown, 6:Roaming, 7:Switching state)
    CG : CGREG status (1:Detach not available, 2:Attach available, 3:Detach available, 4:Attaching, 5:Switching state)
    CS : CSQ level (0:0-99, 1:1-11, 2:11-18, 3:18-25, 4:25-32)
    S : SIM status (1:Init, 2:Ready, 3:PIN, 4:PUK, 5:PIN2, 6:PUK2, 7:PHSIM, 8:NETSIM, 9:Absent)
    N : Network state (1:Init, 2:Ready, 3:Down, 4:Down_112, 5:Retry, 6:Luf_112, 7:SelFail_112, 8:Error, 9:Switching state)
    CP : Phone activity (1:Ready, 2:Unvailable, 3:Unknown, 4:Ready, 5:Call, 6:Asleep)
    SM : SMS to send status (1:Some, 2:None, 3:Sending)
  • Return value
    A SMS with state machine information.
    On error, returns “Unable to fetch modem state machine”.
  • Example in
    modemStateMachine
  • Example out
    S=2,M=1,TM=1,P=1,PN=1,G=2,MX=1,MP=2,D=1,T=2,C=2,CG=2,CS=2,S=2,N=2,CP=1,SM=2

Version

  • Action
    Fecthes a component version.
    Put the component path, if it is not found, we will try with the prefix ‘com.’ then with the prefix ‘com.mdi.’.
    On error, returns “Unable to fetch version”.
  • Return value
    A SMS with the value.
    On error, returns “Unable to fetch DB value”.
  • Example in
    version,drivers.modem
  • Example out
    Version:drivers.modem:257r-480

Status

  • Action
    Check the software status.
  • Return value
    Returns an sms to the sender.
    The sms starts with the keyword “status”.
    Each information is separated by a coma ‘,’.
    1. IMEI_SerialNumber ;
    2. longitude ;
    3. latitude ;
    4. Uptime in seconds ;
    5. Modem RSSI ;
    6. GPRS connexion status (‘G’ connected/‘g’ not connected) ;
    7. PPP connexion status (‘P’ connected/‘p’ not connected) ;
    8. Modem activation status (‘M’ modem is on/ ‘m’ modem is off) ;
    9. Boot reason code ;
    10. Watchdog code ;
    11. Number of viewed satellites ;
    12. GPS status (‘G’ GPS is on/‘g’ GPS is off) ;
  • Example in
    status
  • Example out
    status,35000000000000,000.00000,000.00000,U471000,C99,G,P,M,b,R 15,w,S11,G

Network reset

  • Action
    Resets the network monitor counters.
    On error, returns “Unable to do network monitor reset.”
  • Return value
    Sms “Net stats, reset done”
    On error, returns “Unable to fetch DB value”.
  • Example in
    netReset
  • Example out
    Net stats, reset done.

Network status

  • Action
    Fetches the network monitor counters.
  • Return value
    Sms “Net stats, rx:%d, tx:%d”
    On error, returns “Unable to fetch network stats”.
  • Example in
    netStats
  • Example out
    Net stats, rx:124, tx:173

Network dry status

  • Action
    Fetches the dry network monitor counters (since last boot).
  • Return value
    Sms “Net dry stats, rx:%d, tx:%d”
    On error, returns “Unable to fetch dry network stats”.
  • Example in
    netDryStats
  • Example out
    Net dry stats, rx:124, tx:173

ModemSMH

  • Action
    Fetches the modem state machine history.
    Then send it to the remote server in TCP.
  • Return value
    A SMS with the acknowledge of the execution of the command.
    On error, returns “Unable to run command”.
  • Example in
    modemSMH
  • Example out
    ModemSMH, command run

ModemSMH,server,port

  • Action
    Fetches the modem state machine history.
    Then send it to the remote server in TCP.
  • Return value
    A SMS acknowledging the command’s excecution.
    You need to specify the server URL and the connexion port.
    On error, returns “Unable to run command”.
  • Example in
    modemSMH,192.168.0.1,7654
  • Example out
    ModemSMH, command run

PdmStats

  • Action
    Fetches the pdm size statistics, can specify an argument to ask only for a specific pdm file.
  • Return value
    On success, returns “PdmStat,X:XSize,Z:ZSize”
    Where X and Z are two different pdm.
    On error, returns “Unable to fetch pdm stats”.
  • Example in
    pdmStats
  • Example out
    PdmStats,tracking:0,smsClient-criticalCommandManager:0,smsFile:0,smsClientsFile:0,smsClient-j$commandManager$0:0

GpsStats

  • Action
    Get information about the GPS and its driver.
  • Return value
    On success, returns GpsStat:GPS Power Status,Source:Antenna Source, synchroRTC:RTC synchronisation satus,lastFrame:time in seconds since EPOCH when we received last NMEA Frame,curReset:number of driver resets since last boot, totReset:number of driver resets since first boot.
    On error, returns “Unable to fetch gps stats”.
  • Example in
    gpsStats

SendNow

  • Action
    If dataEmitter is enabled, then ask it to emit right away.
  • Return value
    None.
  • Example in
    SENDNOW

SysVersion

  • Action
    Fetches the versions of the system modules..
    The categories are semi-column-separated, while the fields inside are comma-separated.
    • hardware: serial number of the board, modem firmware version, gps firmware version.
    • system: bootloader, kernel, modules, rootfs, coproc, [avr
  • Return value
    A SMS with the versions
  • Example in
    sysVersions
  • Example out
    VERSION:

GetOdometer

  • Action
    Get the gps odometer current value.
  • Return value
    On error, returns “Unable to get gpsOdometer value”.
  • Example in
    getOdo
  • Example out
    “odoValue,0,0”

SetOdometer

  • Action
    Set the gps odometer current value.
    Set partial odometer in meters, set full odometer in meters.
    If full odometer is not set or negative, it won’t be modified.
  • Return value
    On error, returns “Unable to set gpsOdometer value”.
  • Example in
    setOdo,0,0
  • Example out
    “odoValue,0,0”

Relay status

  • Action
    If RelayControl is enabled, then fetches the status of the controled output.
  • Return value
    Sends an SMS to the sender with the status.
  • Example in
    relay,status,mdi
  • Example out
    Status: Blocked

Relay block

  • Action
    If RelayControl is enabled, then blocks the output if needed.
  • Return value
    NONE.
  • Example in
    relay,block,mdi

Relay unblock

  • Action
    If RelayControl is enabled, then unblocks the output if needed.
  • Return value
    NONE.
  • Example in
    relay,unblock,mdi