Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cloud Mqtt connection failing #10698

Closed
13 of 14 tasks
rmoosa opened this issue Jan 25, 2021 · 33 comments
Closed
13 of 14 tasks

Cloud Mqtt connection failing #10698

rmoosa opened this issue Jan 25, 2021 · 33 comments
Labels
duplicated Result - Duplicated Issue help needed Action - Asking for help from the community troubleshooting Type - Troubleshooting

Comments

@rmoosa
Copy link

rmoosa commented Jan 25, 2021

PROBLEM DESCRIPTION

I am connecting to the adafruit.io Mqtt server. The password is 32 characters long.
Connection works perfectly on 9.1.0. But fails to connect on subsequent versions.
After connection failed on latest build, I downgraded to 9.1.0 and it connected successfully again.
Tested on 2 separate devices. Same issue.

REQUESTED INFORMATION

Make sure your have performed every step and checked the applicable boxes before submitting your issue. Thank you!

  • Read the Contributing Guide and Policy and the Code of Conduct
  • Searched the problem in issues
  • Searched the problem in discussions
  • Searched the problem in the docs
  • Searched the problem in the chat
  • Device used (e.g., Sonoff Basic): sonoff pow and sonoff th
  • Tasmota binary firmware version number used: 9.2.0.4
    • Pre-compiled
    • Self-compiled
  • Flashing tools used: firmware update
  • Provide the output of command: Backlog Template; Module; GPIO 255:
  Configuration output here:
19:25:14.270 CMD: Backlog Template; Module; GPIO 255:
19:25:14.337 RSL: rmoosa/feeds/PowerMeter/RESULT = {"NAME":"Generic","GPIO":[1,1,1,1,1,1,1,1,1,1,1,1,1,1],"FLAG":0,"BASE":18}
19:25:14.581 RSL: rmoosa/feeds/PowerMeter/RESULT = {"Module":{"43":"Sonoff Pow R2"}}
19:25:14.792 RSL: rmoosa/feeds/PowerMeter/RESULT = {"GPIO0":{"32":"Button1"},"GPIO1":{"3072":"CSE7766 Tx"},"GPIO2":{"0":"None"},"GPIO3":{"3104":"CSE7766 Rx"},"GPIO4":{"0":"None"},"GPIO5":{"0":"None"},"GPIO9":{"0":"None"},"GPIO10":{"0":"None"},"GPIO12":{"224":"Relay1"},"GPIO13":{"320":"Led_i1"},"GPIO14":{"0":"None"},"GPIO15":{"0":"None"},"GPIO16":{"0":"None"},"GPIO17":{"0":"None"}}
  • If using rules, provide the output of this command: Backlog Rule1; Rule2; Rule3:
  Rules output here:
19:27:34.956 RSL: rmoosa/feeds/PowerMeter/RESULT = {"Rule1":"ON","Once":"OFF","StopOnError":"OFF","Length":77,"Free":434,"Rules":"ON tele-energy#power DO publish rmoosa/feeds/PowerMeter.wattage %value% ENDON"}
19:27:35.198 RSL: rmoosa/feeds/PowerMeter/RESULT = {"Rule2":"OFF","Once":"OFF","StopOnError":"OFF","Length":0,"Free":511,"Rules":""}
19:27:35.404 RSL: rmoosa/feeds/PowerMeter/RESULT = {"Rule3":"OFF","Once":"OFF","StopOnError":"OFF","Length":0,"Free":511,"Rules":""}
  • Provide the output of this command: Status 0:
  STATUS 0 output here:
