Joolee / nl.joolee.homey.espeasy

ESP Easy is a firmware for ESP8266 boards like the WeMos D1 and NodeMCU. It allows you to quickly make custom devices with switches, sensors and other hardware. This app adds support to Homey for connecting with ESP Easy units.
GNU General Public License v3.0
6 stars 5 forks source link

Unable to detect my ESP Easy modules #6

Closed Tequila329 closed 4 years ago

Tequila329 commented 4 years ago

Hi,

first of all: great app! :) I use quite a lot of ESP8266, ES32 CAM and Wemos D1 modules. But the app is not able to connect to any of my devices.

"Error

Could not connect to the ESP Easy unit"

Any ideas?

Joolee commented 4 years ago

Could you perform the pairing at https://developer.athom.com/tools/pair and send a log of the developer console of your browser (press F12 to open that) and / or send a diagnostics report from the app settings page on your phone.

Also, I'm interested in the output of your /json page of the ESP unit. Thank you in advance.

Joolee commented 4 years ago

Never mind, found it and fixed it in version 1.0.2 https://homey.app/a/nl.joolee.homey.espeasy/test/

Thanks for making the report

Tequila329 commented 4 years ago

Still no connection possible :/

6ba1149a-b720-4c0a-bc15-f71fcd92e2d3

Joolee commented 4 years ago

In that case, I'll need that debug data. Especially the /json page

Pjotr-bot commented 4 years ago

Hi Joolee,

Experiencing the same problem as Tequila329 with both Wemos D1 mini and NodeMCU's. Do you still need diagnostic reports, or did you already receive them?

Greetings and thanks in advance!

Joolee commented 4 years ago

I downgraded to "mega-20191208" and cannot reproduce the problem.

In your log (6ba1149a-b720-4c0a-bc15-f71fcd92e2d3), I see the following:

2020-05-29 10:54:45 [log] [ESPEasy] [Unit: 192.168.151.63] Fetching http://192.168.151.63:80/json
2020-05-29 10:54:49 [log] [ESPEasy] [Unit: 192.168.151.63] Error in updating json EHOSTUNREACH

Can you access that page when you enter the URL in a webbrowser? It looks like Homey really can't connect to your ESP unit. Are they on a different network segment?

Pjotr-bot commented 4 years ago

As second check. b8882f08-1fc2-44d4-885e-d6284497d112

Joolee commented 4 years ago

Look like there's an error in the JSON response. Can you browse to: http://10.0.1.23:80/json and post the output (if it doesn't contain anything you don't want to share) If I know what they output, maybe I can work around it. There is also an "OK" after the JSON response from running commands so I already have to strip that off before trying to parse the JSON -_-'

You can post the output at: https://gist.github.com/ It's complaining of there being an "F" as first character so I suspect there will be no JSON at all.

Tequila329 commented 4 years ago

I downgraded to "mega-20191208" and cannot reproduce the problem.

In your log (6ba1149a-b720-4c0a-bc15-f71fcd92e2d3), I see the following:

2020-05-29 10:54:45 [log] [ESPEasy] [Unit: 192.168.151.63] Fetching http://192.168.151.63:80/json
2020-05-29 10:54:49 [log] [ESPEasy] [Unit: 192.168.151.63] Error in updating json EHOSTUNREACH

Can you access that page when you enter the URL in a webbrowser? It looks like Homey really can't connect to your ESP unit. Are they on a different network segment?

Yes, the URL is reachable via browser. They are located at the same IP segment, but using different SSIDs to get there. No routing etc is used.

Joolee commented 4 years ago

It might be your access point is configured to now allow wireless clients to talk to each other. You could try making a "logic" flow card to retrieve the /json URL. See what happens.

Pjotr-bot commented 4 years ago

Look like there's an error in the JSON response. Can you browse to: http://10.0.1.23:80/json and post the output (if it doesn't contain anything you don't want to share) If I know what they output, maybe I can work around it. There is also an "OK" after the JSON response from running commands so I already have to strip that off before trying to parse the JSON -_-'

