Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New ESP8285 based 1Channel Inching/Locking 5V/12V Sonoff #453

Closed
ed1402 opened this issue May 15, 2017 · 116 comments

Comments

Projects
None yet
@ed1402
Copy link

commented May 15, 2017

Hi All,

I just took possession of the above new device that appears to be the new version of the old device - the pics on the Itead website has not even been updated.

This board is based on the PSF-B01 itead ESP8285 module.

I have not found any custom firmware yet that appears to work - not Tasmota, ESPEasy or Espurna seems to work.

Using Tasmota it uploads fine with success flag - but this basically puts the module in an endless switch loop with no connection to wifi as setup in config file.

Anyone have any info?

Regards,
Ed

@xinghusp

This comment has been minimized.

Copy link

commented May 16, 2017

Hi,
I have in the same trouble.i just brought the sonoff touch few days ago,and i tried to flash the custom firmware and can't boot to the os anymore.and the serial port didn't have any output message.the wifi cannot connect and the led of the board don't blink anymore.

@sebastianlorenzen

This comment has been minimized.

@ed1402

This comment has been minimized.

Copy link
Author

commented May 16, 2017

Yes albeit not the same as in the 1 channel device photo. That indicates an ESP8266 unit. Mone is ESP8285 based.

@xinghusp

This comment has been minimized.

Copy link

commented May 16, 2017

The sonoff touch of mine is based on the PSF-A01 itead ESP8285 module.

@ed1402

This comment has been minimized.

Copy link
Author

commented May 16, 2017

Some pics:
20170516_210121_001
20170516_210144

@ed1402

This comment has been minimized.

Copy link
Author

commented May 17, 2017

OK - so I have managed to flash the unit with Arduino IDE on latest Tasmota.

I can access the web interface after restart, but the device now shows odd behaviour.
As far as I can establish the actual locking/inching function is controlled externally to the ESP8285.

When in locking mode the device acts normally as a switch, but when in inching mode and the device is either trigger by button press or web toggle it goes into a 10 second flip flop (switching on and off repeatedly) and then hangs. After a restart the device is frozen still and I have to re-flash firmware to get it active again.

I have tried multiple device selections in the device setup (Basic, Slampher, 1 Channel and both 4 channel options.)

My assumption is that the "on" command trigger a gpio either high or low and that the external inching function sends a signal back to the ESP8285 to switch off the trigger gpio. With the new firmware this does not happen and as such the device "loops" and eventually somehow corrupts the ESP8285.

Open to any ideas?

@davidelang

This comment has been minimized.

Copy link
Collaborator

commented May 17, 2017

@paco-ita

This comment has been minimized.

Copy link

commented May 19, 2017

Hello everybody!
I have received the exact same product but I can't figure out how to put it into flash mode.
Any advice?
Thanks

@apouzin

This comment has been minimized.

Copy link

commented Jun 11, 2017

Hi,
I am also using the same device and struggling on putting the device into flash mode (not sure about the wirings nor the procedure for setting it up into flash mode). Any advice/help would be appreciated ! Thanks

@jktz90

This comment has been minimized.

Copy link

commented Jun 19, 2017

Using Arduino (Ground to RST): on the PSFB01 you need to pull GPIO2 to Ground before Powerup and afterwards connect RX TX // TX RX using your Arduino. In my case there was no pinout on the PCB whatsoever, so I had to solder it directly on the PSFB01

@zizebra

This comment has been minimized.

Copy link

commented Jul 9, 2017

I can only assume this device is probably the latest effort from Itead to try and stop us from using custom firmware. the relay is seem to be driven by the stc15w204s.

@levonbragg

This comment has been minimized.

Copy link

commented Jul 11, 2017

I was able to get this sort of working... (See attached picture) I had to remove 1 IC to stop the bouncing of the relay and bridge 2 of the empty pads. Also, need to add a pull-up resistor as indicated in the pic to make the button work after removing the IC.
I tried all tasmota configurations, and it would not work.
I was able to get it working using this firmware
https://github.com/KmanOz/Sonoff-HomeAssistant
So, at least it works now, but maybe someone smarter than I can modify the tasmota firmware (which I like better) to make it work.