19:28:00.673 CMD: Status 0
19:28:00.680 RSL: rmoosa/feeds/PowerMeter/STATUS = {"Status":{"Module":43,"DeviceName":"TasmotaPower","FriendlyName":["Tasmota"],"Topic":"tasmota_CA4BC5","ButtonTopic":"0","Power":1,"PowerOnState":4,"LedState":1,"LedMask":"FFFF","SaveData":1,"SaveState":1,"SwitchTopic":"0","SwitchMode":[0,0,0,0,0,0,0,0],"ButtonRetain":0,"SwitchRetain":0,"SensorRetain":0,"PowerRetain":0}}
19:28:00.686 RSL: rmoosa/feeds/PowerMeter/STATUS1 = {"StatusPRM":{"Baudrate":4800,"SerialConfig":"8E1","GroupTopic":"tasmotas","OtaUrl":"http://ota.tasmota.com/tasmota/tasmota.bin","RestartReason":"Software/System restart","Uptime":"0T00:05:40","StartupUTC":"2021-01-29T18:22:20","Sleep":50,"CfgHolder":4617,"BootCount":200,"BCResetTime":"2020-10-01T05:55:45","SaveCount":492,"SaveAddress":"FB000"}}
19:28:00.690 RSL: rmoosa/feeds/PowerMeter/STATUS2 = {"StatusFWR":{"Version":"9.2.0.4(tasmota)","BuildDateTime":"2021-01-29T15:17:55","Boot":31,"Core":"2_7_4_9","SDK":"2.2.2-dev(38a443e)","CpuFrequency":80,"Hardware":"ESP8266EX","CR":"455/699"}}
19:28:00.695 RSL: rmoosa/feeds/PowerMeter/STATUS3 = {"StatusLOG":{"SerialLog":0,"WebLog":2,"MqttLog":0,"SysLog":0,"LogHost":"","LogPort":514,"SSId":["myWiFly",""],"TelePeriod":30,"Resolution":"558180C0","SetOption":["0000800B","2805C8000100068000005A0A000000000000","00008080","00006000","00000000"]}}
19:28:00.705 RSL: rmoosa/feeds/PowerMeter/STATUS4 = {"StatusMEM":{"ProgramSize":591,"Free":412,"Heap":27,"ProgramFlashSize":1024,"FlashSize":4096,"FlashChipId":"1640EF","FlashFrequency":40,"FlashMode":3,"Features":["00000809","8FDAC787","04368001","000000CF","010013C0","C000F981","00004004","00001000","00000000"],"Drivers":"1,2,3,4,5,6,7,8,9,10,12,16,18,19,20,21,22,24,26,27,29,30,35,37,45","Sensors":"1,2,3,4,5,6"}}
19:28:00.711 RSL: rmoosa/feeds/PowerMeter/STATUS5 = {"StatusNET":{"Hostname":"TasmotaPower","IPAddress":"192.168.1.220","Gateway":"192.168.1.1","Subnetmask":"255.255.255.0","DNSServer":"192.168.1.1","Mac":"CC:50:E3:CA:4B:C5","Webserver":2,"WifiConfig":4,"WifiPower":17.0}}
19:28:00.715 RSL: rmoosa/feeds/PowerMeter/STATUS6 = {"StatusMQT":{"MqttHost":"io.adafruit.com","MqttPort":1883,"MqttClientMask":"DVES_%06X","MqttClient":"DVES_CA4BC5","MqttUser":"rmoosa","MqttCount":0,"MAX_PACKET_SIZE":1200,"KEEPALIVE":30}}
19:28:00.722 RSL: rmoosa/feeds/PowerMeter/STATUS7 = {"StatusTIM":{"UTC":"2021-01-29T18:28:00","Local":"2021-01-29T19:28:00","StartDST":"2021-03-28T02:00:00","EndDST":"2021-10-31T03:00:00","Timezone":"+01:00","Sunrise":"08:23","Sunset":"17:42"}}
19:28:00.725 RSL: rmoosa/feeds/PowerMeter/STATUS9 = {"StatusPTH":{"PowerDelta":[0,0,0],"PowerLow":0,"PowerHigh":0,"VoltageLow":0,"VoltageHigh":0,"CurrentLow":0,"CurrentHigh":0}}
19:28:00.733 RSL: rmoosa/feeds/PowerMeter/STATUS10 = {"StatusSNS":{"Time":"2021-01-29T19:28:00","ENERGY":{"TotalStartTime":"2020-10-01T05:55:45","Total":23.025,"Yesterday":3.333,"Today":6.003,"Power":1337,"ApparentPower":1385,"ReactivePower":360,"Factor":0.97,"Voltage":228,"Current":6.064}}}
19:28:00.739 RSL: rmoosa/feeds/PowerMeter/STATUS11 = {"StatusSTS":{"Time":"2021-01-29T19:28:00","Uptime":"0T00:05:40","UptimeSec":340,"Heap":27,"SleepMode":"Dynamic","Sleep":50,"LoadAvg":19,"MqttCount":0,"POWER":"ON","Wifi":{"AP":1,"SSId":"myWiFly","BSSId":"18:E8:29:A7:60:7E","Channel":1,"RSSI":90,"Signal":-55,"LinkCount":1,"Downtime":"0T00:00:07"}}}
  • Set weblog to 4 and then, when you experience your issue, provide the output of the Console log:
  Console output here:
