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

Feature request: adding Obi Socket #1988

Closed
Frickelmaster1 opened this issue Feb 21, 2018 · 68 comments
Closed

Feature request: adding Obi Socket #1988

Frickelmaster1 opened this issue Feb 21, 2018 · 68 comments

Comments

@Frickelmaster1
Copy link

Frickelmaster1 commented Feb 21, 2018

German DIY store "OBI" is selling ESP8266-based sockets (very similar to Sonoff S20) for less than 10 EUR.

I got two of these sockets. It's quite easy to flash Tasmota on it but it was neccesary to modify sonoff/sonoff_template.h to make it work correctly. The same reason as with other clones: they assigned the GPIOs randomly to the available functions and chose others than ITEAD with their Sonoffs.

It would be nice if this configuration snippet could be added to the official sonoff_template.h.

I suggest adding these lines to sonoff_template.h for making the Obi Socket work:

{ "Obi Socket", // Obi socket (ESP8266) - https://www.obi.de/hausfunksteuerung/wifi-stecker-schuko/p/2291706
0, // GPIO00 Flash jumper - not available
0, // GPIO01
0, // GPIO02
0, // GPIO03
GPIO_LED1, // GPIO04 LED on top and in switch button
GPIO_REL1, // GPIO05 Relay 1 (0 = Off, 1 = On)
0, 0, 0, 0, 0, 0, // Flash connection
0, // GPIO12
0, // GPIO13
GPIO_KEY1, // GPIO14 switch button
0,
0, // GPIO16
0 //
},

@reloxx13
Copy link
Contributor

could you add images from the pins with description which pin is what?

@Frickelmaster1
Copy link
Author

The descriptions of the pins are printed on the PCB. They are similar to the pin names on any FTDI adapter.

@reloxx13
Copy link
Contributor

reloxx13 commented Feb 21, 2018

you could try to use the generic module (ex. wemos d1 pre 5.11.0 i think) on the web interface and set up your gpio config.

grafik
(note: this is not from obi)

@martin-ger
Copy link

Some pics from the opened device can be found here: https://github.com/martin-ger/ESP8266-WiFi-Socket

@martin-ger
Copy link

It works somewhat different than the Sonoff basic: a low pulse on GPIO12 switches the relay on, a low pulse on GPIO5 switches it off.

@Frickelmaster1
Copy link
Author

In my Tasmota there is no "Generic" type so I had to edit the templates...

@tobox
Copy link

tobox commented Feb 21, 2018

"Generic" has been added during the last days, replacing Wemos D1 Mini and NodeMCU variants.

@Jason2866
Copy link
Collaborator

@Frickelmaster1
Does it work with your setup?
I ask this because martin-ger describes the on off function different

@Frickelmaster1
Copy link
Author

My first Obi socket works fine, the second doesn't. I flashed the binary with ESPloader to the sockets. The first is OK, the second (with exactly the same firmware) is accessible via web interface, the on-off works (including the blue LED) but the relay isn't switching at all.

Maybe Martin can explain how he modified Tasmota to make it work with the Obi sockets?!

@martin-ger
Copy link

martin-ger commented Feb 22, 2018

I did not use Tasmota but my onw software - works fine. I am not into the Tasmota code and platform.io, but use the esp_open_sdk and my MQTT framework.

The control of the relay works as follows:

  • a low pulse (150 ms works) on GPIO12 switches the relay on
  • a low pulse on GPIO5 switches it off

The two ports are even named "RELAY ON" and "RELAY OFF" on the PCB of the ESP.

Also have an Arduino sketch that controls the device:
https://github.com/martin-ger/ESP8266-WiFi-Socket/blob/master/OBISocket.ino

@martin-ger
Copy link

martin-ger commented Feb 22, 2018

In the sources I read something about "latch" - should be similar to this issue #58.

@Frickelmaster1
Copy link
Author

Although I can't imagine maybe there are differences between my sockets I'll compare them tonight.

Strange... one is working fine, the other one doesn't switch the relay - with identical firmware.

I'll try to use a modified EXS relay configuration on the second socket. Thanks, Martin!

@thxthx0
Copy link

thxthx0 commented Feb 22, 2018

I have solved the 'pulse issue' by setting GPIO12 to always 0 (as LED) and works fine.

obi wlan kenobi

@Gulaschcowboy
Copy link

Got mine today and can confirm @thxthx0 solution. Thanx

@hudecitydave
Copy link

Same here. Confirm @thxthx0. Firmware flash with GND/GPIO0 pin method, update to tasmota 5.12, shown config above. works. THANKS! What a great community!

@Frickelmaster1
Copy link
Author

Tried it yesterday in the evening - works fine with Tasmota 5.12.x and "Generic" device with the settings above.

Thanks! So my request to add "Obi socket" to Tasmota's sonoff_template.h is no longer necessary :-) Nice!

@reloxx13
Copy link
Contributor

added to wiki https://github.com/arendst/Sonoff-Tasmota/wiki/Obi-Socket

@etamtlosz
Copy link

