Tasmota MQTT Mosquito Telegraf Influxdb Grafana


Just a few notes at the moment – a work in progress.  This is just what I’m doing – your mileage may vary.

ESP8266

The WIFI chip behind the modules.  By most accounts it is not 5V tolerant.  I’m using 2 modules, the D1 Mini Pro and the smaller ESP-01S.

The D1 has a USB interface on-board and programs reliably when plugged directly into the PC.  The ESP-01S needs a 3.3V USB adapter so I got a couple of those small USB adapters the ESP-01S plugs directly into – orient to point the antenna at the USB connector.  This was not reliable until I installed a 1K resistor in series with the TX line to the module.  The USB chip is applying 5V to the RX pin of the 8266, which it doesn’t seem to like.  The USB adapter also needs a switch to Gnd on the GPIO0 line to enable programming.

Note: GPIO0 and GPIO2 must be low and GPIO15 high at boot for the 8266 to run normally.  The D1-Mini-Pro board has 10K resistors on-board to set these levels for normal program boot.  GPIO0 = D3, GPIO2 = D4. GPIO15 = D8.  If these I/O line levels are wrong at reset you program won’t run – be careful.

Tasmotizer can install the network configuration to the D1 so it connects directly to your wifi network after programming.  Otherwise after reboot Tasmota provides a access point (AP) at 192.168.4.1 which you have to use a cellphone to connect to via wifi to configure the SSID and password.  Tasmota then reboots and connects to your wifi, DHPC.

I had some problems getting Tasmotizer to install the configuration but think I have it working now.  Install Tasmota first and reboot normally (Tasmota provides the AP but ignore this.  Use Tasmotizer to save the configuration to Tasmota and reboot it again.  It should now connect to your network without having to use the AP.

Tasmota

Command reference: here

I’m using the D1-Mini-Pro because it has the external antenna option and the ESP-01S (S means 1MB flash) because it’s small and cheap.

Install Tasmota using Tasmotizer – I’m using Kubuntu, running Tasmotizer from the command line by simply entering “tasmotizer.py”.

Tasmotizer will erase then install Tasmota.  If using a cellphone to configure – once Tasmota is installed and restarted, use a smart phone to connect to the AP it provides – a message appears, select “connect to” and it takes you to a page that allows your network SSID and PW to be entered.  It then resets and connects to your network.

Check you wifi router to find out what IP address it’s on then visit that address using a web browser – I had to allow java script on that address for it to be functional.  Now complete the configuration of Tasmota.

When I added the 4th Tasmota device DHCP to the router there was a problem – all 4 devices would appear and disappear, no data getting through and no access using a web browser.  The IP addresses would keep changing making connection attempts impossible.  The solution was to log into the router and manually assign IP addresses to the MAC addresses of the Tasmota devices.

Be sure you have a reasonably good wifi signal between Tasmota and the router or it may be a bit slow and unreliable.  looking at the “Information” page will let you know the signal level and a lot more.  I have noticed that if the signal level is below about 30%, the pages can take a long time to load and often don’t completely load.

To get correctly dated messages you set timezone at the web interface console by entering the command “timezone 12” – for New Zealand.  Timezone without the 12, will display the current setting.  The number “12” is an offset in hours from UTC.

To set a static IP address:  use the web console and enter “IPAddress1 192.168.1.75”, changing the actual address to what you want it to be.

ESP-8266 D1-mini Pro – ACW-1A*

esp8266 1 Mini Pro acw_1a1A carrier board for the D1-Mini-Pro, providing power supply and input/output connections.  The design purpose was to provide a outdoor unit for control/monitoring.  The narrow module can be housed inside a 32mm diameter conduit making it waterproof and suitable for outdoor elevated mounting for best wifi range.

  • mounts a standard ESP-8266 D1-Mini-Pro module (not supplied)
  • power supply nominal 12V DC
  • dc-dc 5V regulator module
  • relay output – 2A, 35V ad/dc, C-NC-NO
  • mosfet output – 5A, 12V – switches -ve
  • 1 each, optically isolated input and output
  • ten general purpose i/o connections
  • narrow to fit inside 32mm electrical conduit
  • mounts various 2.4Ghz wifi antennas
  • corner mounting holes

esp8266 1 Mini Pro acw_1a1For outdoor mounting, possibly raised, up a pole or on a roof the ACW_1A module can be mounted inside a standard 32mm electrical conduit.  The antenna can be sealed into the conduit or protruding through a hole in the end cap – sealed with silicon RTV.  The antenna can be a simple 1/4 wave as shown or for longer ranges a higher gain or directional antenna.

For shorter ranges, the on-board antenna can be used.

Note :  Unless specified, you will need to supply the ESP-8266 D1-Mini-Pro and wifi antenna if required.

For specific application the unit can be supplied complete and ready to install with a suitable wire tail for connection to power and input/output.

Header Pin and I/O functions

  • TX and RX = TX and RX on the D1-Mini-Pro : 3.3V I/O
  • I2C – clk and dat to D1 and D2 on the D1-Mini-Pro : 3.3V I/O
  • Analog Ana = A0 on the D1-Mini-Pro (see comment below)
  • DS 1-wire = D5 : note : the 4K7 pull-up is enabled via a small solder jumper on board
  • isolated opto-input = D3 : apply a voltage to trigger the input – Note: must be off at boot/reset
  • isolated opto-output = D4 : output closes when activated
  • relay = D0 : note : the relay must be enabled via a small solder jumper on board
  • mosfet-output = D8 : affects boot mode (GPIO15).

Analog Input

The input is only rated to a maximum of 3.3V.  As there is a 10K pull-up on the analog input it will read full scale (1024).  The 470R series resistor and the 10K act as a voltage divider but only increase the input voltage slightly.  An additional external series resistor is all that’s needed to read higher voltages.  Example: 33K allows reading approximately 0-14V over the 0-1024 count range – suitable for monitoring a 12V SLA battery.  Note: each instance will require calibrating.

Example I/O

Anemometer and direction : wind sensors.  Fine-Offset.  Yellow/Red the two center wires are the wind speed providing 2 pulses per revolution.  Black/Green the two outer wires are wind direction providing a resistance over 8 steps for 360-deg.  The resistance varies between 1K and 120K but is not in regular increments around 360-deg.

Rain gauge (Fine Offset) produces a pulse with every 0.3mm of rain.

DHT-22 humidity/temperature and DS18B20 temperature sensors each use a different 1-wire data interface.

.  

Sensor Board – CJMCU-8118

This board contains a CCS811 gas sensor and a HDC1080 ?? sensor.

Configure 2 I/O pins, D1 as “I2C SCL” and D2 as “I2C SDA”.  The sensor runs on 3.3V.

PIC – ESP-01 board

wlc_1a controller esp-01This is an update of a previous control board that I have used for several applications.  The on-board PIC controller performs the particular function required.  The expansion/improvements include on-board mains power supply and ESP-01 for basic remote monitoring or control.

wlc_1a controller esp-01Previous applications of the original board include refrigeration controller, power safety cutoff controller for laser cutters, computer cabinets, etc. and water level controller.

ESP-01 Relay Board

Note:  This board as supplied operates from a 5V DC supply.  12V requires the relay to be replaced with a 12V version.

I have the Tasmota sensors version installed to the ESP-01 – was just convenient.  “D3 GPIO0” is the relay output – use “Relay1i(29)” for normal relay operation.