Skip to content

Troubleshooting

Robert Campbell edited this page May 20, 2019 · 69 revisions

Troubleshooting Tools

Logs

The logs are available via the web console, serial port and syslog.

The default logging for serial and weblog is 2 (syslog is disabled by default). It is set separately for each log destination. Log levels range from 0 to 4. The higher the log level, the more information is logged. When troubleshooting your device its recommended to set loglevel to 4.

Web Logs

These show up in the Web UI Console (http://deviceip/cs).

Serial Logs

WARNING, never connect to serial while the device is connected to mains power. You can still collect the logs, but only when powering it via your serial connection. Some devices use the serial port to control the relays or an MCU, so serial logging might interfere with control and even switch relays or lights.

Through a terminal program set the baud rate to 115200, disable hardware flow control and you will see the logs.

Crashdumps

If the ESP8266 crashes, it frequently dumps information about the crash out the serial port, so the process listed above to see serial logs can provide extremely useful information

Syslog

If you have a Linux system, it is probably running syslog and you just need to configure it to listen on the network.

On systems running rsyslog (most linux distros), edit the file /etc/rsyslog.conf. Adding (or uncommenting) the following lines will probably start making the logs show up in some file under /var/log

$ModLoad imudp $UDPServerRun 514

If you do not have access to a Linux system, there are Microsoft Windows Syslog server options.

Erasing flash

This approach solved a lot of small issues. Sometimes this is due to a bad flash, a bad OTA or invalid data that remains in the flash where the SDK memory is.

Erase flash and flash the latest precompiled bins from http://thehackbox.org/tasmota/ over serial.

esptool

Using the latest esptool makes this process "rather" easy.

  1. Go to https://github.com/espressif/esptool and read the README.md regarding installing esptool which boils down to:
    • Download and install Python for your operating system from https://www.python.org
    • Open a command prompt and install pyserial with command
      pip install pyserial
    • Install esptool with command
      pip install esptool
  2. Erase Flash
    • Connect your device to a known serial port (say COM5)
    • Hold the push button and apply 3.3v power to the device from the USB/serial connecting device
    • Erase the complete flash with command
      esptool.py --port COM5 erase_flash
    • Note: after erasing flash, you must hold push button and apply 3.3v again, before loading new flash
  3. Load Tasmota into a device with command
    esptool.py --port COM5 write_flash -fs 1MB -fm dout 0x0 sonoff.bin

NodeMCU PyFlasher

If you don't want to install Python you can download NodeMCU PyFlasher. It offers a checkbox option in the GUI to erase flash before uploading a new binary.

MQTT traffic

To check the flow of MQTT traffic you can use MQTT Explorer which shows your entire MQTT traffic in an organised and structured way.

Tasmota Device Manager offers an overview of all your Tasmota devices using MQTT protocol. You can manage them, use device features and do basic troubleshooting with ease. It also cleanly displays if your device is dropping from the network often or reboots unexpectedly.

Running out of memory

This typically shows up in the device working when it first starts up (hitting the button toggles the relay), but some time later it either reboots or some function won't work.

For example, you can't load the module configuration page.

The only fix for this is to recompile the firmware and disable features you don't need.

Known large features are web server and TLS, but other things to consider disabling if you don't need them are emulation support, Domoticz support, WS8212 support

A 512K firmware binary size is a good "target" and rule of thumb for allowing future OTA firmware updates. Flashing over the air (OTA) requires that there is enough free program memory available to upload the new firmware along with the existing copy before the old copy is deleted. If your firmware binary is larger than the available free program memory, you can replace the existing firmware with a minimal functionality version of Tasmota (roughly 375K). This leaves enough free in the 1024K program memory for the final copy of the firmware (i.e., larger than 512K).

Flashing Tasmota makes it simpler to update to newer versions because it is built for OTA upgrades. In fact, if the new firmware is larger than the available free memory, Tasmota's OTA process will, automatically, first replace the existing firmware with "minimal" to then have enough space to put the new firmware in.

If one is loading firmware only via the serial interface (i.e., wired), then theoretically you could load firmware as large at the program memory size. since you can erase the flash and then fill it to the rim with the new firmware. But then you'd be left with performing upgrades by having to have physical access to the device each time.

Clone this wiki locally
You can’t perform that action at this time.