In this article you’ll learn how to record your data more efficiently by transforming your Raspberry Pi 4 into a connection point between the cloud and any sensors, smart devices and controllers on your network. Logging your data in the cloud can help you identify trends: for example, using your smart scale to record your daily weigh-ins or your smart exercise bike to record the number of miles you’ve cycled. When you’re transmitting large amounts of data to the cloud, you can often reduce response times and network transmission costs by pre-processing that data locally.

What you’ll need

To complete this tutorial, you’ll need:

Raspberry Pi 4SD cardLaptop or computer where you’ll download the Ubuntu system imagePower cable that’s compatible with your Raspberry PiEthernet cableMicro HDMI cableExternal monitorExternal keyboard and a way to attach it to your Raspberry PIA mouse is optional or use the trackpad on your external keyboard

Flash Ubuntu to your Raspberry Pi

To transform your Raspberry Pi into an Edge Gateway, you’ll need Ubuntu 19.10. Later versions of Ubuntu will likely also support EdgeX Foundry, but the process of setting up your Raspberry Pi as an Edge Gateway may differ. In this tutorial, we’ll flash the Ubuntu system image using the free balenaEtcher application. Etcher will now flash the system image to the SD card.

Boot your Raspberry Pi into Ubuntu

We’re now ready to boot the Raspberry Pi: There will now be access to a Terminal to enter all of the commands needed to provision the Raspberry Pi as an Edge Gateway.

Installing EdgeX Foundry

To install the EdgeX Foundry platform, run the following command in the Terminal: Ubuntu will now download the EdgeX Foundry snap, which contains all the services required to run EdgeX, including EdgeX core, security and support reference services, plus Consul, Kong, MongoDB, and Vault. All of the EdgeX work can be performed in a web user interface (UI). To download this UI, enter the following command in the Terminal: Once the download has finished, launch the web browser and enter the following URL: http://((your-raspberry-pir-url):4000/ For example, my Raspberry Pi’s IP address is 192.168.1.45, so this gives me the following URL: http://192.168.1.45:4000/. If the IP address of the Raspberry Pi is unknown, then retrieve it using the following Terminal command: Once this URL has loaded, you’ll be taken to the EdgeX Foundry Console.

Add Raspberry Pi as an Edge Gateway

Log into the console using the default username and password, which are both “admin.” To provision the Raspberry Pi as an Edge Gateway: The Raspberry Pi should now appear in the Console, ready to use.

Conclusion

In this article you learned how to setup a Raspberry Pi 4 as an Edge Gateway. If you’ve followed along with this tutorial, then we’d love to hear how you’re using Raspberry Pi as a connection point between the cloud and your smart home network, so be sure to share your gateway projects in the comments below!