New ESP gadget

Moderators: grovkillen, Stuntteam, TD-er

Message
Author
cherowley
Normal user
Posts: 125
Joined: 14 Jan 2016, 09:39

Re: New ESP gadget

#51 Post by cherowley » 16 Feb 2016, 11:32

costo wrote:
jay_s_uk wrote:
costo wrote:
It is a bit troublesome that you have to do all the settings from start again after a OTA update. Choose network on 192.168.4.1 and so on.
Or you must compile with SSID and PassPhrase into the sourcecode.
I'm glad I'm not the only one with the frustration that OTA is not very useable with 1meg hardware! In fact, I find that in addition to loosing all setting with ota, it usually renders the board unbootable until I reflash using serial..

User avatar
costo
Normal user
Posts: 500
Joined: 21 Nov 2015, 15:03
Location: NL, zw-NB

Re: New ESP gadget

#52 Post by costo » 16 Feb 2016, 11:49

cherowley wrote:
costo wrote:
jay_s_uk wrote:
I'm glad I'm not the only one with the frustration that OTA is not very useable with 1meg hardware! In fact, I find that in addition to loosing all setting with ota, it usually renders the board unbootable until I reflash using serial..
If I flash the 1MB esp with the bin file provided by Martinis, I can OTA the Esp once. I am very curious what settings were used to generate this 1024.bin file because I tried many different settings but get ended with a unusable Esp when I do OTA with bins compiled by myself.
Only a new serial flash revives the esp.

cherowley
Normal user
Posts: 125
Joined: 14 Jan 2016, 09:39

Re: New ESP gadget

#53 Post by cherowley » 16 Feb 2016, 11:55

costo wrote:
cherowley wrote:
costo wrote:
I'm glad I'm not the only one with the frustration that OTA is not very useable with 1meg hardware! In fact, I find that in addition to loosing all setting with ota, it usually renders the board unbootable until I reflash using serial..
If I flash the 1MB esp with the bin file provided by Martinis, I can OTA the Esp once. I am very curious what settings were used to generate this 1024.bin file because I tried many different settings but get ended with a unusable Esp when I do OTA with bins compiled by myself.
Only a new serial flash revives the esp.
Yep exactly the same for me..

Martinus

Re: New ESP gadget

#54 Post by Martinus » 16 Feb 2016, 11:58

cherowley wrote:I'm glad I'm not the only one with the frustration that OTA is not very useable with 1meg hardware! In fact, I find that in addition to loosing all setting with ota, it usually renders the board unbootable until I reflash using serial..
I've run several OTA updates to my Sonoff device without any issues. But you have to stick to some basic rules:

1) There must be enough room between the sketch and spiffs area to store the temporary download. With a 1 MB flash device, use 1M with 64 kb spiffs. This is the same as we're using for the binaries.
2) Do not mix between different spiffs sizes. The ESP Easy config will be lost with each change, because it maps to a different area in flash.

If does not make sense to have more than 64k spiffs reserved area. We're only using about 40 kb for total configuration.

cherowley
Normal user
Posts: 125
Joined: 14 Jan 2016, 09:39

Re: New ESP gadget

#55 Post by cherowley » 16 Feb 2016, 12:08

Martinus wrote:
cherowley wrote:I'm glad I'm not the only one with the frustration that OTA is not very useable with 1meg hardware! In fact, I find that in addition to loosing all setting with ota, it usually renders the board unbootable until I reflash using serial..
I've run several OTA updates to my Sonoff device without any issues. But you have to stick to some basic rules:

1) There must be enough room between the sketch and spiffs area to store the temporary download. With a 1 MB flash device, use 1M with 64 kb spiffs. This is the same as we're using for the binaries.
2) Do not mix between different spiffs sizes. The ESP Easy config will be lost with each change, because it maps to a different area in flash.

If does not make sense to have more than 64k spiffs reserved area. We're only using about 40 kb for total configuration.
Thanks for clarifying Martinus. I will try this tonight on both the sonoff and the H801 :)