19:29:30.754 MQT: Attempting connection...
19:29:30.968 MQT: Connect failed to io.adafruit.com:1883, rc -2. Retry in 20 sec
19:29:30.977 DMP: 55 5A 02 EC 70 00 03 4B 00 3E A8 00 0A 56 4F 73 D8 00 0F 55 71 2D 06 94
19:29:30.989 DMP: 55 5A 02 EC 70 00 03 4B 00 3E A8 00 0A 56 4F 73 D8 00 0F 4C 71 2D 21 A6
19:29:31.021 DMP: 55 5A 02 EC 70 00 03 4B 00 3E A8 00 0A 56 4F 73 D8 00 0F 4E 71 2D 3C C3
19:29:31.099 DMP: 55 5A 02 EC 70 00 03 4B 00 3E A8 00 0A 56 4F 73 D8 00 0F 48 71 2D 57 D8
19:29:31.203 DMP: 55 5A 02 EC 70 00 03 4B 00 3E A8 00 0A 57 4F 73 D8 00 0F 4A 71 2D 71 F5
19:29:31.307 DMP: 55 5A 02 EC 70 00 03 4B 00 3E A8 00 0A 57 4F 73 D8 00 0F 45 71 2D 8C 0B
19:29:31.412 DMP: 55 5A 02 EC 70 00 03 4B 00 3E A8 00 0A 57 4F 73 D8 00 0F 4E 71 2D A7 2F
19:29:31.516 DMP: 55 5A 02 EC 70 00 03 4B 00 3E A8 00 0A 57 4F 73 D8 00 0F 54 71 2D C2 50
19:29:31.620 DMP: 55 5A 02 EC 70 00 03 4B 00 3E A8 00 0A 57 4F 73 D8 00 0F 57 71 2D DC 6D
19:29:31.725 DMP: 55 5A 02 EC 70 00 03 4B 00 3E A8 00 0A 57 4F 73 D8 00 0F 62 71 2D F7 93
19:29:31.830 DMP: 55 5A 02 EC 70 00 03 4B 00 3E A8 00 0A 57 4F 73 D8 00 0F 6A 71 2E 11 B6
19:29:31.933 DMP: 55 5A 02 EC 70 00 03 4B 00 3E A8 00 0A 57 4F 73 D8 00 0F 6C 71 2E 2C D3
19:29:32.052 DMP: 55 5A 02 EC 70 00 03 4B 00 3E A8 00 0A 57 4F 73 D8 00 0F 5D 71 2E 47 DF
19:29:32.156 DMP: 55 5A 02 EC 70 00 03 4B 00 3E A8 00 0A 57 4F 73 D8 00 0F 50 71 2E 62 ED
19:29:32.261 DMP: 55 5A 02 EC 70 00 03 4B 00 3E A8 00 0A 57 4F 73 D8 00 0F 3D 71 2E 7D F5
19:29:32.366 DMP: 55 5A 02 EC 70 00 03 4B 00 3E A8 00 0A 57 4F 73 D8 00 0F 32 71 2E 97 04
19:29:32.470 DMP: 55 5A 02 EC 70 00 03 4B 00 3E A8 00 0A 57 4F 73 D8 00 0F 38 71 2E B2 25
19:29:32.574 DMP: 55 5A 02 EC 70 00 03 4B 00 3E A8 00 0A 57 4F 73 D8 00 0F 50 71 2E CD 58
19:29:32.678 DMP: 55 5A 02 EC 70 00 03 4B 00 3E A8 00 0A 57 4F 73 D8 00 0F 6D 71 2E E7 8F
19:29:32.783 DMP: 55 5A 02 EC 70 00 03 4B 00 3E A8 00 0A 57 4F 73 D8 00 0F 73 71 2F 02 B1
19:29:32.887 DMP: 55 5A 02 EC 70 00 03 4B 00 3E A8 00 0A 61 4F 73 D8 00 0F 6C 71 2F 1C CE
19:29:32.992 DMP: 55 5A 02 EC 70 00 03 4B 00 3E A8 00 0A 61 4F 73 D8 00 0F 5A 71 2F 37 D7
19:29:33.098 DMP: 55 5A 02 EC 70 00 03 4B 00 3E A8 00 0A 61 4F 73 D8 00 0F 51 71 2F 52 E9
19:29:33.203 DMP: 55 5A 02 EC 70 00 03 4B 00 3E A8 00 0A 61 4F 73 D8 00 0F 51 71 2F 6D 04
19:29:33.307 DMP: 55 5A 02 EC 70 00 03 4B 00 3E A8 00 0A 61 4F 73 D8 00 0F 55 71 2F 87 22
19:29:33.411 DMP: 55 5A 02 EC 70 00 03 4B 00 3E A8 00 0A 61 4F 73 D8 00 0F 59 71 2F A2 41
19:29:33.516 DMP: 55 5A 02 EC 70 00 03 4B 00 3E A8 00 0A 61 4F 73 D8 00 0F 58 71 2F BD 5B
19:29:33.620 DMP: 55 5A 02 EC 70 00 03 4B 00 3E A8 00 0A 61 4F 73 D8 00 0F 4F 71 2F D7 6C
19:29:33.724 DMP: 55 5A 02 EC 70 00 03 4D 00 3E A8 00 0A 61 4F 73 D8 00 0F 4E 71 2F F2 88
19:29:33.829 DMP: 55 5A 02 EC 70 00 03 4D 00 3E A8 00 0A 61 4F 73 D8 00 0F 59 71 30 0D AF
19:29:33.934 DMP: 55 5A 02 EC 70 00 03 4D 00 3E A8 00 0A 61 4F 73 D8 00 0F 65 71 30 27 D5
19:29:34.038 DMP: 55 5A 02 EC 70 00 03 4D 00 3E A8 00 0A 61 4F 73 D8 00 0F 64 71 30 42 EF
19:29:34.142 DMP: 55 5A 02 EC 70 00 03 4D 00 3E A8 00 0A 61 4F 73 D8 00 0F 59 71 30 5D FF
19:29:34.246 DMP: 55 5A 02 EC 70 00 03 4D 00 3E A8 00 0A 61 4F 73 D8 00 0F 58 71 30 77 18
19:29:34.351 DMP: 55 5A 02 EC 70 00 03 4D 00 3E A8 00 0A 61 4F 73 D8 00 0F 56 71 30 92 31
19:29:34.457 DMP: 55 5A 02 EC 70 00 03 4D 00 3E A8 00 0A 61 4F 73 D8 00 0F 53 71 30 AD 49
19:29:34.560 DMP: 55 5A 02 EC 70 00 03 4D 00 3E A8 00 0A 55 4F 73 D8 00 0F 4A 71 30 C7 4E
19:29:34.664 DMP: 55 5A 02 EC 70 00 03 4D 00 3E A8 00 0A 55 4F 73 D8 00 0F 57 71 30 E2 76
19:29:34.769 DMP: 55 5A 02 EC 70 00 03 4D 00 3E A8 00 0A 55 4F 73 D8 00 0F 5F 71 30 FD 99
19:29:34.873 DMP: 55 5A 02 EC 70 00 03 4D 00 3E A8 00 0A 55 4F 73 D8 00 0F 64 71 31 17 B9
19:29:34.977 DMP: 55 5A 02 EC 70 00 03 4D 00 3E A8 00 0A 55 4F 73 D8 00 0F 5D 71 31 32 CD
19:29:35.082 DMP: 55 5A 02 EC 70 00 03 4D 00 3E A8 00 0A 55 4F 73 D8 00 0F 53 71 31 4D DE
19:29:35.186 DMP: 55 5A 02 EC 70 00 03 4D 00 3E A8 00 0A 55 4F 73 D8 00 0F 52 71 31 68 F8
19:29:35.291 DMP: 55 5A 02 EC 70 00 03 4D 00 3E A8 00 0A 55 4F 73 D8 00 0F 49 71 31 82 09
19:29:35.395 DMP: 55 5A 02 EC 70 00 03 4D 00 3E A8 00 0A 55 4F 73 D8 00 0F 4A 71 31 9D 25
19:29:35.499 DMP: 55 5A 02 EC 70 00 03 4D 00 3E A8 00 0A 55 4F 73 D8 00 0F 51 71 31 B8 47
19:29:35.604 DMP: 55 5A 02 EC 70 00 03 4D 00 3E A8 00 0A 55 4F 73 D8 00 0F 58 71 31 D3 69
19:29:35.708 DMP: 55 5A 02 EC 70 00 03 4D 00 3E A8 00 0A 55 4F 73 D8 00 0F 4A 71 31 ED 75
19:29:35.812 DMP: 55 5A 02 EC 70 00 03 4D 00 3E A8 00 0A 55 4F 73 D8 00 0F 4A 71 32 08 91
19:29:35.917 DMP: 55 5A 02 EC 70 00 03 4D 00 3E A8 00 0A 55 4F 73 D8 00 0F 4E 71 32 23 B0
19:29:52.286 RSL: rmoosa/feeds/PowerMeter/RESULT = {"WebLog":2}

