CE Register troubleshooting
A CE Keepalive request is like a friendly wave that a device called CE sends to show that it is still working and connected to a platform called hiCLOUDS. After the CE device is checked in and given a deviceId and authToken, it regularly sends out these waves to let everyone know it's OK and still doing its work.
This request serves multiple purposes, including the following:
- Monitoring whether the device is online or offline
- Triggering events for configuration updates
- Initiating firmware updates
- Sending status reports
Troubleshooting Steps
- Cloud
- UCI
- Run-Time
- Testing
Cloud Configuration verification
Keepalive Request & Response Storage
| File Path | Description |
|---|---|
/tmp/last_keepAlive_request.json | Stores the last keepalive request sent |
/tmp/last_keepAlive_response.json | Stores the last keepalive response received |
Q:1 Where can I see the last keepalive response?
Q:2 If you want to troubleshoot a connection issue, which file should you check first?
Q:3 Are these files auto overwritten?
UCI Configuration Verification
Verify Network Connectivity:
Make sure the CE device has a valid IP address, subnet mask, and gateway. Use the following command to check network configuration:
uci show network
The given one is just an example output; when this command is run, it will show something like this.
(Example Response):
root@Backup_node:~# uci show network
network.loopback=interface
network.loopback.device='lo'
network.loopback.proto='static'
network.loopback.ipaddr='127.0.0.1'
network.loopback.netmask='255.0.0.0'
network.@globals[0]=globals
network.@globals[0].packet_steering='1'
network.eth0=interface
network.eth0.device='eth0'
network.eth0.default_wan='1'
network.eth0.disabled='0'
network.eth0.proto='static'
network.eth0.ipaddr='172.20.10.8'
network.eth0.netmask='255.255.255.0'
network.eth0.dns='172.20.10.1'
network.eth3=interface
network.eth3.device='eth3'
network.eth3.proto='static'
network.eth3.netmask='255.255.255.0'
network.eth3.disabled='0'
network.eth3.ipaddr='172.30.1.1'
network.@rule[0]=rule
network.@rule[0].priority='901'
network.@rule[0].lookup='main'
network.wlm0=interface
network.wlm0.disabled='1'
network.wlm0.proto='3g'
network.wlm0.pppname='wlm0'
network.wlm0.device='ttyUSB0'
network.wlm0.apn='comgt'
network.wlm0.ipv6='0'
network.wlm0.delegate='0'
network.wlm0.metric='2'
network.wlm0.ip4table='2'
network.f85c71f21c3040bdb4abcd168fa8e900=route
network.f85c71f21c3040bdb4abcd168fa8e900.target='172.30.2.0'
network.f85c71f21c3040bdb4abcd168fa8e900.netmask='255.255.255.0'
network.f85c71f21c3040bdb4abcd168fa8e900.gateway='172.31.0.2'
network.f85c71f21c3040bdb4abcd168fa8e900.table='main'
network.f85c71f21c3040bdb4abcd168fa8e900.proto='static'
network.f85c71f21c3040bdb4abcd168fa8e900.metric='1'
network.f85c71f21c3040bdb4abcd168fa8e900.interface='br25'
network.1777530465de4eafada07376f1239abf=route
network.1777530465de4eafada07376f1239abf.target='172.30.1.0'
network.1777530465de4eafada07376f1239abf.netmask='255.255.255.0'
network.1777530465de4eafada07376f1239abf.gateway='172.31.0.1'
network.1777530465de4eafada07376f1239abf.table='main'
network.1777530465de4eafada07376f1239abf.proto='static'
network.1777530465de4eafada07376f1239abf.metric='1'
network.eth1=interface
network.eth1.proto='static'
network.eth1.device='eth1'
network.eth1.ipaddr='100.100.100.2'
network.eth1.netmask='255.255.255.0'
network.eth1.dns='172.20.10.1'
This output contains information about network settings such as IP address, netmask and DNS server for each interface pay particular attention to the interface used for WAN connectivity ( in this example, probably eth0). It must have a valid IP address and configured DNS server too. In any case, wrong network settings can block the access of the essential for accessing various networks. Ensure that the routes required to access the hiCloud server are properly configured.
Check hiCLOUDS Configuration:
The configuration on the CE device can be verified using the following command.
uci show hiclouds
The given one is just an example output; when this command is run, it will show something like this.
(Example Response):
root@Backup_node:~# uci show hiclouds
hiclouds.globals=hiclouds
hiclouds.globals.hub='hub.hi-clouds.com'
hiclouds.globals.uri='deviceApi/getEndpointUrl'
hiclouds.globals.request_timeout='30'
hiclouds.globals.machine_id='33b01673-94a7-343e-b403-8c47cabac692'
hiclouds.globals.router_id='08:00:27:82:fc:73'
hiclouds.globals.endpoint='dev.hi-clouds.com'
hiclouds.globals.device_id='677e6da4ab30043a8492148a'
hiclouds.globals.auth_token='eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiI2NzdlNmRhNGFiMzAwNDNhODQ5MjE0OGE6OmNlOjozM2IwMTY3My05NGE3LTM0M2UtYjQwMy04YzQ3Y2FiYWM2OTI6OjA4OjAwOjI3OjgyOmZjOjczIiwiaWF0IjoxNzM4NjcxOTg5LCJleHAiOjE3Mzg2NzU1ODl9.JU0WBSCzpCbS8PTPypXoCvjka01IKcuKVm54YJnPjtt9jUZdF_5fTyraDc3oirSh67ZzKU7MbYo7Osy84AmoeA'
hiclouds.register=hiclouds
hiclouds.register.interval='30'
hiclouds.register.uri='api/deviceApi/v1/devices/register'
hiclouds.status=hiclouds
hiclouds.status.keepalive_interval='10'
hiclouds.status.status_interval='30'
hiclouds.status.uri='api/deviceApi/v1/devices'
hiclouds.config=hiclouds
hiclouds.config.uri='api/deviceApi/v1/devices'
hiclouds.config.revision='64bd463d-f6ae-4cfc-b89d-c4d74b63a382'
hiclouds.edge=hiclouds_edge
hiclouds.edge.type='CE'
hiclouds.hiclouds=hiclouds
hiclouds.hiclouds.version='22.03.5'
hiclouds.hiclouds.build='b75'
root@Backup_node:~# uci show hiclouds
hiclouds.globals=hiclouds
hiclouds.globals.hub='hub.hi-clouds.com'
hiclouds.globals.uri='deviceApi/getEndpointUrl'
hiclouds.globals.request_timeout='30'
hiclouds.globals.machine_id='33b01673-94a7-343e-b403-8c47cabac692'
hiclouds.globals.router_id='08:00:27:82:fc:73'
hiclouds.globals.endpoint='dev.hi-clouds.com'
hiclouds.globals.device_id='677e6da4ab30043a8492148a'
hiclouds.globals.auth_token='eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiI2NzdlNmRhNGFiMzAwNDNhODQ5MjE0OGE6OmNlOjozM2IwMTY3My05NGE3LTM0M2UtYjQwMy04YzQ3Y2FiYWM2OTI6OjA4OjAwOjI3OjgyOmZjOjczIiwiaWF0IjoxNzM4NjcxOTg5LCJleHAiOjE3Mzg2NzU1ODl9.JU0WBSCzpCbS8PTPypXoCvjka01IKcuKVm54YJnPjtt9jUZdF_5fTyraDc3oirSh67ZzKU7MbYo7Osy84AmoeA'
hiclouds.register=hiclouds
hiclouds.register.interval='30'
hiclouds.register.uri='api/deviceApi/v1/devices/register'
hiclouds.status=hiclouds
hiclouds.status.keepalive_interval='10'
hiclouds.status.status_interval='30'
hiclouds.status.uri='api/deviceApi/v1/devices'
hiclouds.config=hiclouds
hiclouds.config.uri='api/deviceApi/v1/devices'
hiclouds.config.revision='64bd463d-f6ae-4cfc-b89d-c4d74b63a382'
hiclouds.edge=hiclouds_edge
hiclouds.edge.type='CE'
hiclouds.hiclouds=hiclouds
hiclouds.hiclouds.version='22.03.5'
hiclouds.hiclouds.build='b75'
This output displays the hiCLOUDS-related configurations, such as the hub address, endpoint, deviceId, authToken, and the keepalive_interval. Check whether the hub and endpoint are correct and if the authToken is valid and non-expired. The keepalive_interval specifies how often the device is set to send Keepalive requests. A very short interval may cause unnecessary overloading of the network, while a too big interval may cause the device to be determined as offline in case connectivity is temporarily lost
Q:1 How do I identify the WAN interface in the output?
Q:2 What happens if DNS is not configured properly?
Q:3 What does the uci show hiclouds command do?
Run Time Configuration Verification
CE Backend Process
Additionally, the CE device has a background service called KeepLive that is responsible for managing HiClouds communications. This is what keeps the device responsive to status checks as well as update triggers.
Managing the Keepalive Service
| Command | Description |
|---|---|
/etc/init.d/keepalive start | Starts the keepalive service |
/etc/init.d/keepalive stop | Stops the keepalive service |
/etc/init.d/keepalive status | Checks the status of the service |
- Keepalive Service Responsibilities
- Device Status Monitoring – Ensures the device remains connected and operational.
- Triggering Configuration & Firmware Updates – Detects updates and applies them accordingly.
Q:1 What issues can occur if Keepalive is misconfigured or stopped?
Q:2 How frequently should I verify the Keepalive service status?
Testing Verification
CE Registration Troubleshooting Workflow
When troubleshooting CE registration issues, follow these steps to systematically identify the problem:
-
Cloud Verification: After the CE device is registered in the cloud, verify its online status.
-
IP Address Verification: Check the IP address of the CE device using the uci show network. Ensure it has a valid IP address.
-
Network Connectivity Check: Test external network connectivity by pinging a reliable external IP address, such as Google's DNS server.
ping 8.8.8.8 -
Keepalive Last Response File Check: Inspect the content of the last keepalive response file to ensure proper communication.
CE KeepAlive Request Process
Before making a Keepalive request, the CE device produces a JSON file which includes required information like:
- MAC Address
- Machine ID
- Interface List This file is located at:
/tmp/last_keepAlive_request.json
The Keepalive request can be tested manually using the curl command by referencing this JSON file.
Manual Keepalive Request via cURL
Here is the main script that executes this request:
/usr/bin/hiclouds_keepalive.sh
Testing Keepalive Request Using cURL
A keepalive request can be checked manually using the CURL command. The body of the request should be modified as needed based on device specific details.
curl -k -H 'Content-Type: application/json' \
-H 'Authorization: Bearer <your_auth_token>' \
-d @/tmp/last_keepAlive_request.json \
https://dev.hi-clouds.com/api/deviceApi/v1/devices/<device_id>/status
- The authToken and deviceId are retrieved from
/tmp/last_register_response.json. - Without a valid authToken, the request will not be processed.
hiCLOUDS Keepalive API
The HICLOUDS platform has a special method (called POST API). When you want to send a message to these devices, you need to include important information such as their machine ID (a unique number that identifies them), their MAC address (another type of unique number), and the time the message was sent.
API Endpoint
https://<endpoint>/api/deviceApi/v1/devices/
or
https://dev.hi-clouds.com/api/deviceApi/v1/devices/
Request Body
{
"statusType": "keepAlive",
"deviceType": "CE",
"machineId": "60fb4479-c393-3398-836f-ef531e89c91f",
"macAddress": "08:00:27:95:a3:65",
"timestamp": 1678800330,
"config": {
"revisionId": "c9f41726-5907-4d88-9cc6-a6c474e3c487"
}
}
Response Body (No Updates Required)
{
"triggerEvent": {
"configUpdate": false,
"firmwareUpdate": false,
"sendStatus": false,
"commands": null
},
"httpCode": 200,
"errorCode": 0
}
Response Body (Configuration & Firmware Update Required)
{
"triggerEvent": {
"configUpdate": true,
"firmwareUpdate": true,
"sendStatus": false,
"commands": null
},
"httpCode": 200,
"errorCode": 0
}
If someone doesn't use a CE device, they won't get a special authentication token to talk to other devices.
Troubleshooting Keepalive File Errors
If HTTP-related errors occur in the keepalive file, follow these steps:
- Firstboot Reset: The firstboot -y command is used to reset the device's configuration to its factory defaults. This can resolve issues caused by corrupted or incorrect configurations.
Performing firstboot -y will erase all custom configurations.
firstboot -y
-
Reboot: After performing any significant configuration changes, especially after a firstboot reset, it is crucial to reboot the device to ensure all changes are properly applied and the system starts with the new configuration.
reboot now -
Hard Reset: As a last resort, if all software-based troubleshooting fails, perform a hardware reset of the CE device. Refer to the Rebbot Reset documentation for instructions on how to perform a hard reset.