User avatar
costo
Normal user
Posts: 500
Joined: 21 Nov 2015, 15:03
Location: NL, zw-NB

Re: New ESP gadget

#56 Post by costo » 16 Feb 2016, 12:10

Martinus wrote:
I've run several OTA updates to my Sonoff device without any issues. But you have to stick to some basic rules:

1) There must be enough room between the sketch and spiffs area to store the temporary download. With a 1 MB flash device, use 1M with 64 kb spiffs. This is the same as we're using for the binaries.
2) Do not mix between different spiffs sizes. The ESP Easy config will be lost with each change, because it maps to a different area in flash.

If does not make sense to have more than 64k spiffs reserved area. We're only using about 40 kb for total configuration.
There seems to be some issues in the arduino-esp8266 v2.0.0 libraries.
I tried to do OTA on a version with 64k spiffs but the OTA never confirmed with OK.
Also with other size of Spiffs I can do a OTA and getting a OK confirmation while the result is unbootable.

So we do need to know all the settings to generate the 1024.bin file.
Also because of the erroneous results with arduino-esp v2.0.0 we may have to look at a newer release ?

BobS
Normal user
Posts: 15
Joined: 18 Jan 2016, 21:29

Re: New ESP gadget

#57 Post by BobS » 16 Feb 2016, 12:31

Maybe this should be discussed in a separate topic.
There seems to be some issues in the arduino-esp8266 v2.0.0 libraries.
I tried to do OTA on a version with 64k spiffs but the OTA never confirmed with OK.
Also with other size of Spiffs I can do a OTA and getting a OK confirmation while the result is unbootable.

So we do need to know all the settings to generate the 1024.bin file.
Also because of the erroneous results with arduino-esp v2.0.0 we may have to look at a newer release ?
I have seen this happen with some esp-12e too.
I have about 5 esp-12e that work perfect with ota but two other from a different supplier that show same behaviour as you describe.
What happens is that the download crashes. Looking further it seems to crash when it reaches the 512k border.
All have 4mb.

This is for the real experts to investigate.

Martinus

Re: New ESP gadget

#58 Post by Martinus » 16 Feb 2016, 12:34

costo wrote:There seems to be some issues in the arduino-esp8266 v2.0.0 libraries.
I tried to do OTA on a version with 64k spiffs but the OTA never confirmed with OK.
Also with other size of Spiffs I can do a OTA and getting a OK confirmation while the result is unbootable.
Also because of the erroneous results with arduino-esp v2.0.0 we may have to look at a newer release ?
I'm also running the same 1024 binaries on 8 pieces of ESP-01 (black edition) without issues after OTA. Done multiple updates using the webgui and the binaries.

jay_s_uk
Normal user
Posts: 11
Joined: 31 Dec 2015, 02:43

Re: New ESP gadget

#59 Post by jay_s_uk » 16 Feb 2016, 17:47

costo wrote:
Are you sure you are powering the sonoff with 230 V after flashing it with a USB/Serial adapter? Because the adapter cannot deliver the power for the WiFi to work, it will reset often.
About the flashsize, I believe 1M with 512kSPIFFS is the better option to use when you want to do OTA.

The best result I get is to upload the ESPEasy_R78_1024.bin file from http://www.esp8266.nu/downloads/ESPEasy_R78.zip
with the flashtool. From that version I update with the forked ESPEasy from here https://github.com/costonisp/MiniESPEasy to disable the UART on Rxd&Txd and enable GPIO1 and GPIO3 on these pins for I/O

It is a bit troublesome that you have to do all the settings from start again after a OTA update. Choose network on 192.168.4.1 and so on.
Or you must compile with SSID and PassPhrase into the sourcecode.
Flashing the bin file seems to have fixed things. It's working ok in my little work shop so now all I need to do is swap the wifi it uses and attach a lamp to it.

User avatar
costo
Normal user
Posts: 500
Joined: 21 Nov 2015, 15:03
Location: NL, zw-NB