sonoffinching

@zizebra

This comment has been minimized.

Copy link

commented Jul 11, 2017

Brilliant stuff. Didn't think about that. Will try that and see if it helps.

@arendst

This comment has been minimized.

Copy link
Owner

commented Jul 11, 2017

The devices discussed in this issue are based on the esp8285 chip while the original device used the esp8266 chip. The main difference is the way flash is addressed and loading the default sonoff firmware on these devices will probably NOT work unless you take the following steps:

  • Initially load tasmota firmware file sonoff-touch-4ch-bnsz.bin or compile your own using the DOUT flash mode.
  • Open the configuration webpage (or use serial commands) to select module 12 1 Channel
  • If things are as I expect it should now work like a standard 1 channel inching device
@zizebra

This comment has been minimized.

Copy link

commented Jul 11, 2017

Mine is definitely esp8285. That is the one I compiled and loaded on mine. I believe I tried the 1 channel and the behavior was not perfect. In my case, I noted that when using the inching method, it would work perfectly as expected but with one issue. I could turn on or off generally about 5 times in row. Thereafter, the next 2 or 3 attempts would not have effect.
I will test again just to verify that your suggested options works on this device.

@zizebra

This comment has been minimized.

Copy link

commented Jul 11, 2017

levonbragg, do you still have the IC number for the chip you removed.

@levonbragg

This comment has been minimized.

Copy link

commented Jul 11, 2017

zizebra, I do not. All of mine are blank. Looks like they were rubbed off.
After digging around, it looks like a STC15F101W series 8051 micro...

@zizebra

This comment has been minimized.

Copy link

commented Jul 11, 2017

Hope itead is not trying to revive the useless ESP8266 Black board T5

@levonbragg

This comment has been minimized.

Copy link

commented Jul 11, 2017

arendst,
I can confirm that after adding the pullup resistor, and loading the module with the sonoff-touch-4ch firmware, and setting it to "12 1 Channel" that the board seems to be working great.
Thanks for the help!

@zizebra

This comment has been minimized.

Copy link

commented Jul 11, 2017

arendst, on my end there is no joy. I still see the behavior where some commands will have no effect. it usually takes up to 4 commands to get a response. thereafter the next 4-5 commands works before it stops responding again. below is a trace from webconsole. the highlighted power on commands did not work

capture

@arendst

This comment has been minimized.

Copy link
Owner

commented Jul 11, 2017

@zizebra you have a MQTT server problem. This causes delays in command processing. If you fail to connect the MQTT server execute command mqttretry 60 to make more room for command processing.

@zizebra

This comment has been minimized.

Copy link

commented Jul 11, 2017

thank you., I didn't think that to be the problem. My sd card for my PI packed up before I received this device. I will re-install the mqtt server and test

@zizebra

This comment has been minimized.

Copy link

commented Jul 13, 2017

I manage to reinstall my PI yesterday. However could not test, because my sonoff kept trying to connect to the mqtt server provided in the code instead of my custom one. It will usually connect to the correct one after a couple of hours. I hope to have a good test later on.

@zizebra

This comment has been minimized.

Copy link

commented Jul 13, 2017

Finally managed to test. It is definitely working perfectly with mqtt. One minor issue which I picked up is that after loading firmware, the relay default is activated. When I choose 1ch on configuration. The relay is changed to default off. Occasionally when the sonoff restarts, the relay is activated momentarily before being Switch off. Does any one have a quick workaround for this. I would like the relay start default off throughout the reboots.

arendst added a commit that referenced this issue Jul 15, 2017

