client-sdk-flutter
client-sdk-flutter copied to clipboard
[Question] LiveKit with local network and no internet connection.
Hi!
Hope you can give me any hint of the implementation I'm trying please.
I'm using LiveKit in a local network, it's a Windows app, sometimes with no internet connection but all the devices are connected to the same network. It turns out that when there's no internet connection LiveKit doesn't work and I get an error in signal_client.dart line 121.
I'd like to know if this approach is possible with the current version of LiveKit.
I'm using the following stack:
- Flutter (Channel stable, 3.22.2, on Microsoft Windows [Version 10.0.22631.3737], locale en-US)
- livekit_client: 2.1.5 (Flutter version).
- I'm using this LiveKit server version (1.6.1)
Thanks in advance. I'd really appreciate any hint or response. And any additional info I'll be willing to provide you.
Can you capture any logs in the console? It sounds like the system connection is not ready yet, you need to wait for some time and try again
2024-09-16T10:24:52.104+0530 INFO livekit server/main.go:208 starting in development mode
2024-09-16T10:24:52.107+0530 INFO livekit server/main.go:211 no keys provided, using placeholder keys {"API Key": "devkey", "API Secret": "secret"}
2024-09-16T10:24:52.111+0530 INFO livekit routing/interfaces.go:111 using single-node routing
2024-09-16T10:24:52.143+0530 INFO livekit service/server.go:258 starting LiveKit server {"portHttp": 7880, "nodeID": "ND_pxqYSRwvJUPP", "nodeIP": "192.168.192.6", "version": "1.7.2", "bindAddresses": ["127.0.0.1", "::1"], "rtc.portTCP": 7881, "rtc.portUDP": {"Start":7882,"End":0}}
2024-09-16T10:24:52.143+0530 DEBUG livekit service/signal.go:122 starting relay signal server {"topic": "ND_pxqYSRwvJUPP"}
how to connect the flutter client my android emulator and the livekit server is in the same PC macOS
192.168.192.6: 7880
if (_connectivityResult.contains(ConnectivityResult.none)) {
logger.warning('no internet connection');
events.emit(SignalDisconnectedEvent(
reason: DisconnectReason.noInternetConnection));
throw ConnectException('no internet connection');
}
Same problem, you can delete this code to solve this problem Connectivity_plus library, the result returned in the local LAN is ConnectivityResult.none
if (_connectivityResult.contains(ConnectivityResult.none)) { logger.warning('no internet connection'); events.emit(SignalDisconnectedEvent( reason: DisconnectReason.noInternetConnection)); throw ConnectException('no internet connection'); } Same problem, you can delete this code to solve this problem Connectivity_plus library, the result returned in the local LAN is ConnectivityResult.none
Right, I had to do the same in order to make that work. Unfortunately, the connectivity_plus library doesn't recognize network interfaces other than those exposed to the internet. So commenting that code is a temporal "fix".