Re: New ESP gadget

#60 Post by costo » 17 Feb 2016, 00:27

Martinus wrote: I've run several OTA updates to my Sonoff device without any issues. But you have to stick to some basic rules:

1) There must be enough room between the sketch and spiffs area to store the temporary download. With a 1 MB flash device, use 1M with 64 kb spiffs. This is the same as we're using for the binaries.
2) Do not mix between different spiffs sizes. The ESP Easy config will be lost with each change, because it maps to a different area in flash.

If does not make sense to have more than 64k spiffs reserved area. We're only using about 40 kb for total configuration.
I can confirm both points, my findings are here http://www.esp8266.nu/forum/viewtopic.p ... =818#p4274
The FOTA works more or less flawless now with this 64k Spiffs setting, but sometimes the flashing does not succeed at the first time and a reboot and retry is needed.

ambassadoro
Normal user
Posts: 40
Joined: 17 Nov 2015, 15:58

Re: New ESP gadget

#61 Post by ambassadoro » 17 Feb 2016, 09:45

I got mine yesterday in the evening. Looks good and fast delivery!

But I already face my first challenge: How can I open this little box? Is there a hidden screw? I don't want to break the case.

Martinus

Re: New ESP gadget

#62 Post by Martinus » 17 Feb 2016, 17:28

ambassadoro wrote:I got mine yesterday in the evening. Looks good and fast delivery!

But I already face my first challenge: How can I open this little box? Is there a hidden screw? I don't want to break the case.
The bottom plate can be 'clicked' open, just use your nails or creditcard or something. No hidden screws.

Please be careful, do not run the unit on mains power without the cover. I would solder a header, connect jumpwires and do the programming without mains power connected.
After programming, verify ESP is working, remove jumpwires.

Only then put the cover back on and power on mains for the final test.


From there on, you should be able to use OTA.

tozett
Normal user
Posts: 734
Joined: 22 Dec 2015, 15:46
Location: Germany

Re: New ESP gadget

#63 Post by tozett » 18 Feb 2016, 21:17

you all reading here at petes blog, too. dont you?
fiddling with smd components to tweak this thing.

http://tech.scargill.net/even-more-sonoff/

User avatar
ManS-H
Normal user
Posts: 279
Joined: 27 Dec 2015, 11:26
Location: the Netherlands

Re: New ESP gadget

#64 Post by ManS-H » 21 Feb 2016, 11:35

Martinus wrote:
ambassadoro wrote:I got mine yesterday in the evening. Looks good and fast delivery!

But I already face my first challenge: How can I open this little box? Is there a hidden screw? I don't want to break the case.
The bottom plate can be 'clicked' open, just use your nails or creditcard or something. No hidden screws.

Please be careful, do not run the unit on mains power without the cover. I would solder a header, connect jumpwires and do the programming without mains power connected.
After programming, verify ESP is working, remove jumpwires.

Only then put the cover back on and power on mains for the final test.


From there on, you should be able to use OTA.
For my information: Solder an header, connect it to a FTDi and use the switch on the board to bring it in a programming mode. Is this right sequence?
And all without MAINS POWER.

Another question, is it possible to save the original firmware?

User avatar
costo
Normal user
Posts: 500
Joined: 21 Nov 2015, 15:03
Location: NL, zw-NB

Re: New ESP gadget

#65 Post by costo » 21 Feb 2016, 14:19

ManS-H wrote: For my information: Solder an header, connect it to a FTDi and use the switch on the board to bring it in a programming mode. Is this right sequence?
And all without MAINS POWER.

Another question, is it possible to save the original firmware?
Right, use a USB/Serial device like the FTDI which can be switched between 3.3V and 5V. Set the switch to 3.3V, connect Gnd, 3.3V, Rxd and Txd. Then while the button is pushed connect the FTDI to the USB, so the device will come up in flash mode.

