Network configuration

The necessary configuration to ensure the proper communication

Feel free to do it in your own way in case you feel safe to configure by yourself, we'll only show how we did it

In order to put the clovers on the same network, we must work on the network architecture. By default, the clover's image makes it so that the Raspberry PI works as an access point, so normally you'd have to access it to establish a connection to the drone. Check the coex wifi documentation session.

We can change that by turning each Raspberry into a client and make them connect to a local network. But, for that, we neet to change the IP attribution system.

Our solution is: Give each drone a static IP pre-configured, and reserve this IP on the router for each MAC Address.

How to do it

First of all, we need to prevent the Raspberry from turning on an access point. For that, go to the wpa_supplicant.conf file located at /etc/wpa_supplicant/ and open it with any text editor

nano ~/etc/wpa_supplicant/wpa_supplicant.conf

Then delete the network configuration for clover-xxxx and add yours, for example:

network={
    ssid="network_ssid"
    psk="network_password"
}

Now the Raspberry will try to connect to this wifi every time it boots. But it probably won't work yet, because by default clover has the ip 192.168.11.1 set and it's very likely that the router will not accept its connection. To change this, it will depend on how the router is working and how it's attributing IP addresses, and it varies from router to router. However, the router should have a configuration page by typing its IP on the browser.

In our case, we fixed a range of possible IP on the router, and reserved 192.168.0.4 for clover 0 and 192.168.0.5 for clover 1. To change the fixed IP that the Raspberry Pi will try to connect to match the same IP reserved for them on the router, you can edit the ~/dhcpcd.conf file

nano ~/dhcpcd.conf

and change the lines referring to static ip_address to the desired IP. Furthermore, if you want to connect the Raspberry on the internet, you must configure the gateway and the DNS on this file. These previous two are usually the router's local IP address:

# 
interface wlan0
static ip_address=192.168.0.4/24 # example!! with 24 as subnet mask
static routers=192.168.0.1 # (gateway) - usually your routers ip
static domain_name_servers=192.168.0.1 # (dns) - same-

Now, they should be already connecting to the desired network everytime they boot and also be able to access the internet (if the local area network has any).

You should try accessing each rasp through SSH to make sure everything is working. Let's say the chosen IP is also 192.168.0.4.

ssh pi@192.168.0.4

The default password is rasbperry.

Last updated