Skip to content

save-nemo-org/NemoPi-DTU

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

65 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

NemoPi-DTU

NemoPi data transfer unit firmware of AIR780X CAT-1 Modem

Development environment

Hardware: Hezhou AIR780XX CAT-1 Modem based on EC618 silicon

Host operating system: Win10, Win11

Firmware flashing tool: Luatools_v2

Note: AIR780 uses a Microsoft defined COM PORT driver which availables in Windows 10. This driver only seems to work on native Window 10 machine. All COM PORTS can be recognised in Virtual Machine (VirtualBox), but the firmware flashing tool (Luatools_v2) cannot establish connection with the hardware in bootloader mode.

Development resource

API

SMS API

Due to the cost of outbound SMS and challenges in handling international mobile number, most of the SMS commands will not respond over SMS.

PING command is designed to return OK over SMS for functionality checking. Please use this API with care.

COMMAND ARGUMENT RETURN NOTE
PING N/A OK
REBOOT N/A N/A
CREDENTIALS URL N/A URL has to start with http:// or https://
OTA URL N/A URL has to start with http:// or https://, firmware has to be generated by luatools in .bin format

MQTT API

client_id <IMEI>
publish to buoys/<IMEI>/d2c/#
subscribe to buoys/<IMEI>/c2d/#

D2C Telemetry

Logon package on mqtt connect
  • endpoint: buoys/\<IMEI>/d2c/telemetry
  • msg_type: connection
  • schema:
    {
      "msg_type": "connect",
      "firmware": str,
      "ticks": int,
      "imei": str,
      "power_on_reason": [int, int, int],
      "version": "x.x.x"
    }
Sensor detection (once every boot up)
  • endpoint: buoys/\<IMEI>/d2c/telemetry
  • msg_type: detect
  • schema:
    {
      "msg_type": "detect",
      "sensors": [
        {
          "model": "DS18B20-LOGGER",
          "feature": { "ch2": true, "ch1": false },
          "address": 2,
          "interface": "rs485"
        }
      ]
    }
Sensor reading
  • endpoint: buoys/\<IMEI>/d2c/telemetry
  • msg_type: data
  • schema:
    {
      "msg_type": "data",
      "sensors": [
        {
          "model": "DS18B20-LOGGER",
          "interface": "rs485",
          "address": 2,
          "data": [
            {
              "channel": "ch1",
              "value": 1.234, // float or null
              "fault": "string (empty string when no fault detected)"
            },
            {
              "channel": "ch2",
              "value": null, // float or null
              "fault": "string (empty string when no fault detected)"
            }
          ]
        }
      ]
    }
Diagnosis info
  • endpoint: buoys/\<IMEI>/d2c/telemetry
  • msg_type: diagnosis
  • schema:
    {
      "msg_type": "diagnosis",
      "lat_lon": {
        "lon": float,
        "lat": float
      },
      "vbat": float,
      "cell": [<Tower Info Dict>, <Tower Info Dict>, ...]
    }

C2D Telemetry

Credentials
  • endpoint: buoys/\<IMEI>/c2d/cmd
  • msg_type: credentials
  • schema:
    {
      "msg_type": "credentials",
      "credentials": {
        "username": str,
        "password": str,
        "cert": str,
        "key": str,
      }
    }
  • response: device will reboot after applying the new credentials, server should expect a new logon message with new credentials
Config
  • endpoint: buoys/\<IMEI>/c2d/cmd
  • msg_type: config
  • schema:
    {
        "msg_type": "config",
        "config": {
            "read_interval_ms": float
        }
    }
  • response: device will reboot after applying the new config, server should expect a new logon message
Ota
  • endpoint: buoys/\<IMEI>/c2d/cmd
  • msg_type: config
  • schema:
    {
        "msg_type": "ota",
        # This needs to be the .bin file produced by luatools
        "url": "http:/xxxxx/xxx.bin"
    }
  • response: device will reboot after applying the new firmware, server should expect a new logon message
Reboot
  • endpoint: buoys/\<IMEI>/c2d/cmd
  • msg_type: config
  • schema:
    {
      "msg_type": "reboot"
    }
  • response: device will reboot immediately
PING
  • endpoint: buoys/\<IMEI>/c2d/cmd
  • msg_type: config
  • schema:
    {
      "msg_type": "ping"
    }
  • response:
    { "msg_type": "ping", "imei": "<IMEI>" }

About

NemoPi data transfer unit firmware of AIR780 CAT-1 Modem

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published