K interpreter release notes

Smick v.16.37.114 (last version - Alexa)

  1. The publication of MQTT messages is always 'retained', ie stored on the broker.
  2. Code optimization for recovery of 4Kbytes of SRAM.
  3. Modified command led: 1=on, 0=off.
  4. Added command mqtt to enable/disable MQTT client.
  5. Removed command link.
  6. Added 'vox' module for interaction with Alexa Voice User Interface (VUI).

Added configuration parameter:

    • voxkey your API key of VUI bridge.

Added command:

    • vox indicates whether the VUI is enabled.

Added events:

    • Voxcon indicates whether the VUI is connected
    • Voxdev VUI device identifier (device ID) (1)
    • Voxcom VUI command code
    • Voxval value of VUI command.

(1) Normally it is always empty. When a message is received from Alexa it is set with the device identifier invoked by Alexa.

When Alexa receives a command for your device, she understands it and sends a message to Smick containing:

    • device identifier (Voxdev),
    • command code (Voxcom) and
    • a numerical parameter (Voxval).

To trace the messages sent by Alexa use the following sketch:

   // set your VUI key, enable VUI and set JSON data format
   start = [voxkey = "f83702bb-f9ee-43db-b25d-968a874a2c14", vox = 1, json]     
   // define trace message
   msg = [Voxdev, Voxcom, Voxval]
   // If I receive a message from Alexa, show it
   Voxdev != "" -> msg

   Here's how a command received from Alexa is traced:

Note: "f83702bb-f9ee-43db-b25d-968a874a2c14" is an example key.

Smick v.15.36.110 - MQTT patch

  1. Increased buffer size MQTT input to 255 bytes.

Smick v.14.36.109 - Telnet, RF, motors and NB-IoT

  1. Firmware Updates for KRACK WPA2 Vulnerability #3725 https://github.com/esp8266/Arduino/issues/3725. Espressif has released updates for ESP-IDF, ESP8266 RTOS SDK, & ESP8266 NONOS SDK on their Github page https://github.com/espressif/ESP8266_NONOS_SDK.
  2. Added configuration parameters:
    • host (default: smick) used for the telnet connection (telnet smick.local)
    • login and password to allow, if set, access to the serial interface and telnet only to authorized users
    • logser=0/1 disables / enables the login and password request when accessing via serial link
    • logtel=0/1 disables / enables the login and password request when logged in via telnet
    • login username required for login (if login is not set, no login is active)
    • password secret word required for login
    • valform=n format of numerical values: 0: std (standard), 1: dec (decimal code), 2: hex (hex code), 3: bin (bin format), 4: char (chr)
    • rxtrim=0/1 disables / enables the removal of the control characters on the left and on the right (eg CR LF ...) of the serial input buffer (Rx)
    • mqtto=0/1 disable / enable automatic sending of events and rules actions on MQTT
    • kinter=0/1 K interpreter interface (0=serial, 1=telnet) *** replaces the telnet command ***
    • bitrate sets the bit rate of the serial connection

3. Added commands:

    • tx sends a string on the serial connection
    • Rx returns the string received on the serial connection
    • chr sets the standard format of numeric values
    • dec sets the standard format of numeric values
    • hex sets the standard format of numeric values
    • bin sets the standard format of numeric values
    • run loads and executes a sketch (equals [load,start])