TO REPRODUCE

Steps to reproduce the behavior:
Upgrade to latest build and connect to Mqtt server using 32 character long password.

EXPECTED BEHAVIOUR

connect successfully to Mqtt server

SCREENSHOTS

If applicable, add screenshots to help explain your problem.

ADDITIONAL CONTEXT

Add any other context about the problem here.

(Please, remember to close the issue when the problem has been addressed)

@ascillato
Copy link
Contributor

Please, could you be so kind on completing the troubleshooting template in order to have more information so as to properly help you? Please also provide all the logs.

Remember to read the Contributing Guideline and Policy. Thanks.


Support Information

See Docs for more information.
See Chat for more user experience.
See Community for forum.
See Code of Conduct

@ascillato2 ascillato2 added the template missing/incomplete Action - Template Missing or incomplete (issue will be closed) label Jan 25, 2021
@ascillato2
Copy link
Collaborator

Hi, any news on this?

@arendst
Copy link
Owner

arendst commented Jan 27, 2021

I don't think the password lenght is the issue here.

Searching the changelog it seems since v9.1.0 the following two MQTT related changes have been introduced:

As your issue starts with v9.2 I suggest you try to change back the Wifi connection timeout from 200 mSec to 5000 mSec and see if it solves your issue. If soo try to lower it again (as it was way too high for most users) to find a workable solution for Adafruit MQTT.

