Trouble flashing Sonoff-Tasmota on Sonoff Pow R2 using Raspberry Pi (model B)

1,311 views
Skip to first unread message

Sam Hobbs

unread,
Jul 8, 2018, 5:21:55 PM7/8/18
to SonoffUsers
Hi all,

I've been struggling to flash my new Sonoff Pow R2 with sonoff-tasmota and would appreciate some advice with troubleshooting! This is my first time using any Sonoff device, and the first time using the GPIO on a pi, so it could be something really stupid.

The TL;DR is that I can't get esptool to connect to the sonoff. I'm not sure if I've failed to put it in flash mode, but when I try to erase the flash (or read_mac) I get the following output:

$ sudo esptool.py --port /dev/ttyAMA0 erase_flash
esptool
.py v2.4.1
Serial port /dev/ttyAMA0
Connecting........_____....._____....._____....._____....._____....._____....._____


A fatal error occurred
: Failed to connect to Expressif device: Timed out waiting for packet header

I get the same result if no device is attached.

The device I'm trying to flash is a Sonoff Pow R2 (board says v1.0, 2017-11-30). I've soldered a 6-pin female header onto the Sonoff, and have some male to female jump leads to connect to the pi.

I'm using a Raspberry Pi B as I don't have a USB to serial programmer.

The software on the pi is a fresh installation of Raspbian Jessie (Lite), with esptool v2.4.1 installed using pip (python 3 version)

I have followed the instructions on the wiki for setting everything up, replacing ttys0 with ttyAMA0 throughout as my Pi is the older type.

I am of course holding the button down as the 3.3v power is connected to the sonoff. I've tried both holding the button before the power is connected and then releasing after a couple of seconds, and holding it and keeping it pressed until the command is running.

Things I've already tried:
  • Verified the voltage output from the pi using a digital multimeter (I get 3.28v, which doesn't drop when I connect the sonoff). The reading is the same on the pi, at the ends of the jump leads, and at the solder at the bottom of the header.
  • Changed jump leads
  • Changed the power supply to the pi. The supply I'm using is a decent 3A lead made specifically for a pi.
  • Checked my soldering - I'm quite new to it but I can't see a solder bridge anywhere
  • Tried another raspberry pi (another model B)
  • Swapped the TX and RX leads over - same result
  • Double checked that I've set up the pi correctly so serial-getty is not hogging the serial connection (again, using /dev/ttyAMA0 instead of /dev/ttys0 because my pi is older)
Any ideas?

Some photos attached. Please don't judge me for my terrible soldering!

Before anyone freaks out, the AC is not connected - the wires coming off the unit are connected to push connectors.


Phil

unread,
Jul 9, 2018, 10:11:08 PM7/9/18
to SonoffUsers


sounds like a basic coms problem, i dont know esptool i assume its attempting connection @ 115200baud perhaps look at attempting connections at different speeds starting @ 9600 and stepping up using the standard options upto the usual 15200 ?

if still no joy have you any other soc's or prototyping boards like an arduino you can use to set up a test serial comms a simple arduino sketch to connect a serial connection and echo back any input received should be a simple cut n paste job on the example sketchs in the arduino ide ;) once set up and working that should provide you with confidence with your PI side..

the trick is to power up the sonoff with the button pressed (gpio0 grounded) this should start it up in flashable mode, looking at your set up i would probably pull the +v(vcc) or -v(gnd) wire from the sonoff board press the button keeping it pressed while reattaching the  + or - dc power back to the sonoff..  


Double checking the soldering pics .... and your solderings not too bad   BUT  some of the pins look a bit longer than the others??  did you perhaps heat damage the sockets you soldered onto the board,  a simple continuity (conductivity) test with a lead plugged in and testing the solder joint perhaps? 

Philip Knowles

unread,
Jul 10, 2018, 12:53:40 AM7/10/18
to Phil, SonoffUsers

If the device still functions (and it should do) I would give up and try using SonOTA on a laptop. The POW is a dangerous device with high voltages potentially availabe at the pins when operating on mains. At the end of the day the aim is to get Tasmota on the device and SonOTA will do that for you.


--
You received this message because you are subscribed to the Google Groups "SonoffUsers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sonoffusers+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Walter LeFort

unread,
Jul 10, 2018, 8:45:41 AM7/10/18
to SonoffUsers
I had a similar issue that was resolved with a bit of editing of commands.  You can see my inital problem with resolution here on reddit.

Sam Hobbs

unread,
Jul 10, 2018, 3:35:17 PM7/10/18
to SonoffUsers
Thank you all for your replies.

First I messed around for a bit with baud rates but had no luck.

Got some soldering advice from my boss today and then soldered a header onto a second Pow R2. When I attempted to flash this second pow, it all worked as expected.

I went back and cleaned up the solder on the original Pow R2 with a bit of braid and re-soldered it "properly", after which I was able to flash it with the default settings of esptool.

Note for soldering noobs like myself: the thing that made the difference was holding the hot soldering iron against the header pin and contact to heat them up before feeding the solder in. This made the solder flow onto both contact surfaces much easier - before I must have had a neat ball of solder on the header pin, which wasn't actually in contact with the board.

Thanks,

Sam
Reply all
Reply to author
Forward
0 new messages