4. String management

    • strings can be defined as sequences of characters enclosed in single (') or double quotes (")
    • added operator + to concatenate strings

5. Structured display of the configuration (conf):

            --- NTP management
            --- OTA management
            --- SERIAL management
            --- TELNET management

6. ls | dir also summarizes the number of config files and the sketch number

          /Smick.k                             660 bytes
                             2% used space   24598 bytes
                            98% free space  932716 bytes
                             6  config files
                            34  sketch files

7. Added two new commands for the engines operating on both motor1 and motor2 engines. They are used to control a robotic base:

    • motors = x wich equals [motor1 = x, motor2 = x]. The robotic base moves forward if x> 0 and backwards if x <0. The value x is in the range -100 and +100
    • motoro = x wich equals [motor1 = x, motor2 = -x]. The robotic base rotates clockwise if x> 0 and counterclockwise if x <0. The value x is in the range -100 and +100.

8. Modified command load and run: does not run new if it refers to configuration file (starting with a capital letter) .

9. Connection with NB-IoT (Narrow Band IoT) u-blox transceiver on serial interface. Added new configuration parameters:

    • nbiot enables / disables NB-IoT functions
    • Nbip get the dynamic IP assigned to the card by DHCP after registering on the Narrow Band network
    • nbport set the socket listening UDP port 5680
    • nbserverip set the remote server IP
    • nbserverport set the remote server port 5685
    • Nbttl get TTL (Time To Live)
    • Nbrtt get RTT (Round Trip Time)
    • nbtxudpmsg set UDP msg to send (hex format)
    • nbtxudplen set UDP msg length to send
    • Nbrxudpmsg get UDP msg received (hex format)
    • Nbrxudplen GET UDP msg length received
    • Nbrxudpsid get the socket id of UDP msg received (0..6)

Setting nbiot=0 the dynamic parameters Nbrtt, Nbttl, Nbip, Nbrxudpsid, Nbrxudplen, Nbrxudpmsg are initialized.

10. Added new commands to manage the MAX7219 4x 8x8 LED Dot Matrix module:

    • matrix to define the message to show and the connection PIN
    • inverse to reverse text and background. Allowed values: 0 = normal (default), 1 = inverse
    • scroll to reverse the direction of horizontal scrolling. Allowed values: 0 = left (default), 1 = right
    • HHMM provides the string HH: MM
    • MMSS provides the string MM: SS
    • Date provides the string dd-mm-yyyyy
    • Time provides the string hh-mm-ss
    • Date and Time are concatenable strings while the words date and time no.

11. MQTT connection executable with and without credentials (mqttuser, mqttpass)

12. The mqttserver parameter can contain an IP address or a domain name.

Smick v.13.32.89 - Telnet

  1. Modified command new to reset I/O PINs.
  2. When a timed command generates an error (nok) it is removed from crontab.
  3. Added new Wifiip command that returns the local IP assigned by DHCP.
  4. Added Telnet network serial interface and 3 configuration parameters to handle it: telnet, distel and Telnetcon.

The telnet parameter can take the following values:

    • 0: Telnet disabled
    • 1: Telnet enabled with login
    • 2: Telnet enabled without login.

With the distel parameter set the idle time (in minutes) for automatic deactivation of the Telnet interface. If distel is zero no automatic deactivation is set.

The Telnetcon event indicates whether Telnet is active. It can be used to know, for example, when someone connects or disconnects via Telnet.

    • Telnetcon -> led = 1
    • !Telnetcon -> led = 0

5. Added bell dynamic configuration parameter that enables or disables sending the BELL code to the Serial and Telnet interfaces:

    • 0: sending BELL disabled
    • 1: sending BELL enabled.

Sending BELL is performed at the same time as reading the bell parameter (when it is 1). To hear the bell on the Serial or Telnet client, you must configure it on the client.

6. Added new reboot command to reinitialize the system without resetting.

7. Added new fota command to force the OTA update with the latest available version. This command replaces the forced OTA update procedure described in release notes Smick v.10.29.80, step 1.

Smick v.11.31.85 - TH sensor, motor

  1. Removed boot command.
  2. Replaced ver parameter with read-only Ver.
  3. Replaced sn parameter with read-only Sn.
  4. Added the new parameter dhtype to handle different types of temperature and humidity sensors DHT: 0 (none) is the default setting, 11 (DHT11), 22 (DHT22), 21 (DHT21). The parameter must be set to use Temp, Hum, Temperr, Humerr events.
  5. Added ultrasonic distance sensor HC-SR04. It has two PINs: trigger (output) and Echo (input). To define the connections use
sonar :: <trigger PIN>
Sonar :: <Echo PIN>

To set the maximum visibility distance use

sonar = <maximum distance> (3, .., 250) expressed in cm



returns the distance of the obstacle. The value 0 indicates no obstacle.

6. Added Wemos motor shield to handle two engines: motor1 and motor2. The shield uses the I2C serial interface via the D1 and D2 PINs and it is not necessary to define the connection. The motor1 and motor2 parameters can take between -100 and +100.

7. Added pressure and temperature sensor BMP180. It uses the I2C serial interface (addr. 0x77) via the D1 and D2 PINs and it is not necessary to define the connection. The press parameter must be set with the pressure, expressed in hPa (default=1013.25), at the current sea level and its area available from any weather forecast site. You can consult, for example http://www.weatheronline.co.uk, search for your city, view the 'SL pressure' map and read the isobara from the map. If, for example, you read 1026, you have to set

press = 1026

The sensor provides the following parameters:

  • Press: pressure, in hPA.
  • Tempb: temperature (in degrees Celsius)
  • Alt: altitude (in meters).

8. Removing sub-commands limitation up to three levels. Subcommands can be leveled as long as the system's memory resources allow it.

Smick v.10.29.80 - Calendar

  1. Forced Firmware update

To force the firmware update through OTA:

    • set otaupd with a positive value (i.e. otaupd=1440)
    • set trace=1
    • request the firmware update with ota command
] otaupd=1440, trace=1, ota
OTA  Check firmware update

 ets Jan  8 2013,rst cause:4, boot mode:(3,0)

