Problems and Questions over config Tasmota with Sonoff S20 (UK)

740 views
Skip to first unread message

Alan UK

unread,
Apr 22, 2017, 6:25:34 PM4/22/17
to SonoffUsers
Hi, newbie here with first venture into IoT.

Trying to get a Sonoff S20 working (UK version made Dec 2016). I followed the YouTube video https://www.youtube.com/watch?v=-JxPWA-qxAk as far as 11:40. All seemed to go well but the S20 does not make contact with my wi-fi access point.

Arduino IDE
Installed v1.8.2 under Windows 7 64bit
Edited PubSubClient.h and changed Line #define MQTT_MAX_PACKET_SIZE 128 to #define MQTT_MAX_PACKET_SIZE 512
Installed esp8266 by ESP8266 Community (version 2.3.0)
Installed PubSubClient v 2.6.0
Installed ArduinoJson v 5.8.4
Downloaded Tasmota 4.1.3 from Git

Network:
Vigor router at 192.168.1.1 with DHCP
Fixed IP Address to MAC Address Strict Bind temporarily disabled
Vigor is cabled linked to a TP-Link Wi-Fi Access Point
TP-Link is at 192.168.1.17
Has DHCP disabled
Channel: Auto
Mode: 11bgn mixed
Channel Width: auto
Wireless Radio Enabled
SSID Broadcast Enabled
MAC filtering is temporarily disabled
Security is WPA2-PSK and AES

Tasmota config

#define WIFI_IP_ADDRESS        "0.0.0.0"         // [IpAddress1] Set to 0.0.0.0 for using DHCP or IP address
#define WIFI_GATEWAY           "192.168.1.17"   // {IpAddress2] If not using DHCP set Gateway IP address
#define WIFI_SUBNETMASK        "255.255.255.0"   // [IpAddress3] If not using DHCP set Network mask
#define WIFI_DNS               "212.23.6.100"    // [IpAddress4] If not using DHCP set DNS IP address (might be equal to WIFI_GATEWAY)

#define STA_SSID1              "xxxx xxxx-xxx"      // [Ssid1] Wifi SSID                    - 20 chars long has blanks and hyphens
#define STA_PASS1              "xxxxxxxxx"   // [Password1] Wifi password            - 13 chars with digits, letters special chars
#define STA_SSID2              ""      // [Ssid2] Optional alternate AP Wifi SSID
#define STA_PASS2              ""      // [Password2] Optional alternate AP Wifi password

Note: SSID and Password were copied/pasted from the TP-Link - not retyped

As per the YouTube video disabled:
//#define USE_DOMOTICZ                     - home automation system https://www.domoticz.com/
//#define USE_I2C                               - I2C using library wire
//#define USE_IR_REMOTE        - Send IR remote commands using library IRremoteESP8266 and ArduinoJson
//#define USE_WS2812_CTYPE     1     - WS2812 Color type (0 - RGB, 1 - GRB)

As per video in Arduino IDE:
Under Tools\Board and selected Generic ESP8266 Module
Under Tools\Flash size set to 1M 64k
Under Tools\Port set to COM21

Flashing:
Flashing went OK with no error messages and 100% downloaded.
I did not solder a header but held a header in the holes with constant pressure.
Unplugged USB cable and replugged in. S20 flashes

Results:
S20 does not appear in the TP-Link Wireless Statics page where connected devices are listed with their MAC address

Tried:
1. Setting #define WIFI_IP_ADDRESS    to  "192.168.1.29" - this should be the next available address issued by the Vigor
2. Accessing 192.168.1.29 from a browser - times out
3. Plugging S20 into a power socket - every 30 seconds it repeats a cycle of LEDs flashing for 12 secs or so, then the relay clicking.
4. Pressed the S20 reset button - goes off - press again it starts to repeat the cycle but the relay does not click anymore
5. Checked the S20 PCB - all solder joints look neat
6. Disabling the wi-fi security - still no access
7. Pinging 192.168.1.29 - times out

Note: phones and tablets are quite happy accessing the wifi access point and being configured using DHCP on the vigor.

Questions:
1. Any idea what is wrong?
2. Can I test without plugging into a wall socket? - i.e. just unplug and replug the USB cable
3. Is tasmota OK with WPA2-PSK and AES security?
4. Does #define WIFI_IP_ADDRESS        "0.0.0.0"  when set refer to the desired IP address for the S20?