EDIT: To revert, change in file xdrv_02_mqtt.ino define MQTT_WIFI_CLIENT_TIMEOUT from 200 to 5000

@arendst arendst added the awaiting feedback Action - Waiting for response or more information label Jan 27, 2021
@ascillato2 ascillato2 added the troubleshooting Type - Troubleshooting label Jan 27, 2021
@ascillato2
Copy link
Collaborator

@rmoosa

Hi, any news on this?

@harryd31
Copy link

Running into the same issue when trying to connect to aws iot also

@ascillato
Copy link
Contributor

@harryd31

Please, help us solving this issue you are experiencing. Can you try as Theo has explained above?

@rmoosa
Copy link
Author

rmoosa commented Jan 29, 2021

Apologies for taking so long to respond. Life came in the way of tinkering.
It is unlikely to be the wifi timeout, cause the device is successfully connected to the wifi.
I am able to get to the device on my network.

And the adafruit Mqtt connection is normally established in less than 1 second, so an Mqtt socket timeout of 4 secs also should not have any impact.
This is the log from another similar device on my network (running 9.1.0) and you can see the mqtt connection happens in less than 1 second:

00:00:00 CFG: Loaded from flash at FB, Count 318
00:00:00 QPC: Count 1
00:00:00 Project tasmota Tasmota Version 9.1.0(tasmota)-2_7_4_5
00:00:00 WIF: Connecting to AP1 myWiFly Channel 1 BSSId 18:E8:29:A7:60:7E in mode 11N as tasmota-2636...
00:00:01 WIF: Connected
19:59:38 HTP: Web server active on tasmota-2636 with IP address 192.168.1.221
19:59:39 MQT: Attempting connection...
19:59:39 MQT: Connected
19:59:39 MQT: rmoosa/LWT = Online (retained)

I updated this device to 9.2.0 as well, and it failed to connect.
I downgraded the OS back to 9.1.0 and it connected successfully to broker.

You can also see from the restart logs here that the failure happened in just over 200 milliseconds.

00:00:00.050 CFG: Loaded from flash at F9, Count 510
00:00:00.060 Project tasmota TasmotaPower Version 9.2.0.4(tasmota)-2_7_4_9(2021-01-29T15:17:55)
00:00:00.163 SER: Set to 8E1 4800 bit/s
00:00:00.166 SNS: Hardware Serial
00:00:00.751 WIF: Connecting to AP1 myWiFly Channel 1 BSSId 18:E8:29:A7:60:7E in mode 11n as TasmotaPower...
00:00:01.521 WIF: Connected
00:00:01.756 HTP: Web server active on TasmotaPower with IP address 192.168.1.220
20:18:15.592 MQT: Attempting connection...
20:18:16.004 MQT: Connect failed to io.adafruit.com:1883, rc -2. Retry in 10 sec
20:18:26.754 MQT: Attempting connection...
20:18:26.969 MQT: Connect failed to io.adafruit.com:1883, rc -2. Retry in 20 sec

I have not compiled this code myself yet, so gonna do some reading and will try the changes suggested.

