Enable Javascript


Last Arduino/ESP project (click to open)

Gebruikerswaardering: 4 / 5

Ster actiefSter actiefSter actiefSter actiefSter inactief
 

Artikelindex

jan 2020, now we use ESP-NOW
in the New project mySimpleThings
with an unlimited number of nodes


What is simpleHomeSwitch?
This is simpleHomeSwitch:

  • A very cheap and easy solution for your Home Automation over the Internet and (W)LAN with a WebSocket capable Web Browser (HTML5).
  • A Mesh Nodes ad-hoc network with a lot off IoT modules.
  • Each Node may, independently of the other Nodes, automatically run commands that are stored in a private Node SPIFF-simpleDatabase.
  • We use only a Web Browser to create and modify the database command records.
  • Each Node test once per minute the record(s) if a automatic action is needed.
  • There are eleven modes available, one manual and ten automatic on varied data:
    0:Manual, 1:Time, 2:Lux, 3:Temp, 4:sunRise, 5:sunSet, 6:Sun, 7:Day, 8:Night, 9:Timer, 10:TimeTemp.
  • With a Web Browser we can overrule, pause or stop the automatic functions.
    (pause: reset on 04:00am, stop: wait for revoked)
  • Use the simpleHomeSwitch template to create a new Node (open as a Arduino example).
  • Included simpleHomeSwitch functions and options:
    (use the Arduino compiler directives to switch options ON/OFF)
    • simpleDB (a one table database with a fixed record length and a non fixed field length)
    • simpleNTP, simpleRTC (I2C) or simpleTime time with millis$ (13 digits UNIX time stamp)
    • simpleSunrise and simpleSunset (on your location)
    • simpleDST/Summertime (on your location)
    • simpleDS18B20 temperature (Dallas OneWire)
    • simpleBH1750 light (I2C)
    • simpleADS1115 Hi-Res ADC (4 to 16 A-ports, 16 bits resolution, I2C)
    • simpleThermistor (with Steinhart-Hart model equation to get the right A,B and C values)
    • simpleStepperMotorSteps (home/end detection, turn +/- steps, adjustable speed and steps/rotation)
    • simpleStepperMotorDegrees (home detection, turn to degree<n>, usable with a potentiometer)
    • simplePublish (replacement for the old NHS (Not)AtHome module).
      (This function is capable to send pre-defined commands to other Nodes, just like with a Web Browser)
    • KaKu (CoCo) 433MHz radio transmitter (light and other wireless switches)
    • Button bridges (wired to remote control buttons)
    • Sonoff modules (relays and sensors) I use Sonoff as:
      • Sonoff-button Publish (Not)AtHome and combined with front/back night lighting (mode: 8, Night on sunSet/sunRise times).
      • kitchen boiler switch with multi temperatures on time X,Y,Z. 
  • A Node can ask another Node for values such as time, temperature, light intensity or whatever is available.
  • You can add your own functions and or commands.
  • Web Browser(s) and Nodes can
      - set: D-pin LOW/HIGH or pinMode INPUT/OUTPUT/INPUT_PULLUP
      - get: D-pin LOW/HIGH or A-pin values
    on another Node.

The problem with my previous NewHomeSwitch project
A ESP8266 Wi-Fi Server is limited to maximal four simultaneous connections, and sometimes old connections are still registered. One server with maximal two IoT Slaves and a Web Browser Slave is possible. No problem there is a painlessMesh library from BlackEdder ;-) it is perfect to solve the connection problem. But... a ESP8266 Wi-Fi Mesh Network, or actually more an wireless ad-hoc network, can't connect to a Local Wi-Fi Home Network. So, first log in on a Node with WebSocket and then, only local, communicate through a Web Browser. That is still tricky, limited, and not my thing.

My solution
A combination of three different communication protocols (red: the Node ID)

  1. (IoT WS) WebSocket Server <-> Web Browser WebSocket Client (browsers WB).
    + SoftwareSerial (115200 baud) HC-05 Serial Bluetooth Master.
    (or: wired SoftwareSerial to IoT 00)

    The WebSocket Server works in Wi-Fi modes with:
     - WLAN HTML5 Browser Client(s).
     - Internet HTML5 Browser Client(s).
    The WebSocket Server must have a static IP.
  2. (IoT 00) SoftwareSerial (115200 baud) HC-05 Serial Bluetooth Slave.
    (or: wired SoftwareSerial to IoT WS)

    + Mesh Wi-Fi ad-hoc Network Node.
  3. (IoT 01-98) Mesh Wi-Fi ad-hoc Network Nodes .

