Geode GNS3 / GNS2 battery gauge commands

3 Sep 2024

You can use the Geode Connect's terminal screen to send messages relating to the battery. The messages detailed below are valid for the Geode GNS2 and GNS3 models. The battery message requires the GGA message to be enabled in order to report a correct time value in the battery message.

Note: All messages must be entered in ALL CAPS. 

The messages below are specific to the Geode devices, which is noted by the initial elements $JRELAY and $PJSI (JRELAY= relays a custom message to other internal components, such as the battery controller, P=proprietary, and JSI=Juniper Systems).  

To check battery status and charge, use this command: 

$JRELAY,A,$PJSI,BAT

To check battery reporting interval, use the command:

$JRELAY,A,$PJSI,CFG,BAT

Battery Charge Level & Status

Use the following command to receive a report of the battery’s charge level and status:
$JRELAY,A,$PJSI,BAT
The elements of this message are described in the following table.

Elements Description
$JRELAY Relays a custom message to other internal components, such as the battery controller
$PJSI Message ID
$ = message header character
P = proprietary sentences
JSI = Juniper Systems 
PORTx

Indicates the port where the message will be sent. Letters have the following meanings: 
A —Bluetooth
B—RS-232
U—USB

BAT Identifies the message as relating to the battery

 

The receiver’s response will be in a form similar to the following message: 

$PJSI,BAT,a,b,c,d*CC<CR><LF>

The elements of this message are described in the following table.
 

Elements Description
$PJSI Message ID
$ = message header character
P = proprietary sentences
JSI = Juniper Systems 
BAT Identifies the message as relating to the battery
a The time is given in UTC  in the form of HHMMSS.SS (hours, minutes, seconds)
b This number identifies which battery the following information applies to. The Geode’s battery is always 1. 
c The percentage of charge in the battery (0 – 100). 
d Status of the current battery reported in a number with the following meaning:
0—not present
 1—Charging
2—Discharging
3—Error condition
*CC Data checksum value
<CR><LF> These elements literally stand for carriage return and line feed. Together they mean that a new line will begin.

 

 As an example, a returned message might look like the following:

$JRELAY,A,$PJSI,BAT,082710.00,1,52,2*15

This example message tells that the custom Juniper Systems message was sent through serial port A at 8:25:10 UTC.  Battery 1 holds a 52% charge and is currently discharging. The data checksum value is *15.

Configure Battery Reporting Interval

Use the following message to adjust the battery reporting interval output refresh rate, i.e., the interval configuration command. 

$JRELAY,A,$PJSI,CFG,BAT,a

The elements of this command are described in the following table.
 

Elements Description
$JRELAY Relays a custom message to other internal components, such as the battery controller
PORTx

Indicates the port where the message will be sent.
Letters have the following meanings: 
A —Bluetooth
B—RS-232
U—USB

$PJSI Message ID
$ = message header character
P = proprietary sentences
JSI = Juniper Systems 
CFG Identifies the message as relating to configuration  
BAT Identifies the message as relating to the battery
a Enter a numeric value to set the update rate. Entering 0 will disable the battery reporting messages. Enter the following decimals to achieve the indicated reporting interval. 
1—update every 1 seconds
0.5—update every 2 seconds
.2—update every 5 seconds
0.1—update every 10 seconds
0.0667—update every 15 seconds
0.02—update every 50 seconds
0.01—update every 100 seconds  
0.0083—update every 120 seconds

 

As an example, a command message with element values follows: 

$JRELAY,A,$PJSI,CFG,BAT,1

This example shows that a custom Juniper Systems message was sent through serial port A to configure the battery to report every second.

Reviewed & Approved:  JF, BJ 3Sep2024