Thank you for reading this long post but I tried to include anything that may be relevant.

Alan

Alan UK

unread,
Apr 23, 2017, 10:38:49 AM4/23/17
to SonoffUsers
I continue to investigate and opened a Putty terminal to the device. The log showed

`00:00:33 APP: Restarting
 ets Jan  8 2013,rst cause:1, boot mode:(3,7)
load 0x4010f000, len 1384, room 16
tail 8
chksum 0x2d
csum 0x2d
v09826c6d
~ld
   ▒
00:00:00 APP: Project sonoff Sonoff (Topic sonoff, Fallback DVES_9F4B86, GroupTopic sonoffs) Version 4.1.3
00:00:00 Wifi: Connecting to AP1   abc in mode 11N as sonoff-2950...         <<<<<< abc is the SSID for my AP
00:00:07 Wifi: Connect failed as AP cannot be reached
00:00:07 Wifi: Connecting to AP2 indebuurt2 in mode 11N as sonoff-2950...
00:00:14 Wifi: Connect failed as AP cannot be reached
00:00:14 WPSconfig: Active for 1 minute`
-----------------------------

Notice that AP2 is indebuurt2, the default setting before I set it to blank.

I then found a Edimax wifi dongle and set it up as an AP. I update tasmota to

-----------------------------
#define STA_SSID1              "abc"      // [Ssid1] Wifi SSID   <<<<< my TP-Link Ap
#define STA_PASS1              "zzzzzzzzzzz"   // [Password1] Wifi password
#define STA_SSID2              "xyz"      // [Ssid2] Optional alternate AP Wifi SSID   <<<<< my Edimax dongle AP
#define STA_PASS2              ""      // [Password2] Optional alternate AP Wifi password   << no pswd
-----------------------------

I reflashed the S20 and reran Putty. Now the log is

-----------------------------
00:00:33 APP: Restarting
ets Jan  8 2013,rst cause:1, boot mode:(3,7)
load 0x4010f000, len 1384, room 16
tail 8
chksum 0x2d
csum 0x2d
v09826c6d
~ld
   ▒
00:00:00 APP: Project sonoff Sonoff (Topic sonoff, Fallback DVES_9F4B86, GroupTopic sonoffs) Version 4.1.3
00:00:00 Wifi: Connecting to AP2 indebuurt2 in mode 11N as sonoff-2950...
00:00:07 Wifi: Connect failed as AP cannot be reached
00:00:07 Wifi: Connecting to AP1   abc in mode 11N as sonoff-2950...
00:00:14 Wifi: Connect failed as AP cannot be reached
00:00:14 WPSconfig: Active for 1 minute
-----------------------------

Still indebuurt2 is being used.

I've now spent 20 hours on this and getting a bit despondent! Help appreciated.

David Lang

unread,
Apr 23, 2017, 11:07:36 AM4/23/17
to Alan UK, SonoffUsers
see the troubleshooting page on why changes to user_config.h don't show up.

David Lang

On Sun, 23 Apr 2017, Alan UK wrote:

> Date: Sun, 23 Apr 2017 07:38:49 -0700 (PDT)
> From: Alan UK <al...@cooperfamily.me.uk>
> To: SonoffUsers <sonof...@googlegroups.com>
> Subject: Re: Problems and Questions over config Tasmota with Sonoff S20 (UK)

Sporty Morty

unread,
Apr 23, 2017, 11:12:21 AM4/23/17
to SonoffUsers
I had the same problem... Maybe start all over again sonoff will save old wireless configuration I  flash a blank.bin to 0x000000 and then reload the good one?     and i would change your wireless configuration to more like this i think
 
#define WIFI_IP_ADDRESS        "0.0.0.0"         // [IpAddress1] Set to 0.0.0.0 for using DHCP or IP address
#define WIFI_GATEWAY           "192.168.1.1"   // {IpAddress2] If not using DHCP set Gateway IP address

#define WIFI_SUBNETMASK        "255.255.255.0"   // [IpAddress3] If not using DHCP set Network mask
#define WIFI_DNS               "192.168.1.1"    // [IpAddress4] If not using DHCP set DNS IP address (might be equal to WIFI_GATEWAY)

 i am just a noob i might be just talking out of my butt...LOL