It's looks complicated but is yet simple, very cheap and works fine.
All he Nodes, included WS and 00, can be equipped with your own functions and hardware.
Each Node may, independently of the other Nodes, automatically run commands that are stored in a private Node SPIFF-simpleDatabase. We use a Web Browser to create and modify this database records.

You can combine two, or more, Fritzing modules to one Node.
 - By example "My Sunscreen Mesh Node":

My Sunscreen is controlled with this Mesh Node on temperature and light intensity.
(example DOWN: >=21.5*C && >=360 LUX, UP: <21*C || <120 LUX. With anti Yo-Yo delay and bath weather UP).

Other Nodes may ask for the time, Temp and Lux.
It communicate over, Bluetooth or Wired, SoftwareSerial with the WebSocket Server Node WS. And, of course, with all the other Mesh Nodes in this wireless ad-hoc network.


Unfortunately, but ...
Wi-Fi OTA upload on Mesh Nodes is not possible by the aforementioned reasons.
But... HardwareSerial Bluetooth OTA is a good alternative. With HardwareSerial Bluetooth is it also possible to use a (Arduino or Termite) serial monitor to get OTA (debug) information from the Mesh Nodes .
(HC-05 Serial Bluetooth: Windows and Android only)

Sonoff 4 pins header, ESP8266-nn 8 pins header.           Sonoff Bluetooth OTA debug information.
(as Fritzing included) You can use one Serial Bluetooth HC-05 module for all the Nodes .
Setup "Serial Bluetooth HC-05" is included as helper in the sHS library.


Internet access
Set Server Port Forwarding in your Router for Internet Browser Clients.
The router must have a static IP, ask your provider.
What is my (yours of course) IP address? Get it from: http://kendziorra.nl/mijnip.php.
Router settings how-to:
- Active: ON
- Service Name : sHS (or ???)
- WAN Interface : ETHWAN (or ???)
- WAN IP : (empty)
- Trigger Start Port : 8080
- End Port : 8080
- Translation Start Port : 8080
- Translation End Port : 8080
- Server IP Address : 192.168.1.110 (the static local station IP of your sHS WebSocket Server (Node "WS"))
- Protocol : TCP/UDP

Internet test:
In webbrowser address bar type <your-IP>:8080.
If Port Forwarding settings are correct then the sHS-Server will reply with:

Don't forget to adjust your firewall.


Possible use of simpleHomeSwitch Nodes
The Nodes action parameters can be set with a WebSocket capable Web Browser. The Nodes testing once per minute if actions are needed.
simpleHomeSwitch use a UTC/GMT UNIX Time Stamp. And of course: The Local Time, Sunrise/set and Summertime/DST are based on your location and rules.
Example parameters: Local time and *C or *F. Sunrise/Sunset Time "Offset", for both a positive or negative value.

  • Lights ON/OFF (in the morning and evening, mode 4:sunRise, 5:sunSet)
    ON: 06:30 (if ONtime<Sunrise+offset)
    OFF: Sunrise+offset
    ON: Sunset-offset (if OFFtime>Sunset-offset)
    OFF: 23:30 (Or after midnight 00:45, A new sHS day starts on 04:00 am)
  • Sun screen (mode 6:Sun)
    DOWN: if temp>=21.5*C && lux>=380 && YoYoTime
    UP: if lux <= 30(badweatherLux) || ((temp<=21*C || lux<=60) && YoYoTime)
  • off/onPublish (mode 0: Manual, 8: Night)
    (replacement for ((Not)AtHome or Night), push button and (RED) GREEN flashing LEDs)

        Short time PAUSE: night 04:00, a new day and doAction() set it to ACTIVE
        Long time STOP: wait for user revoked
        Normal ACTIVE: action mode

    Central heating (LOW and PAUSE/STOP) AUTO (send command to the optocouplers thermostat bridge Node, see picture)
    Kitchen close-in boiler (OFF and PAUSE/STOP) ACTIVE and ON (send commands to the Sonoff boiler relay Node)
    Room lights (OFF and PAUSE/STOP) ACTIVE (send commands to the KaKu (CoCo) radio Node)
    .... and more ...
  • Outdoor lighting (mode 8: Night)
    OFF: Sunrise+offset
    ON: Sunset-offset
  • (Lamella) Curtains (mode 8: Night, with stepperSteps motor)
    OPEN: Sunrise+offset
    CLOSE: Sunset-offset
  • Pond pump (mode 7: Day)
    ON: Sunrise+offset
    OFF: Sunset-offset
    SPEED: turn the AC power potentiometer 0-259* (with stepperDegrees motor)
  • And much more....

