MPP Firmware

NOTE: V3 of MppDevices is Arduino based and supports Over The Air (OTA) upgrades: https://sites.google.com/site/mppsuite1/esp8266-updates-v3.

Here's what you need to flash an ESP8266 device for use with AutomationManager:

  1. AutomationManager (aka WemoManager).

  2. MppArduino for setup and debugging.

  3. An ESP8266 device of some kind.

  4. A USB/UART programmer depending on your device type.

    • Often all that's needed is a USB cable for NodeMCU, wemos mini, etc.

    • Other types will need something like the picture below with wires to jumper the programmer to a header on the ESP8266 card.

  5. A PC (or MAC or Linux, the instructions here are for the PC).

  6. Espressif's ESP8266 DOWNLOAD Tool

  7. The applicable bin file from MPP Arduino Firmware - download it to your PC. Start with MppDevice.bin, make sure everything is working, then use the MppDevice OTA to load the bin for your specific application.

Available from ebay, etc. Wires can be soldered to the breakboard to add a RST and GPIO0 switches (to ground) to simplify entering programming mode. Use male pins on sonoff devices to use male-male jumper wires from the adapter breakout pins for a stable connection.

And the steps:

  1. Verify the device is working as expected before attempting to flash it!

  2. Wire the device to the programmer. Most devices use 3v3 so be careful which power connection you use! Unplug from mains power, find and attach wires to VCC, GND, TX, RX, RST (optional), and GPIO0.

  3. Plug the programmer into your USB port. Let windows install the drivers. Confirm it as operational.

  4. Put the device into flash mode:

    • Sonoff and similar: Unplug the programmer from the USB port. Hold down the flash button (which depends on the device type), plug it back in.

    • Wemos or NodeMCU dev type cards: no action is necessary, simply plug in the USB port. Make sure no other app is connected to the port (e.g. the MppArduino app) and start the flasher. The flasher will reset the board using the USB cable.

    • ESP01: Connect to the USB adapter. Use a wire to connect GND to RESET and GPIO0. Roll up off of the RESET pin to continue holding GPIO0 to ground as the device reboots. If you're flashing a lot of devices you might want to build a dedicated flash/jumper board with buttons.

    • Tuya and other custom devices: solder wires or use an adapter. Ground GPIO0 then power the device.

  5. Start the Flasher app.

    1. Select the correct COM port and device type (ESP8266 or ESP8285, it does matter)

    2. Go to the "config" tab to select the firmware file you downloaded earlier into the first slot. This will replaces the default with the desired firmware.

    3. Press "Flash" to start the process.

    4. If the flashing doesn't start after a few seconds try reversing RX & TX if it's a wired connection.

    5. If it still doesn't start, close the flasher app and try removing and re-inserting the programmer USB while holding the GPIO0 button down, then restarting the app (you may need to return the RX & TX lines to their original pins!). If you're using an ESP01 or similar, try rolling the reset/GPIO0 pins again.

  1. When flashing is complete exit the flasher and unplug (power off) or reset the device.

  2. Either find the device stand alone access point SSID and connect, or use MppArduino to configure it's wifi. If the device's wifi has previously been configured (wifi configuration is sticky) it may not broadcast an AP SSID, in this case you'll need to use MppArduino to configure it's wifi connection.

    • Use the "Scan" button to find an available SSID. Enter the correct credentials and click "Set AP", then "Restart" the device. Visit your router's wifi client page or use MppArduino/Status to find the device's new IP.

You're done! Press the "Status" button in MppArduino to find the device's assigned IP. This will enable the IP menu allowing you to update or change the firmware OTA and to visit the device web page with your web browser. Confirm that you are able to make OTA updates using using AM, MppArduino, or your web browser to confirm the device can be updated OTA. Once this has been verified you can physically install the device now as you don't need it to be accessible to change/update the firmware.

The next step is to configure your device to work with AutomationManager. If AM does not find the device use the IP to find it manually (in this case you may need to assign it a reserved IP). Use MppArduino, AM (the ESP8266Manager), or open a web browser to the device IP to manage the device configuration (properties). Once configured you can use the ESP8266 device like any device in AutomationManager - using the on/off buttons, custom images, automation rules, remote access, etc.

Troubleshooting

LED slow flashing (once per second) means the device cannot connect to your wifi router. See below for help.

Sometimes the flash won't "take", when you restart the device and connect, you'll see junk characters. Try setting MppArduino to 74880bps to see if there are checksum errors - if so, try to reflash.

Newer Sonoff's need to be flashed in "DOUT" mode (see the "advanced" tab of the espflasher.exe). My new ones are marked YD QCPASS and the PCB labelled "Sonoff". Older ones were marked with Sonoff TH. Try this first.

Double check the flash size for your device and make sure it's correctly specified in your flasher app.

Sometimes your ESP8266 came with an older flashed firmware version and can be resolved by flashing the esp_init_data_default.bin file (available from MPP Base Firmware) along with the ...4mpp binary. Instructions to use this file are here: NodeMCU flashing, look for "SDK Init Data". From that page:

The correct address for the init data depends on the capacity of the flash chip.

    • 0x7c000 for 512 kB, modules like most ESP-01, -03, -07 etc.

    • 0xfc000 for 1 MB, modules like ESP8285, PSF-A85, some ESP-01, -03 etc.

    • 0x1fc000 for 2 MB

    • 0x3fc000 for 4 MB, modules like ESP-12E, NodeMCU devkit 1.0, WeMos D1 mini

On some versions it may be necessary to erase the entire flash before doing anything, download, unzip, and flash the blank file from MPP Base Firmware to 0x00000. This should be relatively rare - only very old ESP8266 devices.

If the device is connected to your PC via USB you can use MppArduino or similar to find any problems. Reboot (reset if available) the device and watch for any error messages. Try a few different baud rates - error messages are often displayed at 74880 or 115k buad. Once running note whether the MppDevice support has started.

If you see a boot loop (continuously flashing the communication LED or checksum messages in your USB application) and there's no way to recover, use the EspFlasher to flash the blank file over all memory: 0x00000, 0x10000, 0x20000, ... until the flasher stops flashing with those values. This will wipe the entire device flash and should allow you to get it going by flashing the firmware. You may need to flash the init file too.

Firmware Recovery

    1. MppArduino supports OTA firmware updates. If the device cannot be recovered via it's web page you may need to reflash it using your USB connector.

Wifi Recovery

Slow flashing of the LED means the device cannot connect, check your router status and/or the configured SSID and password.

If your device is connected to your wifi network you can use the ESP8266 Device Manager in AutomationManager to assign it to a different network. You can connect directly to the device using a web browser to update the device properties, change the assigned wifi, or take other recovery actions.

If your device is not connected to wifi and is already installed you can put it into AP mode to configure the wifi with a web browser:

    1. Press and hold the device button. The LED will starting flashing slowly after 5s, then quickly after 10s. Release the button when the fast flashing begins.

    2. Wait about 10s for the device to reboot into emergency recovery (AP) mode.

    3. Use a PC, phone, or tablet to look for the device's wifi SSID. The SSID will be MPP_{mac} with a password "MppDevice". You may need to configure your wifi device so that it will not disconnect when it discovers it cannot connect to the internet through the device's AP (unselect "prefer internet connections").

    4. The default AP IP is usually at 192.168.4.1. Check your wifi connection details to confirm.

    5. Open a web browser and connect to the default AP. You should be able to correct the problem from the web page. Update the wifi settings, re-upload the startup files, or format the file system and start again.

If the device cannot be made available on wifi and the reset button does not work (or is not available, it's not supported by all devices), it will be necessary to connect the device to a PC with a USB port to either update the wifi connection using MppArduino or to reflash the firmware.

Firmware Files

The firmware and initial setup files can be found here: Downloads.

After the initial flash MppDevices can be upgraded over the air (OTA) using AM Manager - look in the AM menu for the "ESP8266 Manager" app.