Skip to main content

CellularHub

1 CellularHub.getState

Get Hub's State

BDDP

ParamValueDesc
methodCellularHub.getStateGet Hub's State
targetDevice<String,Necessary>DeviceId of the Hub you use;
token<String,Necessary>Net token of the Hub you use;

BUDP

ParamValueDesc
data.version<String,Necessary>Hub's Version;
data.wifi.enable<boolean,Necessary>Is WiFi Connected;
data.wifi.ssid<String,Necessary>Current connected Wi-Fi;
data.wifi.ip<String,Necessary>Current ip of Wi-Fi;
data.wifi.gateway<String,Necessary>Current Gateway of Wi-Fi;
data.wifi.mask<String,Necessary>Current Subnet Mask of Wi-Fi
data.eth.enable<boolean,Necessary>Is Ethernet Connected
data.eth.ip<String,Necessary>Current ip of Ethernet;
data.eth.gateway<String,Necessary>Current ip of Ethernet;
data.eth.mask<String,Necessary>Current Gateway of Ethernet;
data.cellular.enable<boolean,Necessary>Is cellular network connected
data.cellular.module.enable<boolean,Necessary>Is cellular module running
data.cellular.module.mfr<String,Optional>Manufacturer of cellular module
data.cellular.module.model<String,Optional>Model of cellular module
data.cellular.module.ver<String,Optional>Firmware version of cellular module
data.cellular.module.imei<String,Optional>IMEI of cellular module
data.cellular.iccid<String,Necessary>Current ICCID of SIM card. Empty string means no SIM card detected. Note:YS1605 does not support hot-plug of SIM card
data.cellular.apn<String,Necessary>Current apn of cellular link. Empty string means no apn used
data.cellular.regState<String,Necessary>Registration State of current cellular network. ["none","registered","registering","denied","roaming","error"]
data.cellular.regStateCode<Integer,Necessary>Origin registration code from cellular module. Please check the Code Map Of Cellular Registration for detailed info
data.cellular.rssi<Integer,Necessary>RSSI of current cellular link; 99 means not known or not detectable
data.other.power.dc<Boolean,Necessary>True means DC power supply is connected
data.other.power.battery<Boolean,Necessary>True means battery is connected
data.other.power.batteryState<Boolean,Necessary>Current state of battery. Please check the Code Map Of Battery State for detailed info

2.1 Code Map Of Cellular Registration

CodeDescription
0Not registered, ME is not currently searching a new operator to register to.
1Registered, home network.
2Not registered, but ME is currently searching a new operator to register to.
3Registration denied.
4Unknown
5Registered, roaming.
6Registered for "SMS only", home network (applicable only when E-UTRAN)

2.2 Code Map Of Battery State

CodeDescription
0No battery connected
1The battery is powering the hub
2The battery is charging
3The battery is standing by
4Battery under maintenance. Note: The hub regularly maintains the battery to prolong the life of the battery

3 CellularHub.scanWiFiList

Search for available APs

Note:Searching for WiFi networks takes some time, please make the timeout for calling this interface greater than 8 seconds

BDDP

ParamValueDesc
methodCellularHub.scanWiFiListSet Hub's Wi-Fi Info
targetDevice<String,Necessary>DeviceId of the Hub you use;
token<String,Necessary>token of the Hub you use;

BUDP

ParamValueDesc
data.wifiList[*].ssid<String,Necessary>ESSID of ap;
data.wifiList[*].rssi<String,Necessary>RSSI of ap;
data.wifiList[*].encryption<String,Necessary>Encryption of ap; Please check the Code Map Of WiFi Encryption for detailed info

3.1 Code Map Of WiFi Encryption

CodeDescription
noneNo Encryption
wepWEP Encryption
pskWPA-PSK
psk2WPA2-PSK
psk-mixedWPA-PSK/WPA2-PSK Mixed Mode
unknownUnknown Encryption

4 CellularHub.setWiFi

Set hub's WiFi Info when it is online. Please check this to setup WiFi when hub is offline.

BDDP

ParamValueDesc
methodCellularHub.setWiFiSet Hub's Wi-Fi Info
targetDevice<String,Necessary>DeviceId of the Hub you use;
token<String,Necessary>token of the Hub you use;
params.ssid<String,Necessary>The Wi-Fi's SSID you want to connect;
params.password<String,Necessary>The Wi-Fi's Password you want to connect;
params.encryption<String,Necessary>Encryption of ap;

BUDP

ParamValueDesc

5 CellularHub.resetCellular

Reset cellular module

BDDP

ParamValueDesc
methodCellularHub.resetCellularReset cellular module
targetDevice<String,Necessary>DeviceId of the Hub you use;
token<String,Necessary>token of the Hub you use;

BUDP

ParamValueDesc