Dataplicity Developer Hub

Dataplicity Documentation

Here you'll find announcements for new features and comprehensive guides to help you integrate Dataplicity into your Raspberry Pi projects.

Get Started    Announcements

Connect your Pi to the internet

Wired Ethernet connection

Consumer routers are usually configured to issue an IP address to your devices via DHCP as soon as they are connected. This means that in most cases, connecting your Pi to the internet via a wired Ethernet connection is as simple as connecting your Raspberry Pi to your internet router/switch with a standard Ethernet cable.

Raspberry Pi connected to a switch

Raspberry Pi connected to a switch

Troubleshooting an Ethernet connection

Should you run into an issue on a wired Ethernet connection you should test the connection on your PC/laptop first. If your PC can get an internet connection on a wired Ethernet cable, typically the Pi can too.

Possible issues may include:

  1. A damaged Ethernet cable. This is pretty rare but it can happen.
  2. DHCP may be turned off on your router and because of that your device is not being issued an IP address. Most consumer routers have DHCP enabled by default, so if it is disabled it's quite likely that you have a special networking setup that you are aware of which may require a static address be assigned to your Pi.
  3. If you're connecting through a USB-to-Ethernet adapter instead of default Ethernet port you might run into driver issues if your USB device is not natively supported in your chosen operating system. You may wish to try using the standard Pi Ethernet port first to establish if the issue is general, or is specific to the particular USB device you are using.
  4. A router or general internet fault. If you can't get any internet access via your router (including to your PC/laptop), you may need to replace the router and/or raise the issue with your ISP. They will probably ask the typical quesiton 'have you power cycled it?', so it's worth giving that a shot too.

Wireless connection

At the time of writing, only Raspberry Pi 3 devices have built in Wifi. For older devices, The WiPy USB Wireless module is available from the Raspberry Pi Store.

Raspberry Pi using WiFi module

Raspberry Pi using WiFi module

WiPy on Raspberry Pi version 1 devices

In some very early Raspberry Pi devices (model 1), the power supply was in some cases insufficient to properly power the WiPy device and brownouts and dropped connections would result. We recommend you use at least a Raspberry Pi version 2 if you require a WiFi connection to your Pi.

Check your network is visible and in range

Open a terminal emulator and type in the command below to get a list of networks visible to your Pi:

sudo iw dev wlan0 scan | grep SSID

Configure WiFi

In our case, we set up a network named DATAPLICIT and we will now configure our Pi to connect to it after boot up.

Open up network interfaces file using text editor such as nano.

sudo nano /etc/network/interfaces

When you open this file it should look similar to the one shown below.

Default network interfaces configuration file

Default network interfaces configuration file

Modify wlan0 above to match that which is shown below. You will need to supply your own network name and password instead of DATAPLICIT and password123

Modified network interfaces configuration file

Modified network interfaces configuration file

Exit the text editor by pressing CTRL + X then y and then ENTER.

All done!

Last thing to do is to reboot the system.

sudo reboot

Test your connection

You can try to 'ping google.com' to check that your internet connection is working. If this fails, either google.com is broken or your internet connection isn't working, needless to say the latter is more likely. :)

The command below will send 5 packet to google and return connection statistics.

sudo ping -c 5 www.google.com

On successful ping you will see a result similar to the one below.

Successful ping result

Successful ping result

If your connection isn't working, you will see something similar to the below (or some other error).

Ping failure

Ping failure

Find your IP address

To find the IP of the interfaces on your Raspberry Pi use the command below.

You should see a result similar to the one below. To find your IP you have to look at the interface you're currently using e.g. Wlan0 and then look at the inet (IPv4) section.

Information about network interfaces

Information about network interfaces


Connect your Pi to the internet