-
Couldn't load subscription status.
- Fork 7.7k
-
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.
Beta Was this translation helpful? Give feedback.
All reactions
Replies: 3 comments 8 replies
-
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.
Beta Was this translation helpful? Give feedback.
All reactions
-
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.
Beta Was this translation helpful? Give feedback.
All reactions
-
Did you make any progress on this? Did you try https://github.com/sepfy/libpeer ?
Beta Was this translation helpful? Give feedback.
All reactions
-
👀 1
-
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.
Beta Was this translation helpful? Give feedback.
All reactions
-
@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,
Beta Was this translation helpful? Give feedback.
All reactions
-
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
Beta Was this translation helpful? Give feedback.
All reactions
-
@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
Beta Was this translation helpful? Give feedback.
All reactions
-
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.
Beta Was this translation helpful? Give feedback.
All reactions
-
👍 1