arendst / Tasmota

Alternative firmware for ESP8266 and ESP32 based devices with easy configuration using webUI, OTA updates, automation using timers or rules, expandability and entirely local control over MQTT, HTTP, Serial or KNX. Full documentation at
https://tasmota.github.io/docs
GNU General Public License v3.0
22.04k stars 4.78k forks source link

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

Closed ed1402 closed 6 years ago

ed1402 commented 7 years ago

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 commented 7 years ago

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 commented 7 years ago

This Device: https://www.itead.cc/smart-home/inching-self-locking-wifi-wireless-switch.html And probably this: https://www.itead.cc/sonoff-4ch-pro.html

ed1402 commented 7 years ago

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

xinghusp commented 7 years ago

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

ed1402 commented 7 years ago

Some pics: 20170516_210121_001 20170516_210144

ed1402 commented 7 years ago

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 commented 7 years ago

tasmota has never supported the inching functionality of this board. k

paco-ita commented 7 years ago

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 commented 7 years ago

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 commented 7 years ago

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 commented 7 years ago

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 commented 7 years ago

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 commented 7 years ago

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

arendst commented 7 years ago

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:

zizebra commented 7 years ago

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 commented 7 years ago

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

levonbragg commented 7 years ago

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 commented 7 years ago

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

levonbragg commented 7 years ago

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 commented 7 years ago

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 commented 7 years ago

@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 commented 7 years ago

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 commented 7 years ago

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 commented 7 years ago

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.

jktz90 commented 7 years ago

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 commented 7 years ago

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 commented 7 years ago

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 commented 7 years ago

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

jktz90 commented 7 years ago

No blue is Ground and green 3V. The pin you have to connect to Ground upon power up is in the bottom row of the ESP (where the line points to). Make sure to select ESP 8285 in Arduino IDE

moonfarms commented 7 years ago

thanks again I can get it into flash mode i think (the relais keeps opening and closing) (it is also possible to do it by pressing the 2 buttons simultaneously on power up. Still no luck in flushing, but i am using platformio so maybe this is the problem. Thanks alot again jktz90 for your help, really appreciated

jktz90 commented 7 years ago

Just checked it... u're in flash mode if the red led next to the relais is on permanently. (without official firmware on it.. no idea if its different then)

moonfarms commented 7 years ago

can only get that red led to blink....

moonfarms commented 7 years ago

jktz90 I managed to flash !!!!! THANK YOU IN CAPITAL LETTERS. Everything you wrote above is correct, led has to be solid red before flash. I dont know what i was doing wrong..... Have a nice day

LurchiStromberg commented 7 years ago

HI Guys! I am totally new in this Scene so please be gracious to me, i am not even a Technician.

I ordered that Item from Banggood and hoped, i will receive a ESP8266 Model, what is easy to flash by soldering some pins on the Board. Yesterday i received the Board and was surprised by its Pinout. So i done a Google research and luckily I found this Thread here, and that its not an ESP 8266 but an ESP 8285. The wireing @jktz90 showed to us here confused me some, so i try to figure it out myself at looking at Datasheets.

Here is the Result:

esp 8285 anschluss ftdi pinbelegung

and

sonoff 5v besser

What i am surprised of is, that only 3,3 Volts and GND should be at the 4 Pin Connector. Is it really like that, that RX and TX are not supported at one of the 4 or 6 Pins Connector?

What you used to get contact to the Pins of J3 and J2 ? Soldering cables at this Pins is nearly impossible (like i said, i am not so familiar with those Stuff)

And GPIO0 must be connected to GND to put the Board into Flashmode? It is not possible with the 2 Switches on the Board?

GND to put into flashmode can be the GND next to 3,3 Volts?

I would be happy if somebody could explain all this, hopefully jktz90 a little more detailed. Thank you in advance

PeggyFree commented 7 years ago

I flashed 15 sonoff devices with zero solder, so you can do as well. Look for "male dupont cable" that you can use between the ftdi cable and the holes you show on your pic.

Esp 8285 does not really makes difference with 8266 as far as I know, regarding the flash method.

Le mer. 9 août 2017 14:58, LurchiStromberg notifications@github.com a écrit :

HI Guys! I am totally new in this Scene so please be gracious to me, i am not even a Technician.

I ordered that Item from Banggood and hoped, i will receive a ESP8266 Model, what is easy to flash by soldering some pins on the Board. Yesterday i received the Board and was surprised by its Pinout. So i done a Google research and luckily I found this Thread here, and that its not an ESP 8266 but an ESP 8285. The wireing @jktz90 https://github.com/jktz90 showed to us here confused me some, so i try to figure it out myself at looking at Datasheets.

Here is the Result:

[image: esp 8285 anschluss ftdi pinbelegung] https://user-images.githubusercontent.com/30866642/29122265-fc2e6cbe-7d11-11e7-89d5-3e6db378b2fc.jpg

and

[image: sonoff 5v besser] https://user-images.githubusercontent.com/30866642/29122285-0db19f24-7d12-11e7-9d21-76cd7ab91b20.jpg

What i am surprised of is, that only 3,3 Volts and GND should be at the 4 Pin Connector. Is it really like that, that RX and TX are not supported at one of the 4 or 6 Pins Connector?

What you used to get contact to the Pins of J3 and J2 ? Soldering cables at this Pins is nearly impossible (like i said, i am not so familiar with those Stuff)

And GPIO0 must be connected to GND to put the Board into Flashmode? It is not possible with the 2 Switches on the Board?

GND to put into flashmode can be the GND next to 3,3 Volts?

I would be happy if somebody could explain all this, hopefully jktz90 a little more detailed. Thank you in advance

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/arendst/Sonoff-Tasmota/issues/453#issuecomment-321247436, or mute the thread https://github.com/notifications/unsubscribe-auth/AcMo5ahrmWsxIKGO7j6BMXhspLejAY2cks5sWazlgaJpZM4NbfEK .

moonfarms commented 7 years ago

I used needles to hold on rx tx pins and somebody to help to hold the board / flash firmware

davidelang commented 7 years ago

I use pogo pins, you can insert them into a female header (with effort) to keep them aligned.

https://www.adafruit.com/product/394

jktz90 commented 7 years ago

Like I said in my post, you dont need to solder. You can simply hold the male pins to the respective pin.

It made me go crazy tho, so I decided to simply solder it (took me 5 minutes). I had to flash a lot of times and holding 3 male pins is almost impossible. Find someone to help you and it should be easy.

Don't bother with the pin out on the PCB (no idea why they didnt connect it - maybe to make it harder for us to flash custom firmware), just use my connection (it will save you a lot of time).

LurchiStromberg commented 7 years ago

@jktz90 The connections I posted is right ? You also have the 1 Channel Jog inching Board?

What exact Firmware you flashed on that Board?

The Board goes in Flash Mode if I put GPIO0 to GND and connect it to the FTDI?

Sorry if i ask twice here but i like to get sure

Oh and where do i get the needed Files for ESP8285 ? I know this one http://arduino.esp8266.com/stable/package_esp8266com_index.json and i put the Link in the arduino Settings. Is there also an URL for the 8285 or how do i get the Files Arduion needs?

jktz90 commented 7 years ago

Why does my connection confuse you? Its exactly what you have found in the datasheet. GPIO0 to Ground (which triggers flash mode - its enough to connect it once upon power up) and RX/TX to your FTDI adapter to send data.

After you set up your connection, go into your Arduino IDE and select ESP 8285 as your device. If you havent done it yet, go into board manager and download the ESP files.

I for myself write my own sketches. So I control the relay by UDP packets (send by my smartphone or FHEM). But you're free to flash firmwares like ESPeasy aswell (just go to the wiki).

LurchiStromberg commented 7 years ago

Sorry if i maybe annoy you, but like i said i am a bloody beginner... And after reading hours and hours Eyes get blurry and mind freaks out ;) So if i follow those steps like @arendst wrote before:

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

