Amazon FreeRTOS Configuration issue with ESP32 DevKitC

KV_KP wrote on May 28, 2019:

While configuring, I have done the following:

  1. using mingw32.exe, verified that I have Python 2.7.15

  2. performed the easy_intall awscli

  3. ran aws configure with my id and keys.

  4. installed boto3 with easy_install boto 3

  5. updated the configure.json file’s attributes:
    {
    “afr_source_dir”:“C:/Users/KV/Desktop/AWS_eval/amazon-freertos-master”,
    “thing_name”:“KV_ESP32_thing”,
    “wifi_ssid”:“xxxx”,
    “wifi_password”:“xxxx”,
    “wifi_security”:“WPA2”
    }
    //note- for ssid and password, i don’t have xxxx in my actual file. I have my actual ssid and password.

  6. Now I was trying to run the python SetupAWS.py setup from mingw32 shell but got the below error:
    ======================
    $ python SetupAWS.py setup
    Traceback (most recent call last):
    File “SetupAWS.py”, line 205, in
    setup()
    File “SetupAWS.py”, line 157, in setup
    prereq()
    File “SetupAWS.py”, line 27, in prereq
    if not thing_obj.create():
    File “thing.py”, line 13, in create
    assert self.exists() == False, “Thing already exists”
    File “thing.py”, line 25, in exists
    list_of_things = self.client.list_things()[‘things’]
    File “C:/msys32/mingw32/lib/python2.7/site-packages/botocore-1.12.156-py2.7.egg/botocore/client.py”, line 357, in _api_call
    return self._make_api_call(operation_name, kwargs)
    File “C:/msys32/mingw32/lib/python2.7/site-packages/botocore-1.12.156-py2.7.egg/botocore/client.py”, line 661, in _make_api_call
    raise error_class(parsed_response, operation_name)
    botocore.exceptions.ClientError: An error occurred (500) when calling the ListThings operation (reached max retries: 4): Internal server error
    ======================
    Appreciate any help, I am not sure what I am missing.

Other notes:

  • my current file location for this is:
    C:\Users\x007007\Desktop\AWS_eval\amazon-freertos-master\tools\aws_config_quick_start

Normally, this script supposed to do the following:

  1. Creates an IoT thing, certificate, and policy
  2. Attaches the IoT policy to the certificate and the certificate to the AWS IoT thing
  3. Populates the aws_clientcredential.h file with your AWS IoT endpoint, Wi-Fi SSID, and credentials
  4. Formats your certificate and private key and writes them to the aws_clientcredential.h header file

mradula-aws wrote on May 29, 2019:

Hello,

  1. Would you be able to verify if the Thing you are creating already exists in your account? The setup script has to be used to create Thing, certificate and policy for the 1st time. But if the Thing already exists in you AWS account, it will throw an error.
  2. It also shows that you are getting 500 error from the server. Can you run the command aws iot list-things on you command line to see if it works.

KV_KP wrote on May 29, 2019:

  1. I never created the thing, but I still double checked its not there.
  2. yes, aws iot list-things command works and gives me the list of other things in my account.

mradula-aws wrote on May 30, 2019:

It looks like there is high API usage in the AWS region that you are creating the Thing in. Would it be possible for you to change the region and retry. You will need a different IAM user in that region.Also, you have to run aws configure again for the new IAM user Access Key and Secret Key.

1 Like

KV_KP wrote on May 31, 2019:

I gave up on FreeRTOS and ended up using MongooseOS which worked almost seamlessly.
MongooseOS - [https://mongoose-os.com/aws-iot-starter-kit/#dev]
(see link below for one minor issue that I had.)
[https://superuser.com/questions/1442729/esp32-wifi-constantly-fails-to-connect-and-returns-201]

TiglathIII wrote on June 05, 2019:

Hi @KV_KP, I noticed that you were using “WPA2” for “wifi-security”. This value actually needs to be “eWiFiSecurityWPA2”.

Cheers…

Gaurav-Aggarwal-AWS wrote on June 21, 2019:

Very good catch. Thanks for pointing this out.

We have updated our script to throw error in case of incorrect WiFi security value: https://github.com/aws/amazon-freertos/pull/822

Thanks.