Nodes simpleHomeSwitch template
Open the template as an Arduino example file and set the compiler directives to the NodeID type "WS", "00" or "01" to max. "98".
A Node must have a unique ID. Nodes "WS" with "00" are the minimum configuration.

  • "WS" (WebSocket Node with SoftwareSerial/Bluetooth) Wi-Fi Home Network and Internet
  • "00" (Mesh Node with SoftwareSerial/Bluetooth) Wi-Fi ad-hoc Network
  • "01"-"98" (Mesh Nodes ) Wi-Fi ad-hoc Network. The ID "99" and "WB" are reserved
    ("99" to all the Nodes and "WB" the Web Browser ID)
    (free use oft two chars. also "AA" and "bc" is also OK)

There is also a "very basic" HTML UI, with the ID "WB", and associated scripts. It is usable for all the Node functions and commands.
Make your own (graphic) UI and use this as a "How To ...".

Each Node can be set by using a Web Browser. Input: Node ID, function, command, a unique key and parameters (command list). These settings are stored in the simpleDatabase on the Node. A record has 30 fields and can hold a lot of data for, whether or not automatic, use. There are eleven modes available, one manual and ten automatic on varied data:
    0:Manual, 1:Time, 2:Lux, 3:Temp, 4:sunRise, 5:sunSet, 6:Sun, 7:Day, 8:Night, 9:Timer, 10:TimeTemp.
A record has a unique KEY, fixed on 4 chars, and hold the unit setups, status and time counters. On Node (Re)Start/Reset the unit(s) are set in the right status. Every minute a check on unit automatic mode 1-10 actions. If a action is done then the unit-KEY-record is updated. If a Node has lost the connection than it works standalone and will try to reestablish the connection.
Typical use: Light on/off, curtains close/open, blinds down/up, relays on/off, Publish (this Node send commands to other Nodes . Replacement for (Not)Athome), steppers turning left/right and find the home/end position, steppers degrees and find home position, and ... all what you want.
A Node can ask another Node for values such as time, temperature, light intensity, Pin or whatever. So, if no RTC then the Node can get and sync the time from a "ask Node(nn) list". There is also a STOP mode, 0: Active, 1: Pause and 04:00am reset, 2: Stop and wait for revoked.


Helpers in this library

  • Get KaKu (CoCo) transmitter codes (OLD and NEW).
  • Set RTC_DS3231 date and time.
  • ESP8266 SPIFFS file system format. Use this, on all Nodes, before firs time simpleHomeSwitch upload.
    Please note Set IDE compile to: >=2M (1M SPIFFS) or >=1M (64K SPIFFS)
  • ESP8266 SPIFFS FTP Files Server (use the FileZilla FTP Client to down- and upload SPIFFS files).
    This FTP Server bonus tool is not really necessary, but you may want to see, or change, the database records on your PC.
  • Set and test the SoftwareSerial Bluetooth HC-05 Master and Slave modules.
  • Set a "auto connect" Serial Bluetooth HC-05 module for using with Widows and Android (OTA upload and/or Monitor).
    (You can use one Serial Bluetooth HC-05 module for all the Nodes with a small 8 pins ESP8266-nn and a 4 pins Sonoff PCB)

List of all simple... libraries

Al simple... libraries with "How to use" examples. These libraries are also to use in other applications.
The abbreviation "...Ms" stands for UNIX Time Stamp and milliseconds (10 digits long and a 13 digits string).
All the simpleHomeSwitch Nodes can use these simple... libraries.
A Mesh Node without RTC time use the TimeMs library and sync the time, on start and interval delay, by asking another Node.


D and A pins
Web Browser(s) and Nodes can
  - set: D-pin LOW/HIGH or pinMode INPUT/OUTPUT/INPUT_PULLUP
  - get: D-pin LOW/HIGH or A-pin values
on another Node.
Also useful to operate a Node with a (Web Browser)App.


Hint: Show Analog output
(A-pin, ADS1115, Thermistor, ...sensors)

Create a HTML JavaScript Web Browser App with a chart from Google Charts.
Use function 3, command 3 in a time loop, with NodeID and record Key, and get the required values to update the Chart.

(see my Luxe Sous-vide project and Simple Sous-vide project with a DS18B20 sensor and PID control)