so this Download: https://github.com/arendst/Sonoff-Tasmota/releases/download/v5.2.4/sonoff-touch-4ch-bnsz.bin

Just tried it and it dont work :( Arduino give an Error Message, that it can only open its own Sketches...

It will work on my 1 CH Board?

Lasst Question (hopefully) How the Settings need to be for the ESP8285 in Arduino?

arendst commented 7 years ago

@LurchiStromberg Sorry to break in but that information has been superseded a while ago. That's what you get with old issues.

Forget about sonoff-touch..bin file. It is no longer available in the latest release.

Only use the latest release sonoff.bin file which has been compiled with flash mode dout. In case you want to compile yourself, ALWAYS use dout.

LurchiStromberg commented 7 years ago

@arendst But if i use Arduino 1.8.3, File, Open and open your sonoff.bin i also get the same Error Message from Arduino:

bad file

arendst commented 7 years ago

Yes that's because you cannot open bin files with arduino ide...

If this is your first experience with arduino ide I suggest to read the wiki from the start how to setup your environment using the files in this repository.

LurchiStromberg commented 7 years ago

@arendst Ok, after several hours i am now comming to a complete different Software or better Programm called esptool.py i have that running in a Terminal now so it will do the job to flash your sonoff.bin to the ESP8285 ?

Now i also see some clearer what you Guys talking about with flashmode dout... I was searching for that at Arduino desperatly lol

Can somebody give me a hint how the exact Command Line has to look like? I am still scared to do the wrong Settings and to RIP the Board

I found this, will it do the job ?

esptool.py --port COMxy --baud 115200 write_flash -fm dout -fs 8m 0x00000 sonoff.bin

Is it needed to erase flash before with:

esptool.py --port COMxy erase_flash

Oh i just forgot, do i have the right esptool.py version? i installed it thru python via "pip install esptool" its on Version 2.0.1

davidelang commented 7 years ago

On Thu, 10 Aug 2017, LurchiStromberg wrote:

I am still scared to do the wrong Settings and to RIP the Board

The way the esp family of chips are designed, you cannot brick them with software. As long as you don't apply more than 3.3v to them, you can always put them in programming mode and at that point it doesn't matter what was flashed to them in the past.

arendst commented 7 years ago

See wiki troubleshooting section for correct syntax. No need to erase.

moonfarms commented 7 years ago

Here a pic of my setup. You can put the board in flash mode by pressing the TWO buttons simultaneously on power up, then press the outer button again and you will have the TWO led solid red. Now hold your needles on tx and rx pins of PSF-B01 and flash. I am only using ground wire of the ftdi, no power wire. dsc00174

LurchiStromberg commented 7 years ago

@moonfarms Hi Paul, thank you for your Picture. As i see you didnt solder the red Wire, 3,3 Volts ????

moonfarms commented 7 years ago

No, I am powering the unit trough the usb, black wire is for ground for tx rx