You can post the output at: https://gist.github.com/ It's complaining of there being an "F" as first character so I suspect there will be no JSON at all.

Like you thought, there is no JSON at al when testing.

File Not Found

URI: /json Method: GET Arguments: 0

Joolee commented 4 years ago

That is weird. As far as I can find, the /json page has always been part of ESP Easy. What exact build are you running? Do you see the "Show JSON" button on the tools page?

Pjotr-bot commented 4 years ago

Changed some things and tried a different browser and esp unit. That does give a /json, but still no connection in the app.

ed854e13-85b2-4481-8b6b-219d5914f5fa

{
   "System":{
      "Build":20103,
      "Git Build":"mega-20190110",
      "System libraries":"ESP82xx Core 2_4_2, NONOS SDK 2.2.1(cfd48f3), LWIP: 2.0.3 PUYA support",
      "Plugins":46,
      "Plugin description":" [Normal]",
      "Local time":"1970-00-00 00:00:00",
      "Unit":0,
      "Name":"Watermeter",
      "Uptime":129397,
      "Last boot cause":"Manual reboot",
      "Reset Reason":"Power on",
      "Load":6.90,
      "Load LC":5879,
      "Free RAM":17552
   },
   "WiFi":{
      "Hostname":"Counter",
      "IP config":"DHCP",
      "IP":"10.0.1.33",
      "Subnet Mask":"OK",
      "Gateway IP":"OK",
      "MAC address":"OK",
      "DNS 1":"OK",
      "DNS 2":"OK",
      "SSID":"Netwerk",
      "BSSID":"OK",
      "Channel":1,
      "Connected msec":85395083,
      "Last Disconnect Reason":202,
      "Last Disconnect Reason str":"(202) Auth fail",
      "Number reconnects":56,
      "RSSI":-74
   },
   "Sensors":[
      {
         "TaskValues":[
            {
               "ValueNumber":1,
               "Name":"Count",
               "NrDecimals":2,
               "Value":0.00
            },
            {
               "ValueNumber":2,
               "Name":"Total",
               "NrDecimals":2,
               "Value":18673.00
            },
            {
               "ValueNumber":3,
               "Name":"Time",
               "NrDecimals":2,
               "Value":1389174.00
            }
         ],
         "DataAcquisition":[
            {
               "Controller":1,
               "IDX":329,
               "Enabled":"true"
            },
            {
               "Controller":2,
               "IDX":0,
               "Enabled":"false"
            },
            {
               "Controller":3,
               "IDX":0,
               "Enabled":"false"
            }
         ],
         "TaskInterval":60,
         "Type":"Generic - Pulse counter",
         "TaskName":"Watermeter",
         "TaskEnabled":"true",
         "TaskNumber":1
      }
   ],
   "TTL":60000
}
Joolee commented 4 years ago

That's very annoying, your version doesn't supply a MAC Address in the /json output :/ My whole app leans on identifying the units by MAC Address... I will see what I can do but in the mean time, I recommend updating to the latest version.

Pjotr-bot commented 4 years ago

Oh that was me ;) i've deleted that part and just typed OK due to privacy reasons. It correctly shows the MAC adress and all the other data that say 'OK' .

Pjotr-bot commented 4 years ago

Small succes. I've found one ESP that does connect! Flashed with the latest version of a build from: https://github.com/arnemauer/Ducobox-ESPEasy-Plugin/wiki so now i have to find out what the other ESP's do when i update them.

Joolee commented 4 years ago

Could you try: https://homey.app/a/nl.joolee.homey.espeasy/test/ I think I fixed the problem you were having.

Pjotr-bot commented 4 years ago

Could you try: https://homey.app/a/nl.joolee.homey.espeasy/test/ I think I fixed the problem you were having.

It does not fix the problem for the older versions. I'm going to update my water usage counter now to see what effect it gives.

Pjotr-bot commented 4 years ago

