Announcement

Collapse
No announcement yet.

SonOff basic WiFi seeing Sensors with mcsMQTT

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

    #31
    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 25, 2018, 01:26 PM.
    - Pete

    Auto mator
    Homeseer 3 Pro - 3.0.0.548 (Linux) - Ubuntu 18.04/W7e 64 bit Intel Haswell CPU 16Gb
    Homeseer Zee2 (Lite) - 3.0.0.548 (Linux) - Ubuntu 18.04/W7e - CherryTrail x5-Z8350 BeeLink 4Gb BT3 Pro
    HS4 Lite - Ubuntu 22.04 / Lenovo Tiny M900 / 32Gb Ram

    HS4 Pro - V4.1.18.1 - Ubuntu 22.04 / Lenova Tiny M900 / 32Gb Ram
    HSTouch on Intel tabletop tablets (Jogglers) - Asus AIO - Windows 11

    X10, UPB, Zigbee, ZWave and Wifi MQTT automation-Tasmota-Espurna. OmniPro 2, Russound zoned audio, Alexa, Cheaper RFID, W800 and Home Assistant

    Comment


      #32
      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.

      Comment


        #33
        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.
        - Pete

        Auto mator
        Homeseer 3 Pro - 3.0.0.548 (Linux) - Ubuntu 18.04/W7e 64 bit Intel Haswell CPU 16Gb
        Homeseer Zee2 (Lite) - 3.0.0.548 (Linux) - Ubuntu 18.04/W7e - CherryTrail x5-Z8350 BeeLink 4Gb BT3 Pro
        HS4 Lite - Ubuntu 22.04 / Lenovo Tiny M900 / 32Gb Ram

        HS4 Pro - V4.1.18.1 - Ubuntu 22.04 / Lenova Tiny M900 / 32Gb Ram
        HSTouch on Intel tabletop tablets (Jogglers) - Asus AIO - Windows 11

        X10, UPB, Zigbee, ZWave and Wifi MQTT automation-Tasmota-Espurna. OmniPro 2, Russound zoned audio, Alexa, Cheaper RFID, W800 and Home Assistant

        Comment


          #34
          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.

          Comment


            #35
            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 27, 2018, 03:24 PM.
            - Pete

            Auto mator
            Homeseer 3 Pro - 3.0.0.548 (Linux) - Ubuntu 18.04/W7e 64 bit Intel Haswell CPU 16Gb
            Homeseer Zee2 (Lite) - 3.0.0.548 (Linux) - Ubuntu 18.04/W7e - CherryTrail x5-Z8350 BeeLink 4Gb BT3 Pro
            HS4 Lite - Ubuntu 22.04 / Lenovo Tiny M900 / 32Gb Ram

            HS4 Pro - V4.1.18.1 - Ubuntu 22.04 / Lenova Tiny M900 / 32Gb Ram
            HSTouch on Intel tabletop tablets (Jogglers) - Asus AIO - Windows 11

            X10, UPB, Zigbee, ZWave and Wifi MQTT automation-Tasmota-Espurna. OmniPro 2, Russound zoned audio, Alexa, Cheaper RFID, W800 and Home Assistant

            Comment


              #36
              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.

              Comment


                #37
                Fixed...

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

                Auto mator
                Homeseer 3 Pro - 3.0.0.548 (Linux) - Ubuntu 18.04/W7e 64 bit Intel Haswell CPU 16Gb
                Homeseer Zee2 (Lite) - 3.0.0.548 (Linux) - Ubuntu 18.04/W7e - CherryTrail x5-Z8350 BeeLink 4Gb BT3 Pro
                HS4 Lite - Ubuntu 22.04 / Lenovo Tiny M900 / 32Gb Ram

                HS4 Pro - V4.1.18.1 - Ubuntu 22.04 / Lenova Tiny M900 / 32Gb Ram
                HSTouch on Intel tabletop tablets (Jogglers) - Asus AIO - Windows 11

                X10, UPB, Zigbee, ZWave and Wifi MQTT automation-Tasmota-Espurna. OmniPro 2, Russound zoned audio, Alexa, Cheaper RFID, W800 and Home Assistant

                Comment

                Working...
                X