Skip to content
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

Can this program run on Esp-IDF environment? #35

Open
DanielFujiwara opened this issue Sep 21, 2020 · 4 comments
Open

Can this program run on Esp-IDF environment? #35

DanielFujiwara opened this issue Sep 21, 2020 · 4 comments

Comments

@DanielFujiwara
Copy link

I downloaded your file(Micro RTSP) on GitHub recently.And I had some problems during using it.
Here is the problems:
1.Your program is base on Arduino IDE. Can this program run on Esp-IDF environment?
2.Will you write a ESP IDF version in the future?
I sent a email to you,too.
Thank you.

@ameerhazo
Copy link

you can use esp idf api in arduino core.

@brainrecall
Copy link

I just created an esp-idf example. It can be found here: https://github.com/brainrecall/Micro-RTSP/tree/master/examples/esp-idf

@ameerhazo
Copy link

ameerhazo commented Jun 18, 2021

@brainrecall wow cool! I'll take a look into it. Btw this original Micro-RTSP is written in C++ right? The ESP-IDF is in C and if i remember correctly, if you want to use C++ code in ESP-IDF, you would need to change main.c to main.cpp and write extern "C" for app_main() for it to build. This what I had to do back when I used the Arduino code (C++) in the ESP-IDF environment. Great job! Can you tell me how you managed to do it?

@brainrecall
Copy link

Thanks! I started with the example from esp-idf/examples/wifi/getting_started/station as the base. The usage of Micro-RTSP I based on the POSIX-compliant code from this libraries test at test/RTSPTestServer.cpp. I did discover a bug in esp-idf where SO_RCVTIMEO with a timeout of zero is actually blocking, so I had to change tcpsocketread() to use select() instead. I then bolted together a few other examples for MQTT and OTA updates. I also pulled in performance updates from the esp-idf/examples/wifi/iperf example which is greatly missing from the Arduino framework.

I should note, though, the example I wrote will only work with my branch. I should give credit to @kadavris who rewrote the RTSP command sequence handling that greatly improves the connection handshake. I made several other changes to his work to improve buffer handling and actually removing the multiple-client support as that was broken (couldn't handle multiple UDP clients, for one). However, running multiple tasks like I do in the esp-idf example allows multiple clients to work easily.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants