Emonwrt3 Command line guide

From lechacal
Jump to navigation Jump to search

Terminal access

To access the terminal of the emonwrt3 use putty. Use hostname OpenWrt (or the ip address). Connection type ssh. Port 22.

If you are already on a linux type computer just issue a ssh command

ssh root@OpenWrt

If the password has never been set from the web interface then use telnet instead.

telnet OpenWrt

Start/Stop service

The Emonwrt3 service can be stopped with the following command.

/etc/init.d/emonwrt3 stop

Stopping the emonwrt3 service will be required for some commands.

Likewise start the service again like this.

/etc/init.d/emonwrt3 start

Command list

emonwrt3-dbdump

emonwrt3-dbdump

This dumps the rolling database. The output will look as follow

root@emeter:~# emonwrt3-dbdump 
CONFIG: Configuration loaded ok.
DB: Using rolling database /tmp/emonwrt3.db
(0) 0 1550094926 6 -0.00 0.00 0.00 0.11 26.76 -127.00 
(1) 0 1550094936 6 0.00 0.00 0.22 0.00 17.37 -127.00 
(2) 0 1550094946 6 0.00 0.00 0.04 0.08 4.20 -127.00 
(3) 0 1550094957 6 0.00 0.00 0.29 0.08 4.20 -127.00 
(4) 0 1550094967 6 0.00 0.00 1.00 0.03 5.11 -127.00 
KISSDB_get failed (5) (1)

The KISSDB_get failed just means the record has not been filled yet.

emowrt3-serialstore

The emonwrt3 service must be stopped before using this command.

emonwrt3-serialstore -f

This is the program responsible for reading the serial port and saving the data in the rolling database.

We expect an output as this one below.

root@emeter:~# emonwrt3-serialstore -f
Forcing debug on
START
CONFIG: Configuration loaded ok.
DB: Using rolling database /tmp/emonwrt3.db
SERIAL: OPEN BaudRate = 38400 Port = /dev/ttyATH0
Oldest key: (89)
24 06 59 7c 8c 38 e8 fe 2c 3a 3c e4 cf 3d 00 d0 e0 3c b7 60 c0 41 00 00 fe c2 
DB put: (90) 1550142338

The line 24 06 59 etc being the serial data in hex format.

emonwrt3-gateway

The emonwrt3 service must be stopped before using this command.

emonwrt3-gateway -f

This manages the data in the rolling database. Makes a decision whether they should be sent. Then send them to the list of streams.

This command is particularly useful to identify issues with remote servers connections.

emonwrt3-gpio23-reset.sh

emonwrt-gpio23-reset.sh

This command reset the Arduino microcontroller.

A particular use for it is to see the header message from the Arduino. For this use two terminals. In the first stop the emonwrt3 service. Then open the serial port as follow.

stty -F /dev/ttyATH0 raw speed 38400
cat /dev/ttyATH0

If stty is not installed then issue opkg update; opkg install coreutils-stty

In the second terminal issue the gpio-reset command.

The microcontroller will reset showing the version in use.

emonwrt3-eew

The emonwrt3 service must be stopped before using this command.

emonwrt3-eew

This command reads the configuration and writes it to the Arduino eeprom.