Announcement

Collapse
No announcement yet.

SonOff basic WiFi seeing Sensors with mcsMQTT

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Pete
    replied
    Fixed...

    [ATTACH]69592[/ATTACH]
    Last edited by Pete; June 27th, 2018, 04:02 PM.

    Leave a comment:


  • Michael McSharry
    replied
    Where is tele coming from?
    Check you MQTT setup on Tasmota at the bottom and assure Full Topic is only Topic template.

    I did not like the "prefix" and tried to overcome them in mcsTasmota when I first did the Garage Door hack.

    Leave a comment:


  • Pete
    replied
    Thank you Michael. Updated to V 3.4.5.2

    Jun-27 3:04:35 PM Starting Plug-In Initializing plugin mcsMQTT ...
    Jun-27 3:04:35 PM mcsMQTT Version 3.4.5.2 Registered with Homeseer
    Jun-27 3:04:36 PM Starting Plug-In Plugin mcsMQTT started successfully in 255 milliseconds
    Jun-27 3:04:36 PM mcsMQTT MQTTClient is Connected

    So using:

    SonOff basic MQTT configuration:

    Topic: GarageDoor2
    Full Topic: /%topic%/%prefix%/

    Should I change Full Topic to /%topic%/ ?

    Code:
    Dev: SENSOR:DS18x20:DS1:Temperature
    Sub: /GarageDoor2/tele/SENSOR:DS18x20:DS1:Temperature 73.2
    Where is tele (telemetry data) coming from?
    Last edited by Pete; June 27th, 2018, 03:24 PM.

    Leave a comment:


  • Michael McSharry
    replied
    I noticed that the mcsMQTT JSON decoding for the additional level used for the Tasmota 1-wire was not correct. The temperatures were fine, but the topic used by mcsMQTT was somewhat scrambled. It is fixed in 3.4.5.2.

    Leave a comment:


  • Pete
    replied
    Thank you Michael.

    Yeah for a bit was clearing the flash with esptool with a blank bin file.

    Then went to just creating a INO file with all of the wifi info in it...

    For Don's two devices here just went to the Tasmota AP mode and added his AP's. Never opened the two devices to configure a JTAG port.

    Last option was getting it in to AP mode cuz I was always thinking it would work right away and it used to after 4 quick button presses. Now it takes less than a minute but more than 20 seconds.

    Now testing distance from WAP / RSSI with the two Sonoff basic devices.

    Will move the stuff above to the other thread.

    Leave a comment:


  • Michael McSharry
    replied
    esptool.py --port /dev/ttyUSB0 write_flash -fs 1MB -fm dout 0x0 mcsTasmota.bin

    At this point it seems to forget the AP and login and LED starts flashing.
    The location of the SSID info will be different for various ESP images. I had difficulty going from 5.9 to 6.0 because flashing the upgrade lost my settings. After I had the same device flashed with both images then the SSID would "stick". I suspect the memory space use was such that nothing else was overriding prior setup so effectively two copies (at different location) were in the flash so did not matter if 5.9 or 6.0 was last installed it would find the SSID and connect.

    Situations like this make it hard to isolate the root cause of things not working correctly.

    I'm certain you have seen the troubleshooting page, but for others this is a good reference.

    https://github.com/arendst/Sonoff-Ta...roubleshooting


    mcsMTQQ version 3.4.4.0 testing.

    When I click on the reference number 2263 seeing an almost blank page now.

    Should I be posting under update mcsMQTT Version 3.4.4.0 now?
    It would be better under the 3.4.x.x thread. There are so many combinations of ways to navigate. Looks like I may have missed this one. I will look into it.

    Leave a comment:


  • Pete
    replied
    Having an issue here as mentioned above.

    1 - upload a basic SonOff ino file via Arduinio IDE configured with my AP. Works fine.

    2 - next upload this file:

    esptool.py --port /dev/ttyUSB0 write_flash -fs 1MB -fm dout 0x0 Sonoff.ino.generic.bin

    3 - works fine and remembers my AP and I can get to the menu fine.

    4 - then upload this file:

    esptool.py --port /dev/ttyUSB0 write_flash -fs 1MB -fm dout 0x0 mcsTasmota.bin

    At this point it seems to forget the AP and login and LED starts flashing.

    Went back to using WiFi manager as I was doing before. Note when doing the four quick button presses it takes about a minute to go to WAP mode. Just wait until you see the LED flashing then pair with the sonoff device and go to 192.168.4.1 and reconfigure your AP info.


    Button usage
    • 1 short press: Toggles the relay either directly or by sending a MQTT message like cmnd/sonoff/POWER1 ON. This will blink the LED twice and sends a MQTT status message like stat/sonoff/POWER1 ON. If cmnd/sonoff/ButtonRetain on has been used the MQTT message will also contain the MQTT retain flag.
    • 2 short presses: Toggles the relay 2 if available on the device like Sonoff Dual. This will blink the LED twice and sends a MQTT status message like stat/sonoff/POWER2 on.
    • 3 short presses: Start Wifi smartconfig allowing for SSID and Password configuration using an Android mobile phone with the ESP8266 SmartConfig app. The LED will blink during the config period. A single button press during this period will abort and restart sonoff.
    • 4 short presses: Start Wifi manager providing an Access Point with IP address 192.168.4.1 and a web server allowing the configuration of Wifi. The LED will blink during the config period. A single button press during this period will abort and restart sonoff.
    • 5 short presses: Start Wifi Protected Setup (WPS) allowing for SSID and Password configuration using the router's WPS button or webpage. The LED will blink during the config period. A single button press during this period will abort and restart sonoff.
    • 6 short presses: Will restart the module
    • 7 short presses: Start OTA download of firmware. The green LED is lit during the update


    Pressing the button for over forty seconds: Reset settings to defaults as defined in user_config.h and restarts the device

    The button is connected to GPIO 0 (NodeMCU pin D3)

    Looked good for a while then it went back to flashing mode and lost connectivity to AP.

    Wondering if this is just a bad SonOff?

    So used the default sonoff all sensors bin version 5.14 and tested the DS18B20 connected to GPIO 14 and tested soldered wire to GPIO4.

    esptool.py --port /dev/ttyUSB0 write_flash -fs 1MB -fm dout 0x0 sonoff-allsensors.bin
    esptool.py v2.3.1
    Connecting....
    Detecting chip type... ESP8266
    Chip is ESP8266EX
    Features: WiFi
    Uploading stub...
    Running stub...
    Stub running...
    Configuring flash size...
    Compressed 564912 bytes to 385051...
    Wrote 564912 bytes (385051 compressed) at 0x00000000 in 34.0 seconds (effective 133.0 kbit/s)...
    Hash of data verified.


    I also used the http command line to change C to F on the sensor.

    hxxp://192.168.244.221/cm?cmnd=SetOption8 1

    Result: SetOption8 "ON"

    Looks to be working fine:

    16:50:02 MQT: tele/sonoff/SENSOR = {"Time":"2018-06-25T16:50:02","Switch1":"ON","DS18S20":{"Temperature":70.1}," TempUnit":"F"}

    Configured GPIO 4 to switch 1.

    Tested it by touching it to ground. LED flashes each time

    16:54:13 MQT: stat/sonoff/RESULT = {"POWER1":"ON"}
    16:54:13 MQT: stat/sonoff/POWER1 = ON
    16:54:15 MQT: stat/sonoff/RESULT = {"POWER1":"OFF"}
    16:54:15 MQT: stat/sonoff/POWER1 = OFF
    16:54:18 MQT: stat/sonoff/RESULT = {"POWER1":"ON"}
    16:54:18 MQT: stat/sonoff/POWER1 = ON
    16:54:19 MQT: stat/sonoff/RESULT = {"POWER1":"OFF"}
    16:54:19 MQT: stat/sonoff/POWER1 = OFF

    Then changed over to newer mcs for sonoff wifi basic bin...

    esptool.py --port /dev/ttyUSB0 write_flash -fs 1MB -fm dout 0x0 mcsTasmotaC.bin
    esptool.py v2.3.1
    Connecting....
    Detecting chip type... ESP8266
    Chip is ESP8266EX
    Features: WiFi
    Uploading stub...
    Running stub...
    Stub running...
    Configuring flash size...
    Compressed 511664 bytes to 354064...
    Wrote 511664 bytes (354064 compressed) at 0x00000000 in 31.2 seconds (effective 131.1 kbit/s)...
    Hash of data verified.

    Tested ping.

    ping 192.168.244.221
    PING 192.168.244.221 (192.168.244.221) 56(84) bytes of data.
    64 bytes from 192.168.244.221: icmp_seq=1 ttl=128 time=1352 ms
    64 bytes from 192.168.244.221: icmp_seq=2 ttl=128 time=343 ms
    64 bytes from 192.168.244.221: icmp_seq=3 ttl=128 time=3.02 ms
    64 bytes from 192.168.244.221: icmp_seq=4 ttl=128 time=2.78 ms
    64 bytes from 192.168.244.221: icmp_seq=5 ttl=128 time=2.87 ms

    and web gui console for temperature sensor and GPIO4 connection.

    17:05:19 MQT: tele/sonoff/SENSOR = {"Time":"2018-06-25T17:05:19", "Switch1":"ON", "DS18x20":{"DS1":{"Type":"DS18S20", "Address":"10A04713000800D9", "Temperature":70.0}}, "TempUnit":"F"}

    17:06:28 MQT: stat/sonoff/RESULT = {"POWER":"ON"}
    17:06:28 MQT: stat/sonoff/POWER = ON
    17:06:28 MQT: stat/sonoff/RESULT = {"POWER":"OFF"}
    17:06:28 MQT: stat/sonoff/POWER = OFF
    17:06:28 MQT: stat/sonoff/RESULT = {"POWER":"ON"}
    17:06:28 MQT: stat/sonoff/POWER = ON
    17:06:30 MQT: stat/sonoff/RESULT = {"POWER":"OFF"}
    17:06:30 MQT: stat/sonoff/POWER = OFF

    Keep seeing two DS18B20's showing up with the same MAC address:

    17:15:04 MQT: tele/GarageDoor2/SENSOR = {"Time":"2018-06-25T17:15:04", "Switch1":"On", "Switch2":"On", "DS18x20":{"DS1":{"Type":"DS18S20", "Address":"10A04713000800D9", "Temperature":71.7}, "DS2":{"Type":"DS18S20", "Address":"10A04713000800D9", "Temperature":71.7}}, "TempUnit":"F"}

    As previously mentioned lost the html command line options with this update.

    Now see this and it is not working:

    hxxp://192.168.244.221/cm?cmnd=SetOption8

    RESULT = {"POWER":"Off"}
    POWER = Off
    Door2 = INDETERMINATE

    It was working with the earlier version of mcsTasmota bin and works fine with the tasmota basic sonoff bin version 5.14.

    Currently using:

    Program Version 5.9.13c
    Build Date & Time 2018-06-22T22:27:54
    Core/SDK Version 2_4_1/2.2.1(cfd48f3)

    On the two Sonoff basic wifi devices with DS18B20's.

    I do not want to yet install them for use until I get the PIR running.

    Updated mcsMQTT to version 3.4.4.0 this morning.
    Last edited by Pete; June 25th, 2018, 01:26 PM.

    Leave a comment:


  • Pete
    replied
    This is how I am getting back my AP info in to the SonOff basic Wifi module.

    - originally used a simple arduinio code that I would configure with my AP stuff....

    Lately trying a new one which is a bit easier...

    It is a SonOff configuration that uses a Espurna (from Italy) firmware. When I upload this firmware to the SonOff on first boot it comes up as an AP. I log in to it and configure my wifi stuff. The build makes you changes passwords for the web interface. Then using the web based firmware updater update it with the current release of the mcsTasmota bin file. Seems that the AP info is sticking fine here. This one also lets you configure the SonOff with a static IP, NTP, et al. Noticed here too that the RSSI is at 46 which is way lower than the 80-100% that I am seeing with the tasmota bin file which is odd. I am testing here in the same location as before.

    The build also includes a switch to use telnet.

    [ATTACH]69536[/ATTACH]

    So from here do the two file upload to the SonOff Basic which takes me back to the mcs bin file.

    [ATTACH]69537[/ATTACH]

    Personally having an issue reading the light colored font here. Maybe it is me?

    Leave a comment:


  • Pete
    replied
    Pushing a bit on the SonOff basic Wifi module making it multipurpose a bit using all of the GPIO ports on it and making one a temperature sensor.

    Garage door SonOff basic WiFi
    1 - open and closed door sensors
    2 - GDO button
    3 - temperature sensor
    4 - PIR sensor

    The SonOff basic Wifi Garage door sensor thing is totally a separate endeavor that the two RPi's running Node Red / OWFS and Mosquitto.

    Yes here originally build multiple 1-wire networks using cat5e all home runned to the basement mothership which was Homeseer 2 using 3 Temp08's and 1 Temp05 and 1 9097 using xAP for multiple serial connections.

    Basic original temperature sensors were all parasitic and they worked fine.

    That said though as I added Hobby Boards and Midon sensors they utilized different voltages of 5, 12 and 15VDC (barometer) and other 1-wire stuff so I separated the networks accordingly.

    Mixed and added separate 1 wire networks using xAP with one instance connected to one serial port. Way back in the early 2000's here worked a bit with Jim Doolittle as he lived nearby initially configuring his 1-wire stuff to work with two or more serial ports and kept giving him different 1-wire devices to test.

    For a bit tried using UltraJones 1-wire plugin using OWFS emulation...didn't work. This is what the Vera folks are using with OWFS / 1-Wire. It also works fine with the Domoticz automation software (testing running this on same RPi2 in attic).

    Have totally redone my approach now using two RPi2's as OWFS MQTT Node Red Devices for running Homeseer 3 in Linux. RPi2 Node Red in the attic takes care of sensors in the attic and second floor. RPi2 Node Red in the basement takes care of sensors in the basement , outside and on the main floor. Still in to weather went to different instruments for outside (AAG to Davis). Went to using the Davis rain tipping bucket, old Dallas Instruments rain tipping bucket and a new Digital rain guage (well two of them) and now adding more temperature sensors affixing them by default to the SonOff Basic Wifi modules. (already have a 1-wire sensor in the garage).
    Last edited by Pete; June 25th, 2018, 12:01 PM.

    Leave a comment:


  • Steve Q
    replied
    Originally posted by Pete View Post
    @Steve,

    Yeah here have been using 1-Wire stuff since the 1990's and have a collection of:

    1 - original AAG temperature and temperature humidity sensors - the humidity sensors here are very small and compact and continue to work today.

    2 - original Midon 1-wire sensor boards with DS18B20's on them plus traces for more 1-wire devices.

    3 - original Hobby Boards temperature sensors, combo temperature-humidity sensors and combo temperature, humidity and light sensor boards.

    4 - some place have a bunch of DS18B20 sensors loosey goosey in a tiny bag.

    5 - cabled 1-wire probes like the ones you mention that SonOff sells that I purchased a few years back.

    I have no need to purchase any more sensors here. (IE: the second floor - every room (bedrooms and bathrooms and hallway and attic) is wired today with a combo 1-wire temperature and humidity sensor going to the ZNet RPi using Node Red OWFS / Mosquitto these days).

    For outside using regular wired to 9097 / Node Red / OWFS stuff - adding sensors to outdoor AC compressor next. (no SonOFFs).

    For this SonOff basic Wifi module looking to install and configure.

    1 - push button for GDO
    2 - two door sensors (open and close)
    3 - one 1-wire temperature sensor for Garage
    4 - one tiny PIR sensor for Garage (note I already have a regular wired PIR in the garage but it really doesn't work well when it is hot in the garage).

    That said also have other wired sensors in the garage and CCTV and RFID tags on the cars plus one combo temperature humidity sensor (wired).

    Everything is ready in the garage except that I have to climb a ladder to install the SonOff module and I want to make sure that it is working before I install it over the GDO(s).

    Next project, next SonOff basic will try the water meter counter and the add of the 1-wire sensor mounted right on the copper water pipe to see the temperature of the water as it comes in to the house.

    In a quickie summary have or will have relating to 1-wire sensors....

    1 - RPi in basement doing Node Red / OWFS / 1-Wire / Mosquitto doing main floor and outside
    2 - RPi in attic doing Node Red / OWFS / 1-wire / Mosquitto doing 2nd floor and attic

    #1 and #2 are replacing multiple 1-wire networks (xAP) which utilized 3 Temp08's and 1 Temp05 and 1 9097 that are (were) cat5e wired.

    3 - SonOff's will all have at least one temperature sensor or one combo sensor (if it works).

    Additionally here have Leviton OmniPro temperature sensors inside and outside of the house (and combo sensors) wired to the alarm panel.

    Leave a comment:


  • Pete
    replied
    Thank you Michael.

    Yes here with the glue gun by pass it and just heat up the end of a glue stick and try to control the drip on to the board. Well yesterday did drip on my finger and got a bit too much glue on the board. I can just peel the right glue glob off if I cool it a bit with an ice cube. I also used a bit of gorilla glue on the edges of the two terminals on either side of the board as I noticed that they are a bit loosey goosey.

    [ATTACH]69540[/ATTACH]

    When testing yesterday GPIO 4 and 14 did not get any response and attribute it to an eeprom scramble maybe. I know that GPIO14 is good. Testing the two here by just connecting the wires to ground and looking for a response in the console. Did not see any reponse.

    Is your ssid there anthem? When upgrading flash on Sonoff #2 yesterday also saw an SSID with the name Anthem and I saw the password for it.

    It is weird like it is defaulting to the names in parenthesis (same with the MQTT stuff) like an IP of 192.168.0.30 and client name of MCS_44BDAC.

    Ended up with the flashing light Sonoff #2 yesterday such that will be using the JTAG connection today to bring it back to life.

    Found a non tasmota bin that lets me configure a static IP, AP, et al on it before using it.
    Last edited by Pete; June 25th, 2018, 12:05 PM.

    Leave a comment:


  • Michael McSharry
    replied
    The JSON reported is three levels deep. mcsMQTT has provisions for only two so I will need to update the plugin.
    Version 3.3.4.0 in updater six level of JSON to match the six levels provided for topic.

    Finished and will test GPIO 4 lead again ground while watching the console - ideally you want to test before dropping some glue on it. I didn't with the first one and was lucky. Not sure if this one will work.
    I just secured the wire with glue and left the GPIO4 solder connection naked.

    Leave a comment:


  • Pete
    replied
    Installed:

    1 - Sonoff-Tasmota 5.14.0-minimal by Theo Arends

    2 - Sonoff-Tasmota all sensors bin
    Program Version 5.14.0
    Build Date & Time 2018-05-15T15:18:52
    Core/SDK Version 2_3_0/1.5.3(aec24ac9)

    Configured GPIO14 for DS18B20 sensor

    Restarted it.

    Lost the AP connection - blinking now - might have to JTAG it.

    Unplugged it ...still not coming back...

    Went to AP to scan the network...see it...and see Sonoff #2.

    [ATTACH]69506[/ATTACH][ATTACH]69508[/ATTACH]

    2100C

    GUI showing temperature and response times are great.

    18:12:14 MQT: /GarageDoor1/tele/SENSOR = {"Time":"2018-06-23T18:12:14", "Switch1":"On", "Switch2":"On", "DS18x20":{"DS1":{"Type":"DS18S20", "Address":"10A52F47000800CB", "Temperature":70.1}}, "TempUnit":"F"}
    18:17:14 MQT: /GarageDoor1/tele/SENSOR = {"Time":"2018-06-23T18:17:14", "Switch1":"On", "Switch2":"On", "DS18x20":{"DS1":{"Type":"DS18S20", "Address":"10A52F47000800CB", "Temperature":69.3}}, "TempUnit":"F"}
    18:22:14 MQT: /GarageDoor1/tele/SENSOR = {"Time":"2018-06-23T18:22:14", "Switch1":"On", "Switch2":"On", "DS18x20":{"DS1":{"Type":"DS18S20", "Address":"10A52F47000800CB", "Temperature":68.1}}, "TempUnit":"F"}

    Sunday, June 24, 2018 1000c

    GUI showing temperature and response times are great.

    06:49:13 MQT: /GarageDoor1/tele/SENSOR = {"Time":"2018-06-24T06:49:13", "Switch1":"On", "Switch2":"On", "DS18x20":{"DS1":{"Type":"DS18S20", "Address":"10A52F47000800CB", "Temperature":67.9}}, "TempUnit":"F"}
    06:54:13 MQT: /GarageDoor1/tele/SENSOR = {"Time":"2018-06-24T06:54:13", "Switch1":"On", "Switch2":"On", "DS18x20":{"DS1":{"Type":"DS18S20", "Address":"10A52F47000800CB", "Temperature":68.0}}, "TempUnit":"F"}
    06:59:13 MQT: /GarageDoor1/tele/SENSOR = {"Time":"2018-06-24T06:59:13", "Switch1":"On", "Switch2":"On", "DS18x20":{"DS1":{"Type":"DS18S20", "Address":"10A52F47000800CB", "Temperature":67.9}}, "TempUnit":"F"}
    07:01:01 APP: (UTC) Sun Jun 24 15:01:01 2018
    07:01:01 APP: (DST) Sun Mar 25 02:00:00 2018
    07:01:01 APP: (STD) Sun Oct 28 03:00:00 2018
    07:02:00 MQT: /GarageDoor1/tele/UPTIME = {"Time":"2018-06-24T07:02:00", "Uptime":13}

    Curious about time?

    Noticed that I get only some responses to commands. I was tinkering with this before and most of the commands worked.

    hxxp://192.168.244.220/cm?cmnd=Gpio

    07:07:59 RSL: Group 0, Index 1, Command POWER, Data
    RESULT = {"POWER":"Off"}
    POWER = Off
    Door1 = INDETERMINATE

    hxxp://192.168.244.220/cm?cmnd=Status%200

    07:09:34 RSL: Group 0, Index 1, Command POWER, Data 0
    RESULT = {"POWER":"On"}
    POWER = On

    1450c

    Updating hardware SonOff Basic Wifi #2 with:

    1 - GPIO 4 connection - use a bit of flux to solder on wire - then a drop of hot melt glue and glue wire to board to top of board.
    Note this is a bit difficult without a small tipped soldering tool and some flux and hot melt glue and doing this under a magnifying glass.
    Today while using hot melt glue dropped some on my finger. Using ice removed it but also took skin off while doing this.
    2 - Aux ground and VCC. Here ground is soldered over so utilize a bit of flux and a solder sucker and a saftey pin to make the hole a bit bigger to solder wire. Soldering posts on without colored plastic then slipping colored plastic sleeve over post. Using little hand clamps to keep posts in place while soldering them. Easy clean hole with flux and solder sucker. No pin was needed.

    Finished and will test GPIO 4 lead again ground while watching the console - ideally you want to test before dropping some glue on it. I didn't with the first one and was lucky. Not sure if this one will work.
    Last edited by Pete; June 24th, 2018, 04:21 PM.

    Leave a comment:


  • Pete
    replied
    Yes ...just checked testing both DS18B20's together and each one separate and they no longer are showing up...IE: working at around 1200c local time and now 1439c local time and not working any more...

    When testing the Tasmota V5.14 multisensor bin never really left it on for more than 30 minutes ....

    11:36:31 MQT: GarageDoor1/STATE = {"Time":"2018-06-23T11:36:31", "Uptime":0 0, "Vcc":3.511, "Wifi":{"AP":2, "SSId":"ICS-0", "RSSI":100,
    11:36:31 MQT: GarageDoor1/SENSOR = {"Time":"2018-06-23T11:36:31", "Switch1":"On", "Switch2":"On"}

    Leave a comment:


  • Michael McSharry
    replied
    I suspect it is due to the timing delays that are associated with 1-wire protocol response provisions. Since there is just one CPU that needs to manage both the WiFi and the application there is greater potential for WiFi management suffering. I do not have any instrumentation to asses this, but just reflecting upon the code.

    Leave a comment:

Working...
X