DroneBridge / ESP32

DroneBridge for ESP32. A secure & transparent telemetry link with support for WiFi and ESP-NOW. Supporting MAVLink, MSP, LTM or any other protocol
https://dronebridge.github.io/ESP32/
Apache License 2.0
382 stars 107 forks source link

Wifi Client mode with no password #56

Closed mcl-uk closed 7 months ago

mcl-uk commented 8 months ago

Seem to be unable to get dronebridge to connect (in wifi client mode) to my local, un-encrypted wifi, I tried configuring with a blank password field but dronebridge then seems unable to connect/associate. Do I have to use an encrypted wifi?

seeul8er commented 8 months ago

Yes. The current release requires at least WPA as encryption. I may lower that in the future release.

seeul8er commented 8 months ago

Currently there is also a bug that prevents the ESP from reconnecting on connection loss when in client mode. I already fixed that but the code is not released yet

mcl-uk commented 8 months ago

Thanks for the info, good to know. Will keep a look out for v1.4.

jaaptesla commented 7 months ago

Even with password protected wifi in client mode i cannot connect to 14550 The esp does connects to the client IP It comes with an alternative ip obtained. I can acces it via browser i see uart data But I cannot connect to the rover when im connected to that same wifi network. I started missionplanner but

I cant acces the rover unfortunately.

seeul8er commented 7 months ago

@jaaptesla try TCP instead. TCP is very reliable. I did rewrite parts of the UDP communication in the upcoming release to make it even more stable.

jaaptesla commented 7 months ago

@jaaptesla try TCP instead. TCP is very reliable. I did rewrite parts of the UDP communication in the upcoming release to make it even more stable.

Thank you for response. i manually put in the obtained ip adress and it does connect immediately to TCP Thank you for that. but im using also an APP and i cannot connect to the rover with TCP only UDP. The app will function the same as missionplanner

If im connected to AP i just select UDP and baudrate and it connects automatically When i do the same when im connected to the Client IP it does not find the UDP. So it would be Awesome if you would fix that. Thank you for all that you do for the community your work is highly appreciated!!!

mcl-uk commented 7 months ago

FYI, I found no problems connecting with UDP on port 14550 when connected in client mode - once I'd imposed a password on my router.

seeul8er commented 7 months ago

@jaaptesla I do not think there is an easy fix for that problem. In client mode the ESP32 does only know the IP of the access point. It is unaware of any other devices on the network. That way it does not know where to send the UDP messages to. The issue is partly solved by the ESP32 by automatically adding all devices to the UDP-receiver list that sent data to the ESP32s UDP port. QGroundcontrol e.g does have that feature. When setting up an UDP connection you can specify a host+port in addition. QGroundcontrol will then send a packet to that hosts port. That way it 'registers' to the device (in our case the ESP32)

So in client mode you will have to do that (in your GCS) in order to be added to the list of known devices by DroneBridge. Otherwise the ESP32 will not know where to send the UDP packets to

jaaptesla commented 7 months ago

Currently there is also a bug that prevents the ESP from reconnecting on connection loss when in client mode. I already fixed that but the code is not released yet

I noticed, can you also fix that when there is no encryption on a wifi client network That we are able to connect to a wifi network with no password? When can we expect the new v1.4.

If you want i can do beta testing. I have APM and Pixhawk available for testing. teslatokkie at gmail

seeul8er commented 7 months ago

Please check out release v1.4 - it should fix your issues

jaaptesla commented 7 months ago

Please check out release v1.4 - it should fix your issues

In main.c When the wifi_config in client wifi mode init Is set to .password="" //empty And wifi auth to open

I am able to save a blank password in the dronebridge.local.page. and it will connect to a client network with no encryption and also reconnect.

How ever if i just fill in some password in Wifi_config_t wifi_config ={ .sta = { .password "teslajaap"

Then compile it And i will go to the dronebridge.local and save a password as empty blank it will not connect or reconnect to a client network with no password.

I have made some changes it works now. I have uploaded my edited version To GitHub but when i disconnect the client network and put it offline the esp32 will change into an ap with no password ( so no psk or anything) So the drone will also be an open network to connect to

Suggestion.

And it would be nice that if The client network comes back online the Failsafe AP will go offline and reconnect automatically. So it will always listen on an interval for the stored wifi client network. So as soon as it detect the client network is online it will go offline and reconnect. So every ten seconds when in fail mode periodic polling in case client network comes back online

seeul8er commented 7 months ago

I gave this thing some thought and enabling open networks would require me to change and adapt quite a bit of code. All that effort just to enable unsecured connections. I will set the minimum to WEP and password length will remain at min. 8 chars. Since the ESP32 comes with HW-encryption support the speed penalty is also minimal. I just to not see any benefits.

The idea about the failsafe is good. I'll see when I find time for it.

jaaptesla commented 7 months ago

Oke i got you.

Op zo 18 feb. 2024 20:21 schreef Wolfgang @.***>:

I gave this thing some thought and enabling open networks would require me to change and adapt quite a bit of code. All that effort just to enable unsecured connections. I will set the minimum to WEP and password length will remain at min. 8 chars. Since the ESP32 comes with HW-encryption support the speed penalty is also minimal. I just to not see any benefits

— Reply to this email directly, view it on GitHub https://github.com/DroneBridge/ESP32/issues/56#issuecomment-1951420384, or unsubscribe https://github.com/notifications/unsubscribe-auth/A347ROJ4OE7ZCOZYJWSBSMLYUJIDZAVCNFSM6AAAAABCPINMV6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSNJRGQZDAMZYGQ . You are receiving this because you were mentioned.Message ID: @.***>