-
Notifications
You must be signed in to change notification settings - Fork 349
Support for Espressif chipsets via ESP-IDF #2142
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Conversation
d9ab49b
to
b3e9d05
Compare
@sirknightj @unicornss do you have comments on this? I would like to speed up the porting process as per your comments, so that the repo can then be used in-time for ESP-IDF based open-source solutions, viz., esp-rainmaker and esp-matter etc. |
4ff89b5
to
b96ece0
Compare
You may want to review the reference integration for the Realtek Ameba Pro2 Mini board at: https://github.com/awslabs/freertos-webrtc-reference-on-amebapro-for-amazon-kinesis-video-streams. This reference integration utilizes our OS-agnostic libraries. You can adopt a similar approach to develop an integration for the ESP platform. |
This solution in my particular PR is the working one. Only requiring the discussion on the final structure of the code to make it acceptable. The approach you have shared is completely different take from what I've achieved. The particular ameba implementation does not use this repo, and hence I cannot go yet another implementation approach using multiple components. My goal is to get this repo adopted on ESP platforms and make the existing sources/APIs generic enough as is to be able to be used for ESP chipsets. |
6ad13b1
to
7f787a0
Compare
39f8a4a
to
278e573
Compare
- Avoids libwebsockets taking control over using raw fread/nvs APIs - The SDK, hence, do not need to rely on libwebsockets method
- Handle partial writes by sending data in multiple iterations - Use retries when message send fails - Track and handle message receive if in parts using `receiveMessage` var
- Retries increased from 3 to 10 - Consider ENOMEM or PBUF errors also for retries These changes help to retain sockets longer for embedded devices
- Use dynamically allocated WSS URL - Use dynamic allocations for singaling payload - Use required only allocations in LwsApiCalls instead large static arrays
- Added ifaddr altenate for ESP-IDF - Created abstracted API for IDF_CMAKE platform to query local IP - Do not treat SO_SNDBUF not available as fatal
- Use custom thread implementation for receiveLwsMessageWrapper - Custom thread implementation for connectionListener
- esp_hosted + esp_wifi_remote enabled chipsets not having wifi/BT to use it via n/w adapter - network_coprocessor component can be use with network_adapter
- Cleanly added the support under esp_port directory - Added ESP specific components, submodules and an webrtc_classic example - Added `app_common` needed as a common functionality for webrtc example/s. - Added network_adapter example: Needed when we want to use the webrtc_classic on P4+C6 board
- Added esp_websocket_client over libwebsockets for ESP-IDF - Using this as default for ESP port as it provides better flexibility for ESP-IDF
- Refactored webrtc_message re-assembly logic to message utils - Any componenent can include message_utils.h to leverage the same - Use message_utils in webrtc_bridge and register for network_coprocessor messages
- This component is specifically designed to exchange messages between signaling and streaming planes of the WebRTC - For example, if we want to implement only the streaming part of the webrtc and get signaling messages relayed to it, another device can implement signaling and relay those messages to streaming plane
- It helps packing and unpacking of signaling messages - These serialized messages then can be transfered on any transport
- Added streaming_only and signaling_only examples - streaming_only can be flashed on P4 and signaling only on C6 - The message exchange between the two happens over webrtc_bridge
- esp_port/README.md: Added complete description and setup guide for ESP chipsets - esp_port/README.md: Describe two solutions: webrtc_classic and split mode - Added puml diagrams under esp_port/docs showcasing the workflow in both modes - Added a README under example/app_common/spiffs/certs/
- Patch1: Support LWIP in split_mode - Patch2: Work-around for STATUS define
278e573
to
ea74bf0
Compare
### Install pkg-config | ||
|
||
```bash | ||
sudo apt-get install pkg-config |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would recommend adding the sudo apt-get update
step just in case.
- AWS_KVS_LOG_LEVEL | ||
|
||
- You may override the above settings in `main/app_main.c` file of the example also. | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggest also adding the commands to use the idf.py to:
- Connect the board to your computer (micro usb)
- Build the project
- Flash project onto the ESP board (and any buttons that need to be pressed or held down during the flash, any LED indicators that we can look for)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps also some links to troubleshooting documentation in case there is something blocking USB access in the computer (the board is not reachable)
|
||
- ESP_WIFI_SSID | ||
- ESP_WIFI_PASSWORD | ||
- ESP_MAXIMUM_RETRY |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the majority of the fields here are self explanatory, except ESP_MAXIMUM_RETRY.
Perhaps we can make a table with the options along with a description.
@@ -0,0 +1,92 @@ | |||
@startuml |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I saw this which you might want to look at -- to get these displayed in one of the readmes: https://github.com/Zingam/UML-in-Markdown
Alternatively, GitHub supports mermaid diagrams - https://github.blog/developer-skills/github/include-diagrams-markdown-files-mermaid/
- AWS_SECRET_ACCESS_KEY | ||
- AWS_DEFAULT_REGION | ||
- AWS_KVS_CHANNEL | ||
- AWS_KVS_LOG_LEVEL |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I saw some sample frames in one of the folders, would it make sense to have an option to use the camera sensor vs. pre-generated frames?
frame.frameData = pSampleConfiguration->pVideoFrameBuffer; | ||
frame.size = frameSize; | ||
|
||
CHK_STATUS(app_media_read_frame_from_disk(frame.frameData, &frameSize, filePath)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see the frames being read from here
*** This is a placeholder PR: Not to be merged ****
This PR is meant to showcase the work which will bring the support for ESP-IDF build support and hence the Espressif chipsets.
Structure:
esp_port
directory.Setup ESP-IDF
Setup ESP_IDF with release/v5.4 branch: https://docs.espressif.com/projects/esp-idf/en/stable/esp32/get-started/linux-macos-setup.html
BUILD
Flash the code on chip and run monitor
The work is under progress, will keep rebasing as and when common functionality code keeps getting into main repository.
@sirknightj @unicornss
We have two options:
esp_port
maintained by Espressif with some suitable name under espressif/ organisation. It will useamazon-kinesis-video-sdk-c
as a submodule or need developer to set path of cloned repo.We can keep this PR for discussion ground continue discussion on other aspects of how best we can go about this. I prefer the option 1, simply because it remains maintained under single roof without needing to constant rebasing.