@rmoosa
Copy link
Author

rmoosa commented Jan 29, 2021

I have added all of the missing data on the template.

PS thanks for all the efforts in creating and maintaining this great software.

@ascillato2 ascillato2 added duplicated Result - Duplicated Issue and removed template missing/incomplete Action - Template Missing or incomplete (issue will be closed) labels Jan 29, 2021
@ascillato2 ascillato2 changed the title Mqtt connection failing on long password Cloud Mqtt connection failing with long password Jan 29, 2021
@rmoosa
Copy link
Author

rmoosa commented Jan 29, 2021

This is the log after a restart:

00:00:00.049 CFG: Loaded from flash at FB, Count 500
00:00:00.060 Project tasmota TasmotaPower Version 9.2.0.4(tasmota)-2_7_4_9(2021-01-29T15:17:55)
00:00:00.163 SER: Set to 8E1 4800 bit/s
00:00:00.166 SNS: Hardware Serial
00:00:00.772 WIF: Connecting to AP1 myWiFly Channel 1 BSSId 18:E8:29:A7:60:7E in mode 11n as TasmotaPower...
00:00:01.539 WIF: Connected
00:00:01.756 HTP: Web server active on TasmotaPower with IP address 192.168.1.220
19:35:25.576 MQT: Attempting connection...
19:35:25.799 MQT: Connect failed to io.adafruit.com:1883, rc -2. Retry in 10 sec
19:35:36.754 MQT: Attempting connection...
19:35:36.970 MQT: Connect failed to io.adafruit.com:1883, rc -2. Retry in 20 sec
19:35:55.143 RSL: rmoosa/feeds/PowerMeter/STATE = {"Time":"2021-01-29T19:35:55","Uptime":"0T00:00:34","UptimeSec":34,"Heap":28,"SleepMode":"Dynamic","Sleep":50,"LoadAvg":19,"MqttCount":0,"POWER":"ON","Wifi":{"AP":1,"SSId":"myWiFly","BSSId":"18:E8:29:A7:60:7E","Channel":1,"RSSI":90,"Signal":-55,"LinkCount":1,"Downtime":"0T00:00:03"}}
19:35:55.152 RSL: rmoosa/feeds/PowerMeter/SENSOR = {"Time":"2021-01-29T19:35:55","ENERGY":{"TotalStartTime":"2020-10-01T05:55:45","Total":23.196,"Yesterday":3.333,"Today":6.174,"Period":11,"Power":1330,"ApparentPower":1380,"ReactivePower":369,"Factor":0.96,"Voltage":228,"Current":6.057}}
19:35:55.164 RUL: TELE-ENERGY#POWER performs "publish rmoosa/feeds/PowerMeter.wattage 1330"
19:35:55.168 RSL: rmoosa/feeds/PowerMeter.wattage = 1330
19:35:57.753 MQT: Attempting connection...

@rmoosa
Copy link
Author

rmoosa commented Jan 29, 2021