Updating it to the latest version does the trick. (ESP_Easy_mega_20200516_normal_ESP8266_1M)

Tequila329 commented 4 years ago
{
   "System":{
      "Build":20104,
      "Git Build":"mega-20191208",
      "System Libraries":"ESP82xx Core bc204a9b, NONOS SDK 2.2.2-dev(38a443e), LWIP: 2.1.2 PUYA support",
      "Plugins":46,
      "Plugin description":" [Normal]",
      "Local Time":"2020-06-02 18:04:44",
      "Unit Number":0,
      "Unit Name":"Waeschekeller",
      "Uptime":1,
      "Last Boot Cause":"Manual reboot",
      "Reset Reason":"Software/System restart",
      "Load":10.50,
      "Load LC":3490,
      "CPU Eco Mode":"false",
      "Heap Max Free Block":16872,
      "Heap Fragmentation":5,
      "Free RAM":17776
   },
   "WiFi":{
      "Hostname":"Waeschekeller",
      "IP Config":"Static",
      "IP Address":"192.168.151.2",
      "IP Subnet":"255.255.254.0",
      "Gateway":"192.168.150.1",
      "STA MAC":"EC:FA:BC:C5:9D:42",
      "DNS 1":"192.168.150.1",
      "DNS 2":"(IP unset)",
      "SSID":"r-a-f_IoT",
      "BSSID":"9E:DA:C4:96:FF:FC",
      "Channel":6,
      "Connected msec":72563,
      "Last Disconnect Reason":1,
      "Last Disconnect Reason str":"(1) Unspecified",
      "Number Reconnects":0,
      "Force WiFi B/G":"false",
      "Restart WiFi Lost Conn":"false",
      "Force WiFi No Sleep":"true",
      "Periodical send Gratuitous ARP":"false",
      "Connection Failure Threshold":0,
      "RSSI":-69
   },
   "Sensors":[
      {
         "TaskValues":[
            {
               "ValueNumber":1,
               "Name":"Temperature",
               "NrDecimals":1,
               "Value":24.0
            },
            {
               "ValueNumber":2,
               "Name":"Humidity",
               "NrDecimals":1,
               "Value":41.8
            }
         ],
         "DataAcquisition":[
            {
               "Controller":1,
               "IDX":0,
               "Enabled":"true"
            },
            {
               "Controller":2,
               "IDX":0,
               "Enabled":"false"
            },
            {
               "Controller":3,
               "IDX":0,
               "Enabled":"false"
            }
         ],
         "TaskInterval":15,
         "Type":"Environment - DHT11/12/22  SONOFF2301/7021",
         "TaskName":"Umgebung",
         "TaskDeviceNumber":5,
         "TaskEnabled":"true",
         "TaskNumber":1
      },
      {
         "TaskValues":[
            {
               "ValueNumber":1,
               "Name":"Analog",
               "NrDecimals":2,
               "Value":70.00
            }
         ],
         "DataAcquisition":[
            {
               "Controller":1,
               "IDX":0,
               "Enabled":"true"
            },
            {
               "Controller":2,
               "IDX":0,
               "Enabled":"false"
            },
            {
               "Controller":3,
               "IDX":0,
               "Enabled":"false"
            }
         ],
         "TaskInterval":60,
         "Type":"Analog input - internal",
         "TaskName":"MQ-7",
         "TaskDeviceNumber":2,
         "TaskEnabled":"true",
         "TaskNumber":2
      }
   ],
   "TTL":15000
}
Joolee commented 4 years ago

@Tequila329 I strongly suspect this is a network issue if you still have the problem with the latest version of my app. (https://homey.app/a/nl.joolee.homey.espeasy/test/) Can you try making a flow with a "Logic" "Web request" card and the /json url? I suspect that will also fail.

Tequila329 commented 4 years ago

I‘m not so familiar with it: anything for header and body? Method: Get?

Joolee commented 4 years ago

You can leave verything default, except for the url. When you test/run the flow, you should either see a checkbox or an exclamation mark before the card.