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

TLS connection fails on Sonoff SV #5070

Closed
5 of 6 tasks
andreas-bulling opened this issue Jan 30, 2019 · 11 comments
Closed
5 of 6 tasks

TLS connection fails on Sonoff SV #5070

andreas-bulling opened this issue Jan 30, 2019 · 11 comments
Labels
awaiting feedback Action - Waiting for response or more information troubleshooting Type - Troubleshooting

Comments

@andreas-bulling
Copy link

andreas-bulling commented Jan 30, 2019

Make sure these boxes are checked [x] before submitting your issue - Thank you!

Hi, I can't get the TLS connection to work between a Sonoff SV flashed with the latest Tasmota and my Mosquito MQTT broker.

The console output shows

MQT: Attempting connection...
19:02:03 MQT: Connect failed to home.fritz.box:8883, rc -5. Retry in 10 sec

and mosquitto.log

1548871418: New connection from 192.168.178.29 on port 8883.
1548871418: OpenSSL Error: error:1408F10B:SSL routines:ssl3_get_record:wrong version number
1548871418: Socket error on client <unknown>, disconnecting.

I searched for hours online but couldn't find a fix for this. If I compile for a Wemos D1 Mini (same configuration) everything is fine... BTW: I also noticed that the web interface is not very responsive on the Sonoff and sometimes takes several seconds to load a new page. Maybe connected?

@andrethomas2 andrethomas2 added the troubleshooting Type - Troubleshooting label Jan 30, 2019
@ascillato2
Copy link
Collaborator

Hi, please, share your status 0

@ascillato2 ascillato2 added the awaiting feedback Action - Waiting for response or more information label Jan 31, 2019
@andreas-bulling
Copy link
Author

andreas-bulling commented Jan 31, 2019

I've REMOVED some values - as mentioned, same configuration works fine on a Wemos D1 Mini.

06:13:04 RSL: Group 0, Index 1, Command STATUS, Data 0

06:13:04 RSL: stat/relay/STATUS = {"Status":{"Module":1,"FriendlyName":["Relay"],"Topic":"relay","ButtonTopic":"0","Power":0,"P
owerOnState":3,"LedState":4,"SaveData":1,"SaveState":1,"SwitchTopic":"0","SwitchMode":[0,0,0,0,0,0,0,0],"ButtonRetain":0,"Switc
hRetain":0,"SensorRetain":0,"PowerRetain":0}}
06:13:04 RSL: stat/relay/STATUS1 = {"StatusPRM":{"Baudrate":115200,"GroupTopic":"sonoffs","OtaUrl":"REMOVED","RestartReason":"Power on","Uptime":"0T00:01:12","StartupUTC":"2019-01-31T05:11:52","Sleep":50,"BootCount":1,"Sa
veCount":3,"SaveAddress":"F9000"}}
06:13:04 RSL: stat/relay/STATUS2 = {"StatusFWR":{"Version":"6.4.1.11(basic)","BuildDateTime":"2019-01-31T06:10:12","Boot":7,"Co
re":"2_4_2","SDK":"2.2.1(cfd48f3)"}}
06:13:04 RSL: stat/relay/STATUS3 = {"StatusLOG":{"SerialLog":3,"WebLog":2,"SysLog":1,"LogHost":"REMOVED","LogPort":514,"
SSId":["REMOVED",""],"TelePeriod":300,"SetOption":["00088009","558180C0","00000000"]}}
06:13:04 RSL: stat/relay/STATUS4 = {"StatusMEM":{"ProgramSize":390,"Free":612,"Heap":28,"ProgramFlashSize":1024,"FlashSize":102
4,"FlashChipId":"146085","FlashMode":3,"Features":["00000809","00002480","24000000","00000004","000000C0"]}}
06:13:04 RSL: stat/relay/STATUS5 = {"StatusNET":{"Hostname":"relay-3168","IPAddress":"192.168.178.29","Gateway":"192.168.178.1"
,"Subnetmask":"255.255.255.0","DNSServer":"192.168.178.1","Mac":"REMOVED","Webserver":2,"WifiConfig":4}}
06:13:04 RSL: stat/relay/STATUS6 = {"StatusMQT":{"MqttHost":"REMOVED","MqttPort":8883,"MqttClientMask":"DVES_%06X","Mqtt
Client":"DVES_684C60","MqttUser":"admin","MqttType":1,"MAX_PACKET_SIZE":1000,"KEEPALIVE":15}}
06:13:04 RSL: stat/relay/STATUS7 = {"StatusTIM":{"UTC":"Thu Jan 31 05:13:04 2019","Local":"Thu Jan 31 10:13:04 2019","StartDST"
:"Sun Mar 31 02:00:00 2019","EndDST":"Sun Oct 27 03:00:00 2019","Timezone":"+05:00"}}
06:13:04 RSL: stat/relay/STATUS10 = {"StatusSNS":{"Time":"2019-01-31T06:13:04"}}
06:13:04 RSL: stat/relay/STATUS11 = {"StatusSTS":{"Time":"2019-01-31T06:13:04","Uptime":"0T00:01:12","SleepMode":"Dynamic","Sle
ep":50,"LoadAvg":19,"POWER":"OFF","Wifi":{"AP":1,"SSId":"REMOVED","BSSId":"REMOVED","Channel":1,"RSSI":100}}}

I also tried running the ESP at 160Mhz as described here: #146 (comment)
But still no success :(

@ascillato2
Copy link
Collaborator

Your config seems ok. So, if the RSSI is 100% you also have a perfect wifi signal. Have you tried to erase all flash with esptool.py as explained in the wiki for the device that don't work, and then flash the firmware again?

@majherek
Copy link

@andreas-bulling Aye you use webserver and MQTT TLS in the same time?

@andreas-bulling
Copy link
Author

Your config seems ok. So, if the RSSI is 100% you also have a perfect wifi signal. Have you tried to erase all flash with esptool.py as explained in the wiki for the device that don't work, and then flash the firmware again?

This I didn't do yet. Will give it a try and report back, thanks!

@andreas-bulling
Copy link
Author

@andreas-bulling Aye you use webserver and MQTT TLS in the same time?

I've tried both - with and without. No difference :(

@andreas-bulling
Copy link
Author

Your config seems ok. So, if the RSSI is 100% you also have a perfect wifi signal. Have you tried to erase all flash with esptool.py as explained in the wiki for the device that don't work, and then flash the firmware again?

Erased the flash and reflashed with Tasmota - no difference :(

@andreas-bulling
Copy link
Author

andreas-bulling commented Feb 1, 2019

I tried with esphomelib. First it didn't work but after setting tls_version tlsv1 for mosquitto the node could successfully connect and I could flip the switch. Back to Tasmota and things don't work any more...

@andreas-bulling
Copy link
Author

I switched to esphomelib completely. Has the additional benefit that I don't need mqtt anymore thanks to the esphomelib native home assistant interface

@ascillato
Copy link
Contributor

Sorry to hear that. Anyway, I agree that you need to use what best suits your needs.

@ascillato2
Copy link
Collaborator

This issue was very weird due to in one hardware it works and in another it doesn't.
Anyway, if you want to try again in the future, please do not hesitate on asking to reopen this issue or asking anything else.

One thing I was about to ask you was if the mqtt client name was different in both devices. It should to make it work.

Hope that now it is working ok for you. Thanks for all the testings.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting feedback Action - Waiting for response or more information troubleshooting Type - Troubleshooting
Projects
None yet
Development

No branches or pull requests

5 participants