Show the IP address at boot on the SenseHAT attached to your Raspberry Pi

2 minute read

For my demos in the field I use a Raspberry Pi with a SenseHAT attached to it and power it through my power-bank. For internet connectivity I use the Personal Hotspot feature of my iPhone.

This article will detail the steps necessary to show the IP address the Raspberry Pi uses once booted so you can easily ssh into it.

For my demos in the field I use a Raspberry Pi with a SenseHAT attached to it and power it through my power-bank. For internet connectivity I use the Personal Hotspot feature of my iPhone.

This article will detail the steps necessary to show the IP address the Raspberry Pi uses once booted so you can easily ssh into it.

How it works

The script will install a service that starts at boot time once the network becomes active. The service calls a script that finds the IP address and calls a python script to show the IP address on the SenseHAT.

It loops showing the IP address on the SenseHAT until you login to the Raspberry Pi with SSH. The login script (.bashrc) calls a script to stop the service and clears the SenseHAT\’s display.

Prerequisites

1
You have a running Raspberry Pi with a SenseHAT attached to it.

###Optional

Steps

The files used for this are available on my GitHub repository. To download and install the service, execute the following on your Raspberry Pi:

1
2
3
4
git clone https://github.com/CrossCloudGuru/showIP_pub.git
cd showIP_pub
chmod +x install_showIP.sh
sudo install_showIP.sh

The script displays the progress while execution and writes it to a log file. If you want to read through the log:

1
cat /tmp/install_showIP.log