xoseperez / espurna

Home automation firmware for ESP8266-based devices
http://tinkerman.cat
GNU General Public License v3.0
3k stars 638 forks source link

Support son off 2 switches #2

Closed xoseperez closed 6 years ago

xoseperez commented 7 years ago

Originally reported by: Sylvain Blot (Bitbucket: sylvainblot, GitHub: sylvainblot)


Hello!

Thank you for this firmware it works really nice my s20 socket. On the other hand I've this sonoff card : sonoff.jpg

I tried to flash it without success (same process as s20, press button 1 when power up and sudo platformio run --target upload -e sonoff-debug --upload-port /dev/ttyUSB0)

Unfortunately I always get :

Linking .pioenvs/sonoff-debug/firmware.elf
Checking program size .pioenvs/sonoff-debug/firmware.elf
text       data     bss     dec     hex filename
320792     8576   34016  363384   58b78 .pioenvs/sonoff-debug/firmware.elf
Looking for upload port...
Use manually specified: /dev/ttyUSB0
Uploading .pioenvs/sonoff-debug/firmware.bin
warning: espcomm_sync failed
error: espcomm_open failed
error: espcomm_upload_mem failed
*** [upload] Error 255

Do you have any idea why I can't flash it? Is this board supported?

Regards

xoseperez commented 7 years ago

The latest firmware supports multiple-relay boards, including the Electrodragon and the Sonoff Dual. Maybe you'd like to give it a look and give feedback...

xoseperez commented 7 years ago

Hi

Sorry for your electrodragon but glad to hear you made it work. Actually I reuse lots of code from ESPurna in other projects, and the other way around, of course. I am thinking on the plugin approach too, but still have not defined the way to do it. I'd like to have something really dynamic, so I can enable/disable a sensor from the web interface or change the GPIO it is connected to. A problem with a lot of libraries currently available is that you have to define the pins in the constructor so you pretty much lose that flexibility. Of course I can pretend to define everything at compile time but...

xoseperez commented 7 years ago

Original comment by Sylvain Blot (Bitbucket: sylvainblot, GitHub: sylvainblot):


Hi Xose,

I finally fried the electrodragon when I plugged it to the wall socket... I can confirm I managed to get the firmware running. I find your firmware is really good base (platformio + gulp) to create app on top of it. What is your roadmap? I would like to add support for "plugins", such as neopixel lights ect.

Regards, Sylvain

xoseperez commented 7 years ago

The ESPurna firmware does not support 2 relays just yet, but it's in the roadmap. I will soon target Electrodragon and Sonoff Dual devices. But anyway the wifi should be up for the electrodragon. Could you please paste here the output from the console, just type

pio device monitor -b 115200

right after powering the board.

xoseperez commented 7 years ago

Original comment by Sylvain Blot (Bitbucket: sylvainblot, GitHub: sylvainblot):


Took me a while to get it, but the board is not from sonoff but electrodragon : http://www.electrodragon.com/w/ESP_Relay_Board I managed to flash it (hold button 2 on power up) with sonoff-debug. Unfortunately once rebooted I can't see any wifi SONOFF. I will keep digging.