zephyrproject-rtos / zephyr

Primary Git Repository for the Zephyr Project. Zephyr is a new generation, scalable, optimized, secure RTOS for multiple hardware architectures.
https://docs.zephyrproject.org
Apache License 2.0
10.79k stars 6.58k forks source link

Issue in connection with aws #61526

Closed tanmaygoyal875 closed 1 year ago

tanmaygoyal875 commented 1 year ago

I want to send the images captured from camera which has integreted with the stm32f412g_disco microcontroller using the Quectel EC200U-CN 4G module for GSM connection. I am using the Zephyr library for that. The Zephyr has provided support for publishing data to AWS IoT Core using the MQTT protocol as per given in https://github.com/zephyrproject-rtos/zephyr/tree/main/samples/net/cloud/aws_iot_mqtt link. I am able to send the data to AWS IoT Core using the MQTT protocol as per there suggestions.

But Zephyr does not provide any support for sending data to an S3 bucket for AWS using HTTP. However, Zephyr offered support for sending arbitrary temperature values via HTTP to the TAGOIO server, which I tested, and it works fine as per given in https://github.com/zephyrproject-rtos/zephyr/tree/main/samples/net/cloud/tagoio_http_post link.

The issue that I am facing is "Could not resolve dns, error: -11". This is because the function that Zephyr has defined to get the IP address is not able to resolve the dns for the server address of the AWS S3 bucket. The Function which Zephyr has used for getting server IP address is as follows.

while (dns_attempts--) { ret = getaddrinfo(AWS_SERVER, port, &hints, &addr); if (ret == 0) { break; } k_sleep(K_SECONDS(1)); } where the AWS_SERVERs with port, which I have explored are as follows but getting same error in all the options. S. NO. AWS_SERVER PORT 1.) bucket_name.s3.amazonaws.com 80 2.) bucket_name.s3.region.amazonaws.com 80 3.) http://[bucket_name.s3.amazonaws.com](https://www.google.com/url?q=http://bucket_name.s3.amazonaws.com&source=gmail-imap&ust=1692711361000000&usg=AOvVaw2bAn_zb8cHPz1NUA8_JZlC) 80 4.) http://[bucket_name.s3.region.amazonaws.com](https://www.google.com/url?q=http://bucket_name.s3.region.amazonaws.com&source=gmail-imap&ust=1692711361000000&usg=AOvVaw0DLVtqv7ZZIE9QxKzWp0jY) 80 5.) bucket_name.s3.region.amazonaws.com 443 6.) https://[bucket_name.s3.region.amazonaws.com](https://www.google.com/url?q=http://bucket_name.s3.region.amazonaws.com&source=gmail-imap&ust=1692711361000000&usg=AOvVaw0DLVtqv7ZZIE9QxKzWp0jY) 443

The parameter &hints it is using the TCP connection and will take this parameter automatically. The parameter &addr is used to store the resolved address and also no need to configure this parameter also. the only thing that we have to configure is the AWS_SERVER and port.

You can help in folowing ways. 1.) Can you suggest AWS_SERVER and port for s3. 2.) Can you provide the IP address from the URL of the S3 bucket so that I can connect to s3 and send data to it? 3.) You can provide other way how can I connect to s3 bucket of AWS using Zephyr library.

I shall be very thankful to you.

github-actions[bot] commented 1 year ago

Hi @tanmaygoyal875! We appreciate you submitting your first issue for our open-source project. šŸŒŸ

Even though I'm a bot, I can assure you that the whole community is genuinely grateful for your time and effort. šŸ¤–šŸ’™

fabiobaltieri commented 1 year ago

Closing as duplicated, please reopen if that was not the case.