Hi Jürgen thanks for reply. Hope that shorttrip to Wangerooge was relaxing.
I don’t know too. Which Version you have installed ? (before and after Flash) English or German ?
What are your settings in the platform.io file for the first flash ?
Mine are:
[platformio]
src_dir = sonoff
; *** Uncomment one of the lines below to build/upload only one environment
;env_default = sonoff
;env_default = sonoff-minimal
;env_default = sonoff-classic
;env_default = sonoff-knx
;env_default = sonoff-allsensors
;env_default = sonoff-BG
;env_default = sonoff-BR
;env_default = sonoff-CN
;env_default = sonoff-CZ
env_default = sonoff-DE
;env_default = sonoff-ES
;env_default = sonoff-FR
;env_default = sonoff-GR
;env_default = sonoff-HU
;env_default = sonoff-IT
;env_default = sonoff-NL
;env_default = sonoff-PL
;env_default = sonoff-PT
;env_default = sonoff-RU
;env_default = sonoff-UK
;env_default = sonoff-TW
[common] ; ************************************************************
; *** Esp8266 core for Arduino version 2.3.0
platform = espressif8266@1.5.0
; *** Esp8266 core for Arduino version 2.4.0
;platform = espressif8266@1.6.0
; *** Esp8266 core for Arduino version 2.4.1
;platform = espressif8266@1.7.0
; *** Esp8266 core for Arduino version latest beta
;platform = https://github.com/platformio/platform-espressif8266.git#feature/stage
; *** Esp8266 core for Arduino current version
;platform = espressif8266
and in user_config.h
// -- Master parameter control --------------------
#define CFG_HOLDER 4617 // [Reset 1] Change this value to load SECTION1 configuration parameters to flash
// -- Project -------------------------------------
#define PROJECT "sonoff" // PROJECT is used as the default topic delimiter
#define MODULE SONOFF_BASIC // [Module] Select default model from sonoff_template.h (Should not be changed)
#define SAVE_DATA 1 // [SaveData] Save changed parameters to Flash (0 = disable, 1 - 3600 seconds)
#define SAVE_STATE 1 // [SetOption0] Save changed power state to Flash (0 = disable, 1 = enable)
// -- Wifi ----------------------------------------
#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.2.254" // [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.2.27" // [IpAddress4] If not using DHCP set DNS IP address (might be equal to WIFI_GATEWAY)
#define STA_SSID1 "MyNetworkName" // [Ssid1] Wifi SSID
#define STA_PASS1 "MyWifiPassword" // [Password1] Wifi password
#define STA_SSID2 "" // [Ssid2] Optional alternate AP Wifi SSID
#define STA_PASS2 "" // [Password2] Optional alternate AP Wifi password
#define WIFI_CONFIG_TOOL WIFI_RETRY // [WifiConfig] Default tool if wifi fails to connect
// (WIFI_RESTART, WIFI_SMARTCONFIG, WIFI_MANAGER, WIFI_WPSCONFIG, WIFI_RETRY, WIFI_WAIT)
// -- Syslog --------------------------------------
#define SYS_LOG_HOST "" // [LogHost] (Linux) syslog host
#define SYS_LOG_PORT 514 // [LogPort] default syslog UDP port
#define SYS_LOG_LEVEL LOG_LEVEL_NONE // [SysLog] (LOG_LEVEL_NONE, LOG_LEVEL_ERROR, LOG_LEVEL_INFO, LOG_LEVEL_DEBUG, LOG_LEVEL_DEBUG_MORE)
#define SERIAL_LOG_LEVEL LOG_LEVEL_INFO // [SerialLog] (LOG_LEVEL_NONE, LOG_LEVEL_ERROR, LOG_LEVEL_INFO, LOG_LEVEL_DEBUG, LOG_LEVEL_DEBUG_MORE)
#define WEB_LOG_LEVEL LOG_LEVEL_INFO // [WebLog] (LOG_LEVEL_NONE, LOG_LEVEL_ERROR, LOG_LEVEL_INFO, LOG_LEVEL_DEBUG, LOG_LEVEL_DEBUG_MORE)
What is a long time for you when you say flashing and/or reconnecting ?
I’m using the german version. IMHO all the settings you posted will remain unchanged after a flash, I started with different versions (either flashed by me or shopped a flashed one [ sonoff RF] ).
The “long” time was >10 minutes. I investigated by looking onto the console of the device which showed numerous connection trials before it connected.
If I would have checked the Wifi strength (via the sonoff device page) I would have known that problem before starting. 38% isn’t that reliable!
That’s it. After changing the Rule and a new trial it works and the basic was updated .
A last question:
Is this your adress: "/otaurl", "http://sonoff.maddox.co.uk/tasmota/sonoff.bin"
or have you used something like this: "/otaurl", "http://sonoff.maddox.co.uk/tasmota/sonoff-DE.bin"
I Have take this one step further to only update sonoffs that are below the current firmware version. see code below
var firmware = transform(“REGEX”, “.*([0-9].[0-9].[0-9])”, Sonoff_Current_FW_Available.state.toString)
// Work with a list of selected Sonoff modules
val sonoff_device_ids = newArrayList(
//… add all your modules here!
“sonoff/fishtank”,
“sonoff/mbl”,
“sonoff/bedroom”,
“sonoff/livingroom”,
“sonoff/kitchen”,
“sonoff/kitchen_led”,
“sonoff/fan”,
“sonoff/sonoff1”,
“sonoff/sonoff2”,
“sonoff/rice_cooker”,
“sonoff/light1”,
“sonoff/light2”,
“sonoff/light3”,
“sonoff/light4”,
“sonoff/mb_bathroom”,
“sonoff/bathroom”,
“sonoff/hallway”,
“sonoff/RF_Brigde”,
“sonoff/RF_Bridge2”,
“sonoff/4chpro”,
“sonoff/sonoffsc”
)
// OR
// Work with the grouptopic, addressing ALL modules at once
//val sonoff_device_ids = newArrayList(“sonoffs”)
rule “Sonoff Maintenance”
when
Item Sonoff_Action received command
then
logInfo(“sonoff.rules”, "Sonoff Maintenance on all devices: " + receivedCommand + " to " + firmware)
for (String device_id : sonoff_device_ids) {
switch (receivedCommand) {
case “restart” :
publish(“mosquitto”, “cmnd/” + device_id + “/restart”, “1”)
case “queryFW” :
publish(“mosquitto”, “cmnd/” + device_id + “/status”, “2”)
case “upgrade” : {
publish(“mosquitto”, “cmnd/” + device_id + “/otaurl”, “http://sonoff.maddox.co.uk/tasmota/sonoff.bin”)
publish(“mosquitto”, “cmnd/” + device_id + “/upgrade”, “” + firmware)
}
case “timezone” :
publish(“mosquitto”, “cmnd/” + device_id + “/timezone”, “4”)
}
}
Sonoff_Action.postUpdate(NULL)
end
My biggest problem is: I don´t know, whre i can get the correct sytax for my topic inside the thing:
–> stat/sonoff-s20-1/STATE
sonoff-20-1 is my given name for the sonoff-device. But where do i get stat and STATE from? How can i see, which values are possible for STATE and which value is correct for the stat in the first place?
There is an example, but without uptime, time, rssi, firmware-version…
So i don´t know, what is possible with a sonoff s20…
I saw some posts, where firmware-version and rssi are working with a s20. I think i configured it all the way like in the other posts, but still some values are not displayed…
See my EDIT in the last post also. This is my (only) problem, i think.