HA-EA Command Reference

This document briefly explains all relevant configuration commands supported by HA-EA devices, including syntax, parameters and command examples.

Created: 30/08/2021
Last modified: 30/08/2021
Version: 1
Created by: Lukas D'Angelo

Basic commands

help

The help or ? command shows a list of all commands supported by the current HA-EA platform.

Syntax

help

Example

$ help
clear     Clears the Terminal Screen
defaults  Load default Configuration
diagmode  Diagnostic Mode Configuration Commands
fwupdate  Update the System Firmware
hostname  Set Hostname of the System
hw        Hardware Platform Configuration Commands
ip        Internet Protocol Configuration Commands
mqtt      MQTT Protocol Configuration Commands
password  Set Management Password of the System
restart   Restart the System now
save      Save running Configuration to Flash
show      Show System Parameters
telnet    Telnet Management Configuration Commands
username  Set Management User of the System
wifi      WiFi Interface Configuration Commands

Note: ? is also used to give hints about the syntax or options of a command.

clear

The clear command clears the terminal screen if supported.

Syntax

clear

Example

$ clear

defaults

The defaults command loads the default system configuration.

Syntax

defaults

Example

$ defaults
Info: Loading default configuration.

Note: defaults does not load the default system configuration to the persistent memory.

restart

The restart command will restart the device.

Syntax

restart

Example

$ restart
Info: System is restarting now.

Note: When executing restart, all device hardware states and any unsaved configuration will be lost.

save

The save command will write the running configuration to persistent memory.

Syntax

save

Example

$ save
Info: Saving running configuration to flash.

show

The show command will display system, configuration and hardware parameters, states and information.

Syntax

show option

Parameters

Option Value Description
config - shows running system configuration
diagmode - shows diagnostic mode settings
ethernet - shows ethernet interface parameters and information
hostname - shows system hostname
hw - shows hardware platform parameters
info - shows system hardware and software information
ip - shows system IP information
mqtt - shows MQTT protocol settings
password - shows system management password
username - shows system management user
telnet - shows telnet management settings
wifi - shows WiFi interface parameters and information

Example

$ show ip
DHCP: DISABLED
IP-Adress of WiFi Interface: 10.0.10.31
Subnet Mask: 255.255.255.0
Default Gateway: 10.0.10.1
IP-Address of Nameserver: 10.0.10.1

Management & Maintenance commands

diagmode

The diagmode command configures diagnostic message output behaviour.

Syntax

diagmode option value

Parameters

Option Value Description
terminal enable enables printing diagnostic messages to the terminal
terminal disable disables printing diagnostic messages to the terminal
mqtt enable enables the generation of a json string containing diagnostic information which can be published over MQTT
mqtt disable disables the generation of a json string containing diagnostic information which can be published over MQTT

Example

$ diagmode terminal enable

fwupdate

The fwupdate command is used to load a remote binary file in order to upgrade the system firmware. HTTP is used to load the binary file.

Syntax

fwupdate option value

Parameters

Option Value Description
url URL the URL of the firmware binary file with format http://HOSTNAME:PORT/PATH

Example

$ fwupdate url http://10.0.10.73:80/firmware/firmware.bin

Note: After loading the file, the command outputs the md5sum of the received file to verify a successful transmission. restart is required to apply the new firmware.

hostname

The hostname command configures the system hostname.

Syntax

hostname value

Parameters

Option Value Description
- HOSTNAME the hostname of the system

Example

$ hostname HA-EA

password

The password command configures the password of the system management user.

Syntax

password option value

Parameters

Option Value Description
plain-text PASSWORD sets the user password and stores it in plain text
crypt PASSWORD sets the user password and stores a SHA-256 hash of it

Example

$ password crypt ultrasecurepassword
Info: System password set successfully.

username

The username command configures the username of the system management user.

Syntax

username value

Parameters

Option Value Description
- USERNAME the username of the system management user

Example

$ username root

telnet

The telnet command configures diagnostic message output behaviour.

Syntax

telnet option value

Parameters

Option Value Description
mgmt enable enables telnet management
mgmt disable disables telnet management
port PORT sets the TCP-port for telnet management

Example

$ telnet mgmt enable
$ telnet port 23

MQTT commands

mqtt

The mqtt command configures the MQTT protocol parameters and MQTT publishing behaviour.

Syntax

mqtt option value

Parameters

Option Value Description
server HOSTNAME configures the IP-address or hostname of MQTT server
port PORT configures the TCP port for MQTT of the server
username USERNAME configures the MQTT username
password PASSWORD configures the MQTT password
topic-relays TOPIC configures the customizable part of the subscribe and publish topic for the relays
topic-sensor TOPIC configures the publish topic for the sensor data string
topic-input-state TOPIC configures the customizable part of the subscribe and publish topic for the input states
topic-diagdata TOPIC configures the publish topic for the diagnostic data json string
send-interval-relays-state INTERVAL configures the send interval for relay state in seconds
send-interval-sensor INTERVAL configures the send interval for sensor data in seconds
send-interval-diagdata INTERVAL configures the send interval for diagnostic data json string data in seconds

