Comments (7)
FYI, I was able to fix the problem based on the information I found here:
VSChina/ESP32_AzureIoT_Arduino#5
On Jul 19, 2018, lirenhe suggested adding the following code to SNTP_Init() in sntp_lwip.c :
if ( sntp_enabled() ) {
sntp_stop();
}
This did fix the problem. Basically, SNTP_Init() would fail the second time it was called. The above code gracefully terminates/cleans up the existing SNTP code which allows it to be restarted successfully.
I merged that code into this file :
C:\Users...\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.1\libraries\AzureIoT\src\az_iot\c-utility\pal\lwip\sntp_lwip.c
I will try your examples to see if I have any better luck (without needing to modify any library code).
Thank you for your time. :-)
-Jon
from esp-azure.
I forgot to mention that when the code detects that the WiFI has dropped, it will execute an Esp32MQTTClient_Close() call, but that errors out since there is no active WiFi/Azure connection.
from esp-azure.
No responses?? :-? :-(
from esp-azure.
Are you using Arduino based Azure library?
I don't find Esp32MQTTClient_Close()
API in this repository.
from esp-azure.
I thought I was, but honestly, I'm not 100% sure. In my attempts to get my ESP32 working with Azure, I tried a number of different libraries until I found one that worked. According to the Arduino IDE, I have the following Azure related libraries installed:
- AzureIoTHub (by Microsoft, ver 1.0.45)
- AzureIoTHubMQTTClient (by Andri Yadi, ver 0.2.3)
- AzureIoTProtocol_MQTT (by Microsoft, ver 1.0.45)
- AzureIoTUtility (by Microsoft, ver 1.0.45)
Under the File -> Examples menu, I started with ESP32 Azure IoT Arduino -> SimpleMQTT in order to get something working. Once I had this up and running, I wrote my own, based off of the SimpleMQTT example. This is the example that uses "Esp32MQTTClient.h" and the corresponding Esp32MQTTCLient_xxxx() calls. It doesn't use _Close directly, but it's in the include file, so I thought I'd give it a try.
Under the File -> Examples -> INCOMPATIBLE menu, there are several Azure IoT example -- I did not try any of these.
from esp-azure.
@JonS9999 Can you try the samples given at examples directory of this repository?
from esp-azure.
@JonS9999 I will close this issue as problem is fixed. If you still find any problem, please feel free to raise new issue.
from esp-azure.
Related Issues (20)
- When will this project get its next update ot match ESP-IDF V4.x? (CA-128) HOT 1
- Replace printf() with proper ESP_LOGx() (CA-137)
- Device disconnects after ~49 days online (CA-138)
- HSM Module not included (CA-140)
- Send Azure message larger than 5000 bytes (CA-153)
- Update to LTS_07_2021_Ref01 (CA-167) HOT 11
- README update (CA-172)
- Cannot compile project, issues (CA-184) HOT 1
- Not able to auto-reconnect with Azure Cloud (CA-218) HOT 6
- Loss of wifi AP connection results in Azure/TLS errors on recovery (IDFGH-7210) (CA-220) HOT 6
- connection string setup for multiple device (CA-222) HOT 1
- Example iothub_client_sample_mqtt crash (CA-251)
- Delays / waits in Direct Method / Device Twin Callbacks (CA-269)
- prov_dev_client_ll_sample - Failure encountered on registration PROV_DEVICE_RESULT_DEV_AUTH_ERROR (CA-279) HOT 1
- JSON Serialization failed! iothub device twin sample. (CA-290)
- tls error when compiling on esp-idf 5 (CA-295) HOT 4
- No connection with NB-IoT (CA-308) HOT 1
- Azure Blob Storage data fetch fails due to HTTPS Client MBed TLS (IDFGH-11100) (CA-313) HOT 1
- ESP-AZURE on Espressif-IDE (CA-315)
- error: implicit declaration of function 'esp_tls_conn_delete' (CA-319) HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from esp-azure.