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

Requesting a sample program for iotedge downstream device (ESPRESSIF ESP32) #2500

Open
wsrimal opened this issue Feb 13, 2023 · 3 comments
Open
Labels
customer-reported Issues that are reported by GitHub users external to the Azure organization. IoT question The issue doesn't require a change to the product in order to be resolved. Most issues start as that

Comments

@wsrimal
Copy link

wsrimal commented Feb 13, 2023

I am struggling to connect my ESP32-based IoT devices to the Azure IoT edge agent running on the Ubuntu server. Please suggest me a sample program for Azure iotedge downstream devices.

Device: ESPRESSIF ESP32
Platform: Arduino
Need to connect: Azure IoT Edge Transparent Gateway

@ghost ghost added needs-triage This is a new issue that needs to be triaged to the appropriate team. customer-reported Issues that are reported by GitHub users external to the Azure organization. question The issue doesn't require a change to the product in order to be resolved. Most issues start as that labels Feb 13, 2023
@danewalton danewalton added the IoT label Feb 22, 2023
@ghost ghost removed the needs-triage This is a new issue that needs to be triaged to the appropriate team. label Feb 22, 2023
@electro89
Copy link

Any progress on this @danewalton ?

@ghost
Copy link

ghost commented May 17, 2023

I am attempting to do the same thing with a Nordic-based device. I have also created a help ticket with Nordic here.

Any guidance or feature additions would be greatly appreciated, as this will be critical to our deployment.

@jeffvan98
Copy link

jeffvan98 commented Sep 22, 2023

@wsrimal and @ghost: you might try looking at the ESP8266 sample.

This can be adjusted to work with IoT Edge by changing the call to mqtt_client.setServer so that the first input parameter points to your edge device and not the FQDN of IoT Hub.

Next, I think you need to make an adjustment to the X509List variable (cert) so that it points to the root CA used to generate the certificate on your IoT Edge device. To do this, you'll need to have the PEM file for your root CA certificate, and I think you need to convert it to an array of unsigned char. It would look someting like:

unsigned char my_pem[] = {
0x2d, 0x2d, 0x2d, ...
};
 
Then, if you're anything like me, you may still have problems due to certificate validation. If that's the case, you can call setInsecure on the WiFiClientSecure class - but, of course, this would compromise the security of your solution. For me, I think the real fix to this security issue is to change the certificate on IoT Edge so that its subject name matches its host name.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
customer-reported Issues that are reported by GitHub users external to the Azure organization. IoT question The issue doesn't require a change to the product in order to be resolved. Most issues start as that
Projects
None yet
Development

No branches or pull requests

4 participants