The XBee Hive for Wi-SUN local filesystem has approximately 300 MB of space available for storing files, such as Python programs, alternative configuration files and firmware versions, and release files, such as cellular module images. The writable directories within the file system are:

  • /tmp

  • /opt

  • /etc/config

Files stored in the /tmp directory do not persist across reboots. Therefore, /tmp is a good location to upload temporary files, such as files used for firmware updates. Files stored in /opt and /etc/config do persist across reboots, but are deleted if a factory reset of the system is performed.

Display directory contents

To display directory contents by using the WebUI or the Admin CLI:

Log into the XBee Hive for Wi-SUN WebUI as a user with full Admin access rights.

  1. On the menu, click System. Under Administration, click File System. The File System page appears.

  2. Highlight a directory and click to open the directory and view the files in the directory.

  1. Select the device in Remote Manager and click Actions > Open Console, or log into the XBee Hive for Wi-SUN local command line as a user with full Admin access rights.
    Depending on your device configuration, you may be presented with an Access selection menu. Type admin to access the Admin CLI.

  2. At the Admin CLI prompt, type ls /path/dir_name. For example, to display the contents of the /etc/config directory:

    > ls /etc/config
    -rw-r--r--    1 root     root           856 Nov 20 20:12 accns.json
    drw-------    2 root     root           160 Sep 23 04:02 analyzer
    drwxr-xr-x    3 root     root           224 Sep 23 04:02 cc_acl
    -rw-r--r--    1 root     root            47 Sep 23 04:02 dhcp.leases
    ...
    >
  3. Type exit to exit the Admin CLI.
    Depending on your device configuration, you may be presented with an Access selection menu. Type quit to disconnect from the device.

Create a directory

This procedure is not available through the WebUI.

To make a new directory, use the mkdir command, specifying the name of the directory.

For example:

  1. Select the device in Remote Manager and click Actions > Open Console, or log into the XBee Hive for Wi-SUN local command line as a user with full Admin access rights.
    Depending on your device configuration, you may be presented with an Access selection menu. Type admin to access the Admin CLI.

  2. At the Admin CLI prompt, type mkdir /path/dir_name. For example, to create a directory named temp in /etc/config:

    > mkdir /etc/config/temp
    >
  3. Verify that the directory was created:

    > ls /etc/config
    ...
    -rw-r--r--    1 root     root          1436 Aug 12 21:36 ssl.crt
    -rw-------    1 root     root          3895 Aug 12 21:36 ssl.pem
    -rw-r--r--    1 root     root            10 Aug  5 06:41 start
    drwxr-xr-x    2 root     root           160 Aug 25 17:49 temp
    >
  4. Type exit to exit the Admin CLI.
    Depending on your device configuration, you may be presented with an Access selection menu. Type quit to disconnect from the device.

Display file contents

This procedure is not available through the WebUI.

To display the contents of a file by using the Admin CLI, use the more command, specifying the name of the file.

For example:

  1. Select the device in Remote Manager and click Actions > Open Console, or log into the XBee Hive for Wi-SUN local command line as a user with full Admin access rights.
    Depending on your device configuration, you may be presented with an Access selection menu. Type admin to access the Admin CLI.

  2. At the Admin CLI prompt, type more /path/filename. For example, to view the content of the file accns.json in /etc/config:

    > more /etc/config/accns.json
    {
        "auth":
            "user": {
                "admin": {
                    "password": "$2a$05$W1sls1oxsadf/n4J0XT.Rgr6ewr1yerHtXQdbafsatGswKg0YUm"
                }
            }
        },
        "schema": {
            "version": "461"
        }
    }
    >
  3. Type exit to exit the Admin CLI.
    Depending on your device configuration, you may be presented with an Access selection menu. Type quit to disconnect from the device.

Copy a file or directory

This procedure is not available through the WebUI.

To copy a file or directory by using the Admin CLI, use the cp command, specifying the existing path and filename followed by the path and filename of the new file, or specifying the existing path and directory name followed by the path and directory name of the new directory.

  1. Select the device in Remote Manager and click Actions > Open Console, or log into the XBee Hive for Wi-SUN local command line as a user with full Admin access rights.
    Depending on your device configuration, you may be presented with an Access selection menu. Type admin to access the Admin CLI.

  2. At the Admin CLI prompt, type cp /path/filename|dir_name /path[filename]|dir_name. For example:

    • To copy the file /etc/config/accns.json to a file named backup_cfg.json in a directory named /etc/config/test, enter the following:

      > cp /etc/config/accns.json /etc/config/test/backup_cfg.json
      >
    • To copy a directory named /etc/config/test to /opt:

      > cp /etc/config/test/ /opt/
      >
  3. Type exit to exit the Admin CLI.
    Depending on your device configuration, you may be presented with an Access selection menu. Type quit to disconnect from the device.

Move or rename a file or directory

This procedure is not available through the WebUI.

To move or rename a file or directory by using the Admin CLI, use the mv command.

To rename a file named test.py in /etc/config/scripts to final.py:

  1. Select the device in Remote Manager and click Actions > Open Console, or log into the XBee Hive for Wi-SUN local command line as a user with full Admin access rights.
    Depending on your device configuration, you may be presented with an Access selection menu. Type admin to access the Admin CLI.

  2. At the Admin CLI prompt, type:

    > mv /etc/config/scripts/test.py /etc/config/scripts/final.py
    >
  3. Type exit to exit the Admin CLI.
    Depending on your device configuration, you may be presented with an Access selection menu. Type quit to disconnect from the device.

