arendst / Tasmota

Alternative firmware for ESP8266 and ESP32 based devices with easy configuration using webUI, OTA updates, automation using timers or rules, expandability and entirely local control over MQTT, HTTP, Serial or KNX. Full documentation at
https://tasmota.github.io/docs
GNU General Public License v3.0
22.1k stars 4.79k forks source link

Can't connect to Azure IoT Hub (ESP8266EX) #16510

Closed peterrre closed 1 year ago

peterrre commented 2 years ago

PROBLEM DESCRIPTION

Hi,

i am trying to connect my device (ESP8266EX) to the Azure IoT Hub. I tried several compiling and configurations but still no success.

My current output from the cosole:

06:15:52.088 MQT: Authenticating with an Azure IoT Hub Token 06:15:52.201 MQT: TLS connection error: 1 06:15:52.204 MQT: Connect failed to host1.azure-devices.net:8883, rc -2. Retry in 70 sec

I followed the Azure IoT Hub guidline https://tasmota.github.io/docs/Azure-IoT-Hub/ and enabled: #ifndef USE_MQTT_TLS #define USE_MQTT_TLS #endif #define USE_MQTT_AZURE_IOT

SetOption 132 1

Inside MQTT configuration: CLIENT, USER, TOPIC and FULL TOPIC have the same value.

I also tried to create a second Azure IoT Hub with the preview features enabled (changes the ciphers) but still no success to connect.

REQUESTED INFORMATION

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

- [ ] If using rules, provide the output of this command: `Backlog Rule1; Rule2; Rule3`:
```lua
  Rules output here:
- [ ] Set `weblog` to 4 and then, when you experience your issue, provide the output of the Console log:
```lua
  Console output here:

TO REPRODUCE

Steps to reproduce the behavior:

EXPECTED BEHAVIOUR

A clear and concise description of what you expected to happen.

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)

Jason2866 commented 2 years ago

Have you seen #15763 ?

peterrre commented 2 years ago

Yes, maybe I set the wrong TOPIC and FULLTOPIC details. I take the same details I used for Client and User For example:

Host: xyz.azure-devices.net Port: 8883 Client: DeviceID_XYZ User: DeviceID_XYZ TOPIC: DeviceID_XYZ FULLTOPIC: DeviceID_XYZ

is this correct?

Padu98 commented 2 years ago

Hi @peterrre , the error (1) means "invalid fingerprint". Try to reset it via the console: mqttfingerprint1 reset I had the same issue when switching my iothub/device. The old fingerprint has to be reset. Hope that helps!

pexeum90 commented 2 years ago

Have the same issue. Seems like, if the TLS Fingerprint is not generated. Are there any updates or workarounds in this topic?

peterrre commented 1 year ago

@Padu98 your command worked for a certain time.

Now i get a TLS connection error: -1002

github-actions[bot] commented 1 year ago

This issue has been automatically marked as stale because it hasn't any activity in last few weeks. It will be closed if no further activity occurs. Thank you for your contributions.

AaronAutomation commented 1 year ago

Exact same issue as above for me also. I pinged the Tasmota Discord and didn't have any luck there either. image

s-hadinger commented 1 year ago

It looks like TLS works, but credentials are rejected. Can you make sure they are not truncated? Also does Azure require a specific ALPN?

paulobriennz commented 1 year ago

same issues here, SSL -1002

paulobriennz commented 1 year ago

as per this thread https://github.com/arendst/Tasmota/issues/14624

If you create an IOT Hub in Central US, turn on preview mode, then you can connect as you would expect above. Something to do with the SSL the Tasmota handles?

github-actions[bot] commented 1 year ago

This issue has been automatically marked as stale because it hasn't any activity in last few weeks. It will be closed if no further activity occurs. Thank you for your contributions.

github-actions[bot] commented 1 year ago

This issue was automatically closed because of being stale. Feel free to open a new one if you still experience this problem.