How to create or change a unit record
Open simpleHomeSwitch.html (included in download) and click the sHS commands list button.
All the function 1 commands create a new record with default values (simpleDB.ino->void newRecord()).
   A new record is added or, if the key already exists, just overwritten (no warning!).
All the function 2 commands (over)write only the respective default values.

Example set on Node03 a record key to switch pin D3 every day: 080:00 ON and 20:30 OFF. toID func cmd data1 data2 data3 data4 03 1 3 pump D3 -1 set the key and pin D2 (data3: -1? see "Explanation Pin setup") 03 2 1 pump 08:00 20:30 ON 8:00, OFF 20:30 03 2 0 pump 1 set auto time 1 action mode TIME 03 0 0 pump 0/1 manual OFF/ON (Web Browser or App) Example set on NodeWS a record key to switch OLD KaKu (CoCo) every day on sunRISE or sunSET. toID func cmd data1 data2 data3 data4 WS 1 0 lamp 118124 322 set the key, KaKu code and KaKu period WS 2 1 lamp 06:30 23:00 mode 4: ON time (OFF=sunrise+offset), mode5:(ON=sunSet-offset) OFF time WS 2 5 lamp 15 15 mode 4: +offset sunRise, mode5: -offset sunSet WS 2 0 lamp 4 or 5 set auto time action, mode 4: sunRISE or mode 5: sunSET WS 0 0 lamp 0/1 manual OFF/ON (Web Browser or App) Example set on Node04 a record key to switch a boiler on time and temperature. By example: Sonoff TH16 WiFi Smart Switch + Sonoff TH Sensor DS18B20 ON: if TimeON&&TempON OFF: if TimeOFF||TempOff toID func cmd data1 data2 data3 data4 04 1 3 blr1 D6 -1 set the key and (Sonoff)relay pin 04 2 1 blr1 06:30 23:00 mode 10: ON time, mode10:OFF time 04 2 4 blr1 58 62 mode 10: ON temp, mode10:OFF temp 04 2 0 blr1 10 set auto TimeTemp action, mode 10 04 0 0 blr1 0/1 manual OFF/ON (Web Browser or App) Example set on Node00 a record key to switch a sun screen on room temperature and luminance with button bridge optocouplers. DOWN: if Lux>=LuxDOWN && Temp>=TempDOWN && YoYo
UP: if Lux<=BadWeatherLux
UP: if (Lux<LuxUP || Temp<TempUP) && YoYo Bridged remote control buttons from Wireless Tubular Sun Screen Motor. toID func cmd data1 data2 data3 data4 00 1 3 scrn D3 D4 set the key, DOWN D3 and UP D4 optocoupler pins 00 2 3 scrn 380 60 LuxDOWN 380, LuxUP 60 (room luminance) 00 2 4 scrn 21.5 21 TempDOWN 21.5, TempUP 21 (room temperature, default *C or set *F) 00 2 6 scrn 10 delay time 10 minutes to prevent the Yo-Yo effect 00 2 7 scrn 4 500 repetitions 4, delay 500 Millis (two momentary button actions) 00 2 8 scrn 30 BadWeatherLux 30 (quick UP) 00 2 0 scrn 6 set auto sun 6 action mode SUN 00 0 0 scrn 1/0 manual DOWN/UP (Web Browser or App)

Explanation Pin setup
(LED can have VCC on ANode then: Pin HIGH = OFF, Pin LOW = ON)
One Pin mode, Function 1, command 3
  - data2: Pinn On/Off or Down/Up.
  - data3: must set to -1.
One Pin Momentary mode, function 1, command 3
  - data2: Pinn. Momentary with a even number of delayed repetitions.
  - data3: must set as data2-Pinn, 1-On/Down or 0-Off/Up has the same result.
     Use this Two Pins mode only with a even number of repetitions.
Two Pins Momentary mode, function 1, command 3
  - data2: Pin1n On/Down. Momentary with a even number of delayed repetitions.
  - data3: Pin2n Off/Up. Momentary with a even number of delayed repetitions.
  Use this Two Pins mode only with a even number of repetitions.
  (very useful to bridge remote control buttons with optocouplers)
Repetitions, function 2, command 7
  - data2: number of repetitions
  - data3: delay time in Millis between the repetitions.
  One repetition: HIGH
  Two repetitions: HIGH->Delay->LOW
  Three repetitions: HIGH->Delay->LOW->Delay->HIGH
  Four repetitions: HIGH->Delay->LOW->Delay->HIGH->Delay->LOW (default values: 4 reps and 500ms)
     and so on... So even repetitions ends with LOW and odd repetitions ends with HIGH.
  This is very useful with bridged remote control buttons by Wireless Tubular Motors: Two Pins, Momentary, Repetitions: 4, Duration: 500.