Could the issue have been caused by this FIX in 9.1.0.1:
GUI MqttUser and MqttPassword updates when TLS is compiled in (#9825)

@rmoosa

This comment has been minimized.

@ascillato2

This comment has been minimized.

@ascillato2 ascillato2 removed the awaiting feedback Action - Waiting for response or more information label Jan 31, 2021
@harryd31
Copy link

harryd31 commented Feb 9, 2021

@ascillato Sorry for the long wait, My issue was with connecting using the aws IOT, however I found the answer I was looking for. It wasn't a bug sorry.

@ascillato2
Copy link
Collaborator

Great to know that now it is working for you.

@rmoosa
Copy link
Author

rmoosa commented Feb 9, 2021

Hi. I logged this issue and it is still a problem. As per my initial description.

@rmoosa
Copy link
Author

rmoosa commented Feb 11, 2021

@ascillato This is still an issue.
I have tested on 9.2.0.7 and the issue still exists there.
I then flashed the device with 9.1.0 without making any changes to any parameters and it started working fine.
Can you please advise.

@ascillato2
Copy link
Collaborator

Reopening as requested

@ascillato2 ascillato2 reopened this Feb 11, 2021
@ascillato2 ascillato2 added the help needed Action - Asking for help from the community label Feb 11, 2021
@arendst
Copy link
Owner

arendst commented Feb 11, 2021

As said before (#10698 (comment)) execute these changes and try again.

Trying to explain it (as you did before) without testing makes no sense.

@arendst arendst changed the title Cloud Mqtt connection failing with long password Cloud Mqtt connection failing Feb 11, 2021
@jaymemaurice
Copy link

@rmoosa can you share more information about the MQTT server and any configuration you have on it? I think getting a packet capture may lead to some clues. Maybe I can attempt to reproduce..

@rmoosa
Copy link
Author

rmoosa commented Feb 13, 2021

@rmoosa can you share more information about the MQTT server and any configuration you have on it? I think getting a packet capture may lead to some clues. Maybe I can attempt to reproduce..

@jaymemaurice it is a public Mqtt broker. I don't have control over the settings.
You can create a free adafruit io account here:
https://io.adafruit.com
Details on using the Mqtt api are here:
https://io.adafruit.com/api/docs/mqtt.html#adafruit-io-mqtt-api
Thanks for the assistance

@barbudor
Copy link
Contributor

@rmoosa I'm also interested to see if I can use Adafruit.IO for a specific use case
I will probably look into it in the next days.
Are you trying to connect insecure 1883 or with TLS ?
How are you expecting to work around Adafruit very specific topic structure ?
Except for rule-publish like I see you are doing, you won't be able to support tasmota's stat tele and cmnd prefixes. So no remote control.

@rmoosa
Copy link
Author

rmoosa commented Feb 17, 2021

@barbudor hi. I'm connecting to port 1883.
I only using the rule-publish.
Mine was also a very specific use case - I just needed to collect sensor data. I did not need to control the device via Mqtt.
I could probably also use a websend rule to adafruit api to accomplish the same.

@barbudor
Copy link
Contributor

OK. I'll do some tests by the end of the week and report back.

@barbudor
Copy link
Contributor

barbudor commented Feb 17, 2021

@rmoosa I can confirm immediate connection to AIO broker in unsecure mode (1883) using latest 9.2.0.7
image

EDIT: the MQTT password should be your AIO key, not your account password

logs :

00:00:00.049 CFG: Loaded from flash at F7, Count 13
00:00:00.054 QPC: Count 1
00:00:00.056 CFG: CR 460/699, Busy 0
00:00:00.058 SRC: Restart
00:00:00.059 Project tasmota Tasmota Version 9.2.0.7(lite)-2_7_4_9(2021-02-17T17:38:00)
00:00:00.161 WIF: Attempting connection...
00:00:00.497 WIF: Connecting to AP1 ******** Channel 6 BSSId ******* in mode 11n as ************-5763...
00:00:01.751 WIF: Connected
00:00:02.003 HTP: Web server active on *******-5763 with IP address 192.168.169.195
00:00:03.537 RTC: UTC 2021-02-17T21:25:12, DST 2021-03-28T02:00:00, STD 2021-10-31T03:00:00
22:25:12.301 MQT: Attempting connection...
22:25:13.178 MQT: Connected
22:25:13.181 MQT: AIOUSERNAME/feeds/tele/LWT = Online (retained)
22:25:13.183 MQT: AIOUSERNAME/feeds/cmnd/POWER = 
22:25:13.184 MQT: Subscribe to AIOUSERNAME/feeds/cmnd/#
22:25:13.186 MQT: Subscribe to tasmotas/feeds/cmnd/#
22:25:13.187 MQT: Subscribe to cmnd/DVES_A6D683_fb/#
22:25:13.190 MQT: AIOUSERNAME/feeds/tele/INFO1 = {"Module":"Generic","Version":"9.2.0.7(lite)","FallbackTopic":"cmnd/DVES_A6D683_fb/","GroupTopic":"tasmotas/feeds/cmnd/"}
22:25:13.199 MQT: AIOUSERNAME/feeds/tele/INFO2 = {"WebServerMode":"Admin","Hostname":"AIOUSERNAME-5763","IPAddress":"192.168.169.195"}
22:25:13.212 MQT: AIOUSERNAME/feeds/tele/INFO3 = {"RestartReason":"Software/System restart"}
22:25:15.449 QPC: Reset
22:25:17.448 APP: Boot Count 6
22:25:17.455 MQT: AIOUSERNAME/feeds/tele/STATE = {"Time":"2021-02-17T22:25:17","Uptime":"0T00:00:09","UptimeSec":9,"Vcc":3.050,"Heap":31,"SleepMode":"Dynamic","Sleep":50,"LoadAvg":19,"MqttCount":1,"Wifi":{"AP":1,"SSId":"BNETWLAN","BSSId":"F8:D1:11:BD:3B:A0","Channel":6,"RSSI":72,"Signal":-64,"LinkCount":1,"Downtime":"0T00:00:03"}}
22:25:18.346 CFG: Saved to flash at F6, Count 14, Bytes 4096
22:26:53.102 CMD: publish AIOUSERNAME/feeds/temp 21.24
22:26:53.104 SRC: WebConsole from 192.168.169.106
22:26:53.106 CMD: Group 0, Index 1, Command "PUBLISH", Data "AIOUSERNAME/feeds/temp 21.24"
22:26:53.110 MQT: AIOUSERNAME/feeds/temp = 21.24

Results in my feeds:
image

Of course errors on subscribing on topics that do not conform to AIO standard (errors shown on AIO web site:)

MQTT ERROR: DVES_A6D683 90.112.255.205 SUBSCRIBE to topic `tasmotas/feeds/cmnd/#` rejected, resource not available or not authorized
MQTT ERROR: DVES_A6D683 90.112.255.205 SUBSCRIBE to topic `cmnd/DVES_A6D683_fb/#` rejected, not a valid resource topic

And standard Tasmota messsages publications such as 22:25:13.199 MQT: AIOUSERNAME/feeds/tele/INFO2 = {"WebServerMode":"Admin","Hostname":"AIOUSERNAME-5763","IPAddress":"192.168.169.195"} are going nowhere as they don't conform to AIO standard.

But as you can see the "manual" publish goes correctly in my feeds

Now, need to test with TLS.

May be a specific AIO mode to conform Tasmota topics to AIO standard would be interresting.
I will investigate that after TLS.

@rmoosa
Copy link
Author

rmoosa commented Feb 18, 2021

@barbudor can you ping the io.adafruit.com server from you network.
I am based in South Africa. I wanna compare network latency with yours.
Strangely enough though, yoI logs seem to indicate about 800 milliseconds to establish connection. Mine is failing in less than 300.
Perhaps I should try and test on an alternate network. Will try and post feedback.

@barbudor
Copy link
Contributor

Located in France, ADSL access in countryside location (around 4Mbps bw)
Ping is around 120 to 140ms in general. Twice 620-640ms on 45 tests

@rmoosa
Copy link
Author

rmoosa commented Feb 18, 2021

@barbudor my pings to that server are about 400ms. I'm going to try and recompile with new settings as previously suggested. Will test over the weekend.

@barbudor
Copy link
Contributor

There is one recent change regarding the TCP Timeout that is used when establishing the connection with the MQTT socket
The value was reduced from 15 seconds to 4 seconds
Still this doesn't seem to be the problem as your connection is rejected within 300ms.
I would guess this is more like an authentication problem. Are you using your AIOKEY as MQTT password (and not your account password) ?

I've just tested TLS. 1st time for me I tried TLS and it worked on 1st try too. So I strongly suggest that you use it too as transporting credential in clear on the Internet is not the safest.

@rmoosa
Copy link
Author

rmoosa commented Feb 18, 2021

@barbudor i am using the correct auth details and settings.
I downgraded to 9.1.0 without adjusting any of the settings and it starts working.
Ap grade to 9.2.0.7 without changing any settings and it starts fails.
Downgrade again to 9.1.0, again not making any changes to setting (username/password etc) and it starts failing again.

@barbudor
Copy link
Contributor

Downgrading may leads to unexpected behavior as flash mapping of settings have changed

Can you try 9.2.0.7 fresh (serial erase and flash and reconfigure from scratch) ?

Are you sure that after all those downgrades and upgrades your device still has proper access to the Internet and the DNS ?
When I want to check Internet access, my typical test sequence is:
ping -4 google.com on your pc, note the IP address (use ping -4 if needed to have an IPv4 address) and use it in the 1st test below :
In Tasmota console websend [ip.of.google.com] / if replies "Done", you have Internet access, if not => fix it (gateway ?)
Now to test DNS, use google.com name:
In Tasmota console websend [google.com] / if replies "Done" you have DNS, if not => fix it (use 1.1.1.1 or 8.8.8.8 for DNS for example)

@rmoosa
Copy link
Author

rmoosa commented Feb 18, 2021

@barbudor thanks for that info.
I will try that over the weekend.

@jaymemaurice
Copy link

@rmoosa - did you get a chance to try again?

@ascillato2
Copy link
Collaborator

ascillato2 commented Mar 2, 2021

Please, when you have time, tell us if you could solve your issue with the suggestions done above.
Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicated Result - Duplicated Issue help needed Action - Asking for help from the community troubleshooting Type - Troubleshooting
Projects
None yet
Development

No branches or pull requests

7 participants