I have read that the second version of the Sonoff switch, the one with 433MHz module on board, has the switch connected to the secondary processor and not to GPIO-0 of ESP8266. So with this device you have to find out an alternative way to get the device in flash-mode. Maybe push the small button on the RF module while powering-up ? Or connect one of the testpoints to Gnd/Vcc ? I do not own this model so cannot test it.

Saving the original program is not possible.
But I doubt if it is advantageous to flash it back because then everything works over the cloud using a Amazon server. This means that the owner of the cloud automatically knows the access code of your WiFi network.

grz3
Normal user
Posts: 36
Joined: 21 Feb 2016, 21:47

Re: New ESP gadget

#66 Post by grz3 » 21 Feb 2016, 21:48

Hello,

what kind of GPIO are on this SONOFF device? I think GPIO13 is relay, what is button? or LED? is led GREEN/RED? thank you....

grz

NietGiftig
Normal user
Posts: 103
Joined: 16 Sep 2015, 20:32

Re: New ESP gadget

#67 Post by NietGiftig » 21 Feb 2016, 23:39

grz3 wrote:I think GPIO13 is relay, what is button? or LED? is led GREEN/RED?
12 is relais 13 is green led

User avatar
costo
Normal user
Posts: 500
Joined: 21 Nov 2015, 15:03
Location: NL, zw-NB

Re: New ESP gadget

#68 Post by costo » 22 Feb 2016, 00:01

grz3 wrote:Hello,

what kind of GPIO are on this SONOFF device? I think GPIO13 is relay, what is button? or LED? is led GREEN/RED? thank you....

grz
As nietgiftig says : 12 is relais 13 is green led
If you have the sonoff without the 433MHz RF subboard then the button is connected to GPIO-0.

grz3
Normal user
Posts: 36
Joined: 21 Feb 2016, 21:47

Re: New ESP gadget

#69 Post by grz3 » 22 Feb 2016, 20:43

I saw, that the LED got 3legs - so it is two state led, isn't it? not only green, but also red? can I use this second color with any other gpio?
i got sonoff w/o 433module
thank you
grz

NietGiftig
Normal user
Posts: 103
Joined: 16 Sep 2015, 20:32

Re: New ESP gadget

#70 Post by NietGiftig » 22 Feb 2016, 22:26

grz3 wrote:can I use this second color with any other gpio?
No
http://wiki.iteadstudio.com/images/6/6b ... hmatic.pdf

User avatar
rajbadri
Normal user
Posts: 56
Joined: 21 Dec 2015, 21:38
Location: India

Re: New ESP gadget

#71 Post by rajbadri » 23 Feb 2016, 03:56

i have uploaded firmware ver 80 to this device and have been able to activate the relay and led. Now i want to attach a dht11 sensor how should i go about it, which gpio port should i use and where is it located.


Thanks

NietGiftig
Normal user
Posts: 103
Joined: 16 Sep 2015, 20:32

Re: New ESP gadget

#72 Post by NietGiftig » 23 Feb 2016, 07:30

rajbadri wrote:which gpio port should i use and where is it located.
There is no other gpio port exposed, unless you are very good with a soldering iron.
The ESP8266 is already very small, the pins are even smaller. :D

User avatar
rajbadri
Normal user
Posts: 56
Joined: 21 Dec 2015, 21:38
Location: India

Re: New ESP gadget

#73 Post by rajbadri » 23 Feb 2016, 07:49

then is it possible to use the I2C bus
Last edited by rajbadri on 23 Feb 2016, 11:13, edited 1 time in total.

NietGiftig
Normal user
Posts: 103
Joined: 16 Sep 2015, 20:32

Re: New ESP gadget

#74 Post by NietGiftig » 23 Feb 2016, 10:48

rajbadri wrote:then is it possible to use the I2C bus
Did invested time to read the topic?
Or just jumped in to post a question without investigating?
And so let others do the time investment of writing up an answer that has already been giving.

Do a little research, you will be amazed what is possible.

User avatar
costo
Normal user
Posts: 500
Joined: 21 Nov 2015, 15:03
Location: NL, zw-NB