wdt reset

2. Added new read-only variables to manage calendar-based events:

    • Cal indicates that the calendar has been updated
    • Year year of date
    • Month month of date
    • Day day of date
    • WDay day of the week of the date (1=Sunday, 2=Monday,...,7=Saturday)
    • Hour hour time
    • Min minutes of the hour
    • Sec secondss of the hour
    • Secs number of seconds elapsed since power up

3. It is possible to display from MQTT the definition of a link, a variable, an event, a command, or a rule. Send from MQTT:

    • mqttio=1 to set interactive MQTT
    • cal=1 to define cal variable
    • cal? to get the definition of cal variable

and you get on MQTT:

    • -- Variables cal = true

Note: max length of a definition is 80 chars

Smick v.9.28.77 - Reset and OTA

  1. Optimized execution of the reset command.
  2. Added new config parameter sos to define SOS event. The SOS event is verified at each start and if it does not run autostart. It is used to prevent a sketch containing the sleep command no longer be interrupted. The default event is A0>600. To make it true you need to connect PIN A0 with the 3.3V PIN. If your sketch uses PIN A0, you must define the sos event on an unused PIN. You can use one of the following events:
    • D0 or D8; in this case you have to connect PIN D0 or PIN D8 with the 3.3V PIN
    • !D1, !D2, !D3, !D4, !D5, !D6, !D7; In this case you have to connect the PIN you selected with the GND PIN.
  3. Added new config parameter otaupd to define the period, in minutes, of the firmware update request. Set otaupd=0 to disable the firmware update.
  4. Added new command ota to require the firmware update.
  5. Modified the config parameter ntpupd to define the period, in minutes, of the calendar update request to the NTP server. Set ntpupd=0 to disable the calendar update.
  6. Added new operator ':' (activate) to active all definitions with a given pattern. An event generates when it becomes true (that is, it was false and now it is true). EventName: is used to generate the event EventName when it is true (i.e. if it is true at the moment when EventName: is run).

Smick v.8.27.75 - Eval event, help command

1. External event is generated even if disabled!

2. Introduction of two new parameters:

    • val containing the result of the last evaluated expression
    • Eval containing true if an expression was evaluated.

If the command is an expression to be evaluated (i.e. Sec + 3), the result is stored in the val register and set Eval=true.

Example of use.

These two registers are used to define such rules:

Eval -> led = val

to set led with a value received from mqttin or serial channel.

] 0

The LED goes off.

] 1

The LED lights up

3. Added new registry 'mqttio' to set up MQTT channel interaction.

If mqttio = 0 (default), when evaluating an expression via mqttin channel

> Sec+2

the result is not returned on mqttout, but only on serial.

If mqttio = 1, when evaluating an expression via mqttin channel

> Sec+2
< 79

the result is returned to mqttout.

4. For commands '?', '\', '+', '-' the pattern may contain as a suffix:

    • '->' to select only the rules
    • '- = [' to select only commands
    • '::' to select only the links
    • '=' to select only variables and events.

5. Modified the result of the 'help' command:

] help
For any information see the web page http://smick.tk

Smick v.7.27.74 - unix type commands

  1. Default message format is csv
  2. Replaced the type configuration parameter with device to be replaced manually in the configuration files on the archive.
  3. Added the new command ls synonymous with dir.
  4. Added the new command rm synonymous with del.
  5. Added the new command type synonymous with cat.
  6. Added the new command help.