To move test.py from /etc/config/scripts to /opt:

  1. Select the device in Remote Manager and click Actions > Open Console, or log into the XBee Hive for Wi-SUN local command line as a user with full Admin access rights.
    Depending on your device configuration, you may be presented with an Access selection menu. Type admin to access the Admin CLI.

  2. At the Admin CLI prompt, type:

    > mv /etc/config/scripts/test.py /opt/
    >
  3. Type exit to exit the Admin CLI.
    Depending on your device configuration, you may be presented with an Access selection menu. Type quit to disconnect from the device.

Delete a file or directory

To delete a file or directory by using the WebUI or the Admin CLI:

Log into the XBee Hive for Wi-SUN WebUI as a user with full Admin access rights.

  1. On the menu, click System. Under Administration, click File System. The File System page appears.

  2. Highlight the directory containing the file to be deleted and click to open the directory.

  3. Highlight the file to be deleted and click .

  4. Click OK to confirm.

To delete a file named test.py in /etc/config/scripts:

  1. Select the device in Remote Manager and click Actions > Open Console, or log into the XBee Hive for Wi-SUN local command line as a user with full Admin access rights.
    Depending on your device configuration, you may be presented with an Access selection menu. Type admin to access the Admin CLI.

  2. At the Admin CLI prompt, type:

    > rm /etc/config/scripts/test.py
    rm: remove '/etc/config/scripts/test.py'? yes
    >
  3. Type exit to exit the Admin CLI.
    Depending on your device configuration, you may be presented with an Access selection menu. Type quit to disconnect from the device.

To delete a directory named temp from /opt:

  1. Select the device in Remote Manager and click Actions > Open Console, or log into the XBee Hive for Wi-SUN local command line as a user with full Admin access rights.
    Depending on your device configuration, you may be presented with an Access selection menu. Type admin to access the Admin CLI.

  2. At the Admin CLI prompt, type:

    > rm /opt/temp/
    rm: descend into directory '/opt/temp'? yes
    rm: remove directory '/opt/temp'? yes
    >
  3. Type exit to exit the Admin CLI.
    Depending on your device configuration, you may be presented with an Access selection menu. Type quit to disconnect from the device.

Upload and download files

You can download and upload files by using the WebUI or from the command line by using the scp Secure Copy command, or by using a utility such as SSH File Transfer Protocol (SFTP) or an SFTP application like FileZilla.

Using the web UI

Log into the XBee Hive for Wi-SUN WebUI as a user with full Admin access rights.

  1. On the menu, click System. Under Administration, click File System. The File System page appears.

  2. Highlight the directory to which the file will be uploaded and click to open the directory.

  3. Click (upload).

  4. Browse to the location of the file on your local machine. Select the file and click Open to upload the file.

Log into the XBee Hive for Wi-SUN WebUI as a user with full Admin access rights.

  1. On the menu, click System. Under Administration, click File System. The File System page appears.

  2. Highlight the directory from which the file will be downloaded and click to open the directory.

  3. Highlight the appropriate file and click (download).

Using the Secure Copy command

To copy a file from a remote host to the XBee Hive for Wi-SUN device, use the scp command as follows:

> scp host hostname-or-ip user username remote remote-path local local-path to local

where:

  • hostname-or-ip is the hostname or IP address of the remote host.

  • username is the name of the user on the remote host.

  • remote-path is the path and filename of the file on the remote host that will be copied to the XBee Hive for Wi-SUN device.

  • local-path is the location on the XBee Hive for Wi-SUN device where the copied file will be placed.

For example:

To copy firmware from a remote host with an IP address of 192.168.4.1 to the /etc/config directory on the XBee Hive for Wi-SUN device, issue the following command:

> scp host 192.168.4.1 user admin remote /home/admin/bin/WXYZ-25.5.bin local /etc/config/scripts to local
admin@192.168.4.1's password: adminpwd
WXYZ-25.5.bin                   100%    36MB    11.1MB/s        00:03
>

To copy a file from the XBee Hive for Wi-SUN to a remote host, use the scp command as follows:

> scp host hostname-or-ip user username remote remote-path local local-path to remote

where:

  • hostname-or-ip is the hostname or IP address of the remote host.

  • username is the name of the user on the remote host.

  • remote-path is the location on the remote host where the file will be copied.

  • local-path is the path and filename on the XBee Hive for Wi-SUN device.

For example:

To copy a support report from the XBee Hive for Wi-SUN device to a remote host at the IP address of 192.168.4.1:

  1. Use the system support-report command to generate the report:

    > system support-report path /var/log/
    Saving support report to /var/log/support-report-0040D0133536-24-01-12-12:10:00.bin
    Support report saved.
    >
  2. Use the scp command to transfer the report to a remote host:

    > scp host 192.168.4.1 user admin remote /home/admin/temp/ local /var/log/support-report-00:40:D0:13:35:36-24-01-12-12:10:00.bin to remote
    admin@192.168.4.1's password: adminpwd
    support-report-0040D0133536-24-01-12-12:10:00.bin
    >

Using SFTP

This example uploads firmware from a remote host to the XBee Hive for Wi-SUN device with an IP address of 192.168.2.1, using the username ahmed:

$ sftp ahmed@192.168.2.1
Password:
Connected to 192.168.2.1
sftp> put WXYZ-25.5
Uploading WXYZ-25.5 to WXYZ-25.5
WXYZ-25.5                                                                      100%  24M  830.4KB/s   00:00
sftp> exit
$

This example downloads a file named test.py from the XBee Hive for Wi-SUN device at the IP address of 192.168.2.1 with a username of ahmed to the local directory on the remote host:

$ sftp ahmed@192.168.2.1
Password:
Connected to 192.168.2.1
sftp> get test.py
Fetching test.py to test.py
test.py                                                                             100%  254    0.3KB/s   00:00
sftp> exit
$