David Lang

unread,
Apr 23, 2017, 11:20:28 AM4/23/17
to Sporty Morty, SonoffUsers
read the troubleshooting page and it will explain why the config is not being
changed.

On Sun, 23 Apr 2017, Sporty Morty wrote:

> Date: Sun, 23 Apr 2017 08:12:21 -0700 (PDT)
> From: Sporty Morty <spm...@gmail.com>
> To: SonoffUsers <sonof...@googlegroups.com>
> Subject: Re: Problems and Questions over config Tasmota with Sonoff S20 (UK)
>
Message has been deleted

Lorcan Adrain

unread,
Apr 23, 2017, 11:52:59 AM4/23/17
to SonoffUsers
I always change the number stored at CFG_HOLDER then rebuild and update the sonoff firmware.  If not it does not appear to update the sonoff, cannot remember who told me to do this?.
It looks like it is not seeing your wifi network, try changing WIFI_IP_ADDRESS so it automatically getting your addresses.

#define WIFI_IP_ADDRESS          "0.0.0.0"         

David Lang

unread,
Apr 23, 2017, 11:55:47 AM4/23/17
to Lorcan Adrain, SonoffUsers
I don't see any text in your reply

On Sun, 23 Apr 2017, Lorcan Adrain wrote:

> Date: Sun, 23 Apr 2017 08:35:56 -0700 (PDT)
> From: Lorcan Adrain <lorcan...@gmail.com>
> To: SonoffUsers <sonof...@googlegroups.com>
> Subject: Re: Problems and Questions over config Tasmota with Sonoff S20 (UK)
>
>
>
> On Saturday, 22 April 2017 23:25:34 UTC+1, Alan UK wrote:
>>

Lorcan Adrain

unread,
Apr 23, 2017, 12:09:40 PM4/23/17
to SonoffUsers
Strange, will try again.


I always change the number stored at CFG_HOLDER then rebuild and update the sonoff firmware.  If not it does not appear to update the sonoff, cannot remember who told me to do this?.
It looks like it is not seeing your wifi network, try changing WIFI_IP_ADDRESS so it automatically getting your addresses.

#define WIFI_IP_ADDRESS          "0.0.0.0"        






 

On Saturday, 22 April 2017 23:25:34 UTC+1, Alan UK wrote:
2017-04-23_17h05_32.jpg

Alan UK

unread,
Apr 23, 2017, 4:30:09 PM4/23/17
to SonoffUsers
Thanks guys :)

Now working - just took a day :(

Indeed CFG_HOLDER has to be updated (changed to any other value - I used today's date).

At first it seemed totally illogical that having changed the user config file and saved it then the changes were not uploaded. I guess the reason is that once it is up and running then further changes will be done via a browser using the web interface and you wouldn't want an out of date user config file destroying any changes made online. On the other hand, some changes must be via the user config file.

I've added a comment line before the CFG_HOLDER definition:

// **************** THE CFG_HOLDER VALUE MUST BE CHANGED (to any different value) FOR CHANGES TO BE UPLOADED ****************


Alan

Alan UK

unread,
Apr 23, 2017, 4:33:09 PM4/23/17
to SonoffUsers
Thanks Lorcan, spot on.


On Sunday, 23 April 2017 16:52:59 UTC+1, Lorcan Adrain wrote:
I always change the number stored at CFG_HOLDER then rebuild and update the sonoff firmware.  If not it does not appear to update the sonoff, cannot remember who told me to do this?.
 
It looks like it is not seeing your wifi network, try changing WIFI_IP_ADDRESS so it automatically getting your addresses.

#define WIFI_IP_ADDRESS          "0.0.0.0"         


I originally had "0.0.0.0" but when I failed to connect changed it. I do set my router to issue fixed IP addresses anyway.

 

David Lang

unread,
Apr 23, 2017, 4:52:38 PM4/23/17
to Alan UK, SonoffUsers
On Sun, 23 Apr 2017, Alan UK wrote:

> I've added a comment line before the CFG_HOLDER definition:
>
> // **************** THE CFG_HOLDER VALUE MUST BE CHANGED (to any different
> value) FOR CHANGES TO BE UPLOADED ****************

or you hold the button for 4 seconds, or you issue the command to reset to the
user_config.h settings

David Lang
Reply all
Reply to author
Forward
0 new messages