Closed awk2019 closed 5 years ago
@molpie Thanks for the feedback. The bug was isolated to around 6.4.1.15-6.4.1.16 and assumed stable from 6.4.1.18. Appreciate the feedback.
@DavinKD From a mechanical side, how did you do your wiring for the SP201? I've got an SP201 that failed OTA conversion, and am trying to work out a reasonable wiring method to access the UART pins on the daughter board... At the moment I think I'll either need some very long probes, or to desolder the AC plug itself if I want to avoid permanently cutting away the back plastic housing. Any tips?
I only used OTA. I've never tried to open these.
Oops, I'm sorry about that, thanks for the heads up. I lost track of who was who during the thread. I actually meant to ask @awk2019 for physical access tips based on the comment about:
tuya-convert on one and cracked on open for wired serial flash.
(FWIW, so far this does not look to be a very physical-modification-friendly device... have to break a glue seal to open it initially, and still TBD what the best serial access route is. OTA on my other one was vastly preferable :) )
Hi! Could't you tell me where I can find the pinouts (Rx,Tx, 3.3V) for flashing the NX-SP201?
@ed-war-d if you provide photos probably yes
A photo of the blue Module from the other side will give the needed infos
Heh, you definitely took the smarter approach to this one @ed-war-d :) I struggled with desoldering the AC connector to free the PCB, so I ended up reprogramming mine with the assistance of a very long needle point logic probe reaching all the way under the PCB between the PCB and the back case plastic to reach the TX pin from behind, and used a GND connection at one of the small headers for the buttons and LEDs on either side.
The pinout can be found on page 6 of this datasheet for the ESP8266-S3: https://fccid.io/2AKBPESP8266-S3/User-Manual/User-Manual-3594791
Overlaid on your image, it looks like this:
Note that the signals are named here with respect to the ESP8266. Meaning: the TX pin here is ESP8266's transmit pin, and you'd want to connect it to your UART adapter's RX pin.
Thanks
Where is the GPIO0: Led1i ?
For completeness for future readers, here are a couple photos of how I did my reflash without removing the AC ground pin.
Needle point logic probe to 2nd pin (TX
) underneath PCB:
Soldered on to IO0
(Brown wire), RX
(Orange wire) and VCC
(Black wire) at board edge:
Plugged into GND
in switch/LED daughterboard connector:
Where is the GPIO0: Led1i ?
Sorry about that... until I pulled out those photos I had forgotten this device didn't route it to a button and I had to solder directly to it. Updated the annotated photo above, or in my photos it's the brown wire.
GPIO0
is very likely also exposed as one of the pins in that same daughterboard header which could save doing one solder joint, but unfortunately I did not trace that out.
I've done it! Thanks!
What device I should select in Module type menu?
I configured mine using an SP-201 template from here: https://blakadder.github.io/templates/sp201dual.html
General instructions on templates here: https://github.com/arendst/Sonoff-Tasmota/wiki/Templates#importing-templates
With the template {"NAME":"SP-201","GPIO":[31,0,0,131,17,134,0,0,21,18,132,22,0],"FLAG":0,"BASE":45} I have 3 switches (not 2). Is this OK?
It seems I should to have got 2 switches
The third "relay" is for the led.
The new LedLink feature in 6.5.0.12 may allow removal of this virtual relay for the LED. If you have questions on its use, ping me over on Discord.
P.S. @DavinKD I was able to clean up the KS-604S config using this new feature.
Thanks
For future reference for any others that need to manually-flash an "NX-SP201" Smart Plug 2-in-1, there are 2 versions that I have just flashed. The Type A version pictured above in this thread with the 14-pin ESP8266-S3 module (with metal shield as pictured) can most easily be flashed with these connections: Programmer RX solder to front of module, 2nd pad from the right. Programmer TX bend a small hook into the tinned end of the wire and hook behind that pad you just soldered to. Programmer 3.3V connect to pin 1 on the left or right end headers (left pin 1 is furthest from the module, right pin 1 is closest to the module). Programmer GND connect to pin 5 on the left or right end header. Jumper pin 4 (GPIO 0 for the blue status LEDs) to pin 5 (GND) on the left or right end header. Only needed during boot to put the chip in programming mode, but it is fine to leave it connected while you program.
The (newer or knock-off?) Type B version has a green module without metal shield (or onboard LED that the ESP8266-S3 has) labeled "E2S-B, 20XX.1X.17" on the back, with 15 staggered contacts (vs the 14 even contacts on the ESP8266-S3 module). And the header's on the left and right have very different pinout. Here's the comparison:
The pinout on this module matches the 11-pad Tuya TYWE2S module except with 4 more pads on the left side (2 more on the front and back). Here's the full pinout of the "E2S-B": And the pads on the back of the module: Side view:
And the labels of the headers:
To flash the Type B version, I had to chop some plastic to access the bottom of the module since 3 of the pads we need are on the back: Programmer RX solder to back of module, 4th pad from the right. Programmer TX solder to back of module, 3rd pad from the right. Programmer 3.3V solder to back of module, furthest pad on the right. Programmer GND connect to pin 2 on the left or right end header. Use a wire to touch from GND (pin2 on the left or right end header) to the "IO0" test pad on the back of the module while you power on the programmer.
The current Tasmota template for "Type A" is https://blakadder.github.io/templates/sp201dual.html though I would update the Template from {"NAME":"SP-201","GPIO":[31,0,0,131,17,134,0,0,21,18,132,22,0],"FLAG":0,"BASE":45} to: {"NAME":"NX-SP201 A","GPIO":[158,0,0,131,17,134,0,0,21,18,132,22,0],"FLAG":0,"BASE":45} (so the blue LEDs are LedLinki instead of Relay3i)
The current template for "Type B" is https://blakadder.github.io/templates/dilisens_SP201.html but I'd update the Template from {"NAME":"Dilisens SP201","GPIO":[0,0,131,0,133,132,52,21,18,22,17,0,0],"FLAG":0,"BASE":18} to {"NAME":"NX-SP201 B","GPIO":[0,0,131,0,134,132,157,21,18,22,17,0,0],"FLAG":0,"BASE":45} (Base on BlitzWolf SHP (45) instead of Generic (18), use LedLink instead of Led1, use BL0937 CF (134) instead of HLW8012 CF (133) since it uses a BL0937 not an HLW8012).
Oh, and the Type A uses a voltage divider (R_upstream + R_downstream) / R_downstream of (2.4Mohm x2 + 1Kohm) / 1Kohm = 2401 where the Type B uses (1Mohm x2 + 1Kohm)/1Kohm = 2001. They both use a 1ohm current sense resister. But I just used a Kill-a-watt type device to manually calibrate the voltage/current/power when running my window AC.
I have flashed two NX-SP201 dual switch with Tasmota via tuya-convert on one and cracked on open for wired serial flash. When I use power monitoring via a custom template(HLW8012) I get a software watchdog resets about every 40-60 minutes. Do any one have any ideas on this.
Pin out per tuya-convert compatible device list. GPIO0: Led1i, GPIO4: Button1, GPIO5: HLW8012 CF, GPIO12: Relay1, GPIO13: Button2, GPIO14: HLWBL CF1, GPIO15: Relay2, GPIO16 HLWBL SEL