Re: New ESP gadget

#75 Post by costo » 23 Feb 2016, 15:41

At the current state of ESPEasy R80 you can only use I2C on the sonoff. GPIO 1&3 can be used for I2C but cannot be used as input or output. So you cannot attach a sensor like DHT11/22.

As alternative you can use the forked version of R78, this version has fully functioning GPIO 1/3 (UART is swapped to other pins).
When you do FOTA to that fork you can attach devices to GPIO-1 and GPIO-3.
https://github.com/costonisp/MiniESPEasy

User avatar
rajbadri
Normal user
Posts: 56
Joined: 21 Dec 2015, 21:38
Location: India

Re: New ESP gadget

#76 Post by rajbadri » 23 Feb 2016, 19:36

Thanks

cherowley
Normal user
Posts: 125
Joined: 14 Jan 2016, 09:39

Re: New ESP gadget

#77 Post by cherowley » 24 Feb 2016, 10:11

costo wrote:At the current state of ESPEasy R80 you can only use I2C on the sonoff. GPIO 1&3 can be used for I2C but cannot be used as input or output. So you cannot attach a sensor like DHT11/22.

As alternative you can use the forked version of R78, this version has fully functioning GPIO 1/3 (UART is swapped to other pins).
When you do FOTA to that fork you can attach devices to GPIO-1 and GPIO-3.
https://github.com/costonisp/MiniESPEasy
Morning buddy!

Just wondering what additional stuff you did to enable use of the serial gpio's beyond just stopping read/write to the serial gpio? I noticed in release 80 the tick box do disable serial port usage you see. Thanks :)

User avatar
costo
Normal user
Posts: 500
Joined: 21 Nov 2015, 15:03
Location: NL, zw-NB

Re: New ESP gadget

#78 Post by costo » 24 Feb 2016, 12:46

I am wrong about you cannot use GPIO 1 & 3 for other purposes than I2C. You can connect a DHT sensor .
Only hardware setting pinmode high or low is not possible in R80.

So the espeasy fork on github is of no use anymore.

edit:
@ cherowly, what I did in that forked version is in the readme file on github. I just added 2 statements and reordered the pinnumbering

Deennoo
Normal user
Posts: 158
Joined: 07 Sep 2015, 13:03

Re: New ESP gadget

#79 Post by Deennoo » 17 Mar 2016, 12:51

Just recieve 6 pcs of this, unable to pair it with "legal" app...now they all got ESPEsy FW !

Thx for tip

cherowley
Normal user
Posts: 125
Joined: 14 Jan 2016, 09:39

Re: New ESP gadget

#80 Post by cherowley » 17 Mar 2016, 13:02

Deennoo wrote:Just recieve 6 pcs of this, unable to pair it with "legal" app...now they all got ESPEsy FW !

Thx for tip
They seem pretty stable with the firmware too!

One of them hooked upto a light:

System Info
Uptime: 58684 minutes

Build: 48

Over 40 days since I last unplugged it and no reboots :)

Deennoo
Normal user
Posts: 158
Joined: 07 Sep 2015, 13:03

Re: New ESP gadget

#81 Post by Deennoo » 17 Mar 2016, 14:42

cherowley wrote: Over 40 days since I last unplugged it and no reboots :)
Just put 1 Sonoff with ESPEasy r78 on it, on a external Light, will see how many time this will stay on the same cycle.

Actualy there is my record :
Capture.JPG
Capture.JPG (40.35 KiB) Viewed 56076 times
This one of my first ESP8266 sp1, this module is use for Swiming pool Temp (ds18b20), and Water Pulse Counter (Itron Hall System), there is no condo :o , using various power supply because there is no 230v near this place (230v ->12 4A->3.3V)

Deennoo
Normal user
Posts: 158
Joined: 07 Sep 2015, 13:03

Re: New ESP gadget

#82 Post by Deennoo » 21 Mar 2016, 14:03

Back to this new ESP Gadget !

My first project with this, is to bring wifi to this :

Image

