Notes on Tasmota Sensors With Display

Feb 6 2022: I have spent just about all damn day today figuring out how to get Tasmota running on sensor devices, including the Heltec Wifi Kit 32, and the Heltec Wifi Kit 8. My goal is to use Tasmota to get Temp/Humidity data into Home Assistant/Grafana for experiments, while ALSO displaying those readings locally on the sensor since I have plenty of dev boards with displays.

Tasmota primarily exists to connect sensors and actuators (relays) to a data backend. It runs on ESP8266, and more recently, ESP32 and its variants.

Because libraries take a lot of space, Tasmota makes precompiled binaries in a ton of different varieties, including tasmota-sensor (with every sensor they support, but missing other stuff) and tasmota-display (with every display they support, missing almost all sensors). I think the idea is you can quickly get an off-the-shelf firmware to test one of your components, then once your configuration works, you compile a custom option set that does all the bits you specifically need.

I started trying to get the Wifi Kit 8 to read a sensor, but failing that, moved on to just trying to get the display to work, which also failed.

Then I moved onto the Wifi Kit 32, to see if maybe THAT would prove easier, for one or the other. It did, ish.

Wifi Kit 32

The first clue is the pinout, which shows that the display (SSD1306, 128×64) I2C was actually the same as the I2C I’d personally been using on my previous project, i.e. my sensor was already wired up to it (GPIO15/SCL GPIO4/SDA). Tasmota likes all I2C devices on the same bus, at least best I know right now.

Having had trouble with the display already on the Wifi Kit 8, I started by installing release tasmota32 which isn’t available via the web installer – I had to download it from releases:

This resulted in success seeing the SHT-31D sensor data after I configured I2C properly. This issue helped:

After that success, I downloaded tasmota32-display.bin from the releases page above, and OTA updated that on the Wifi Kit 32. After some futzing around, I finally landed on the rough procedure below, which worked.

Wifi Kit 8

I tried to install tasmota-sensor from the web installer, but couldn’t get the sensor to show up, so I moved on to trying the display. I ALSO couldn’t get the display working, and found this issue which didn’t ultimately help:

Thinking that maybe I needed to spin a custom firmware to get the display working, I did that. I followed this guide: It felt like it wasn’t working right, but ultimately it did produce a firmware with both display and SHT31 support. Not sure if this video is about the same procedure I followed, I bet it is:

At this point, I moved on to trying with the Wifi Kit 32.

After figuring out both the display and sensor independently, I reinstalled my custom firmware on the 8266 and tried the procedure below, with success. A significant contributing factor was that the Wifi Kit 8 has pins labeled SDA and SCL, but they are NOT for I2C, and also ARE NOT the same I2C the display is on. D1 is SCL, D2 is SDA. See the Wifi Kit 8 pinout for more info:

Approximate procedure to get a sensor and display working:

  1. Make sure your firmware actually supports both the display and the sensor you want to use. You probably have to do a custom compilation for this.
  2. Make sure your sensor and your display are PHYSICALLY on the same pins. This was a problem for the Wifi Kit 8.
  3. Go into configuration and set GPIOs properly for SDA, SCL, and also the display reset. Both pinouts show which pin the display reset line is on, GPIO16 for these boards. GPIO16 should be set to either Display Rst or Output HI.
  4. In Console, verify i2cscan shows both devices, the sensor and the display.
  5. In Console, use DisplayHeight to set either 32 or 64 depending on the kit. Default may not be right.
  6. In Console, use DisplayMode 4 to set a display mode that will actually try to output something to the display. DisplayMode 0 IS ENTIRELY USER-GENERATED.

At this point, you should have valid sensor data AND a working, if not useful, display. See for more details on how to configure the display.

Be First to Comment

Leave a Reply

Your email address will not be published.