=========================================== Configuring with the command line interface =========================================== .. _configure_by_cli: Configuring devices with the command line interface (CLI) is an administrative procedure that should be used with due care. It can be used instead of the GUI-based initial device setup where Visionect Configurator is not available, or it can automate the advanced configuration and debugging, for example when working in the field or when managing lots of devices. Access the CLI by: * First click to Info button in the Visionect Configurator .. figure:: images/information-button.png * Here, enable the "Debug mode" and go back to the device configuration .. figure:: images/debug-mode.png * Clicking the ‘Console’ button in the Visionect Configurator * Using your own terminal software and connecting to the serial port settings configured to 115200 baud, 8 bit, no parity, 1 stop bit. .. figure:: images/console.png :align: center *Accessing the command line interface through the ‘Console’ button.* .. _configure_by_mac: Access the CLI through MacOS terminal: * Connect the Place&Play device to your computer with the provided USB cable * Start the Terminal * Type in the following command: ``$ ls /dev/cu.*`` .. figure:: images/mac-1.png *Note: We are looking for a usbserial connection here. Please note, that the name may differ.* * Use the built-in screen command to open the serial connection. ``$ screen /dev/cu.usbserial-AU046N37 115200`` .. figure:: images/mac-2.png * And that is it, here you can execute the commands for your device. .. figure:: images/mac-3.jpg .. _cli-commands: Basic configuration ------------------- To enter a command simply type it in and press enter. - ``help``: Gets a printout of all available commands - ``sleep_conf_get``: Displays current soft sleep mode setting - ``conn_type_list``: Lists all the available connections - ``conn_type_set ``: Sets active connectivity type - ``conn_type_get``: Prints out the type of connectivity - ``wifi_conf_set ``: Sets WiFi connection settings - ``wifi_conf_get``: Gets WiFi configuration - ``mobile_conf_set ``: Sets mobile connection settings - ``mobile_conf_get``: Gets mobile configuration - ``flash_save``: Saves settings into FLASH memory - ``reboot``: Reboots device - ``fw_version_get``: Shows system's FW version - ``uuid_get``: Prints out device's uuid .. warning:: All changes to device configuration are by default retained only in the working RAM. If you want your settings to persist across reboots, you will need to run ``flash_save`` before rebooting. .. warning:: Some devices might stop operating after being connected to the configurator app after a while. Possible reason: Some devices might stop operating after being connected to the Visionect Configurator a while. Nothing is wrong with the device; it might have simply entered ‘soft sleep’. This is a power save mode meant to conserve power, which activates after 15 seconds of physical inactivity (as detected by the accelerometer). For more information see :ref:`soft_sleep`. Connecting the device through terminal -------------------------------------- Connecting to Wi-Fi ~~~~~~~~~~~~~~~~~~~ 1. The first part is connecting the device to your Wi-Fi. This can be done with the following command: * ``wifi_conf_set wpa2 0`` * If your Wi-Fi access point has space in the name, you can use the following two commands for configuration: 1. ``wifi_ssid_set `` 2. ``wifi_psk_set `` *Replace the AP_NAME with the name of your Wi-Fi and in the second command the PASSWORD with the Wi-Fi's password.* 2. The second part is connecting the device to the server. This can be done with the following command: * ``server_tcp_set 11113`` *Replace the with your server IP or DNS query.* 3. Once you configure the Wi-Fi and the server, you will need to save the configuration on the device. Use the following command to save the configuration: * ``flash_save`` 4. After you save the configuration, you can reboot, and the device will try connecting to the newly set Wi-Fi and server. And that is it! Connecting to 4G ~~~~~~~~~~~~~~~~ To set the device to use the SIM card, we need to set a different type of connection as it is not set by default. This can be done with the following commands: - ``conn_type_set 8`` - ``flash_save`` - ``reboot`` .. _cli-full-list: Full command list ----------------- A full list of all the registered CLI commands for Visionect devices is available below. A list of all the available commands for a specific device can also be accessed by typing in the command help. .. note:: The command list applies to the latest firmware version. If your device is missing some of the commands listed below or features a different output, it is probably running an outdated firmware. ------ .. _accelerometer_conf_get: accelerometer_conf_get ~~~~~~~~~~~~~~~~~~~~~~ .. csv-table:: :header: "", "" :widths: 30, 60 **Description**, Display accelerometer sensor settings **Compile-time Switch**, USE_MMA7660_DRIVER **Syntax**, accelerometer_conf_get **Example**, "> accelerometer_conf_get Threshold count: 5 Debounce count: 100" **Supported devices**, "Place & Play 6'' ver 0.4, 0.5, 1.1; System Board 9.7''/13.3'' ver 0.2, 1.0, 1.1; System Board 32'' ver 0.3" ------ .. _accelerometer_conf_set: accelerometer_conf_set ~~~~~~~~~~~~~~~~~~~~~~ .. csv-table:: :header: "", "" :widths: 30, 60 **Description**, Set accelerometer sensor settings **Compile-time Switch**, USE_MMA7660_DRIVER **Syntax**, accelerometer_conf_set **Parameters**, threshold_cnt, "Upper accelerometer threshold in counts (0..30)" debounce_cnt, "Number of taps to be detected as single tap (0..254)" **Example**, "> accelerometer_conf_set 5 100 Accelerometer settings set" **Supported devices**, "Place & Play 6'' ver 0.4, 0.5, 1.1; System Board 9.7''/13.3'' ver 0.2, 1.0, 1.1; System Board 32'' ver 0.3" ------ .. _app_sleep: app_sleep ~~~~~~~~~ .. csv-table:: :header: "", "" :widths: 30, 60 **Description**, Put application into deep sleep for N minutes **Syntax**, app_sleep **Parameters**, minutes, number of minutes to deep sleep **Example**, "> app sleep 1" **Supported devices**, "All" ------ .. _app_wakeup: app_wakeup ~~~~~~~~~~ .. csv-table:: :header: "", "" :widths: 30, 60 **Description**, Wakes-up application from the deep sleep **Syntax**, app_wakeup **Example**, "> app_wakeup" **Supported devices**, "All" ------ .. _autoconn: autoconn ~~~~~~~~ .. csv-table:: :header: "", "" :widths: 30, 60 **Description**, Disable auto-connect for a specific amount of time **Syntax**, autoconn **Parameters**, timeout, "Timeout in 1 minute quants, 0 enables auto-connect immediately" **Example**, "> autoconn 1" **Supported devices**, "All" ------ .. _battery_conf_get: battery_conf_get ~~~~~~~~~~~~~~~~ .. csv-table:: :header: "", "" :widths: 30, 60 **Description**, Display battery settings **Syntax**, battery_conf_get **Example**, "> battery_conf_get Threshold OFF: 3600 mv Threshold ON: 3800 mV Threshold CNT: 15" **Supported devices**, "All" ------ .. _battery_conf_set: battery_conf_set ~~~~~~~~~~~~~~~~ .. csv-table:: :header: "", "" :widths: 30, 60 **Description**, Set battery settings **Syntax**, battery_conf_set **Parameters**, thr_off, Battery voltage in mV where device starts to operate (0..4999) thr_on, Battery voltage in mV where device requires charging (0..4999) thr_cnt, Number of battery voltage measurements prior bootloader reboot **Example**, "> battery_conf_set 3600 3800 4 Battery settings set" **Supported devices**, "All" ------ .. _border_get: border_get ~~~~~~~~~~ .. csv-table:: :header: "", "" :widths: 30, 60 **Description**, Display Border mode **Syntax**, border_get **Example**, ">border_get Border support: Yes Border: Server" **Supported devices**, "All" ------ .. _bq24022_mode_get: bq24022_mode_get ~~~~~~~~~~~~~~~~ .. csv-table:: :header: "", "" :widths: 30, 60 **Description**, Show charger status **Compile-time Switch**, USE_BQ24022_DRIVER **Syntax**, bq24022_mode_get **Example**, "> bq24022_mode_get BQ24022: fast charge Battery current: 0 mA Battery voltage: 3948 mV" **Supported devices**, "Place & Play 6'' ver 1.1" ------ .. _bq24023_mode_get: bq24023_mode_get ~~~~~~~~~~~~~~~~ .. csv-table:: :header: "", "" :widths: 30, 60 **Description**, Show charger state **Compile-time Switch**, "USE_BQ24023_DRIVER, BQ24023_CLI_DEBUG" **Syntax**, bq24023_mode_get **Example**, "> bq24023_mode_get BQ24023: fast charge Battery current: 1200 mA Battery voltage: 4000 mV" **Supported devices**, "Place & Play 6'' ver 0.4, 0.5, 1.0; System Boards 9.7''/13.3'', Place & Play 13''" ------ .. _bq24023_mode_set: bq24023_mode_set ~~~~~~~~~~~~~~~~ .. csv-table:: :header: "", "" :widths: 30, 60 **Description**, Set charging mode **Syntax**, bq24023_mode_set **Parameters**, ce, "Charging enable (1=Enable, 0=Idle)" tte, "Charging timer and termination (1=enable timer & termination, 0=disable timer & termination)" **Example**, " > bq24023_mode_set 1 1" **Supported devices**, "Place & Play 6'' ver 0.4, 0.5, 1.0; System Boards 9.7''/13.3'', Place & Play 13''" ------ .. _bq_veps_mode_get: bq_veps_mode_get ~~~~~~~~~~~~~~~~ .. csv-table:: :header: "", "" :widths: 30, 60 **Description**, Set charging status **Compile time switch**, USE_BQ_VEPS_DRIVER **Syntax**, bq_veps_mode_get **Example**, "> bq_veps_mode_get BQ_VEPS: charge disabled Battery current: 0 mA Battery voltage: 0 mV" **Supported devices**, "System Board 32''" ------ .. _bsim: bsim ~~~~ .. csv-table:: :header: "", "" :widths: 30, 60 **Description**, "Simulate battery state (empty, full, charged, charging, ...)" **Syntax**, bsim **Parameters**, mode, "0 = simulator off, 1 = not charging & empty, 2 = not charging & full, 3 = not charging & ready, 4 = charging & empty, 5 = charging & ready" force, "1 = update battery state immediately, 0 = wait for 1 min timer" **Example**, "> bsim 11" **Supported devices**, "All" ------ .. _bsimv: bsimv ~~~~~ .. csv-table:: :header: "", "" :widths: 30, 60 **Description**, Simulate battery voltage : 0..4300mV **Syntax**, bsimv **Parameters**, voltage, 0..4300mV **Example**, "> bsimv 3900" **Supported devices**, "All" ------ .. _cc3100_dns: cc3100_dns ~~~~~~~~~~ .. csv-table:: :header: "", "" :widths: 30, 60 **Description**, Resolve IP from URL **Compile-time switch**, USE_CC3100_DRIVER **Syntax**, cc3100_dns **Parameters**, url, URL to find IP of the server. **Example**, "> cc3100_dns www.visionect.com DNS query: www.visionect.com => 176.9.54.237" **Supported devices**, "Place & Play 6'' ver 1.0 B2; Place & Play 13''" ------ .. _cc3100_format: cc3100_format ~~~~~~~~~~~~~ .. csv-table:: :header: "", "" :widths: 30, 60 **Description**, Formats the CC3100 SPI FLASH **Compile-time switch**, "USE_CC3100_DRIVER, CC3100_FW_UPGRADE_MODE" **Syntax**, cc3100_format **Note**, "To perform format command, connectivity state must be 0 (power off)" **Example**, "> cc3100_format CC3100 SPI FLASH formatted" **Supported devices**, "Place & Play 6'' ver 1.0 B2; Place & Play 13''" ------ .. _cc3100_fw_upgrade: cc3100_fw_upgrade ~~~~~~~~~~~~~~~~~ .. csv-table:: :header: "", "" :widths: 30, 60 **Description**, Force Firmware upgrade **Compile-time switch**, "USE_CC3100_DRIVER, CC3100_FW_UPGRADE_MODE" **Syntax**, cc3100_fw_upgrade **Example**, "> cc3100_fw_upgrade Start FW upgrade CC3100: successfully upgraded. Please power cycle it" **Supported devices**, "Place & Play 6'' ver 1.0 B2; Place & Play 13''" ------ .. _cc3100_fw_version: cc3100_fw_version ~~~~~~~~~~~~~~~~~ .. csv-table:: :header: "", "" :widths: 30, 60 **Description**, Show CC3100 FW version **Compile-time switch**, USE_CC3100_DRIVER **Syntax**, cc3100_fw_version **Example**, "> cc3100_fw_version NWP v2.7.0.0 MAC 31.1.4.0.1 PHY 1.0.3.34 ChipId 67108864 ROM 13107" **Supported devices**, "Place & Play 6'' ver 1.0 B2; Place & Play 13''" ------ .. _cc3100_mac_address: cc3100_mac_address ~~~~~~~~~~~~~~~~~~ .. csv-table:: :header: "", "" :widths: 30, 60 **Description**, Show WiFi module’s MAC address **Compile-time switch**, USE_CC3100_DRIVER **Syntax**, cc3100_mac_address **Example**, "> cc3100_mac_address 00:23:a7:8e:6a:8c" **Supported devices**, "Place & Play 6'' ver 1.0 B2; Place & Play 13''" ------ .. _cc3100_pwr: cc3100_pwr ~~~~~~~~~~ .. csv-table:: :header: "", "" :widths: 30, 60 **Description**, Set TX power of CC3110 **Compile-time switch**, USE_CC3100_DRIVER **Syntax**, cc3100_pwr **Parameters**, power, "TX power: number between 0-15, as dB offset from max power; 0 will set maximum power" **Example**, "> cc3100_pwr 1 New power mode set to 1" **Supported devices**, "Place & Play 6'' ver 1.0 B2; Place & Play 13''" ------ .. _cc3100_rssi: cc3100_rssi ~~~~~~~~~~~ .. csv-table:: :header: "", "" :widths: 30, 60 **Description**, Read RSSI value from WiFi module **Compile-time switch**, USE_CC3100_DRIVER **Syntax**, cc3100_rssi **Example**, "> cc3100_rssi RSSI:-38 dBm" **Supported devices**, "Place & Play 6'' ver 1.0 B2; Place & Play 13''" ------ .. _cc3100_scan: cc3100_scan ~~~~~~~~~~~ .. csv-table:: :header: "", "" :widths: 30, 60 **Description**, Performs scan on CC3100 **Compile-time switch**, USE_CC3100_DRIVER **Syntax**, cc3100_scan **Example**, "> cc3100_scan AP 00: 24:c9:a1:16:da:18, WPA2, -38dBm, Visionect AP 01: 24:c9:a1:16:db:58, WPA2, -36dBm, G-UNIT AP 02: e4:8d:8c:33:fb:bb, WPA2, -83dBm, SZS-Guest AP 03: e6:8d:8c:33:fb:bb, WPA2, -83dBm, Crypto888 AP 04: 20:aa:4b:21:5b:6a, WPA2, -65dBm, TPVision AP 05: 20:aa:4b:21:5b:6c, OPEN, -65dBm, TPVision-guest AP 06: 0a:18:d6:93:ab:e9, WPA2, -34dBm, Dtim600 AP 07: f0:9c:e9:b9:1c:14, WPA2, -47dBm, Aerohive-test AP 08: 8c:0c:90:03:fb:48, WPA2, -41dBm, ruckus1 AP 09: 58:93:96:22:3a:58, WPA2, -39dBm, G-UNIT-3 AP 10: 54:3d:37:01:d3:e8, WPA2, -32dBm, G-UNIT-2 AP 11: 0a:18:d6:93:ac:4e, WPA2, -40dBm, unifi AP 12: c0:c1:c0:9e:c8:fa, WPA2, -77dBm, ARROWSLO AP 13: 00:0e:8f:89:75:79, WPA2, -84dBm, T-2_897579" **Supported devices**, "Place & Play 6'' ver 1.0 B2; Place & Play 13''" ------ .. _certs_config_get: certs_config_get ~~~~~~~~~~~~~~~~ .. csv-table:: :header: "", "" :widths: 30, 60 **Description**, Display dates and types of currently used WiFi certificates **Compile-time switch**, USE_RS9113_DRIVER || USE_CC3100_DRIVER **Syntax**, certs_config_get **Example**, "> certs_config_get" **Supported devices**, "Place & Play 6'' up to ver 1.0; System Boards 9.7''/13.3'' ver 0.2; Place & Play 13''; System Board 32'' ver 0.6, 1.0" ------ .. _cli_version_get: cli_version_get ~~~~~~~~~~~~~~~ .. csv-table:: :header: "", "" :widths: 30, 60 **Description**, Display CLI version **Syntax**, cli_version_get **Example**, "> cli_version_get > CLI version: 1.0" **Supported devices**, "All" ------ .. _conn_retry_get: conn_retry_get ~~~~~~~~~~~~~~ .. csv-table:: :header: "", "" :widths: 30, 60 **Description**, Display device network error settings **Syntax**, conn_retry_get **Example**, "> conn_retry_get Network error retry interval: 5" **Supported devices**, "All" ------ .. _conn_retry_set: conn_retry_set ~~~~~~~~~~~~~~ .. csv-table:: :header: "", "" :widths: 30, 60 **Description**, Set device network error settings **Syntax**, conn_retry_set