Example

$ mqtt topic-relays /heating/outputs

This command will make the device subscribe to the following topics:

/heating/outputs/K0
/heating/outputs/K1
/heating/outputs/K2
....
/heating/outputs/KN

where N+1 is the number of relays to control on the current platform or stack. The payload received with the topics listed above will determine the platform relay state. If "0" is received in the payload of topic /heating/outputs/KX, the corresponding relay KX is deactivated, if "1" is received, the corresponding relay KX is activated. Other payload is ignored.

If the state of a relay is changed, the device will publish the new relay state with the corresponding topic contained in the list:

/heating/outputs/K0_state
/heating/outputs/K1_state
/heating/outputs/K2_state
....
/heating/outputs/KN_state

The payload for deactivated is "0" and "1" for activated.

$ mqtt topic-sensor /sensors

This command defines the topic of the sensor payload string to /sensors. The payload string could look like {"28bb2651080000f7":21.13, "282cdd500800009a":20.56} if two temperature sensors are connected to the platform.

If inputs are supported by the platform, the command

$ mqtt topic-input-state /inputs

will make the device publish the states of the inputs on change with the corresponding topic contained in the list:

/inputs/I0
/inputs/I1
/inputs/I2
....
/inputs/IN

N+1 is the number of inputs supported by the current platform. The payload for voltage presence on the input is "1" and "0" for absence.

$ mqtt topic-diagdata /diagnostics

This command defines the topic of the publish topic for the diagnostic data json string to /diagnostics. The payload string looks like

{"MAC":"A4:CF:12:BC:2B:6C","hostname":"HA-EA","free_heap":40872,"free_flash":2756608,"rssi":-72,"ssid":"WAP_INT","bssid":"60:31:97:F8:C6:83"}

The command

$ mqtt send-interval-sensor 300

will make the device send the sensor payload string every 5 minutes.

Note: A interval of 0 will disable periodic sending.

Interface commands

ethernet

The ethernet command is used to enable or disable the ethernet interface.

Syntax

ethernet option

Parameters

Option Value Description
enable - enables the ETHERNET interface and disables the WiFi interface
disable - disables the ETHERNET interface and enables the WiFi interface

Example

Enabling the ETHERNET interface:

$ ethernet enable
Info: WiFi interface disabled

ip

The ip command configures the IP-address of the system, the default gateway and the DNS server. If ETHERNET is supported by the platform, the configurations applies to both the WiFi and ETHERNET interface. The interfaces cannot be used simultaneously.

Syntax

ip option value

Parameters

Option Value Description
address IP-ADDRESS configures the IP-address of the system, DHCP for IP auto-configuration
netmask NETMASK configures the network mask
gateway IP-ADDRESS configures the IP-address of the default gateway
nameserver IP-ADDRESS configures the IP-address of the DNS server

Example

IP autoconfiguration:

$ ip address DHCP

Note: This command will also attempt autoconfiguration of netmask, gateway and nameserver. Any static configuration of these values is ignored if IP autoconfiguration is enabled.

Static IP configuration:

$ ip address 192.168.1.201
$ ip netmask 255.255.255.0
$ ip gateway 192.168.1.1
$ ip nameserver 1.1.1.1

wifi

The wifi command is used to configure the WiFi interface.

Syntax

wifi option value

Parameters

Option Value Description
enable - enables the WiFi interface and disables the ETERNET interface if present
disable - disables the WiFi interface and anables the ETERNET interface if present
station-ssid SSID configures SSID of the WiFi network to be connected
station-psk PSK configures PSK of the WiFi network to be connected
soft-ap-mode active activates the soft AP feature of the system for management
soft-ap-mode inactive deactivates the soft AP feature of the system for management
soft-ap-ssid SSID configures SSID of the soft AP feature
soft-ap-psk PSK configures the PSK of the soft AP feature

Example

Enabling the WiFi interface:

$ wifi enable
Info: Ethernet interface disabled

Setting up the WiFi network:

$ wifi station-ssid WAP_INT
$ wifi station-psk ultrasecurepsk

HW Platform commands

hw

The hw command is used to configure the hardware platform.

Synatax

hw option value

Parameters

Option Value Description
relay-count INT number of relays to control on the platform or stack
one-wire-mode dallas enables the Dallas 1-Wire protocol
one-wire-mode dht enables the DHT protocol
one-wire-scan - scans the 1-Wire BUS for sensors

Example

Required command to make outputs of a HA-EA-S platform work:

$ hw relay-count 8

Note: For a stack configuration, the total number of relays has to be set.

Required command to enable support for DS18B20 sensors:

$ hw one-wire-mode dallas