SHARE
In this article, I will show you how you can customize your WLAN Pi and make it your own! Feel free to comment and tell me how you guys customize yours.

Here is the video tutorial that explains these customizations.

Create Your Own User

Creating your own user allows you to have your own password and your own home directory. It is more secure and you are free to modify your profile as much as you want.Note: I would also recommend you to change the default password for the wlanpi account.

In order to create a new user, you need to ssh into the WLAN. By default, if you connect the WLAN Pi to your laptop via the USB connection, this should establish an Ethernet over USB connection and your laptop should receive an IP address in the 192.168.42.0/24 IP address subnet.

You can now ssh into the WLAN Pi from your laptop using the default username and password:

Username: wlanpiPassword: wlanpi

Picture
Once connected, we will create a new user and give this new user some privileges.Use the following command to create a new user: sudo adduser usernameIn the following prompts, specify which password you want to use for this userUse the following command to give this user sudo privileges: sudo usermod -aG sudo usernameFinally, try to connect using this new username and password: su – username
Picture
Finally, we will modify the user PATH so we can get access to some basic commands such as ifconfigiwconfig or iw.In the home directory of the user, open the .profile file using the following command: sudo nano .profileModify this file by adding the following line at the end of the .profile file:  PATH=$PATH:/sbin:/usr/sbinSave and close the .profile fileOnce back in the shell, reload the profile using this command: source .profileYou should now be able to use the ifconfig command
Picture

Change the Hostname of the WLAN Pi

The name of the WLAN Pi is configured under the /etc/hostname file. In order to change the hostname permanently, you will have to modify this file:Open the file using the following command: sudo nano /etc/hostnameModify the hostname to your likingSave and close the /etc/hostname fileReboot the WLAN Pi
Picture

When the WLAN Pi comes back online, you should be able to ssh into it and see the new hostname. The new hostname will also appear on the home screen:

Picture

Create Your Aliases

On linux, an alias allows you to create your own command shortcut. For example, instead of typing ls –color=auto, you could create the following alias : alias ls=’ls –color=auto’. Then when you type ls, it will execute the full command line.

Everyone has their own set of aliases they like to use. Here I will just share the ones I use. Feel free to use them as well and feel free to create your own.

In order to create your aliases, you need to do the following:

ssh back to the WLAN Pi using your new user: ssh [email protected]Once connected to the WLAN Pi, modify the .bashrc file using the following command: nano .bashrcAdd your aliases at the end of this .bashrc fileSave and close the .bashrc fileReload your bash profile using the following command: source .bashrcValidate that your aliases have been applied using the alias command.

Picture

Here is the list of my aliases:

Customize Your Prompt

You can also customize your prompt to your liking. You can go wild here. I actually like it simple. I like the default prompt. I just changed the colors for fun!

In order to change the look of your prompt, you can do the following:

From the WLAN Pi and from your user home directory, open the .bashrc file using the following command: nano .bashrcInside the .bashrc file, scroll down until you find the PS1 variable. Then replace the value of that PS1 variable with whatever you would want to use.Save and close the .bashrc fileReload your bash profile using the following command: source .bashrc

Picture

Here is the PS1 value that I used for mine:

Picture

Change the Picture Displayed when Booting

When the WLAN Pi, you can see an image appearing on the screen. By default, it is the logo of the Wireless LAN Professionals company.
Picture
However you could change it to something else if you want to.

First, you need to retrieve the original image used. It is located on the WLAN Pi at the following location: 

/home/wlanpi/NanoHatOLED/BakeBit/Software/Python/wlanprologo.png

In order to retrieve this image, I used the scp command from my laptop. This command allows you to copy files from the WLAN Pi to your laptop over an SSH connection. Here is the command I used: 

This will copy the image on your laptop. Then I studied the picture and retrieve the resolution of it: 128 x 64.

Once I knew the resolution, I created my own image using Illustrator. I actually created the two following ones:

Picture
Picture
Then you need to replace the image that’s currently on the WLAN Pi with your new image, freshly created. You won’t be able to do it in one shot because you don’t have the permission to do so over scp.

So first, you need to transfert the new image back to the WLAN Pi. I transfered mine back to my home directory using the following command: 

Second, you need to ssh back into the WLAN Pi.

​And finally, you need to replace the old image with the new one. I used the following command to do so: sudo cp WLANPi-SemFio-StartUp.png /home/wlanpi/NanoHatOLED/BakeBit/Software/Python/wlanprologo.png

Note: It is very important here that you use the same destination name. The picture name will still be the same as before (wlanprologo.png) but its content will be different. I tried to do it a different way by changing the configuration files of the NanoLED program, but it didn’t work properly.

Then, you can reboot your WLAN Pi, you should see the new picture when the WLAN Pi boots.

Picture

Ideas

In order to improve this customization, I would like to create a Python script that automates all of these tasks. I will then be able to run the script every time I update my WLAN Pi to a newer image and I will be able to retrieve my customizations.

If you manage multiple WLAN Pi, you could also create a Python script that you could run on multiple WLAN Pi to speed up their configurations and customizations.

Please share how you like to customize yours!

Thank you for reading!

​Written by François Vergès

LEAVE A REPLY

Please enter your comment!
Please enter your name here