Hardware and Software Setup
Flashing Canvas firmware to MG100 with default firmware
Our latest Canvas device management firmware is open source and available on our Github. It can be used without being managed by Canvas, and integrates both LWM2M and MQTT support in the same firmware package.
The following guide contains instructions for how to flash the MG100 from its default firmware to Canvas DM enabled firmware.
If you would like your device to utilize the Canvas DM web UI (based on EdgeIQ) please visit us at https://www.ezurio.com/contact.
Requirements:
- TC2030-CTX 6-Pin Cable for ARM Cortex - Normal Orientation
- USB-SWD 453-00062-K1
- https://www.ezurio.com/wireless-modules/programming-kits/usb-swd-programming-kit
- USB SWD Firmware must be latest version as demonstrated in section 12 of the following guide: Application Note - Using the USB-SWD Programmer (software v2.0)
- A PC workstation with Python installed MG100 Gateway
- A micro usb cable (with data lines) to connect with the MG100 UART.
Hardware Configuration
- Remove the 4 screws from the back side of the MG100.
- Remove the top clamshell, disconnect the NFC antenna, and place the screws in the top clamshell for safe keeping.
- Using the pins on the Tag-Connect cable, align and then attach the cable over J5 on the MG100.
- Attach the other end of the cable to the "Debug" header on the USB-SWD.
- Set "sense supply" switch to "out", and tty voltage switch to "1.8v".
Caution: setting this switch to 3.3v can damage the board
Software Configuration
- Download our latest firmware (at the time of this writing, v1.1.0):
- https://github.com/CanvasDM/ble_gateway_dm_firmware_manifest/releases/
- Select the file conaining the string "mg100" and the protocall you would like to use (MQTT, LWM2M, or None).
- Extract the .zip file on your workstation, locate the file with name ending in "_full_image.hex"
- Install pyocd: https://pyocd.io/docs/installing.html
Flashing Firmware:
With pyocd and the firmware installed on your workstation, switch the gateway power switch to the ON position, open a terminal, and execute the following command:
pyocd flash <path_to_hex> -e chip -t nrf52840 for example:
pyocd flash 480-00043-R1.1.0.1676051627_mqtt_0cc2acd8_-mg100-_full_image.hex -e chip -t nrf52840 Verify:
With the flashing process completed, connect to the UART of the MG100 using your prefered terminal emulator. Run the command "attr show" for details of the device's status.
Device Parameter List
GA1 Device parameter list
The following parameters are supported in the GA1 firmware release and are common to all firmware variants.
Non-volatile parameters
The following parameters are modifiable and saved to non-volatile memory.
| Name | id | type | min / min length | max / max length | Default | Enumeration | Description |
|---|---|---|---|---|---|---|---|
| baud_rate | 8 | uint32_t | - | - | 115200 | - | Baud rate for console uart. Requires a reboot to take effect. |
| coap_mflt_proxy_route | 54 | string | - | 32 | "mflt" | - | Route used when publishing Memfault data to CoAP proxy. |
| device_id | 33 | string | 0 | 64 | - | - | Unique identifier for the device. When firmware boots, if the value is blank (the default value), the firmware will set a unique value for the device using BLE MAC address, IMEI, or some similar value. |
| disable_flow_control | 7 | bool | 0 | 1 | 0 | 0 : Flow Control Enabled 1 : Flow Control Disabled | When true flow control is disabled on the console UART. Requires a reboot to take effect. |
| dm_cnx_backoff_multi | 38 | float | 1.0 | 50.0 | 2.0 | - | When in backoff mode, this multiplier will be applied to dm_cnx_delay for each connection retry. |
| dm_cnx_backoff_retries | 39 | uint8_t | 1 | 255 | 5 | - | The number of times to retry a failed DM connection in backoff mode. |
| dm_cnx_delay | 29 | uint16_t | 0 | 600 | 0 | - | Delay (in seconds) before connecting to DM server. Write 0 to generate new randomized delay with value between (mdm_cnx_delay_minin, dm_cnx_delay_max). Read: time in seconds to delay before connecting. |
| dm_cnx_delay_max | 31 | uint16_t | 2 | 600 | 300 | - | Max delay (in seconds) before connecting to DM server. |
| dm_cnx_delay_min | 30 | uint16_t | 1 | 599 | 1 | - | Min delay (in seconds) before connecting to DM server. |
| dm_cnx_retries | 37 | uint8_t | 1 | 255 | 3 | - | The number of times to retry a failed DM connection before going into backoff mode. |
| dm_key_path | 45 | string | 1 | 32 | "/lfs1/enc/dm/key" | - | The path to the key store for DM authentication. |
| dm_trust_path | 44 | string | 1 | 32 | "/lfs1/dm/trust" | - | The path to the trust store for DM authentication. |
| dump_path | 3 | string | 1 | 32 | "/lfs1/attr_dump.txt" | - | The path used for attribute dump files. |
| factory_load_path | 32 | string | 1 | 32 | "/lfs1/enc/factory_load.txt" | - | Path for factory settings that can be restored with attribute load. |
| fs_trust_path | 46 | string | 1 | 32 | "/lfs1/fs/trust" | - | The path to the trust store for firmware and file service authentication. |
| fs_key_path | 47 | string | 1 | 32 | "/lfs1/enc/fs/key" | - | The path to the key store for firmware and file service authentication. |
| gw_smp_auth_req | 35 | bool | 0 | 1 | 0 | - | If true, the gateway will require peripherals to authenticate before sending SMP messages. |
| load_path | 4 | string | 0 | 32 | "/lfs1/enc/attr_load.txt" | - | Absolute file name for load parameters command. |
| log_on_boot | 6 | bool | 0 | 1 | 0 | 0 : Disabled 1 : Enabled | When set to false, logging output will be disabled when the firmware starts. |
| lte_apn | 64 | string | - | 64 | - | - | The LTE access point name. |
| lte_bands | 67 | string | 1 | 20 | - | - | Radio bands enabled in the LTE modem. |
| lte_log_lvl | 72 | enum | 0 | 4 | 2 | 0 : None 1 : Error 2 : Warning 3 : Info 4 : Debug | HL7800 driver log level. |
| lte_rat | 71 | enum | 0 | 1 | 0 | 0 : CAT M1 1 : CAT NB1 | Radio Access Technology. |
| lwm2m_bootstrap | 14 | bool | 0 | 1 | 0 | 0 : Disabled Bootstrap 1 : Enabled | Enables bootstrap functionality. |
| lwm2m_endpoint | 10 | string | 1 | 64 | "my_device" | - | Endpoint name to identify the device. |
| lwm2m_fup_proxy_srv | 27 | string | 11 | 255 | "coaps://coap-proxy.salticidae.net:5684" | - | Firmware update proxy server. |
| lwm2m_fw_ver | 19 | string | 1 | 32 | "0.0.0" | - | Device firmware version. |
| lwm2m_hw_ver | 23 | string | 1 | 32 | "0.0.0" | - | Device hardware version. |
| lwm2m_mfg | 16 | string | 1 | 32 | "Ezurio" | - | Device manufacturer. |
| lwm2m_mn | 17 | string | 1 | 32 | "model" | - | Device model number. |
| lwm2m_psk | 13 | uint8_t array | 16 | 16 | { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f } | - | Pre-shared key. |
| lwm2m_psk_id | 12 | string | 1 | 64 | "my_device" | - | PSK ID. |
| lwm2m_security | 11 | uint8_t | 0 | 4 | 3 | 0 : PSK 1 : RPK 2 : CERT 3 : None 4 : CERT EST | LwM2M Security mode. |
| lwm2m_server_url | 9 | string | 1 | 32 | "coap://leshan.eclipseprojects.io:5683" | - | Server URL to connect to. |
| lwm2m_short_id | 15 | uint16_t | 1 | 65534 | 1 | - | This identifier uniquely identifies each LwM2M Server configured for the LwM2M Client. This Resource MUST be set when the Bootstrap-Server Resource has a value of 'false'. |
| lwm2m_sn | 18 | string | 1 | 64 | "serial_number" | - | Device serial number. |
| lwm2m_sw_ver | 22 | string | 1 | 32 | "0.0.0" | - | Device software version. |
| memfault_transport | 52 | enum | 0 | 3 | 0 | 0 : None 1 : HTTP 2 : MQTT 3: COAP | Publish Memfault data using selected transport (so that it can be forwarded). |
| mqtt_memfault_topic | 53 | string | - | 255 | - | - | Topic for publishing Memfault data. |
| network_id_filter | 51 | uint16_t | - | - | 0 | - | If nonzero, then filter advertisements based on network ID. |
| p2p_key_path | 49 | string | 1 | 32 | "/lfs1/enc/p2p/key" | - | The path to the key store for peer-to-peer authentication. |
| p2p_trust_path | 48 | string | 1 | 32 | "/lfs1/p2p/trust" | - | The path to the trust store for peer-to-peer authentication. |
| shell_password | 40 | string | 4 | 32 | "zephyr" | - | Password to login and use the shell. |
| shell_session_timeout | 41 | uint8_t | 0 | 255 | 5 | - | Time before a login session will expire (in minutes). Set to 0 to disable. |
| smp_auth_req | 34 | bool | 0 | 1 | 0 | 0 : All SMP services available 1 : SMP authentication required before accessing any SMP services | If true, SMP authentication will be required before accessing any SMP services. If false, all SMP services are available regardless of authentication status. |
| smp_auth_timeout | 36 | uint32_t | 0 | 86400 | 300 | - | SMP authentication will time out after a lapse in SMP commands lasting this number of seconds. |
| store_memfault_data | 55 | bool | 0 | 1 | 0 | - | Flag to indicate whether memfault data should be stored to file or posted. |
| tel_key_path | 43 | string | 1 | 32 | "/lfs1/enc/tel/key" | - | The path to the key store for telemetry authentication. |
| tel_trust_path | 42 | string | 1 | 32 | "/lfs1/tel/trust" | - | The path to the trust store for telemetry authentication. |
Static Read-only parameters
The following parameters are read-only and do not change during runtime.
| Name | id | type | min / min length | max / max length | Default | Enumeration | Description |
|---|---|---|---|---|---|---|---|
| api_version | 1 | string | 6 | 11 | "1.1.1" | - | The API attribute version that the firmware supports. |
| bluetooth_address | 28 | string | 12 | 12 | - | - | Bluetooth address. |
| board | 5 | string | 1 | 64 | "my_board" | - | Zephyr board the firmware is built for. |
| firmware_version | 2 | string | 5 | 64 | "0.0.0+0" | - | Firmware Version. Format = Major.Minor.Fix+build. |
| ipv4_addr | 50 | string | - | 15 | - | - | Internet Protocol Version 4 address. |
| lte_iccid | 57 | string | - | 20 | - | - | Gateway SIM ICCID. |
| lte_imei | 56 | string | - | 15 | - | - | Gateway SIM IMEI. |
| lte_imsi | 58 | string | - | 15 | - | - | International Mobile Subscriber Identity. |
| lte_init_error | 63 | enum | -5 | 0 | 0 | 0 : None -1 : No Iface -2 : Iface Cfg -3 : DNS Cfg -4 : Modem -5 : Airplane | Initialization status of LTE driver. |
| lte_network_state | 61 | enum | 0 | 240 | 0 | 0 : Not Registered 1 : Home Network 2 : Searching 3 : Registration Denied 4 : Out Of Coverage 5 : Roaming 8 : Emergency 240 : Unable To Configure | LTE network state. |
| lte_sn | 59 | string | - | 14 | - | - | LTE serial number. |
| lte_startup_state | 62 | enum | 0 | 6 | 0 | 0 : Ready 1 : Waiting for Access Code 2 : SIM Not Present 3 : SIM Lock 4 : Unrecoverable Error 5 : Unknown 6 : Inactive SIM | Modem startup state. |
| lte_version | 60 | string | - | 29 | - | - | Firmware version of the LTE modem. |
| lwm2m_fup_pkg_name | 25 | string | 1 | 32 | my_firmware | - | Firmware update firmware package name. |
| lwm2m_fup_pkg_ver | 26 | string | 1 | 32 | "0.0.0" | - | Firmware update package version. |
| lwm2m_pwr_src | 20 | uint8_t | 0 | 7 | 1 | 0 : DC 1 : Internal Battery 2 : External Battery 3 : Fuel Cell 4 : POE 5 : USB 6 : AC 7 : Solar | Device power source. This attribute maps to LwM2M path 3/0/6/0. |
| param_path | 39 | string | 2 | 8 | "/ext" | - | Folder on file system used for Parse/Dump commands. |
Dynamic Read-only parameters
The following parameters are read-only and can change during runtime.
| Name | id | type | min / min length | max / max length | Default | Enumeration | Description |
|---|---|---|---|---|---|---|---|
| lte_active_bands | 68 | string | - | 20 | - | - | Radio bands in use by the LTE modem. |
| lte_data_total | 78 | uint32_t | - | - | 0 | - | Total number of socket (UDP and TCP) payload bytes. |
| lte_fup_status | 73 | enum | 0 | 8 | 0 | 0 : Idle 1 : Start 2 : WIP 3 : PAD 4 : Send EOT 5 : File Error 6 : Install 7 : Reboot Reconfig 8 : Complete | HL7800 firmware update status. |
| lte_operator_index | 69 | uint8_t | - | - | 255 | - | LTE Operator index. |
| lte_rsrp | 65 | int16_t | - | - | 0 | - | Reference Signals Receive Power (RSRP) in dBm. |
| lte_sinr | 66 | int16_t | - | - | 0 | - | Signal to Interference plus Noise Ratio (SINR) in dB. |
| lte_sleep_state | 70 | enum | 0 | 4 | 0 | 0 : Uninitialized 1 : Hibernate 2 : Awake 3 : Lite Hibernate 4 : Sleep | Sleep state of the driver. |
| lte_tcp_rx | 77 | uint32_t | - | - | 0 | - | Number of TCP RX payload bytes. |
| lte_tcp_tx | 76 | uint32_t | - | - | 0 | - | Number of TCP TX payload bytes. |
| lte_udp_rx | 75 | uint32_t | - | - | 0 | - | Number of UDP RX payload bytes. |
| lte_udp_tx | 74 | uint32_t | - | - | 0 | - | Number of UDP TX payload bytes. |
| lwm2m_batt_stat | 24 | uint8_t | 0 | 6 | 6 | 0 : Normal 1 : Charging 2 : Charging complete 3 : Damaged 4 : Low 5 : Not installed 6 : Unknown | Device battery status. |
| lwm2m_pwr_src_volt | 21 | int32_t | -600000 | 600000 | 0 | - | Device power source voltage. This attribute maps to LwM2M path 3/0/7/0. |
GA1 Device parameter list (MQTT variant specific)
The following parameters are supported in the GA1 firmware release and appear only in the MQTT firmware version.
Non-volatile parameters
The following parameters are modifiable and saved to non-volatile memory.
| Name | id | type | min / min length | max / max length | Default | Enumeration | Description |
|---|---|---|---|---|---|---|---|
| mqtt_ble_delimiter | 95 | string | - | 1 | - | - | String placed between data items. |
| mqtt_ble_enable | 92 | bool | 0 | 1 | 0 | - | Allow module to process advertisements and publishes. When going from disabled-to-enabled, credentials are loaded. |
| mqtt_ble_postfix | 96 | string | - | 15 | - | - | Postfix to advertisement string. |
| mqtt_ble_prefix | 94 | string | - | 63 | - | - | Prefix to publish string For example, add prefix to format data for an AWS Shadow (JSON). |
| mqtt_ble_quote | 97 | bool | 0 | 1 | 0 | - | Add quote characters around the advertisement data Allows JSON array of strings to be generated. |
| mqtt_ble_topic | 93 | string | - | 255 | - | - | Topic for publishing BLE advertisement data. |
| mqtt_clean_session | 91 | bool | 0 | 1 | 1 | - | If false, then allow persistent sessions. Not supported by all brokers. |
| mqtt_connect_on_request | 88 | bool | 0 | 1 | 1 | - | Try to load certs, resolve server, and connect when pub/sub is requested. |
| mqtt_id | 83 | string | - | 127 | - | - | Client ID used in MQTT connect. Server may limit this to 23 alpha-numeric characters. |
| mqtt_peer_verify | 86 | enum | 0 | 3 | 2 | 0 : None 1 : Optional 2 : Required 3 : Unset | Verify server. |
| mqtt_port | 82 | string | 3 | 4 | "8883" | - | Server host port. |
| mqtt_publish_qos | 85 | uint8_t | - | - | 1 | - | Quality of service. |
| mqtt_root_only | 90 | bool | 0 | 1 | 0 | - | Only load root certificate. |
| mqtt_subscribe_qos | 87 | uint8_t | - | - | 1 | - | Subscription quality of service. |
| mqtt_transport_secure | 89 | bool | 0 | 1 | 1 | - | If possible (CONFIG_MQTT_LIB_TLS defined), use TLS for transport. |
| mqtt_watchdog | 84 | uint32_t | - | - | 0 | - | Maximum time in seconds between successful MQTT publishes. Disabled when 0. |
Write-only non-volatile parameters
The following parameters are modifiable and saved to non-volatile memory and are write-only.
| Name | id | type | min / min length | max / max length | Default | Enumeration | Description |
|---|---|---|---|---|---|---|---|
| mqtt_user_name | 79 | string | - | 127 | - | - | Client user name in connect request. Not used if empty. |
| mqtt_password | 80 | string | - | 127 | - | - | Client password. Not used if empty. |
| mqtt_endpoint | 81 | string | - | 127 | - | - | Server host name. |
GA1 Device parameter list (LWM2M specific)
The following parameters are supported in the GA1 firmware release and are applicable only to the LWM2M firmware variant.
Non-volatile parameters
The following parameters are modifiable and saved to non-volatile memory.
| Name | id | type | min / min length | max / max length | Default | Enumeration | Description |
|---|---|---|---|---|---|---|---|
| lwm2m_telem_enable | 85 | bool | 0 | 1 | 0 | - | 0 - disable telemetry connection, 1 - enable. |
| lwm2m_telem_endpoint | 80 | string | 1 | 64 | "endpoint" | - | Endpoint name to identify the device. |
| lwm2m_telem_psk | 83 | uint8_t array | 16 | 16 | { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f } | - | Pre-shared key. |
| lwm2m_telem_psk_id | 82 | string | 1 | 64 | "my_device" | - | PSK ID. |
| lwm2m_telem_security | 81 | enum | 0 | 4 | 3 | 0 : PSK 1 : RPK 2 : CERT 3 : NO_SEC 4 : CERT_EST | LWM2M security mode. |
| lwm2m_telem_server_url | 79 | string | 11 | 255 | "coap://leshan.eclipseprojects.io:5683" | - | Server URL to connect to. |
| lwm2m_telem_short_id | 84 | uint16_t | 1 | 65534 | 2 | - | This identifier uniquely identifies each LwM2M Server configured for the LwM2M Client. This Resource MUST be set when the Bootstrap-Server Resource has a value of 'false'. |
/filters:background_color(white)/2024-11/MG100%20-%20Canvas1.png)