v5.3.0
5.3.0 20170715
* Major Hue rewrite which might introduce Alexa problems. If so,
initiate an issue
* Add support for Sonoff Led and BN-SZ01 Ceiling Led brightness control
to Hue
* Fix Sonoff Led Power, Dimmer and Color MQTT response (#176)
* Add commands Delay and Backlog to allow multiple commands at once
separated by ";" (#593)
* Use default flashmode DOUT to solve restart hangs on esp8285 chips
(#453, #598)
* Change Web console column width from 99 to 300 (#599)
@jktz90

This comment has been minimized.

Copy link

commented Aug 7, 2017

You can simply use this wiring (if you have someone to help you, you dont neet so solder).
If you use an arduino to flash: connect GROUND with RESTART on your Arduino, select ESP 8285(!) in Arduino IDE and you are good to go.
img_2491

@moonfarms

This comment has been minimized.

Copy link

commented Aug 8, 2017

hello jktz90, please if I connect my usb to uart like this it does overheat very fast, so instead I am powering the sonoff from his own usb and connecting tx rx and Ground of module to my usb to uart but I get eeprom error, I also not sure that ESP goes into Flash mode (i assume rx pin is #5 from bottom on the image and I assume the connect to ground is the second pin from left on the bottom row of connectors. Your help greatly appreciated

@jktz90

This comment has been minimized.

Copy link

commented Aug 8, 2017

You probably plugged Ground/3V the wrong way around. You can definitely use your adapter to power the Sonoff.
Try switching RX with TX, the 5th pin from the button (where the red line points to) has to be connected to TX on your adapter.

Before you power up the Sonoff, you have to pull the pin out in the bottom to Ground (I don't have the official datasheet anymore) in order to force flash mode (I can't remember how exactly but the LED blinked differently to indicate the flash mode).

@moonfarms

This comment has been minimized.

Copy link

commented Aug 8, 2017

3v is the square pin one (blue wire on your pic) isn it? please what pin on your pic has to go to ground to enable flash

@TSparkas

This comment has been minimized.

Copy link

commented Apr 30, 2018

No luck so far :( Will try again during the upcoming weekend.

@rmarkle

This comment has been minimized.

Copy link

commented May 2, 2018

@TSparkas I FINALLY figured it out. Make sure you attach your ground from your FTDI to the ground on your board.

I had some issues using a mac because of the default FTDI drivers (on second thought, maybe it's because i didn't use the ground.. idk)

This was using Arduino IDE on a windows 7 Machine.

Make sure both FTDI Board and Relay Board are disconnected from everything.

Anyway, Here's the steps i took (no solder):

  1. Prepared the FTDI - I placed the jumper wires on the RX, TX and Ground pins on the FTDI board and plugged in the FTDI board to your computer.
  2. Attached FTDI ground to the board's ground
  3. Put the relay board in flash mode by holding the two buttons, plugging in the micro usb, released the two buttons (you should hear the relay click on and off repeatedly) and hitting the "bottom" button (the button closest to the edge of the board). You should see two LEDS remain lit.
  4. Started upload process in ArduinoIDE.
  5. Quickly held the TX to pin 4 and the RX to pin 3 on the chip.

You should see an uploading progress in the ArduinoIDE so stay very still with those tx/rx pins.

That should be it! The board will automatically restart and attempt to connect to the wifi you setup in the tasmota code.

Let me know if you need any other help.

@tlc76

This comment has been minimized.

Copy link

commented May 23, 2018

I've got one of these 5V devices and I managed to install Tasmota fw by following @rmarkle 's guide (thanks!) and this video. Power can be provided via the micro USB interface, while only the TX and RX pins must be connected manually to esp pins #3 and respectively #4.

Unfortunately the device does not work in inching mode; the relay is triggered approx. 4-6 times in a row and immediately the module restarts; the wifi is available few seconds later. Sometimes it remains frozen and it needs a cold reboot (plug-out / plug-in the USB cable).

However, I believe one can easily simulate the inching function by simply triggering a sequence of power on / power off commands via mqtt.
This turns the device into a simple Sonoff basic, from the functionality perspective.

There is also the (somehow useless) alternate option to configure the device as ElectroDragon, in which case two switches are available:

  • sw1 - controls the LED near the on/off switch
  • sw2 - controls the onboard relay.

Either way, the device works only in normal power on/off mode. If one presses sw2 and then tries to use the web/mqtt interface to fire up commands, the module will go haywire as depicted above (see italic text).

@tlc76

This comment has been minimized.

Copy link

commented May 23, 2018

In case someone wants to revert to the original Itead firmware, I've dumped the esp binary before overwriting it with Tasmota.

sonoff_5v_module.bin

@PauloPC

This comment has been minimized.

Copy link

commented May 30, 2018

You ca use this switch as same of Sonoff 5v: Geekcreit® USB 5V DIY 1 Channel Jog Inching Self-locking WIFI Wireless Smart Home Switch Socket APP Remote Control
I flashed it soldering some wires in ESP module as photos show here.

@syphe

This comment has been minimized.

Copy link

commented Jun 8, 2018

Am having the same errors as others above:

warning: espcomm_sync failed
error: espcomm_open failed
error: espcomm_upload_mem failed
error: espcomm_upload_mem failed

Have tried a number of methods, interestingly, I seem to have issues with the GND connection, if I leave it off, I see activity led's on the uart lighting up a wee bit, but if I plug the GND in, I get no activity on the led's, attached a picture of the board while in flashing mode, can anyone see any problems?

img_20180607_211318

@PauloPC

This comment has been minimized.

Copy link

commented Jun 8, 2018

@PauloPC

This comment has been minimized.

Copy link

commented Jun 8, 2018

Even I send a command CMD: PowerOnState
MQT: stat/sonoff5V/RESULT = {"PowerOnState":0} As result
Ever time I Power on it it comes as Power ON.
Some one has a solution for this?

@jktz90

This comment has been minimized.

Copy link

commented Jun 8, 2018

@syphe How exactly did u put your Sonoff into flash mode? Ground has to be connected to GPIO0 upon power up.
Select ESP 8285 generic in Ardunio IDE and try flashing. If it fails, try swapping RX/TX if ure not sure if connected correctly (RX TX / TX RX).

If I remember correctly I had some problems with the inching mode. Try disabling it (LED turns off @ USB port) and try putting it into flash mode again. The LED at the relais should be on permanetly.

@syphe

This comment has been minimized.

Copy link

commented Jun 10, 2018

Managed to get it working finally, first tried a raspberry pi I had to see if my serial adapter was the cause, then after that still didn't work ended up just soldering all the required points to the board as below.

I think what finally worked was supplying 3.3v to the board, as giving it 5v from usb didn't work, but as soon as I have it 3.3v the flashing process went through perfectly.

img_20180610_142639

Note: 3.3v is disconnected in the picture, was connected to the top right header pin in the image, I was disconnecting everything at the time, but figured I should take a picture just to show what worked for me.

@antimix

This comment has been minimized.

Copy link

commented Jun 24, 2018

I still don't have this new device (yet), but I am sure it is a derivative work of a board that used to control the relay through a chain, in which the ESP82xx sent a serial command to the chip STCSTC15F104, that activated the relay. The STC15F104 had a proprietary firmware to control the relay, but had the following serial commands to enable the relay control (using 9600,N,8,1)
0xA0 0x01 0x01 0xA2 => relay on
0xA0 0x01 0x00 0xA1 => relay off
This means that for boards that still have the chip STC15F104 (I have one that has is controlled by an ESP01 on board) Tasmota could give the correct command on the serial port to enable/disable the relay.

@senadaruc

This comment has been minimized.

Copy link

commented Jun 30, 2018

Thanks for the great help, so I managed to flash my "1Channel Inching/Locking 5V/12V Sonoff "with Tasmota which is working fine but I want to install a sensor to detect if my garage door is open, so to do this I need a GPIO14 but I cant find on this board!

So is there a GPIO14 or not?

Thanks,

inching_self-locking_wifi_wireless_switch_5v_2

@PauloPC

This comment has been minimized.

@senadaruc

This comment has been minimized.

Copy link

commented Jul 1, 2018

Thanks, PauloPC so this device doesn't have GPIO14, I need to go with SV version.

@KBrownConsulting

This comment has been minimized.

Copy link

commented Aug 4, 2018

@senadaruc Actually I believe GPIO14 is the 5th pin from the top on the left side of the chip.

image
(I didn't create this image & haven't tested for GPIO14, but it's not the only picture I've seen that shows GPIO14 in that same location.)

@ascillato2

This comment has been minimized.

Copy link
Collaborator

commented Sep 4, 2018

Hi,

Closing issue as there is no activity in this thread. Please, if you need more help, ask to reopen it.

@ascillato2 ascillato2 closed this Sep 4, 2018

curzon01 pushed a commit to curzon01/Sonoff-Tasmota that referenced this issue Sep 6, 2018

v5.3.0
5.3.0 20170715
* Major Hue rewrite which might introduce Alexa problems. If so,
initiate an issue
* Add support for Sonoff Led and BN-SZ01 Ceiling Led brightness control
to Hue
* Fix Sonoff Led Power, Dimmer and Color MQTT response (arendst#176)
* Add commands Delay and Backlog to allow multiple commands at once
separated by ";" (arendst#593)
* Use default flashmode DOUT to solve restart hangs on esp8285 chips
(arendst#453, arendst#598)
* Change Web console column width from 99 to 300 (arendst#599)
@tedsluis

This comment has been minimized.

Copy link

commented Jan 5, 2019

Can this issue be reopened, please?

I have trouble flashing a Sonoff 1CH. My board is based on the PSF-B01 (PSF-B85). On the board I found this number: 150318AP130-181031.

I believe I followed all the instructions and recommendations mentioned in this github issue, without success. May be I am doing something wrong or may be my board needs a slidely different approach?

I did solder wires to the PSF-B01:

  • TxD (left side, 3rd pin from below)
  • RxD ( left side, 4th pin from below)
  • GPIO0 (upper side, 2nd from the right)

And I did solder a 4 pin connector in the middle of the board (difficult to see on the photo, sorry):

  • GND upper pin
  • n/a
  • n/a
  • 3v3 lower pin

After soldering the board is still working (it is responding to the buttons, the leds are working and the relay is clicking).

I do have experience in soldering wires on to chip pins and I was able to flash the Tasmota firmware onto other Sonoff boards using VSCODE + PlatformIO plugin (running on Linux) and a CH340G USB.

To flash to board I took to following steps:

  • connect TxD board to CH340G RxD
  • connect RxD board to CH340G TxD
  • connect GND board to CH340G GND
  • connect GPIO0 board to GND board (to trigger flash mode when the board is powered on)
  • insert CH340G USB into laptop
  • connect 3v3 board to CH340G 3v3
  • wait a few seconds
  • disconnect the GPIO0 board from GND (the board should now be in flash mode)
  • noticed a flashing led on the CH340, like is normal when I flash other boards
  • start flashing
  • instead of two leds on the CH340G should flash, only one led flashes.
  • after some seconds the flash process stops with an error:

Flash log:

Compiling .pioenvs/sonoff-basic/src/sonoff.ino.cpp.o
Linking .pioenvs/sonoff-basic/firmware.elf
Retrieving maximum program size .pioenvs/sonoff-basic/firmware.elf
Building .pioenvs/sonoff-basic/firmware.bin
Checking size .pioenvs/sonoff-basic/firmware.elf
Memory Usage -> http://bit.ly/pio-memory-usage
DATA:    [======    ]  55.4% (used 45380 bytes from 81920 bytes)
PROGRAM: [====      ]  43.9% (used 449140 bytes from 1023984 bytes)
Configuring upload protocol...
Looking for upload port...
Use manually specified: /dev/ttyUSB0
Uploading .pioenvs/sonoff-basic/firmware.bin
warning: espcomm_sync failed
error: espcomm_open failed
error: espcomm_upload_mem failed
*** [upload] Error 2

Any feedback is welcome!

@owieder

This comment has been minimized.

Copy link

commented Jan 8, 2019

Same Issue to me, is there any help outside?

@ascillato

This comment has been minimized.

Copy link
Contributor

commented Jan 8, 2019

@tedsluis @owieder

For support on flashing, please address this to the Tasmota Support Chat. Thanks

@tedsluis

This comment has been minimized.

Copy link

commented Jan 8, 2019

For support on flashing, please address this to the Tasmota Support Chat. Thanks
@ascillato: Thnx for your advise!

@johnsnow0

This comment has been minimized.

Copy link

commented Jan 18, 2019

Hello,
i am new to this forum and programming in general but following this tutorial i managed to flash my 1 ch sonoff and it is working. I know how it is hard sometimes to find information about all stepsHere is instruction how i did it.

  1. i downloaded ESPEasy_mega-20190110, extracted to folder /ESPEasy_mega-20190110
  2. i downloaded sonoff.bin from tasmota, place into folder /ESPEasy_mega-20190110
  3. Hardware setup. First picture FTDI232 setup and wires, second picture 1CH bord pin setup. FTDI 232 power mode must be 3.3V.
  4. hold both buttons on 1CH board while insert FTDI232 usb to computer. Release buttons right after insert usb into pc. Now 1CH board must be in flashing mode.
  5. Run FlashESP8266.exe, select correct port and choose sonoff.bin in menu.
  6. Put pins on board and hold them. You must hold pins very steady on board 5 pin - RX, 6 pin - TX. Hit flash and process should be started. It might not work from first time, just try few times.

I hope this will be helpful.

Update: after flashing to tasmota, 1CH relay started to swich on/off randomly. This happens all the time then relay looses wifi connection and restores it. I could not find any reliable solution for this problem.
Only solution i found and it is working 100% time is switch to ESPURNA 1ch relay firmware. Now i'm testing ESPURNA for few days and absolutely happy with results.

img_3897
img_3899

@tsunglung

This comment has been minimized.

Copy link

commented Jan 21, 2019

I can flash custom firmware now.
Use unofficial PL2302: failed (the voltage of TX and RX may be incorrect 3.3V)
After use FTDI, it is ok and there is a key point. That is removing the power 3.3 of sonoff while retrying.

@leonardofibonacci

This comment has been minimized.

Copy link

commented Apr 8, 2019

hold down the B1 button and connect the USB voltage.
The LED diode next to the button must be on.
Permanent relay switching is deactivated
ESPEasy:
Rules:
// Relay GPIO 12
// KEY GPIO 0
on Button#State=1 do
if [Relay#State]=1
gpio 12,0
else
gpio,12,1
endif
endon

@scasic

This comment has been minimized.

Copy link

commented Apr 10, 2019

ESPURNA 1ch relay firmware

could you please refer to ESPURNA binary which have you used?
I tried this one espurna-1.13.5-itead-1ch-inching.bin and it randomly switches as well

@johnsnow0

This comment has been minimized.

Copy link

commented Apr 11, 2019

i used espurna-1.13.3-itead-1ch-inching.bin for 1ch switch, for my Sonoff 4Ch pro i used espurna-1.13.5-itead-sonoff-4ch-pro.bin and i can confim that it is working properly. No random switching.
BTW, in espurna settings you have to check that device always start in OFF mode. Maybe this was reason for you.

@scasic

This comment has been minimized.

Copy link

commented Apr 11, 2019

you have to check that device always start in OFF mode

thank you for feedback. I've just tried to flash tasmota - it's much less stable than espurna, on toggle command it triggers relay multiple times and disconnects from wifi.

As for espurna I tried with OFF mode but it also triggers relay multiple times in a row. But at least it doesn't lose wifi connectivity

@johnsnow0

This comment has been minimized.

Copy link

commented Apr 11, 2019

@scasic

This comment has been minimized.

Copy link

commented Apr 11, 2019

finally i got it work with tamosta:

  • using "model change" button switch relay to simple switch mode (led is always on)
  • type in GUI console "PulseTime 30"

I know it's just software emulation of inching mode, but at least it now works as expected. Without sporadic triggering and restarts, on startup relay keeps calm.

However there is an issue with manual board restart, when i call restart from GUI it triggers relay before getting reset. By the way same behavior on espurna

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.