Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Web RTC #7717

zekageri started this conversation in Ideas
Web RTC #7717
Jan 15, 2023 · 3 comments · 8 replies
Discussion options

I'm thinking about a web rtc implementation for esp32 arduino. Somebody has any idea or clue how would it work out?
Could this be a library or should it be a native thing? It would be really helpfull even just the data channel part. P2P communication would be a really huge thing in the IOT world.

You must be logged in to vote

Replies: 3 comments 8 replies

Comment options

I'm not aware of any WebRTC implementation for ESP32. The closest is ESP32 supports MQTT. This is the only web search that provides any hope:
https://www.reddit.com/r/esp32/comments/atnl6r/esp32_anywhere_access_webrtc_stun_turn_ice/

It's also possible that Arduino libraries implement WebRTC in a way that could run on ESP32.

You must be logged in to vote
0 replies
Comment options

There is Husarnet but it requires a custom firmware for the esp32. This is not an ideal solution. Mqtt is great but not a p2p solution. What I'm thinking on is a real secure p2p within a browser client and the esp32 from anywhere.

For now, because the esp32 has barely supports https we only have unsecured ways like port forwarding and such.

You must be logged in to vote
0 replies
Comment options

Did you make any progress on this? Did you try https://github.com/sepfy/libpeer ?

You must be logged in to vote
8 replies
Comment options

Unfortunately not. Libpeer does not work on arduino and other vpn solutions require some spec server. Husarnet working on a library instead of a complete redesign of the idf framework but it will lock into their environment.

I went with a node js server and forwarding every message trought wss to the clients and back.

Other solutions does not exists or would be too difficult to write on my own.

Comment options

@zekageri Can u give some more details on communication between nodejs side and arduino, and how does nodejs mediates msgs between arduino and webrtc/turn client etc

What i am thinking is : i can have a turn server installed, where arduino will connect... and i can have a nodejs/go/python app on host pc that will work as turn client and that way arduiono can communicate with host pc

However, i have hard time finding out a suitable library, i dont need full wrtc support,

Comment options

As i said, libpeer does not work with Arduino. And this is the only implementation of a webrtc for esp32. You need to do it with IDF

Comment options

@zekageri I understand libpeer doesnt work with arduino, i am looking for ideas on what was ur alternative solution,
Also i am not looking for a full webrtc support, a TURN server can be used to get p2p communication working, if i can find a proper client side library for TURN.

Would be great if u can give details about ur nodejs based solution, even if it doesnt use webrtc, STUN or TURN or any thing like that

If nothing works (or easy to implement) i can just go with a reverse tunnel like frp or chisel etc

Comment options

I have made my own solution. Esp connects to server with native idf websocket client using https. Esp sends every message to server. If the server got any http or ws request from a client it forwards it to the esp32 on websockets. Basically thats it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

AltStyle によって変換されたページ (->オリジナル) /