Pages

13/06/2020

Flashing the BlitzWolf BW-RC1 with Tasmota

I recently purchased some BlitzWolf BW-RC1 IR Controllers from Banggood to create an IR Blaster between two rooms so I can control my SkyQ box from the bedroom, and also integrate some dumb devices into my home automation system. 

I tend to prefer local control over dodgy servers in the cloud, and as they're ESP8266 based I was going to flash them with Tasmota - an open source project that adds MQTT and other goodies to enable local control.


I was hoping I could use tuya-convert - an awesome tool that fakes part of the Tuya setup process and allows you to flash your own firmware, however it turns out these devices are being shipped with a newer more secured version of firmware that tuya-convert can no longer take advantage of. 


With little documentation online, I took it apart and attempted to flash it via serial. After a few set backs, it became apparent that the serial pins are broken out via the USB connector (N.B, these are the raw serial pins, there is no real USB interface) so flashing is straightforward and doesn't require any soldering.



Note: I only cover  preparing and connecting the device for flashing.  It's assumed that you already know how to flash Tasmota onto a device once it's connected via serial.




Perquisites

  • BlitzWolf BW-RC1
  • Spudger
  • USB to Serial UART adapter with 3.3v support
  • Hook Up / "Dupont" Wires
  • 5V power supply / adjustable power supply
  • Tasmotizer Software
  • USB A Breakout Board
  • Soldering Iron and associated tools ( For adding header pins to USB Breakout)

Opening the device

Before flashing you will need to open the device. The first device opened easily enough with a spudger but a clip got damaged due to my heavy handedness. The device still clicks back together though, so it's not a huge deal. One the second device I tried popping it open with a clamp on the sides of the device - it popped right open but a few minor stress marks were left on the plastic.

For the third device I returned to using a spudger. This time I was a bit more gentle, and opened the device without any visible marks. If the USB port is at the 6 o'clock position, the clips are at 1 o'clock, 3 o'clock, 5 o'clock, 7 o'clock, 9 o'clock, and 11 o'clock positions


Once the outer shell is open you will need to undo 3 small screws holding the PCB to the bottom shell.



Spudger of choice


The PCB

 ( This section is mostly me waffling about how I figured out how to flash the device, so if you just want the Tl;Dr, skip it)

Once you're removed the PCB you can have a look at it. The top side isn't of much interest, but features 7 IR LEDs and one IR receiver. There's a couple of exposed test points for 3.3V, GND and "IR" - Presumably the output to the LEDs, but we don't need to use them.


Top side, showing IR receiver and LEDs




The bottom side of the PCB is more interesting, showing the power supply circuitry, the transistor driving the LEDs, and the TYWE3S, an ESP8266 based MCU that shares the same footprint as the ESP-12S.



Bottom side, showing TYWE3S, ESP8266 based MCU



Initially I tried soldering wires to the TYWE3S in order to flash it using using the pinout below. After setting the baud correctly to 74880, I could see output on the console, but even after putting into flash mode by holding GPIO0 / D0 low at boot, I was unable to flash the chip.

TYWE3S Pinout

After several attempts and due to heavy handedness on my part ( a recurring theme ) the wires I was using to connect to the Tx and Rx pins fell off and damaged the castellations, so at that point with little to lose I decided to use some hot air to remove the 
TYWE3S altogether - perhaps I could swap it out for a pre-flashed ESP12-S or get a better understanding of why I wasn't able to flash the device.

The PCB, minus the TYWE3S

With the TYWE3S removed, I could see tracks going to the Tx and Rx pins. Interesting! It didn't take long to trace them and figure out they're broken out on pins 4 and 3 of the Micro USB connector. The ESP8266 doesn't natively support USB, so this is serial exposed on the USB connector.

So why wouldn't it flash over serial? I was powering the device via USB when flashing, so presumably the charger was interfering with the process - they often have resistors on the lines to signal current capacity, and the ID pin may be pulled to ground.

Now we know how this thing is put together, we can flash it without needing to solder anything. 



Preparing the Device for flashing

Now we know where the serial console lines are broken out, we can get things hooked up ready for flashing. To avoid hacking a USB cable apart, I bought a USB breakout board like the one shown below. They're cheap and readily available. I had to solder some header pins on mine.


USB Breakout Board
The D+ pin on the USB breakout is connected to the Tx pin of the TYWE3S, and the D- pin to the Rx pin. You will need to reverse these connections when connection to your Serial Adapter.

Use the diagram below to help get things connected. Note I'm using an external power 5V supply connected to the VBUS pin of the Breakout board. I used an adjustable bench top power supply but you can use anything that puts out 5V. The ESP8266 can use up to 300mA of current, so make sure it's got suitable capacity. You will also need to bond the grounds together. Your Serial Adapter will likely look different to the one in the picture - the only pins that matter are Tx, Rx and GND. Make sure its set to 3.3V mode if there is a jumper or switch.

Hook Up Guide (Click to expand)

I bond my grounds my inserting a jumper wire into the connector of the other.

My completed flashing wiring

Flashing the Device

Once everything is connected, it's time for flashing. Make sure the 5V power supply is off, and short GPIO0 to ground with a jumper wire. Use the TYWE3S pinout diagram above to figure out which pin is GPIO0, and short it to the GND test point showng on the silk screen, and turn on the 5V supply - Don't short it to the USB Connector, it doesn't work. 

After a few seconds the TYWE3S will be in boot mode and you can remove the jumper wire and begin flashing

I won't cover actually flashing the device here, but that should be enough to get your started.

You may find the following tools useful for flashing:

Before you disconnect!

Before disconnecting the wires you used for flashing, connect to the Tasmota device and get it connected to your Wifi and set up the basics. There is a Tasmota template available on Blakadder's Website

I strongly advise you to disable Serial Logging with the command show below. Most chargers bridge the data lines with resistors to signal their rated current. This means anything Transmitted from the TYWE3S will get looped back to itself, flooding the logs and making the device unresponsive:


SerialLog 0

Et Voila! Your device should now be running Tasmota.

1 comment:

  1. Thanks for this guide. I just successfully loaded Tasmota IR using the Tasmotizer. Instead of a separate 5V power supply, I just took the 3v3 feed from the USB to Serial adapter and connected that to the 3V3 pad on the board, bypassing the 5V to 3V3 reduction circuitry.
    I've now got it linked to my Home Assistant through the Tasmota Integration and now I only have to see what I can do with it!
    I have a second BW RC1 that I haven't Tasmotized and that's been working fine through Blitzwolf and Alexa for over a year now, but I want to get as much local as I can.
    Thanks again
    Graham

    ReplyDelete