Adding application for Exanh water level sensors (bord v04)
[soft/lpc82x/exanh] / v04 / README
1 Exanh Gardener soil moisture sensor support.
3 Copyright 2017 Nathael Pajani <nathael.pajani@ed3l.fr>
6 /* ****************************************************************************
7  * This program is free software: you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation, either version 2 of the License, or
10  * (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
19  *
20  *************************************************************************** */
23 This code handles the v0.2 and v0.3 versions of the Exanh Gardener soil
24 moisture sensor.
26 The code also provides support of all three sensors found on exanh sensor board
27 in version 0.2 :
28  - BME280 I2C temperature, humidity and pressure sensor
29  - TSL256x I2C luminosity and IR sensor
30  - VEML6070 I2C UV sensor
32 The default behavior for the sensor does nothing (should enter sleep, but not
33 implemented yet).
34 When the sensor is not configured (no address set), then all data received on
35 serial is silently dropped.
36 Pressing the "Mode" button on the sensor for more than 4 seconds sends a "c"
37 request on the serial line, changes address to 0 (nul), and enters the
38 "address requested" state. The host should then send a message to the sensor on
39 it's temporary address, containing it's new address. The message is three bytes
40 long and it's format is :
41   #     0       addr
42  0x23  0x00  (0x01 to 0x1F)
43 Addresses are between 1 and 31, allowing up to 30 sensors on one link.
45 Once the address is set, the host can request samples data by sending a message
46 addressed to the sensor.
47 The message is three or more bytes long (depending on the type) and it's
48 format is :
49   #         addr           type          [other data]
50  0x23  (0x01 to 0x1F)  (0x00 to 0xFF)    [....]
51 Valid types are :
52  - 'a' : all - request to send all available sensor data to host.
53  - 'l' : set led color - set the sensor led color. Three bytes of data (RGB).
55 It is also possible to broadcast a message to all sensors by sending to address
56 255 (0xFF)
59 To set the sensor address using a serial line from a linux host, you can use
60 these commands (sensor connected to ttyUSB0) :
62 # For device address 1 (0x01) :
63 echo -ne "#\x00\x01" > /dev/ttyUSB0
65 # For device address 2 (0x02) : 
66 echo -ne "#\x00\x02" > /dev/ttyUSB0
68 # and so on ...
69 [...]
71 # To check what these command send if you are not sure :
72 echo -ne "#\x00\x01" | hexdump -C
75 When debug is set at compile time, then debug data is sent on UART0