-
Notifications
You must be signed in to change notification settings - Fork 20
MQTT send failed, not authorized #13
Comments
Hello. Have same problem, try to fix it 2 days in a row. The only thing I found out - its wrong fetched time (you can see in Thu Jan 1 00:01:01 1970). And i don't know how to fix it. Work on Arduino 1.8.5 I think if we can get correct time - we can do authorization Do any have solution to this problem ? |
I did fix this issue by using the arduino libs to get date time of the ntp server but I should look up where in the code. This is a sub task at or company, not urgent. Try this: espressif/arduino-esp32#935. |
@FlorisColpaert ty for reply. I'm maybe trying ESP32, but i have ESP8266 and it will be great to find solution for it. |
@AlexeyKopchak This is also available on the esp8266 |
@FlorisColpaert if it's work - where i need to put correct time on Azure mqtt lib ? |
I find solution to my problem: i change wi-fi point (i use work free wi-fi and i dont know it configuration but im trying to get it), i use android phone as router (3G) and it start work, i get correct time and my packed now valid. If i have new detail - i report here. |
UPD. Time works only on 2.3.0 version of Arduino ESP8266 lib |
I solved that by putting the delay(1000); after configTime(...). |
hello @AlexeyKopchak @FlorisColpaert I'm trying to connect ESP8266 with Azure cloud as per given Example Edit my wifi routers connection and "HostName=<host_name>;DeviceId=<device_id>;SharedAccessKey=<device_key>" hey @anmalkov |
Issue appears resolved. |
Hey, I tried to send data to a device. I get the message not authorized. (I'm using the ESP32 and on Ubuntu with esp32makearduino).
Now I noticed in the error logging, the date time with your timer was incorrect. Could this be an issue? I allready runned the code with ESP-IDF and ESP32-Azure IOT. Then it works with the same connecting string. Do I have to set your time.h used library?
K.R.
Floris
-- or logger --
2018/05/14 13:27:20 FanController Warn Fan stopped, rebooting the motor
2018/05/14 13:27:24 FlowRateCalculator Warn interpolation failed
-- your code --
Info: IoT Hub SDK for C, version 1.1.29
IoTHubClient accepted the message for delivery
Error: Time:Thu Jan 1 00:01:01 1970 File:./libs/azure-iot_arduino/src/sdk/iothubtransport_mqtt_common.c Func:mqtt_operation_complete_callback Line:1552 Connection Not Accepted: 0x5: Not Authorized
Error: Time:Thu Jan 1 00:01:02 1970 File:./libs/azure-iot_arduino/src/sdk/iothubtransport_mqtt_common.c Func:mqtt_operation_complete_callback Line:1552 Connection Not Accepted: 0x5: Not Authorized
Error: Time:Thu Jan 1 00:01:02 1970 File:./libs/azure-iot-arduino-protocol-mqtt/src/azure_umqtt_c/mqtt_client.c Func:sendPacketItem Line:332 141: Failure sending control packet data
Error: Time:Thu Jan 1 00:01:02 1970 File:./libs/azure-iot-arduino-protocol-mqtt/src/azure_umqtt_c/mqtt_client.c Func:mqtt_client_disconnect Line:1176 Error: mqtt_client_disconnect send failed
Message Id: 0 Received.
Result Call Back Called! Result is: IOTHUB_CLIENT_CONFIRMATION_BECAUSE_DESTROY
The text was updated successfully, but these errors were encountered: