# RB5 unable to connect to hotspot

Source: https://forum.modalai.com/topic/611/rb5-unable-to-connect-to-hotspot
Category: Development Drones (https://forum.modalai.com/category/44/development-drones)
Tags: rb5
Posted: 2021-12-15 14:27:56 UTC by Francesco Jacomel
Replies: 10 · Views: 2041

## Francesco Jacomel · 2021-12-15 14:27:56 UTC

I've been trying to connect to different wifi networks and I'm unable to succeed on that.
WPA supplicant file is being updated as below:
```
ctrl_interface=/var/run/wpa_supplicant
update_config=1

network={
#WPA-PSK
        ssid="Test1"
        key_mgmt=WPA-PSK
        psk="abcdefgh"
}
```

And I just can't see any error but the connection is not established. Test1 is a hotspot on my cellphone, should I use WPA2-PSK instead? 

Hotspot settings are as follows:
```
SSID:	Test1
Protocol:	Wi-Fi 4 (802.11n)
Security type:	WPA2-Personal
Network band:	2.4 GHz
Network channel:	1
```
Thanks

## Reply by modaltb (ModalAI staff) · 2021-12-15 17:18:25 UTC

Hi @Francesco-Jacomel ,

This is an example of our WPA supplicant used at the factory during setup:

```
# Only WPA-PSK is used. Any valid cipher combination is accepted.
ctrl_interface=/var/run/wpa_supplicant
update_config=1

network={
	ssid="Foo"
	key_mgmt=WPA-PSK
	pairwise=TKIP CCMP
	group=TKIP CCMP
	psk="Bar"
}
wowlan_triggers=magic_pkt
```

These got things connected on our network.  I've not dug into the params myself though so 'use at own security risk' ;)

## Reply by tom (ModalAI staff) · 2021-12-15 19:06:42 UTC

@Francesco-Jacomel Are you rebooting your RB5 Flight after modifying the wpa_supplicant file?

## Reply by Francesco Jacomel · 2021-12-16 18:58:29 UTC (in reply to modaltb)

@modaltb It's the pretty same as I have here. :( I've tried keeping the pairwise and group for some attempts but also didn't work.

## Reply by Francesco Jacomel · 2021-12-16 19:16:17 UTC (in reply to tom)

@tom Yep, after any change on the file I'm rebooting.

## Reply by tom (ModalAI staff) · 2021-12-16 20:36:10 UTC

@Francesco-Jacomel  Are you able to connect to any WiFi network? i.e. your home / office network?

## Reply by Francesco Jacomel · 2021-12-17 13:39:51 UTC (in reply to tom)

@tom I've tried two different networks so far, one from my company so a firewall might be affecting the connection attempt through WPA, other using my iPhone Hotspot which is WPA2 so I'm unsure whether this might be an issue. I'm setting up a new one with no restrictions (no firewall, no wpa2).

I'll update here accordingly.
Thanks

## Reply by Francesco Jacomel · 2021-12-20 14:42:55 UTC

I've set up a new network with very few restrictions and now it is connected to the network! Thank you very much for your support!

## Reply by tom (ModalAI staff) · 2021-12-20 17:53:09 UTC

@Francesco-Jacomel Great! Thanks for investigating that, our test network is fairly open security-wise so we hadn't run into that issue.

## Reply by justinGE · 2022-05-12 18:56:50 UTC

Not to necro a thread, but if you're using WPA2 you need to supply a country code at the top of the wpa_supplicant such as

```
# Only WPA-PSK is used. Any valid cipher combination is accepted.
country=US
ctrl_interface=/var/run/wpa_supplicant
update_config=1

network={
	ssid="Foo"
	psk="Bar"
}
wowlan_triggers=magic_pkt
```
I was having trouble connecting to our local internet until I did this.

## Reply by tom (ModalAI staff) · 2022-05-13 17:02:56 UTC (in reply to justinGE)

@justinGE This is good information, thanks for sharing!