List of used libraries

https://github.com/esp8266/Arduino ESP8266WiFi WiFiUdp SPI SD FS Wire SoftwareSerial https://github.com/milesburton DallasTemperature https://github.com/Links2004 WebSocketsServer https://github.com/PaulStoffregen OneWire TimeLib https://github.com/flav1972/433mhzforarduino 433mhzforarduino (KaKu, CoCo) ##### Included in SimpleHomeSwitch library ##### https://gitlab.com/BlackEdder painlessMesh // Do not download!!! It's included in sHS http://kendziorra.nl simpleKaKu // A simple KaKu (CoCo) 433MHz library simpleNtpMs // A simple NTP Time library incl. millis timestamp$ simpleRtcMs // A simple DS3231 RTC Time library incl. millis timestamp$ simpleTimeMs // A simple Time library, use syncTime from a other Node, incl. millis timestamp$ simpleDB // A simple database library simpleTimers // A simple alternative milliseconds timer(s) library simpleTempDS18B20 // A simple single DS18B20 Temp library simpleLuxBH1750 // A simple BH1750 Lux library simpleAdcADS1115 // A simple 0-15 ports ADC library simpleThermistor // A simple Thermistor library simpleStepperSteps // A simple stepper library simpleDegreesSteps // A simple degrees stepper library simpleSummerTimeDST // A simple Summertime/DST library simpleSunRiseSet // A simple SunRise/Set library

simpleHomeSwitch command list

