CellularHub
1 CellularHub.getState
Get Hub's State
Param | Value | Desc |
---|---|---|
method | CellularHub.getState | Get Hub's State |
targetDevice | <String,Necessary> | DeviceId of the Hub you use; |
token | <String,Necessary> | Net token of the Hub you use; |
Param | Value | Desc |
---|---|---|
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
Code | Description |
---|---|
0 | Not registered, ME is not currently searching a new operator to register to. |
1 | Registered, home network. |
2 | Not registered, but ME is currently searching a new operator to register to. |
3 | Registration denied. |
4 | Unknown |
5 | Registered, roaming. |
6 | Registered for "SMS only", home network (applicable only when E-UTRAN) |
2.2 Code Map Of Battery State
Code | Description |
---|---|
0 | No battery connected |
1 | The battery is powering the hub |
2 | The battery is charging |
3 | The battery is standing by |
4 | Battery 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
Param | Value | Desc |
---|---|---|
method | CellularHub.scanWiFiList | Set Hub's Wi-Fi Info |
targetDevice | <String,Necessary> | DeviceId of the Hub you use; |
token | <String,Necessary> | token of the Hub you use; |
Param | Value | Desc |
---|---|---|
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
Code | Description |
---|---|
none | No Encryption |
wep | WEP Encryption |
psk | WPA-PSK |
psk2 | WPA2-PSK |
psk-mixed | WPA-PSK/WPA2-PSK Mixed Mode |
unknown | Unknown Encryption |
4 CellularHub.setWiFi
Set hub's WiFi Info when it is online. Please check this to setup WiFi when hub is offline.
Param | Value | Desc |
---|---|---|
method | CellularHub.setWiFi | Set 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; |
Param | Value | Desc |
---|
5 CellularHub.resetCellular
Reset cellular module
Param | Value | Desc |
---|---|---|
method | CellularHub.resetCellular | Reset cellular module |
targetDevice | <String,Necessary> | DeviceId of the Hub you use; |
token | <String,Necessary> | token of the Hub you use; |
Param | Value | Desc |
---|