homieiot / homie-esp8266

πŸ’‘ ESP8266 framework for Homie, a lightweight MQTT convention for the IoT
http://homieiot.github.io/homie-esp8266
MIT License
1.36k stars 307 forks source link

Error with SSL Mosquitto connection #679

Open seineken opened 4 years ago

seineken commented 4 years ago

I'm getting an error when activated the SSL with Let's Encrypt in the Mosquitto broker.

This is the log from the device:

βœ– /homie/config.json doesn't exist Configuration invalid. Using CONFIG MODE Configuration mode started οΏ½πŸ’‘ Firmware growtth-nanny (1.0. οΏ½πŸ”Œ Booting innto config mode Device ID is ecfabc6e221c AP started as GN-ecfabc6e221c with IP 192.168.123.1 Triggering Wi-Fi scan... βœ” Wi-Fi scan completed Triggering Wi-Fi scan... βœ” Wi-Fi scan completed Triggering Wi-Fi scan... βœ” Wi-Fi scan completed Received captive portal request: Redirect: http://192.168.123.1 Received captive portal request: Redirect: http://192.168.123.1 Received captive portal request: Redirect: http://192.168.123.1 Received captive portal request: UI bundle found Triggering Wi-Fi scan... Received captive portal request: Redirect: http://192.168.123.1 βœ” Wi-Fi scan completed Received captive portal request: UI bundle found Received captive portal request: Redirect: http://192.168.123.1 Received captive portal request: Redirect: http://192.168.123.1 Received heart request Received device information request Received captive portal request: Redirect: http://192.168.123.1 Received captive portal request: Redirect: http://192.168.123.1 Received captive portal request: Redirect: http://192.168.123.1 Received captive portal request: UI bundle found Received captive portal request: UI bundle found Received networks request Triggering Wi-Fi scan... βœ” Wi-Fi scan completed Received config request βœ” Configured ↻ Rebooting into normal mode... οΏ½οΏ½οΏ½οΏ½LοΏ½οΏ½DοΏ½οΏ½οΏ½

Normal mode started οΏ½πŸ’‘ Firmware growth-nanny (1.0. οΏ½πŸ”Œ Booting into normal moode {} Stored configuration β€’ Hardware device ID: ecfabc6e221c β€’ Device ID: ecfabc6e221c β€’ Name: Veg β€’ Device Stats Interval: 60 sec β€’ Wi-Fi: β—¦ SSID: * β—¦ Password not shown β€’ MQTT: β—¦ Host: ***** β—¦ Port: 8883 β—¦ Base topic: devices/ β—¦ Auth? yes β—¦ Username: ***** β—¦ Password not shown β€’ OTA: β—¦ Enabled? yes β€’ Custom settings: β—¦ readInterval: 5 (set) ↕ Attempting to connect to Wi-Fi... βœ– Wi-Fi disconnected, reason: 4 Triggering WIFI_DISCONNECTED event... Wi-Fi disconnected, reason: 4 ↕ Attempting to connect to Wi-Fi... βœ” Wi-Fi connected, IP: 192.168.1.5 Triggering WIFI_CONNECTED event... Wi-Fi connected, IP: 192.168.1.5, gateway: 192.168.1.254, mask: 255.255.255.0 ↕ Attempting to connect to MQTT... ↕ Attempting to connect to MQTT... ↕ Attempting to connect to MQTT... ↕ Attempting to connect to MQTT... ↕ Attempting to connect to MQTT... ↕ Attempting to connect to MQTT... ↕ Attempting to connect to MQTT... ↕ Attempting to connect to MQTT... ↕ Attempting to connect to MQTT... ↕ Attempting to connect to MQTT... ↕ Attempting to connect to MQTT... ↕ Attempting to connect to MQTT...

This is the log from Mosquitto broker:

1590086726: Client connection from 179.13.148.144 failed: error:1408F10B:SSL routines:ssl3_get_record:wrong version number. 1590086727: Client connection from 179.13.148.144 failed: error:1408F10B:SSL routines:ssl3_get_record:wrong version number. 1590086731: Client connection from 179.13.148.144 failed: error:1408F10B:SSL routines:ssl3_get_record:wrong version number. 1590086739: Client connection from 179.13.148.144 failed: error:1408F10B:SSL routines:ssl3_get_record:wrong version number. 1590086754: Client connection from 179.13.148.144 failed: error:1408F10B:SSL routines:ssl3_get_record:wrong version number. 1590086777: Client connection from 179.13.148.144 failed: error:1408F10B:SSL routines:ssl3_get_record:wrong version number. 1590086813: Client connection from 179.13.148.144 failed: error:1408F10B:SSL routines:ssl3_get_record:wrong version number.

I'm using Homie 3.0.0

This is my platformio.ini

[env:nodemcuv2] platform = espressif8266 board = nodemcuv2 framework = arduino build_flags = -D PIO_FRAMEWORK_ARDUINO_LWIP2_LOW_MEMORY lib_deps = https://github.com/homieiot/homie-esp8266.git#develop

mkfrey commented 4 years ago

It looks like you haven't enabled SSL. You need to set the flag ASYNC_TCP_SSL_ENABLED.