Marvee Amasi
Marvee Amasi
Have anyone worked with nucleo board lwip to send data to aws iot core
Load the AWS IoT certificates
mg_tls_opts cert_options;
mg_tls_opts cert_options;
Your device certificate
cert_options.cert = "/path/to/device_cert.pem";

cert_options.cert = "/path/to/device_cert.pem";

Your private key
cert_options.key = "/path/to/private_key.pem";
cert_options.key = "/path/to/private_key.pem";
Amazon root CA certificate
cert_options.ca = "/path/to/root_ca.pem";

cert_options.ca = "/path/to/root_ca.pem";

Then after u can Initialize the connection to AWS IoT as in
struct mg_connection *conn = mg_connect(&mgr, "ssl://ur-endpoint-stuff.amazonaws.com:8883", event_handler);

if (conn == NULL) {
printf("Failed to connect to AWS IoT Core or anything u want to \n");
return;
}
struct mg_connection *conn = mg_connect(&mgr, "ssl://ur-endpoint-stuff.amazonaws.com:8883", event_handler);

if (conn == NULL) {
printf("Failed to connect to AWS IoT Core or anything u want to \n");
return;
}
Then u shuld enable TLS with the provided certificates
mg_tls_init(conn, &cert_options);
mg_tls_init(conn, &cert_options);
8 replies