Home Home Control: Setup SONOFF with Espurna
Post
Cancel
Preview Image

Home Control: Setup SONOFF with Espurna

Requirements

  • Latest version of the esptool.py tool, extracted in Downloads
    • Check python version in Terminal: python –version [2.7.16]
    • Install pip: *curl https://bootstrap.pypa.io/pip/2.7/get-pip.py python*
    • Install esptool: pip install esptool

Flash ESPURNA to SONOFF

  • DISCONNECT SONOFF FROM MAINS
  • Connect USB serial adapter to SONOFF pins. ENSURE adapter is set on 3.3 volts
  • Erase flash
    • Drag esptool.py from …Archive/files/electronics/… folder into Terminal to get full path
      • Disconnect SONOFF, hold button down and reapply power to put in programming mode
      • …/esptool.py erase_flash
      • Finds serial port [/dev/cu.usbserial-A5XK3RJT] and erases flash for a clean start
  • Flash the binary to the ESP8266
    • Disconnect SONOFF, hold button down and reapply power to put in programming mode
    • Drag esptool.py and firmware.bin from relevant locations to get fullpaths in Terminal, and add PORT id:
      • *…/esptool.py –chip esp8266 –port write_flash –flash_size 1MB –flash_mode dout 0x00000 …/*
  • Reboot

Configure ESPURNA

  • Initially SONOFF boots in SoftAP mode named “ESPURNA-XXXXXX”
    • Connect with phone/MacBook to AP, passphrase: [STRONGBOX]
    • Once connected, browse to “http://192.168.4.1
    • Login with username “admin“, password “[STRONGBOX]
    • Change password when prompted, and then re-login with new password [found it repeated login twice, no idea why]. Save PW in Strongbox
  • Can then setup Hostname, Description, MQTT, NTP, Sensors, WiFi as required
    • COMMON
      • MQTT: enabled / 192.168.0.130 / 1883 / openhabian / PW_Strongbox
      • NTP: “pool.ntp.org”, GMT+0, DST, Europe
      • Switches: Switch #0 (GPIO12), Always off, Don’t pulse
      • WiFi: [STRONGBOX]
    • KATE (kitchen LED uplights)
      • Espurna 1.13.1 [espurna-1.13.1-itead-sonoff-basics.bin]
      • MAC address: 5C:CF:7F:41:EB:EB, IP allocated: 192.168.0.132
      • Hostname “esp-kate“, description “Kitchen LED Uplights
      • MQTT clientID = esp-kate
    • GINA (garage temperature sensor)
      • Espurna 1.14.1 [espurna-1.14.1-itead-sonoff-basic-r2-dallas.bin]
      • MAC address: 2C:F4:32:A8:3D:30, IP allocated: 192.168.0.84
      • Hostname “esp-gina“, description “Garage Temperature Sensor
      • MQTT clientID = esp-gina
    • PENNY (pergola lights)
      • Espurna 1.14.1 [espurna-1.14.1-itead-sonoff-basic-r2-dallas.bin]
      • MAC address: 2C:F4:32:A8:3D:1A, IP allocated: 192.168.0.90
      • Hostname “esp-penny“, description “Pergola Lights
      • MQTT clientID = esp-penny

References / Resources

  • esptool.py code (GitHub)
  • Serial flashing SONOFF guide (Tasmota)
  • Espurna how to flash prebuilt binary guide (GitHub)
  • Espurna configuration guide (GitHub)
This post is licensed under CC BY 4.0 by the author.
Recently Updated
Trending Tags
Contents
Trending Tags