USB-C
Note
This is an additional feature intended for making work of installation professionals easier.
It is not intended to be used by end customers.
All gateways are equipped with a USB-C diagnostic port.
Description
- Gateway`s hardware is designed to work both as USB HOST and DEVICE. Currently only the DEVICE option and CDC class are supported.
- Communication with the device is handled using text commands. Command is processed after receiving LF or/and CR character. Receiving ETX (Ctrl+C) character deletes previously received characters.
- Commands' arguments are separated using SPACE character. Arguments can be interpreted as subcommands, INT (integers) or STR (strings), depending on the command.
Authorization
There are 4 authorization levels:
Level | Description | Commands |
---|---|---|
0 | Default level. All the commands work in read-only mode | APN, AUTH, DHCP, HELP, IFCONFIG, IFSTATUS, INFO, INTERFACE, LIMITS, REBOOT, RTC, SERIAL, TZ, UID, UPTIME, WDS, VSN |
1 | Write permission to most of the level 0 commands | - |
2 | Admin level | - |
3 | Factory level | - |
Authorization level can be checked and changed using AUTH command.
Higher authorization levels have all the benefits of the lower ones.
Sending a command that is not supported for current auth level will cause the device to repond with an ERROR.
Commands
APN
Allows reading and writing APN CONFIG.
APN [apn] [username] [password]
Arguments:
- none - returns current APN CONFIG value
apn
- (STR) Access Point Name to be saved in APN CONFIGusername
- (STR) username to be saved in APN CONFIGpassword
- (STR) password to be saved in APN CONFIG
Notes
APN CONFIG may consist of either just an apn or an apn with both a username and a password. Providing username without a password will cause an ERROR.
-> APN
<- risims
-> APN internet
<- OK
-> APN internet internet internet
<- OK
-> APN
<- internet internet internet
AUTH
Handles authorization levels.
AUTH [level] [password]
Arguments:
- none - returns current authorization level
level
- (INT) authorization level to change topassword
- (STR) password for the desired authorization level
Notes
Changing authorization level to 0 doesn't require a password.
-> AUTH
<- 0
-> AUTH 1 AF6743
<- OK
-> AUTH
<- 1
-> AUTH 0
<- OK
DHCP
Allows reading and writing DHCP CONFIG.
DHCP [dhcp]
Arguments:
- none - returns current DHCP CONFIG
dhcp
- (INT) DHCP CONFIG to be saved
-> DHCP
<- 1
-> DHCP 0
<- OK
-> DHCP
<- 0
HELP
Returns all the commands available for the current authorization level.
-> HELP
<- APN
<- AUTH
<- CONFIG
<- DHCP
<- FACTORY
<- HELP
<- IFCONFIG
<- IFSTATUS
<- INFO
<- INTERFACE
<- LIMITS
<- REBOOT
<- RTC
<- SERIAL
<- SLOT
<- TZ
<- UID
<- UPDATE
<- UPTIME
<- WDS
<- VSN
IFCONFIG
Allows reading and writing IFCONFIG CONFIG.
IFCONFIG [addr] [netmask] [gateway] [dns]
Arguments:
- none - returns current ICONFIG CONFIG
addr
- (STR) IP address to be saved in IFCONFIG CONFIGnetmask
- (STR) network mask to be saved in IFCONFIG CONFIGgateway
- (STR) gateway address to be saved in IFCONFIG CONFIGdns
- (STR) DNS address to be saved in IFCONFIG CONFIG
Notes
ALL arguments are required when writing.
-> IFCONFIG
<- 192.168.0.15 255.255.255.0 192.168.0.1 8.8.8.8
-> IFCONFIG 192.168.0.3 255.255.255.0 192.168.0.1 8.8.4.4
<- OK
-> ICONFIG
<- 192.168.0.3 255.255.255.0 192.168.0.1 8.8.4.4
IFSTATUS
Returns IFSTATUS (read-only, currently used IP settings).
-> IFSTATUS
<- 192.168.0.5 255.255.255.0 192.168.0.1 8.8.8.8
INFO
Returns debug information about requested module.
INFO [subcmd]
Arguments:
subcmd
- subcommand
Subcommands:
BOOT
Returns information about device's hardware and firmware versions.
Output:
HW
- hardware versionBOOT
- bootloader versionACTIVE
- currently active SLOTSX
- SLOT X information (status, version, size, CRC)
-> INFO BOOT
<- HW: 1
<- BOOT: 1
<- ACTIVE: S1
<- S0: 1,"NG-0000",102400,2863311530
<- S1: 1,"NG-1000",204800,3149642683
<- S2: 0,"",0,0
CONN
Returns connection with server status.
Output:
ONLINE
- 0 - not yet connected, 1 - connectedINTERFACE
- 0 - not yet connected, 1 - ETH, 2 - GSMFRAMES
- number of frames exchanged with the server since the last connectionCONN
- last connection timestamp in msCOMM
- last communication (frame) timestamp in msRETRY
- number of failed connection attempts (0 if connected)
-> INFO CONN
<- ONLINE: 1
<- INTERFACE: 2
<- FRAMES: 5
<- CONN: 4050
<- COMM: 160850
<- RETRY: 0
GSM
Returns information about GSM network.
Output:
CREG
- 0 - not registered and not currently searching, 1 - registered (home network), 2 - not registered but currently searching, 3 - registration denied, 4 - unknown, 5 - registered (roaming)PDP
- 0 - PDP context not activated, 1 - PDP context activatedAPN
- APN currently in useMCC
- Mobile Country CodeMNC
- Mobile Network CodeRSSI
- signal strength in dBmLAC
- Location Area Code (hexadecimal string)CELL
- cell number (hexadecimal string)
-> INFO GSM
<- CREG: 1
<- PDP: 1
<- APN: "internet"
<- MCC: 260
<- MNC: 3
<- RSSI: -63
<- LAC: E29A
<- CELL: A45F
FLASH
Returns information about external FLASH (XFLASH) and filesystem memory.
Output:
CHIPS
- number of detected XFLASH chipsSIZE
- total XFLASH memory size in bytesFREE
- free filesystem size in bytes
-> INFO FLASH
<- CHIPS: 2
<- SIZE: 16777216
<- FREE: 16770304
MODEM
Returns information about detected GSM modem and SIM card.
Output:
INIT
- 0 - not yet initialized, 1 - initializedTYPE
- 1 - GE310, 2 - ME310G1-WW, 3 - ME310G1-WWVIMEI
- modem's IMEI numberVSN
- modem's firmware versionCCID
- SIM card's ICCID number
-> INFO MODEM
<- INIT: 1
<- TYPE: 1
<- IMEI: 352539100029223
<- VSN: 35.00.002-B002
<- CCID: 8948031952034356854
RESET
Returns information about device's resets.
Output:
CAUSE
- 0 - unknown, 1 - power-on, 2 - software, 3 - watchdogTIME
- timestamp of the last reset in seconds from 2000-01-01 00:00:00COUNT
- number of resets since the last power-onCRITICAL
- number of critical resetrs since the last power-on
-> INFO RESET
<- CAUSE: 2
<- TIME: 677075242
<- COUNT: 5
<- CRITICAL: 0
INTERFACE
Allows reading and writing INTERFACE CONFIG.
INTERFACE [interface]
Arguments:
- none - returns current INTERFACE CONFIG value
interface
- (INT) INTERFACE CONFIG to be saved
-> INTERFACE
<- 0
-> INTERFACE 2
<- OK
-> INTERFACE
<- 2
REBOOT
Causes a device software reset.
-> REBOOT
<- OK
RTC
Handles Real-Time-Clock.
Arguments:
- none - returns current RTC date and time.
date
- (STR) date to be set (format: YYYY-MM-DD)time
- (STR) time to be set (format: HH:MM:SS)
Notes
Both arguments are required when writing.
-> RTC
<- 2000-01-01 01:00:00
-> RTC 2021-06-02 15:30:00
<- OK
-> RTC
<- 2021-06-02 15:30:00
TZ
Allows reading and writing TZ CONFIG.
TZ [tz]
Arguments:
- none - returns current TZ CONFIG
tz
- (INT) TZ CONFIG to be saved
-> TZ
<- 0
-> TZ -2
<- OK
-> TZ
<- -2
UID
Returns the device's Unique ID in NG format (read-only)
-> UID
<- Q9415390200350054
UPTIME
Returns device's running time in ms.
-> UPTIME
<- 250960
WDS
Allows reading and writing WDS CONFIG.
WDS [wds]
Arguments:
- none - returns current WDS CONFIG value
wds
- (INT) WDS CONFIG to be saved
-> WDS
<- 2
-> WDS 0
<- OK
-> WDS
<- 0
VSN
Returns the firmware version of currently active SLOT (read-only)
-> VSN
<- NG-1000