/** =========================================================================================== * A unit is a "function" on a Mesh Node. A Node can have more than one function. * A unit (setup function 1 commands) is saved in the Mesh Node database. * Automatic unit actions setup in function 2. Other, not unit, commands in function 3. * A functions has one or more commands. The "key" (four char fixed) always in data1 * (key: a unique key of four chars, unit: the function to control) * * Func 0 Cmd Descr data1, data2, data3, data4 * ============================================================================================ * #manual switch units# * --------------------- * 0 0 switch a unit key, [data2[,data3[,data4]] * a KaKu unit * data2: 0/1/2(OFF/ON/DIM) * [data3: 1-15] dim value(optional) * a D-Pin * data2: 0/1(OFF/ON) * a StepperSteps * data2: 0/1/2 (HOME/END/nn-steps) * 1:endSwitch or steps (512/4096 step mode:set by func 1, cmd 4) * 2:go to position data3-steps (position from HOME) * data3: nn-steps * a DegreesSteps * data2: 0/1/2 (HOME/DEGREES/nn-degrees) * 1:position set by func 1, cmd 5 * 2:go to position data3-degrees * data3: nn-degrees * 0 1 repeat last - key, (no parameters) * action * 0 2 get unit status key, (no parameters) Also usable to check if record exist * return - OFF/UP:0, ON/DOWN:1, and/or action value(s) * ---------------------------- * Func 1 Cmd Descr * ============================ * #setup a unit# If unit key exist then overwrite else add new * -------------- * 1 0 setup OLD KaKu: key, data2: code * data3: period * (NO additional signal options needed) * Use "simpleHomeSwitch\examples\KaKu-Receive.ino" * to get this two values * OLD KaKu: Use only the remote control ON-buttons * ======== ========== * to get the right "code"! * 1 1 setup1 NEW KaKu: key, data2: period * data3: address * data4: groupBit * finish this setup with function 1, command 2 * Use "simpleHomeSwitch\examples\KaKu-Receive.ino" * to get this six values * 1 2 setup2 NEW KaKu: key, data2: unit * data3: dimLevelPresent * data4: dimLevel * 1 3 setup PIN unit: key, Two pins mode (very useful to bridge remote * control buttons) (notation: D0, D1, D...) * data2: Pin1(ON/DOWD), momentary or hold * data3: Pin2(OFF/UP)), momentary or hold * One pin mode * data2: Pin(ON or OFF), * data3: -1 * 1 4 setup Stepper key, data2: 0/1(360* in 512/4096 steps mode) * data3: 0/nn-steps (set the ON action state) * (0:endSwitch or nn-steps:goto nn-steps) * 1 5 setup Degrees key, data2: degrees 1-259* (set the ON action state) * Now you can use this unit(s) with "function 0, command 0, key, option list" or ad * a "mode" and other parameters (Function 2 commands) * ---------------------------- * Func 2 Cmd Descr * ============================ * #setup unit mode# * ----------------- * 2 0 mode: key, data2: mode (0-10) * 0:Manual, 1:Time, 2:Lux, 3:Temp, 4:sunRise, 5:sunSet, * 6:Sun, 7:Day, 8:Night, 9:Timer, 10:TimeTemp * mode 6: use Lux + Temp + bad weather (sun screen mode) * mode 7: use sunrise + time offset, * mode 8: use sunSet + time offset * 2 1 time: key, data2: hh1:mm1 * data3: hh2:mm2 * time hh1:mm1(ON), time hh2:mm2(OFF) * (mode 1, 4, 10: hh1:mm1, mode 1, 5, 10: hh2:mm2) * 2 2 timer: key, data2: minutes * manual ON, OFF after n-minutes * 2 3 lux: key, data2: lux1(ON) * data3: lux2(OFF) * light intensity in lux, mode: 2, 6 * 2 4 temp: key, data2: temp1(ON) * data3: temp2(OFF) * temperature in nn.n°C/°F, mode: 3, 6, 10 * 2 5 offset key, data2: minutes1 * data3: minutes2 * after sunRise, before sunSet (minutes) * (mode: 4, 7, 8(minutes1), 5, 7, 8(minutes2)) * positive or negative values are valid * 2 6 yoyo: key, data2: minutes * minutes to prevent a yo-yo effect (mode: 6) * 2 7 repetitions: key, data2: repetitions * data3: millis * number of repetitions, length in Millis (mode: 6) * 2 8 bad weather key, data2: lux * lux, quick dark (bad weather) (mode: 6) * 2 9 stop: key, data2: 0/1/2 * 0:Active * 1:Pause, 04:00am reset * 2:Stop, wait for revoked (mode: all) * 2 10 reverse: key, data2: 0/1 * 0:normal * 1:reverse the unit (ON<->OFF) (mode: all) * 2 11 delete: key, (noting) * tombstone the unit (use func:3, cmd:99 to compressDB) * ---------------------------- * ###################################### * Other, not unit, commands and function * ###################################### * ---------------------------- * Func 3 Cmd Descr * ============================ * #Sync the Time?# * ---------------- * 3 0 Nodes can ask a UTC/GMT UNIX timestamp from Node(nn) * ask NodeWS or a Node with a RTC or all "99" * also usable to check the time with a Web Browser * ---------------------------- * #Time set# * ----------------- * 3 1 time set in seconds as UTC/GMT UNIX timestamp * data1: 10 digits (uint32_t) * not usable with NTP and WEB time * usable with RTC (and Timelib if no askTime sync) * ---------------------------- * #Time correction# * ----------------- * 3 2 time correction in -/+ seconds * data1: -32767 to 32767 (int16_t) * usable with RTC and Timelib * not usable with NTP and WEB time * usable with RTC (and Timelib if no askTime sync) * ---------------------------- * #get Temp and Lux# * ------------------ * 3 3 Nodes /Web Browser can ask the Temp and Lux from a Node * ---------------------------- * #get Analog values# * ------------------- * 3 4 Nodes /Web Browser can ask ADC values from a Node with A-pin or HiRes ADS1115 port * very useful in a (Web Browser-)App (use Google Charts) * data1:A-pin (notation: A0, A1, ...) or ADS1115 port (A0-A15) * data2: 0-3 (ask for ..., values are set in data3-4) * 0:volt and steps (volt, ADC value) * 1:voltStep and maxSteps (volt resolution, max resolution) * 2:temp and ohm (if using a thermistor) * ---------------------------- * #get/set Digital value# * ----------------------- * 3 5 Nodes /Web Browser can ask/set digital values from a Node * data1:D-pin (notation: D0, D1, ...) * data2: 0:getPin, 1:setPin, 2:set pinMode * data3:setPin (0/1 - LOW/HIGH) * pinMode (0/1/2 - INPUT/OUTPUT/INPUT_PULLUP) * ---------------------------- * #get sunRise/Set times * ----------------------- * 3 6 Nodes /Web Browser can ask sun rise/set times * rise hh:mm to data1 * set hh:mm to data2 * DST to data3 * ---------------------------- * #add your own ask functions# * ---------------------------- * 3 ? (??? in doFunc.ino->void function3()) * ---------------------------- * #DB backup and compress# * ------------------------ * 3 99 backup the database and then compress it (remove tombstone records) * ---------------------------- **/