depthai-experiments icon indicating copy to clipboard operation
depthai-experiments copied to clipboard

Webserver not working offline

Open JuanFuriaz opened this issue 3 years ago • 5 comments

Hi Luxionis Team, I can not connect to the camera when I'm offline. The main.py shows:

======== Running on http://0.0.0.0:9999 ========
(Press CTRL+C to quit)

while the web-browser console shows:

client.mjs:31 [PC] ICE Gathering state:  new
client.mjs:35 [PC] ICE Connection state:  new
client.mjs:39 [PC] Signaling state:  stable
client.mjs:37 [PC] Signaling state:  have-local-offer

If I switch on the WiFi or Ethernet everything works correctly.

Do you have any idea why after have-local-offer I can't make the connection?

Thanks in advance!

Best regards Juan

JuanFuriaz avatar Feb 01 '22 14:02 JuanFuriaz

Hi @JuanFuriaz, WebRTC used in this experiment requires an internet connection as it seeks for ICE and STUN/TURN servers for communication (internal WebRTC mechanism) Since the app is offline, it stops at "have-local-offer" as it doesn't receive any ICE candidates and cannot send this offer to the server (and therefore establish the direct connection)

I would recommend either using the MJPEG experiment or the RTSP experiment

VanDavv avatar Feb 09 '22 12:02 VanDavv

@VanDavv can we host these servers locally as well?

themarpe avatar Feb 09 '22 15:02 themarpe

Hi @VanDavv and @themarpe, I already made a lot of adaptation for my prototype so that I wouldn't like to start from scratch with other experiments. I'll first try to run locally the STUN/TURN servers with https://openvidu.io/ if it doesn't work I'll change to your recommendations. Do you have any experience trying to run the servers locally or recommendations for it?

JuanFuriaz avatar Feb 09 '22 15:02 JuanFuriaz

Sorry Juan - haven't dealt with that from my side. Maybe check what openvidu uses, if they support "self-hosted" setups as well.

themarpe avatar Feb 09 '22 16:02 themarpe

@themarpe @JuanFuriaz I have not set up a local server as well, so sadly cannot give any recommendations. But I'm more than happy to extend this example and add support for offline mode if you manage to get it working this way @JuanFuriaz

VanDavv avatar Feb 09 '22 21:02 VanDavv