Goal is :

- Drive this light via is own on/off switch
- Drive this light via Sonoff relay
- Get Switch Statut


Drive the light via Sonoff relay is ok :

Code: Select all

http://<ESP IP address>/control?cmd=GPIO,<pin>,0

http://<ESP IP address>/control?cmd=GPIO,<pin>,1
Getting switch status is ok by using serial gpio.

Now, i need to drive the physical relay by the physical switch like the sonoff module do as original (without going to my home automation and come back to the light) some thing like a rules :

If switch gpio change to 1 and gpio 12 = 0 then gpio 12 = 1
if switch gpio change to 0 and gpio 12 = 1 then gpio 12 = 0
If switch gpio change to 1 and gpio 12 = 1 then gpio 12 = 0
If switch gpio change to 0 and gpio 12 = 0 then gpio 12 = 1

Did you have any tricks please ?

fluppie
Normal user
Posts: 89
Joined: 09 Oct 2015, 13:23

Re: New ESP gadget

#83 Post by fluppie » 22 Mar 2016, 20:48

I used the new R91 release with rules to control the Sonoff relay with the button and get feedback from the led:

Code: Select all

on SW_1#Switch do
  if [SW_1#Switch]=0
    gpio,12,0
    gpio,13,1
  else
    gpio,12,1
    gpio,13,0
  endif
endon
Attachments
Sonoff1.png
Sonoff1.png (29.97 KiB) Viewed 55903 times

User avatar
costo
Normal user
Posts: 500
Joined: 21 Nov 2015, 15:03
Location: NL, zw-NB

Re: New ESP gadget

#84 Post by costo » 23 Mar 2016, 00:33

Good news for those who do not like to have 220V near the ESP .

Itead has a newer SonOff switch for low voltage. https://www.itead.cc/sonoff-sv.html. It just needs an external voltage between 5-24 volt DC.
The good news is that more GPIO pins are easy available on this board. GPIO-4, GPIO-5 and GPIO-14 are connected to headers.
As was in the 230V version the relais is at GPIO-12 and a pushbutton on GPIO-0 for easy flashing.
The flash memory is 1Mbyte so perfect for OTA.
The price is the same as the high voltage version $4.85 ex shippingcost

This is a perfect device for ESPEasy

MacHack
New user
Posts: 1
Joined: 25 Mar 2016, 09:32

Re: New ESP gadget

#85 Post by MacHack » 25 Mar 2016, 09:46

Hi,

Sonoff together with Espeasy is a really great tool ! I bought 9 of them and installed them at home to control my heaters using the French "fil pilote" and Domoticz. I use R82 version for now, I plan on upgrading quite soon.
They work perfectly. I also installed on a few of them a ds18b20 temperature sensor. However, I haven't managed to make them work them using GPIO-1 or GPIO-3.
As a quick work around, I used GPIO 0 which already have a pull up.
To connect easily to GPIO-0, there is a quick fix using solder to expose GPIO-0 on the rf headers.
Have anyone of you managed to connect 1wire devices to GPIO1 or GPIO3 ?

Anyway, I plan on using another sonoff with espeasy to control my water heater and check my power consumption.
Attachments
sonoff.jpg
sonoff.jpg (15.93 KiB) Viewed 55775 times

Deennoo
Normal user
Posts: 158
Joined: 07 Sep 2015, 13:03

Re: New ESP gadget

#86 Post by Deennoo » 25 Mar 2016, 10:29

MacHack wrote:Hi,

Sonoff together with Espeasy is a really great tool ! I bought 9 of them and installed them at home to control my heaters using the French "fil pilote" and Domoticz. I use R82 version for now, I plan on upgrading quite soon.
They work perfectly. I also installed on a few of them a ds18b20 temperature sensor. However, I haven't managed to make them work them using GPIO-1 or GPIO-3.
As a quick work around, I used GPIO 0 which already have a pull up.
To connect easily to GPIO-0, there is a quick fix using solder to expose GPIO-0 on the rf headers.
Have anyone of you managed to connect 1wire devices to GPIO1 or GPIO3 ?

Anyway, I plan on using another sonoff with espeasy to control my water heater and check my power consumption.
I install ESPEASY mini r78 on it, this provid aviability to use GPIO 0 or GPIO 2.

On R91 there is option :

Use Serial Port :
Capture.JPG
Capture.JPG (82.77 KiB) Viewed 55766 times
Don't test yet if this allow the same as ESPeasy mini

Edit : Just test to unmark : Enable Serial Port, It Allow aviablility to use rx and tx as "normal" GPIO
Last edited by Deennoo on 25 Mar 2016, 14:32, edited 1 time in total.

Deennoo
Normal user
Posts: 158
Joined: 07 Sep 2015, 13:03

Re: New ESP gadget

#87 Post by Deennoo » 25 Mar 2016, 14:30

fluppie wrote:I used the new R91 release with rules to control the Sonoff relay with the button and get feedback from the led:

Code: Select all

on SW_1#Switch do
  if [SW_1#Switch]=0
    gpio,12,0
    gpio,13,1
  else
    gpio,12,1
    gpio,13,0
  endif
endon
Just Try it ! Perfect !! Thx you and thx R91 !

micha
New user
Posts: 3
Joined: 31 Mar 2016, 19:22

Re: New ESP gadget

#88 Post by micha » 31 Mar 2016, 19:44

Hi,

I tried a configuration for my Sonoff using a combination of Devices, Rules (R94) and an addition to the commands for ESP-Easy to get the following features:

press switch for less than 1 second: turn relais on
press switch for about 3 seconds: turn relais off
press switch for about 7-8 seconds: start access point of esp to recover from mis-configuration

Maybe this is helpful for anybody...
Rules:

Code: Select all

on sw1#Switch=0 do
  timerSet,1,1
endon
On Rules#Timer=1 do
  if [sw1#Switch]=0
    timerSet,2,2
  else
    gpio,12,1
  endif
endon
On Rules#Timer=2 do
  if [sw1#Switch]=0
    timerSet,3,5
  else
    gpio,12,0
  endif
endon
On Rules#Timer=3 do
    wifiap
endon
addition to file command.ino
(insert somewhere after other wifi commands, eg after line 242 "WifiDisconnect"...)

Code: Select all

// --> disconnect current Wifi and restart AP mode
   if (strcasecmp_P(Command, PSTR("WifiAP")) == 0)
  {
    success = true;
    WifiDisconnect();
    WifiAPMode(true);
    //ESP.reset();
  }
 // <-- 
 
Devices:
Devices_Sonoff.png
Devices_Sonoff.png (112.26 KiB) Viewed 55462 times

fluppie
Normal user
Posts: 89
Joined: 09 Oct 2015, 13:23

Re: New ESP gadget

#89 Post by fluppie » 01 Apr 2016, 13:08

I'm wondering why you configure an output as an input? Is there a specific reason to?

micha
New user
Posts: 3
Joined: 31 Mar 2016, 19:22

Re: New ESP gadget

#90 Post by micha » 02 Apr 2016, 13:13

fluppie wrote
I'm wondering why you configure an output as an input? Is there a specific reason to?
You`re right. It´s completely unnecessary :oops:

Was my error to think it´s needed to use it in domoticz. It´s not...

If you need to read the relay control port level in your rules, you do. :)

morle
Normal user
Posts: 17
Joined: 30 Jan 2016, 08:50
Location: Germany

Re: New ESP gadget

#91 Post by morle » 08 Apr 2016, 00:41

Hi,
I got 3 sonoff with 5 pin, tried to flash one with espeasy.
Always get this error:

Code: Select all


warning: espcomm_sync failed
error: espcomm_open failed
error: espcomm_upload_mem failed
Can anybody help here?
Regards
Hubert

User avatar
SuperToma
Normal user
Posts: 14
Joined: 08 Apr 2016, 08:33

Re: New ESP gadget

#92 Post by SuperToma » 08 Apr 2016, 08:35

Hi !

I have the same problem, is it possible to flash it with a serial port RS232 ?

cherowley
Normal user
Posts: 125
Joined: 14 Jan 2016, 09:39

Re: New ESP gadget

#93 Post by cherowley » 08 Apr 2016, 10:13

5 pins?

Ooo, please take a picture :)

Deennoo
Normal user
Posts: 158
Joined: 07 Sep 2015, 13:03

Re: New ESP gadget

#94 Post by Deennoo » 08 Apr 2016, 10:39

Maybe like H801 module one pin have to be set on gnd before power it, to set it on "programmation mode"

morle
Normal user
Posts: 17
Joined: 30 Jan 2016, 08:50
Location: Germany

Re: New ESP gadget

#95 Post by morle » 08 Apr 2016, 11:08

It looks like in the wiki explaned here:
http://wiki.iteadstudio.com/Sonoff_TH
Regards
Hubert

cherowley
Normal user
Posts: 125
Joined: 14 Jan 2016, 09:39

Re: New ESP gadget

#96 Post by cherowley » 08 Apr 2016, 11:54

Ah, hadn't seen that one before :)

Convenient extra io pin :)

I've used the tx/rx pins on mine for PIR and dht sensors etc :)

kr0815
Normal user
Posts: 136
Joined: 18 Nov 2015, 18:24

Re: New ESP gadget

#97 Post by kr0815 » 10 Apr 2016, 20:02

fluppie wrote:
I used the new R91 release with rules to control the Sonoff relay with the button and get feedback from the led:

CODE: SELECT ALL
on SW_1#Switch do
if [SW_1#Switch]=0
gpio,12,0
gpio,13,1
else
gpio,12,1
gpio,13,0
endif
endon
i tried to change it the way that the relais status instead of the switch is read, so i could toggle always, even if the relais is switched from somewhere else

Now I have to push the button several times till it changes the state, any suggestions ?


[img]
Clipboard01.jpg
Clipboard01.jpg (69.45 KiB) Viewed 46124 times
[/img]

Code: Select all

on SW_1#Switch do
  if [relais#Switch]=1
    gpio,12,0
    gpio,13,1
  else
    gpio,12,1
    gpio,13,0
  endif
endon

kroonen
Normal user
Posts: 26
Joined: 05 Oct 2015, 22:00

Re: New ESP gadget

#98 Post by kroonen » 11 Apr 2016, 21:15

Any idea what GPIO this extra pin is?

Looking at the schema, it looks like gpio14?

xbmcnut
Normal user
Posts: 49
Joined: 17 Mar 2016, 08:49
Location: Auckland, NZ
Contact:

Re: New ESP gadget

#99 Post by xbmcnut » 12 Apr 2016, 07:52

morle wrote:Hi,
I got 3 sonoff with 5 pin, tried to flash one with espeasy.
Always get this error:

Code: Select all


warning: espcomm_sync failed
error: espcomm_open failed
error: espcomm_upload_mem failed
Can anybody help here?
Regards
Hubert
Had this today on several units. Hold down the button, plug in the USB and continue to hold button down for 10 seconds. Worked for me.
Numerous Sonoff's and Shelly's, Home Assistant on Intel NUC i3, Aeotec Z-Stick (Gen 5), deCONZ Zigbee Stick, 3 x Echo Dot's and 5 x Google Home

morle
Normal user
Posts: 17
Joined: 30 Jan 2016, 08:50
Location: Germany

Re: New ESP gadget

#100 Post by morle » 12 Apr 2016, 11:39

Hi,
I managed to flash the ESPEasy_R78_1024.bin image.
But now i am not able to flash a newer version OTA.
Not even to do a config with the R78.
I can see in the log that the config is saved into the Flash, but when i reboot my sonoff, it starts again in AP mode with the initial setup.
What to do here?
Regards
Hubert

Post Reply

Who is online

Users browsing this forum: No registered users and 21 guests