Friday, December 8, 2017

Create Ad-hoc Wifi Hotspot On Your Donkeycar (RPi3)

Here is some quick instructions on how to create an ad-hoc Wifi connection on your Donkeycar (RPi3).  This connection is mainly used for direct connections to the Donkeycar at the track.  You will then not need a router or other Wifi access point.  I have found the range of the Wifi connection to be great.


So the typical way to communicate with your Donkeycar is through SSH.  To connect through SSH, both your laptop and the Donkeycar must be on the same network.  These instructions will make your Donkeycar (RPi3) a Wifi Hotspot.  You will then connect to the Donkeycar through Wifi just like you connect to any other Wifi connection.

Your Donkeycar will have a static IP.  So you will always know the IP address.  So when you SSH into your Donkeycar, you can always give the same IP address.  You will need to make your laptop match your Donkeycar IP address.


  • On your Raspberry PI modify the file:
sudo nano /etc/network/interfaces

  • Modify the wlan0 entry to create an ad-hoc network.
#allow-hotplug wlan0
auto wlan0
iface wlan0 inet static
# wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf
  wireless-channel 1
  wireless-essid Donkeycar_Rico
  wireless-mode ad-hoc
The address is any address you would like for your Donkeycar. The essid is any name you want.  The essid entry is the the name you find in available Wifi networks.

  • Close the file.
Ctrl-X, then Y to save.

  • Reboot the RPi3.
sudo reboot

 Connect to RPi3 through Wifi

When the RPi3 reboots, you will see in the list of available Wifi connections your essid name listed.  

  • Connect to the Donkeycar Wifi network
  • You will now need to set your IP address on your laptop to a static IP address.  The RPi3 does not have DHCP to give you an IP address.
The IP Address must be similar to the RPi3 address.  But it cannot be the same.  So something like

Depending on your OS, this will vary how you set your IP address. 

Here is a site for OSX

Here is a site to show you how on Windows.
I notice that Windows 10 is having issues connecting to an Ad-hoc network, but OSX works fine.

And here is a site for Ubuntu


This wifi connection will make you lose your internet connection.  It will only be connected to the RPi3 now.

You can then SSH or RSYNC to the RPi3.  If you need to transfer files from the internet to your RPi3, you will first need to reconnect to your Wifi connection with the internet.  Get the files you need.  Then connect to the Wifi connection for the Donkeycar.  Then RSYNC the files between the laptop and RPi3.  This connection is mainly used for remote connections at the track.


Post a Comment