Comments (8)
I started with a fresh Ubuntu 16.04 machine and I was able to build by following the getting started guide here: https://docs.aws.amazon.com/freertos/latest/userguide/getting_started_espressif.html
Here is my command history:
sudo apt-get update
sudo apt install build-essential
sudo apt install gcc git wget make libncurses-dev flex bison gperf python python-serial
wget https://dl.espressif.com/dl/xtensa-esp32-elf-linux64-1.22.0-80-g6c4433a-5.2.0.tar.gz
mkdir esp
cd esp
tar -xzf ~/xtensa-esp32-elf-linux64-1.22.0-80-g6c4433a-5.2.0.tar.gz
cd ..
vim ~/.profile
source ~/.profile
printenv PATH
git clone https://github.com/aws/amazon-freertos.git
cd amazon-freertos/demos/espressif/esp32_devkitc_esp_wrover_kit/make/
make
As mentioned in the getting started guide - "Do not install the ESP-IDF library from Espressif, Amazon FreeRTOS already contains this library. In addition, make sure the IDF_PATH environment variable has not been set."
For connecting to Local MQTT Broker, you need to make the following changes:
- Change the broker endpoint - clientcredentialMQTT_BROKER_ENDPOINT macro in file https://github.com/aws/amazon-freertos/blob/master/demos/common/include/aws_clientcredential.h
- If your local broker uses TLS, update the keys in file https://github.com/aws/amazon-freertos/blob/master/demos/common/include/aws_clientcredential_keys.h
- If your broker does not use TLS, define the macro democonfigMQTT_AGENT_CONNECT_FLAGS to 0 in file https://github.com/aws/amazon-freertos/blob/master/demos/espressif/esp32_devkitc_esp_wrover_kit/common/config_files/aws_demo_config.h
Hope that helps.
Thanks.
from amazon-freertos.
Hi,
Would you please share some more details about your setup:
- Which platform are you using (Windows/Linux/Mac)?
- What is the installation path of tool chain?
- If you are using Windows, you may be hitting maximum file path length problem as mentioned here: https://docs.aws.amazon.com/freertos/latest/userguide/getting_started_espressif.html. To confirm would you tell us what is the location of msys32 and Amazon FreeRTOS source code?
Thanks.
from amazon-freertos.
from amazon-freertos.
I worked. It was happening because of IDF path.
MQTT with TLS is not connecting. Without TLS is connecting if i make democonfigMQTT_AGENT_CONNECT_FLAGS to 0
from amazon-freertos.
I am glad that it worked for you.
In order to use TLS, you need to set device certificate and key in file https://github.com/aws/amazon-freertos/blob/master/demos/common/include/aws_clientcredential_keys.h. In addition to that you need to supply the server certificate in MQTT Connect parameters (pcCertificate
and ulCertificateSize
members of the following struct):
typedef struct MQTTAgentConnectParams
{
const char * pcURL; /**< The URL of the MQTT broker to connect to. */
BaseType_t xFlags; /**< Flags to control the behavior of MQTT connect. */
BaseType_t xURLIsIPAddress; /**< Deprecated. Set the mqttagentURL_IS_IP_ADDRESS bit in xFlags instead. */
uint16_t usPort; /**< Port number at which MQTT broker is listening. This field is ignored if the mqttagentUSE_AWS_IOT_ALPN_443 flag is set. */
const uint8_t * pucClientId; /**< Client Identifier of the MQTT client. It should be unique per broker. */
uint16_t usClientIdLength; /**< The length of the client Id. */
BaseType_t xSecuredConnection; /**< Deprecated. Set the mqttagentREQUIRE_TLS bit in xFlags instead. */
void * pvUserData; /**< User data supplied back as it is in the callback. Can be NULL. */
MQTTAgentCallback_t pxCallback; /**< Callback used to report various events. In addition to other events, this callback is invoked for the publish
* messages received on the topics for which the user has not registered any subscription callback. Can be NULL. */
char * pcCertificate; /**< Certificate used for secure connection. Can be NULL. If it is NULL, the one specified in the aws_credential_keys.h is used. */
uint32_t ulCertificateSize; /**< Size of certificate used for secure connection. */
} MQTTAgentConnectParams_t;
Also, if your broker runs on port 8883, the value of xFlags should not contain mqttagentUSE_AWS_IOT_ALPN_443:
xConnectParams.xFlags = mqttagentREQUIRE_TLS;
You will need to change the code in function prvCreateClientAndConnectToBroker
in the file https://github.com/aws/amazon-freertos/blob/master/demos/common/mqtt/aws_hello_world.c.
Hope that helps.
Thanks.
from amazon-freertos.
Did the same thing. Configured the keys also. But it is not connecting.
These keys works wth esp-idf also.
No error while packet tracing also. Can i also put CA cert in place of clientcredentialJITR_DEVICE_CERTIFICATE_AUTHORITY_PEM ??
from amazon-freertos.
You should not need to change clientcredentialJITR_DEVICE_CERTIFICATE_AUTHORITY_PEM
in order to connect to local broker.
Which local broker are you using? If that comes with a client, can you verify that key and certificates work with that client?
from amazon-freertos.
Thanks It worked.
from amazon-freertos.
Related Issues (20)
- [BUG] `CORE_MQTT_MUTUAL_AUTH` Demo: Failed to establish new connection HOT 5
- [BUG] pPublishInfo->payloadLength changes after call to sendPacket HOT 6
- [BUG] MbedTLS version not reflected within git modules. HOT 2
- [BUG] Array bound warning observed in iot_test_tcp.c HOT 2
- [General] Where is esp_hw_support component ? HOT 1
- [Feature Request] Allow to define custom 'help' command in freertos-cli HOT 2
- nvs_flash_init() panics HOT 1
- [BUG] Lacking a check for the return value of mbedtls_ssl_conf_own_cert() HOT 1
- [Feature Request] Update submodule "vendors/espressif/esp-idf" to release/v4.4 of esp-afr-sdk HOT 2
- [General] Unable to access esp-idf ble_wifi_provisioning component HOT 9
- [General] Cannot use Bluedroid, NVS crashes/panics HOT 15
- [General] BLE service to leverage IOT BLE data transfer service HOT 1
- ESP32 compiled binary shows absolute file path when walked through using binwalk HOT 6
- [General] STM32L4 discovary board AWS IoT Tera Term Error HOT 5
- [BUG] ESP32 Port SPI Error with S3 HOT 2
- [BUG] Trace output of ESP32-DevKitC jobs demo is clobbered HOT 2
- [General] Ethernet AWS MQTT DNS Network Error HOT 4
- [General] Is there a reason, why there is almost two months no merge in main? HOT 5
- [General] ESP32S3 OTA fails due to not multiple of 16 bytes
- [General] esp_ota_begin fails in simple example 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 amazon-freertos.