How did you manage to access Tasmota on the OBI plug? I'm struggling since yesterday evening. I'm able to flash it, but no wifi, no interface, nothing.

@reloxx13
Copy link
Contributor

reloxx13 commented Feb 23, 2018

build the firmware yourself, enter wifi credentials in the user_config.h and flash again.

dont forget to reset the cfg_holder

enter wifi data
change cfg_holder
flash
change cfg_holder back to default
flash again.

their is not btn on gpio1 thats why you cannot start the manager with btn press and default is wps mode

@etamtlosz
Copy link

I'm doing something wrong.

edited my wireless settings, including ip
changed cfg_holder to the actual day
flashed
reconnected
changed the cfg_holder to 0x20161209
flashed

It won't connect to my wireless, no ping, etc.
I think I'll wait until some more detailed tutorials are going to be published for this plug.

@reloxx13
Copy link
Contributor

reloxx13 commented Feb 23, 2018

their is nothing more to add, its an esp like in all other devices.

do you got other devices with tasmota which are connected to your wifi?

ip on 0.0.0.0 for dhcp.

no special chars in wifiname and password.

how you want to send a ping without an ip or connection to your router wtf dude...

even if it says its flashed 100% it can be not flashed due a defect usb flasher or you used wrong device config in arduino/atom. read the flash guides in the wiki.

@etamtlosz
Copy link

My ip was set to a fix IP, this is why I was monitoring the IP with ping.
I'll try with DHCP, now.

I'm using the correct flashing method, I assume - Generic ESP8266 Module.

@gunnwo
Copy link

gunnwo commented Feb 26, 2018

I have the latest firmware flashed. As the wlan was preconfigured access was possible. But I'm struggeling with the OBI socket and generic Type. Comparing the screen shot from above with the settings I only get 4 entries in the module configuration: GPIO1/3/4/14. So how do you enable the rest of the fields and enter the settings?

@etamtlosz
Copy link

Change it to generic, save. It will restart an you'll have the other options as well.

@thxthx0
Copy link

thxthx0 commented Feb 27, 2018

If someone wants to confgure more sensors:

the onboard ESP8266 Module with 1MB is similar to 'WT8266-S1'

wt8266-s1-pins

@cyablo
Copy link

cyablo commented Feb 27, 2018

Got mine flashed with tasmota and used the settings suggested by thxthx0, but my relay does not turn on. Only Red & Blue LED's turn on. @Frickelmaster1 : Did you get it working on yours?

EDIT: MY BAD!!! Relay only works on wall power, not on 3.3V from USB TTL

@CarstenKochems
Copy link

I tryed to flash it with esptool.
Connected gpio0 to grnd
it flashes but then dosent boot up.

after 2-3 trys i got:

00:00:09 APP: starte neu

ets Jan 8 2013,rst cause:4, boot mode:(1,6)

wdt reset

and nothign happend further, i used 5.12

@Jason2866
Copy link
Collaborator

@Steakschen PreBuild Image or self compiled?

@CarstenKochems
Copy link

@CarstenKochems
Copy link

i flashed 2 times, and booted it 5 minutes, now it works
solved :-) wait 2min+ to boot

@dzett
Copy link

dzett commented May 25, 2018

@arendst After playing around with the socket a bit more yesterday (trying to use the existing latching implementation for module EXS_RELAY which I assume is working and remapping the GPIOs), I am not so sure that the Obi socket really has a latching relay, as it would turn off right away when the pulse was over.
Also, I looked for some sort of datasheet for the relay that is used (same type as seen on the pictures in earlier posts) and from what I found it seems to be just a plain standard relay. Does anybody still have the stock firmware on it and actually look at the outputs?

Edit: On the other hand, @martin-ger 's coding obviously uses pulses and his pictures show the same hardware :-)

@cremofix
Copy link

I just opened my socket
and found this relais
SMIH-NingBoSongle.pdf

this is not a latching relais. perhaps they use different models?

@thxthx0
Copy link

thxthx0 commented May 25, 2018

That's right, it is not a latching relay.

There is a standard 16 amp relay,
but driven by 'some kind of latching' transistor circuit.

I couldn't measure any differences in power consumption
by using stock firmware, Tasmota (GPIO12 always 0) or martin-ger's ino.

The relay is driven at about 140mA and 5.4 V

@dzett
Copy link

dzett commented May 25, 2018

Hi all,

@thxthx0, thanks for clarification - should have checked my inbox a bit earlier :-)

I just picked up another one at Obi and can confirm that also with stock firmware, across the pins driving the relay coil, there is a constant voltage visible while the output is active. The "Relay On" trace from the ESP8266 board goes into something that looks like a circuit around two transistors (flip flop, eh? good old times). So I guess we don't need any code changes after all. Thanks to all!

@thilokru
Copy link

thilokru commented Jun 5, 2018

Is it normal that the devices get hot? When turned off, it is warm to the touch, but when on it realy heats up.

@thxthx0
Copy link

thxthx0 commented Jun 8, 2018

Yes, seems to be normal (and a 'feature' of this relay ;).

Power Consumption of the relay is about 0.75W
(data sheet says 0.72W).

It also works reliable @ 4V and 0.4W,
but temperature isn't much different
(~ 40°C at the solder joints & case opened).

@rudi48
Copy link

rudi48 commented Jun 17, 2018

Unfortunately the Button1 wired to GPIO14 no longer allows to use the Button usage (usually wired to GPIO0), described on https://github.com/arendst/Sonoff-Tasmota/wiki/Button-Usage

Does anybody know how to regain this Button-Usage, e.g. for providing an Access Point with IP address 192.168.4.1?

Correction: Button1 works also with GPIO14, I had a problem with the test.

@renne
Copy link
Contributor

renne commented Jun 17, 2018

@arendst
I suggest a profile for the Obi WLAN "KenObi" which usses GPIO14 for "Button usage".

@stale
Copy link

stale bot commented Aug 1, 2018

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale Action - Issue left behind - Used by the BOT to call for attention label Aug 1, 2018
@josch
Copy link

josch commented Aug 5, 2018

Are the tasmota developers against adding a template for the OBI socket and would prefer that one uses the Generic setting?

Or would a pull request be appreciated?

@stale stale bot removed the stale Action - Issue left behind - Used by the BOT to call for attention label Aug 5, 2018
@nobirdnobird
Copy link

nobirdnobird commented Aug 13, 2018

Yes, I will also really appreciate to add the adapter configuration to the template !
thanks & BR

@ascillato2
Copy link
Collaborator

@josch

Please, Make a PR.

Thanks

@florianschroen
Copy link
Contributor

Created PR #3944

@Jason2866
Copy link
Collaborator

@renne OBI plug is a cheap china device too...
#1988 (comment)
See: #3944
Model tested: WFG-1
Models maybe working: WFF-1, WFE-1, WFI-1, WFD-1, WFR-1, WFA-1, WFU-1
Manufactured by: Cixi Yidong Electronics Co. Ltd - http://www.cn-yidong.com/
Sold by: OBI DIY market in Germany - https://www.obi.de

arendst added a commit that referenced this issue Oct 1, 2018
 * Add support for OBI Power Socket (#1988, #3944)
 * Add support for Teckin Power Socket with Energy Monitoring (#3950)
@dreamlayers
Copy link

OBI Socket setting also works for Orvibo S25US https://fccid.io/2ACLPS25US/Internal-Photos/Internal-Photos-2970651

Button, relay and blue LED work. The S25US LED can also be red if the blue is turned off and GPIO12 is on. Though red and blue cannot be on at the same time. I experimented with this using Sonoff 4CH module setting.

@mkormendy
Copy link

mkormendy commented Jul 18, 2019

I wonder if this Works for the Orvibo S31 (which has power monitoring) as well. It doesn't have any nice board pins to connect headers to, so it's not as simple as some other devices. I have opened up the outlet and here's what it looks like:

IMG_8225
IMG_8226
IMG_8227

@roger-
Copy link

roger- commented Nov 2, 2019

Interested in the S31 as well. Any try this yet?

@ascillato
Copy link
Contributor

@roger-
Copy link

roger- commented Nov 30, 2019

@roger-
Please, check https://github.com/arendst/Tasmota/blob/development/README.md#note

Yeah, I’m just curious if the template is the same before I flash it.

@KSumwalt
Copy link

@roger- Did you figure out how to connect to this and flash it? This is the first unit I am trying to flash and I don't see labeled points to connect to.

@roger-
Copy link

roger- commented Dec 14, 2019

@KSumwalt no, haven’t tried yet.

@mkormendy really? Do you have a link to someone who’s tried it?

@rudi48
Copy link

rudi48 commented Dec 15, 2019

A HowTo with USB-Serial converter to flash:
https://www.rudiswiki.de/wiki9/ObiWIFISteckdose

@Jason2866
Copy link
Collaborator

@rudi48 the way you describe is outdated. Devices are supported and easily configured via Template function. See https://blakadder.github.io/templates/

@perozonp
Copy link

I've been unable to put in program mode that Orvibo S31 (pictures from @mkormendy above), I don't want to de-solder the board where the 8266 is and accessing the pins is very dificult...

@mkormendy
Copy link

@mkormendy really? Do you have a link to someone who’s tried it?

I spoke too soon, and I've deleted my comment. I got the Smart Life / Tuya apps confused with the HomeMate app which appears to not be Tuya based.

I've been unable to put in program mode that Orvibo S31 (pictures from @mkormendy above), I don't want to de-solder the board where the 8266 is and accessing the pins is very dificult...

I managed to separate the smaller board from the larger base board with all of the larger components on it. I needed to use a vacuum soldering gun (we have one at work) and that got all of the solder off enough for me to pull the smaller board out.

However, I was unsuccessful at my first couple attempts to flash the device with easier access to the pins. I put it down for the past while. I wish they would just allow us to flash our own software on the device, this sort of lock down would obviously void warranties but I wouldn't care at that point.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests