User Tools

Site Tools


wiki:usb_service

This is an old revision of the document!


USB interface

Introduction

A USB key service is available on the SPN gateway. It can be used to:

  • Configure the gateway.
  • Configure the end-devices fleet.
  • Receive frames from end-devices.
  • Debug / troubleshoot the gateway.

Instruction

In this page, “XXXXXXXX” represents the hardware serial number of the board (8 digits)(upper case)(see How to find the hardware serial number of the board?)

Create the USB folder structure

In order to activate the USB key features a USB folder structure must be respected. When all the features are available, the structure is:

Add the password file

On USB key root directory, create a file “spn/password/XXXXXXXX_password” which must contain “spn” user password.

Add the files

Depending on the feature that will be used, different files must be created/added in the folders. Refer to the USB features section to determine which file should be added in wich folder.

Plug the USB key

Once the folders, the feature specific files and the password files are created, the USB key can be plugged. During the execution of the USB key the led behaviour of the gateway is the following:

1) The red power LED is blinking during USB commands processing.
2) Once all commands are processed, the LED is kept switched on. The USB key can be removed.
3) Once the USB key is unplugged, the LED is switched off.

USB features

From firmware 2.0.3, all features are detailed both in the web interface and hereunder.

End-device fleet flow

/spn/end_device directory must be created and used for the end-device fleet commands.

Add end-device fleet

  • Create a CSV file XXXXXXXX_end_device_fleet.csv.
    • XXXXXXXX_end_device_fleet.csv: Syntax can be retrieved by downloading the template from the web interface or, it can be downloaded from the resources page.
  • Command triggered with a file add_fleet.
  • A file XXXXXXXX_add_fleet_processed_yy is created once command processed.
    • XXXXXXXX: gateway serial number in upper case.
    • yy: command status ok or ko.

Command add_fleet is processed if XXXXXXXX_add_fleet_processed_yy does not exist and each time the command file is edited. XXXXXXXX_end_device_fleet.csv will be erased once command processed.

Get end-device fleet

  • Command triggered with a file get_fleet.
  • A CSV file XXXXXXXX_end_device_fleet.csv is created once command processed.
  • A file XXXXXXXX_get_fleet_processed_yy is created once command processed.
    • XXXXXXXX: gateway serial number in upper case.
    • yy: command status ok or ko.

Command get_fleet is processed if XXXXXXXX_get_fleet_processed_yy does not exist and each time the command file is edited.

Delete end-device fleet

  • Command triggered with a file delete_fleet.
  • A file XXXXXXXX_delete_fleet_processed_yy is created once command processed.
    • XXXXXXXX: gateway serial number in upper case.
    • yy: command status ok or ko.

Command delete_fleet is processed if XXXXXXXX_delete_fleet_processed_yy does not exist and each time the command file is edited.

Gateway fleet flow

/spn/gateway directory must be created and used for the gateway fleet commands.

Add gateway fleet

  • Create a CSV file XXXXXXXX_gateway_fleet.csv.
    • XXXXXXXX_gateway_fleet.csv: Syntax can be retrieved by downloading the template from the web interface or, it can be downloaded from the resources page.
  • Command triggered with a file add_fleet.
  • A file XXXXXXXX_add_fleet_processed_yy is created once command processed.
    • XXXXXXXX: gateway serial number in upper case.
    • yy: command status ok or ko.

Command add_fleet is processed if XXXXXXXX_add_fleet_processed_yy does not exist and each time the command file is edited.

Get gateway fleet

  • Command triggered with a file get_fleet.
  • A CSV file XXXXXXXX_gateway_fleet.csv is created once command processed.
  • A file XXXXXXXX_get_fleet_processed_yy is created once command processed.
    • XXXXXXXX: gateway serial number in upper case.
    • yy: command status ok or ko.

Command get_fleet is processed if XXXXXXXX_get_fleet_processed_yy does not exist and each time the command file is edited. XXXXXXXX_gateway_fleet.csv will be erased once command processed.

Delete gateway fleet

  • Command triggered with a file delete_fleet.
  • A file XXXXXXXX_delete_fleet_processed_yy is created once command processed.
    • XXXXXXXX: gateway serial number in upper case.
    • yy: command status ok or ko.

Command delete_fleet is processed if XXXXXXXX_delete_fleet_processed_yy does not exist and each time the command file is edited.

Rx data flow

/spn/rx_data directory must be created and used for the Rx data commands.

Get Rx data

  • Command triggered with a file get_rx_data.
  • One or several files XXXXXXXX_rx_data_YYYYMMDDhhmmss.csv are retrieved once command processed.
  • A file XXXXXXXX_get_rx_data_processed_yy is created once command processed.
    • XXXXXXXX: gateway serial number in upper case.
    • yy: command status ok or ko.
    • YYYYMMDDhhmmss: UTC date and time of file creation.
      • YYYY: system year (zero padded, in [0000;9999]).
      • MM: system month (zero padded, in [01;12]).
      • DD: system day (zero padded, in [01;31]).
      • hh: system hour (zero padded, in [00;23]).
      • mm: system minute (zero padded, in [00;59]).
      • ss: system second (zero padded, in [00;59]).

Command get_rx_data is processed if XXXXXXXX_get_rx_data_processed_yy does not exist and each time the command file is edited.

Tx data flow

/spn/tx_data directory must be created and used for the Tx data commands.

Add Tx data

  • Create a CSV file XXXXXXXX_tx_data.csv.
    • XXXXXXXX_tx_data.csv: Syntax can be retrieved by downloading the template from the web interface or, it can be downloaded from the resources page.
  • Command triggered with a file add_tx_data.
  • A file XXXXXXXX_add_tx_data_processed_yy is created once command processed.
    • XXXXXXXX: gateway serial number in upper case.
    • yy: command status ok or ko.

Command add_tx_data is processed if XXXXXXXX_add_tx_data_processed_yy does not exist and each time the command file is edited.

Get Tx data

  • Command triggered with a file get_tx_data.
  • A CSV file XXXXXXXX_tx_data_YYYYMMDDhhmmss.csv is created once command processed.
  • A file XXXXXXXX_get_tx_data_processed_yy is created once command processed.
    • XXXXXXXX: gateway serial number in upper case.
    • yy: command status ok or ko.
    • YYYYMMDDhhmmss: UTC date and time of file creation.
      • YYYY: system year (zero padded, in [0000;9999]).
      • MM: system month (zero padded, in [01;12]).
      • DD: system day (zero padded, in [01;31]).
      • hh: system hour (zero padded, in [00;23]).
      • mm: system minute (zero padded, in [00;59]).
      • ss: system second (zero padded, in [00;59]).

Command get_tx_data is processed if XXXXXXXX_get_tx_data_processed_yy does not exist and each time the command file is edited.

Configuration flow

/spn/configuration directory must be created and used for the configuration commands.

Set configuration

  • Create a JSON file XXXXXXXX_data.json.
    • XXXXXXXX_data.json: Syntax can be retrieved by downloading the template from the web interface or, it can be downloaded from the resources page.
  • Command triggered with a file set_configuration.
  • A file XXXXXXXX_set_configuration_processed_yy is created once command processed.
    • XXXXXXXX: gateway serial number in upper case.
    • yy: command status ok or ko.

Command set_configuration is processed if XXXXXXXX_set_configuration_yy does not exist and each time the command file is edited.

Get configuration

  • Command triggered with a file get_configuration.
  • A JSON file XXXXXXXX_data.json is created once command processed.
  • A file XXXXXXXX_get_configuration_processed_yy is created once command processed.
    • XXXXXXXX: gateway serial number in upper case.
    • yy: command status ok or ko.

Command get_configuration is processed if XXXXXXXX_get_configuration_yy does not exist and each time the command file is edited. XXXXXXXX_data.json will be erased once command processed.

Reset configuration

  • Command triggered with a file reset_configuration.
  • A file XXXXXXXX_reset_configuration_processed_yy is created once command processed.
    • XXXXXXXX: gateway serial number in upper case.
    • yy: command status ok or ko.

Command reset_configuration is processed if XXXXXXXX_reset_configuration_yy does not exist and each time the command file is edited.

Update flow

/spn/update directory must be created and used for the update commands.

Update

  • Copy an *.ipk.gpg file.
  • Command triggered with a file update.
  • A file XXXXXXXX_update_processed_yy is created once command processed.
    • XXXXXXXX: gateway serial number in upper case.
    • yy: command status ok or ko.

Command update is processed if XXXXXXXX_update_yy does not exist and each time the command file is edited.

Add license

  • Copy a license file XXXXXXXX_license.txt.
  • Command triggered with a file add_license.
  • A file XXXXXXXX_add_license_processed_yy is created once command processed.
    • XXXXXXXX: gateway serial number in upper case.
    • yy: command status ok or ko.

Command add_license is processed if XXXXXXXX_add_license_yy does not exist and each time the command file is edited.

Restore

  • Command triggered with a file restore.
  • A file XXXXXXXX_restore_processed_yy is created once command processed.
    • XXXXXXXX: gateway serial number in upper case.
    • yy: command status ok or ko.

Command restore is processed if XXXXXXXX_restore_yy does not exist and each time the command file is edited.

Reboot

  • Command triggered with a file reboot.
  • A file XXXXXXXX_reboot_processed_yy is created once command processed.
    • XXXXXXXX: gateway serial number in upper case.
    • yy: command status ok or ko.

Command reboot is processed if XXXXXXXX_reboot_yy does not exist and each time the command file is edited.

Halt

  • Command triggered with a file halt.
  • A file XXXXXXXX_halt_processed_yy is created once command processed.
    • XXXXXXXX: gateway serial number in upper case.
    • yy: command status ok or ko.

Command halt is processed if XXXXXXXX_halt_yy does not exist and each time the command file is edited.

Status flow

/spn/status directory must be created and used for the status commands.

Get status

  • Command triggered with a file get_status.
  • A CSV file XXXXXXXX_status.csv is created once command processed.
  • A file XXXXXXXX_get_status_processed_yy is created once command processed.
    • XXXXXXXX: gateway serial number in upper case.
    • yy: command status ok or ko.

Command get_status is processed if XXXXXXXX_get_status_yy does not exist and each time the command file is edited. XXXXXXXX_status.csv will be erased once command processed.

Log flow

/spn/log directory must be created and used for the log commands.

Get log

  • Command triggered with a file get_log.
  • A directory XXXXXXXX_logs containing logs public, internal, packet_forwarder and loramacserver is created once command processed.
  • A file XXXXXXXX_get_log_processed_yy is created once command processed.
    • XXXXXXXX: gateway serial number in upper case.
    • yy: command status ok or ko.

Command get_log is processed if XXXXXXXX_get_log_yy does not exist and each time the command file is edited.

wiki/usb_service.1584116926.txt.gz · Last modified: 2020/03/13 17:28 by ghi