aws / amazon-freertos

DEPRECATED - See README.md
https://aws.amazon.com/freertos/
MIT License
2.54k stars 1.1k forks source link

Examples of Custom Projects or Documentation #1940

Closed jsinglet closed 4 years ago

jsinglet commented 4 years ago

In following the documentation, it seems that the "correct" way to develop your custom application is to drop freertos in a directory, create a src directory at the top level, and build from there. Something like this:

freertos
src
CmakeLists.txt

However, there is no MWE for how to do this or what should go in the main.c file. I've managed to cobble together things by looking at the demos but I think much more needs to be done to explain this. For example, I learned that there are various functions that must be implemented for it to compile, for example: vApplicationDaemonTaskStartupHook. I've combed through the documentation and I cannot find any indication of what the requirements for standalone applications are. Also, no mention of the details of app_main in the case of the ESP32, which is the entry point that is expected.

I think what is needed is a way to understand the structure of the application and specific instructions on how to pull in and use each component rather than trying to work it out from the demo code.

Additionally, there is a graphic in the documentation that suggests that the way one develops an app is by creating a custom distribution of freertos in the console, downloading it, and then developing your app. It is not clear however what that last step means. Is the intention that you modify the demos?

I think without these items it will be very hard to use amazon-freertos for many people.

aggarg commented 4 years ago

I think what is needed is a way to understand the structure of the application and specific instructions on how to pull in and use each component rather than trying to work it out from the demo code.

Thank for providing the feedback about our documentation. We strive to continuously improve our documentation to best serve our customers and we look forward to the feedback.

Meanwhile, you can look at this project created by my teammate @tgsong to demostrate how to set up a CMake project for ESP32 and use FreeRTOS as an external library: https://github.com/tgsong/amazon-freertos-examples

Additionally, there is a graphic in the documentation that suggests that the way one develops an app is by creating a custom distribution of freertos in the console, downloading it, and then developing your app. It is not clear however what that last step means. Is the intention that you modify the demos?

Yes, the demos are provided to show how to use our libraries and depending on your requirements, may serve to be a starting point.

Thanks.

jsinglet commented 4 years ago

thanks @aggarg -- for what it's worth, this was also helpful to me and possibly to future searchers: https://github.com/kevinresol/amazon-freertos-hello-world

Yes, the demos are provided to show how to use our libraries and depending on your requirements, may serve to be a starting point.

I think the confusion for me and perhaps others is if the intent is to just modify the demos where they exist and base your application off of those.

From an outsider perspective, a LOT of text is dedicated to talking about the demos and just a few paragraphs about how one might go about developing their own app, which is probably what most people are reading for.

So perhaps these could be helpful suggestions from the outside looking in:

aggarg commented 4 years ago

Thank you for all the suggestions - these are really good suggestions both about the documentation and the demo code. We will try to improve both.

Thanks.

BasemTarek commented 4 years ago

Hello, I still cannot understand how i can develop my custom app using Amazon FreeRTOS, and i did not understand how this project can help me do that.

https://github.com/tgsong/amazon-freertos-examples

I've tried to use it without any enabled demo but i get the following error: #error "No demo to run. One demo should be enabled"

Is this mean that the only way to develop my application is to modify the demo code..!? Can you give me some insight about how can i do that, where is the point that i can start from to do that..?

I think what is needed is a way to understand the structure of the application and specific instructions on how to pull in and use each component rather than trying to work it out from the demo code.

What i need is to use AFreeRTOS for esp32 to connect through AWS Greengrass Core device to AWS IoT Core to publish sensor readings. And i did not know how to modify the iot_demo_mqtt.c to publish my own messages to my specific topic as long as i want, the demo publishes this specific payload #define PUBLISH_PAYLOAD_FORMAT "Hello Basem %d!" for a limited number of times and i don't know how to modify this number even if i modify the following #define TOPIC_FILTER_COUNT ( 4 ) i get some errors.

Thank you.

aggarg commented 4 years ago

If I understand correctly, you want to publish some data to AWS IoT via Greengrass. You will need to setup a Greengrass core first. Assuming that you have a Greengrass core running, publishing data from your edge device requires the following two steps:

The following demo shows how to do the above two steps: https://github.com/aws/amazon-freertos/blob/master/demos/greengrass_connectivity/aws_greengrass_discovery_demo.c

This page documents the above demo: https://docs.aws.amazon.com/freertos/latest/userguide/gg-demo.html

Hope that helps.

Thanks.

yanjos-dev commented 4 years ago

I'm going to close this issue since it has become inactive. Please reopen this issue if you need any further assistance.