posts /

Easymeter: Building Tasmota

Posted Wed Sep 14 10:32:04 2022 Florian Lohoff

If you want to use Tasmota for parsing your SML output and sending it out to MQTT you need to get tasmota from git, change some stuff, build it and flash it to your NodeMCU.

The easyiest way is to build tasmota with the espressif toolchain in a Docker container. To create the docker container:

git clone https://github.com/tasmota/docker-tasmota 
cd docker-tasmota
docker build -t docker-tasmota .

Now you have a usable toolchain. Next step is to fetch tasmota and enable SML and fix the immediate MQTT sendout to a different Topic:

git clone git@github.com:arendst/Tasmota.git
cd Tasmota
git checkout -b build v12.1.1
curl https://github.com/flohoff/Tasmota/commit/c64dea980a5bdde75e4d1097c4c384bc08f49813.patch | patch -p1 -E 
curl https://github.com/flohoff/Tasmota/commit/9669193390e64e926267f4af1aa8aed41617991b.patch | patch -p1 -E

And now we need to build Tasmota:

mkdir platformiocache
docker run --rm -ti -v $PWD/platformiocache:/.platformio \
    -v $PWD/Tasmota:/tasmota \
    -u $UID:$GID \
    docker-tasmota \
    -e tasmota4M

And there is your tasmota NodeMCU binary in Tasmota/build_output/firmware/tasmota4M.bin

In case you need to flash your NodeMCU by USB because you have a 1M flash version installed and cant do "Over The Air" (OTA) upgrades - use esptool like this:

esptool --port /dev/ttyUSB0 --baud 1000000 \
    write_flash --flash_size=4MB \
    -fm dio 0 \

And continue your normal setup by joining the Wifi the Tasmota opens.