Blynk and SonoffBoilerplate

I feel dumb right now hahaha I will try it this afternoon thanks!

Luis, did you get the boilerplate running on your sonoff? Is it a good route to follow, I love Blynk and it would be great if this actually works.

1 Like

@David_Vinch there are numerous posts of Blynkers using Sonoff / Itead hardware.

1 Like

I was searching the terms sonoff blynk and only retrieving 5 and of that 5 only 2 seemed relevant and neither of them discussed their experience flashing and running. I’ll keep looking, I’ve got two to play with after we return and was just trying to make sure I wasn’t going down an untrod path vs. some of the other options. Sonoff’s are pretty interesting and compact but Ewelink is just a horrible app and the way Chinese company’s come and go makes a cautious person hesitate.
I’m just killing time right now waiting for departure, trying not to order anything and staying out of my wife’s hair.
Oh, and BTW, some phone chargers make terrible power supplies for nodemcu. I swapped one yesterday on my temp project and I was getting crazy readings and notifications, swapped back to another and it all smoothed out. I think I had read at some point that some switching supplies really need a battery present for happiness.

1 Like

Hi @David_Vinch,

I wasn’t able to connect using the boilerplate.

I create a regular sketch following one of the examples, and work flawlessly.

Sorry for the late response, I was on vacation last week.

Greetings.

1 Like

sonoff first flash with this programer:

  1. to power the sonoff directly from programmer, remove the jumper and solder together the vcc + 3v3 pins, (see photo) (actually, i do not understand how should one use the programmer with the jumper on, because than it is not possible to connect the vcc cable…)

  1. connect programmer to sonoff
    programmer -> sonoff:
    gnd -> gnd
    rxd -> tx (tx / rx labels are reversed on 4ch v2 pcb silkscreen!!!)
    txd -> rx
    vcc + 3v3 -> vcc

  2. in ide set:
    board: generic esp8266 (for sonoff 1 channel and 2 channel), esp8285 (for sonoff 4 channel)
    flash mode: DIO
    flash size: 1M (64K SPIFFS)
    debug port: disabled
    debug level: none
    reset method: ck
    flash frequency: 40MHz
    cpu frequency: 80MHz
    upload speed: 115200 (more if the cables are good and short)

  3. keep fw button pressed on sonoff

  4. connect programmer to usb

  5. wait a second, release button

  6. upload firmware (any firmware that works on other esp82 boards, should work on sonoff too, respecting the actual pullup / pulldown resistors)

notes:

  • on the internet, everywhere writes that the programmer can’t supply enough juice to power the whole sonoff board and it needs separate psu while programming. with the above programmer mods i didn’t found this to be an issue. i can flash without external psu even the 4 channel board. if not working, unplug the usb, wait some seconds, firmly press the fw button, insert the usb, and keep pressed the button for 1-2 seconds, then release. double check the settings in ide, jumper wires connection quality (max length 10~20cm!)

  • on the 4ch sonoff there is the esp8285 mcu used, so take care while setting the ide!
    also, to use interrupts on all buttons, there is a special case. please read here

3 Likes

I’ve been able to program it as well using a usb to ttl converter like that (not exactly the same).

My problem was with the configuration of the firmware. I wasn’t able to connect to blynk using the boilerplate.

yes, maybe the boilerplate is a bit outdated or who knows. however, from step 7, one can use the sonoff as any standard esp8266/8285 board.

1 Like

yes, maybe that is the issue…

anyway, I’ve been able to control it using starting with the esp8266 example.

1 Like

@luis_diaz, with that step by step post actually i replied to this :slight_smile:

Presumably the silkscreen on 4CH V2 is correct, right?

Ignoring that device I assume as long as the USB2TTL has the same pin order of 3V3, TXD, RXD and GND then any one will work, right?

It’s just the ones I have don’t require the power line to be soldered, they have 3V3 at one side and 5V after the GND pin. Also I guess you can just use jumper wires for the 4CH V2 or if your USB2TTL has a different order of pins to the Sonoff / Itead.

Just to chip in here, this could be due to some programmers use regulators that have a max current output of 200mA such as the HT7333
and the peak current of an esp can exceed it. It would be wise to check the regulator and if it is as stated above, soldering a 1000uF cap over 3.3V and GND pins is advisable :slight_smile: at least from my own experience

1 Like

no, i mean that normally, when connecting 2 devices via serial communication:
rx go to the other devices tx and tx to rx. if we follow this ideology, the silk screen on sonoff th10/16 is correct, but on the sonoff 4ch, one should plug the programmer tx cable to the pin labeled tx, and rx cable to pin labeled rx.

also, if you check the physical circuit on the 4 channel, the header pin labeled rx goes to the mcu tx pin and vice versa. they were in a rush when designing the pcb probably…

1 Like

i would do that happily, if you can point me the regulator on this one :smile:
(i think they’re using the diodes to get the right voltages)

I think the ones I use have a very low rating.

Most of the times, the current peak comes when trying to connect to wifi, so, when uploading the firmware there is no problem of using a low current capable programmer. Although, I do recommend use a one more capable, to avoid power issues.

@luis_diaz yes it’s a common problem where users think that if you can flash with a USB2TTL then you should be able to run it too. By then they have disconnected tx and rx and can’t understand why their ESP keeps crashing.

Yes, I hace faced that issue a lot in other forums and pages…

By the way, I’d read somewhere that if you have the power outlet connected to a power socket and you try to download the firmware, it will destroy the sonoff.

you mean if there is connected to mains and also to the programmer in the same time?

once i have done it that way, and didn’t had any problems / nor me or the sonoff (except of the scary environment :slight_smile: )

however, what i have observed, that on the th10 model the gnd and earth are separated, but on the 4ch version, they have connected the mains earth with the gnd.

Yes, that what I mean. I’ve not tried it, and not going to, just for my own mental health.