tronferno-mcu

Command Line Interface (CLI)

This (partially outdated) text describes the command line interface (CLI) of tronferno-mcu. The CLI can be accessed via a terminal or via front-ends like a smart phone app or an FHEM module..

When using a terminal, local echo should be enabled, so you can see what you type. Backspace key is working.

Syntax

    command option1=value1 option2 option3="quoted value" ... optionN=valueN;

Commands

Commands are help, config, send, timer, mcu, pair

help command

config command

Sets or gets some configuration values. Most of them are stored persistently in the MCU.

Possible options are: cu, rtc, baud, wlan-ssid, wlan-password, longitude, latitude, time-zone, dst, verbose, pw, set-config-password, restart

To set a value: config option=value To get a value: config option=? (not supported by all options)

cu

baud

WLAN options

Data to connect to a WLAN

restart

These options are used to calculate times for the “astro-automatic” built in to receivers. Astro closes the shutter at civil dusk. The user can define a offset time (like 10 minutes before civil dusk).

additional options

send command

Send a plain command message via RF to the receivers. Receiver can be a shutter motor, or a light, if you have the hardware for that.

addressing options

action command option

option SEP for setting end position

By adding the SEP option to c=up or c=down, the set-end-position-mode is entered. In this mode you hold a hardware button to move the shutter in the direction you have specified with c=up/down. If you release the button, the shutter position will be saved as the new end position for that direction. You can hold down the button several time until you are satisfied with the new end position. If you don’t press the button for 30 seconds, the set-end-position-mode will end by timeout.

On ESP8266 we use GPIO0 as hardware button. Its connected to the “Flash” button on some boards.

   send g=2 m=3 c=up SEP;    enter SEP mode.  You can set upper end position with hardware button
   send SEP;                 disable SEP mode (if still enabled)
   send g=2 m=3 c=down SEP;  enter SEP mode.  You can set lower end position with hardware button
   send SEP;                 disable SEP mode

timer command

The timer command sends a message via RF to the receivers. Such a message consists of a plain message like in send, additional RTC data and a big block with timer data, which needs 5 seconds to be transmitted.

Except for rtc-only, all timer options should be send together by a single command line. They are all transmitted together in a monolithic data block. So even if you just want to change the daily timer, a full data block containing weekly timer and astro timer data is send. All options omitted will be set to their default value “disabled.”

We cannot read any data from the receivers anyway, so to be able to tell a user which timer data is currently stored in a receiver, the only way is to memorize it elsewhere (in the MCU would be best, I’m working on it). Because of this, the original central unit 2411 will not know about any timers or options set by our MCU and vice versa. All timer commands will also set the RTC of the receiver. So the RTC of the MCU should set to the correct time, which is usually done by NTP. If NTP is not available it needs to be set by the user or the front-end (GUI).

   timer sun-auto astro ...;     set all options on a single command line
   timer sun-auto;                 this enables sun automatic
   timer astro;                   ... but this will disable sun automatic
   timer ...;                       ... this will disable astro

addressing options

timer options

Each receiver has four built-in timers: daily, weekly, astro, random. Remember that omitted timers are disabled.

   `timer astro=-15;       will set the astro timer and disables all other timers and options`
   `timer astro=-15 daily=0600- sun-auto=1;  sets astro, daily, sun-automatic  and disables all others`

rs - option to read saved timers back

The mcu stores timer commands, so it can print out the timer configuration of each receiver. It overwrites older commands by newer commands and older explicit addressed commands by newer wild-card commands:

on/off options

rtc-only, rtc

Each timer command has RTC data and will update the internal RTC of the receivers addressed by a timer command. This rtc-only option is mainly used after power loss of a shutter; to synchronize the times of all shutters; when daylight time changes.

The built-in RTC of a shutter keeps track of day time, day of month, month of year, day of week and dst yes/no. it does not know about leap-years or years at all.

unknown options

Unknown options give a warning, but will not fail the command.

common options

Common options are accepted by all commands.

mcu command

set or read MCU pins

pair command (experimental state)

currently its used to pair a shutter specified by g/m parameter to a controller specified by a parameter. Commands received by a paired controller will modify the tracked status of the paired g/m and generate status change messages for it.

not fully implemented yet: to pair input and output pins to g/m. So a shutter can be controlled by output pins for up/down. And an up/down/stop switch at the pins can generate up/down/stop commands.

*a=(?|ID) 0 controller to pair. ‘?’ starts auto-scan *g=[0-7] 0 group number *m=[0-7] 0 group member number *gpoutN=(up|down|switch)
*gpinN=(up|down|stop|rain|toggle) *c=(pair|unpair|read)