SemFio Networks

  • Home
  • About
  • Services
    • Wi-Fi DevOps with Mist
  • Partners
    • Mist
  • Training
  • Contacts
  • Blog
  • Home
  • About
  • Services
    • Wi-Fi DevOps with Mist
  • Partners
    • Mist
  • Training
  • Contacts
  • Blog

Customize your WLAN Pi

8/3/2019

2 Comments

 
Picture
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: wlanpi
  • Password: wlanpi
Picture
Once connected, we will create a new user and give this new user some privileges.
  1. Use the following command to create a new user: sudo adduser username
  2. In the following prompts, specify which password you want to use for this user
  3. Use the following command to give this user sudo privileges: sudo usermod -aG sudo username
  4. Finally, 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 ifconfig, iwconfig or iw.
  1. In the home directory of the user, open the .profile file using the following command: sudo nano .profile
  2. Modify this file by adding the following line at the end of the .profile file:  PATH=$PATH:/sbin:/usr/sbin
  3. Save and close the .profile file
  4. Once back in the shell, reload the profile using this command: source .profile
  5. You 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:
  1. Open the file using the following command: sudo nano /etc/hostname
  2. Modify the hostname to your liking
  3. Save and close the /etc/hostname file
  4. Reboot 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
One more thing you need to do here. You need to change the hostname used for dns resolutions. If you don't, you will realize that it takes longer for sudo commands to execute. To do so, open the /etc/hosts file and replace "wlanpi" by your new name:

    

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:
  1. ssh back to the WLAN Pi using your new user: ssh francois@192.168.42.1
  2. Once connected to the WLAN Pi, modify the .bashrc file using the following command: nano .bashrc
  3. Add your aliases at the end of this .bashrc file
  4. Save and close the .bashrc file
  5. Reload your bash profile using the following command: source .bashrc
  6. Validate 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:
  1. From the WLAN Pi and from your user home directory, open the .bashrc file using the following command: nano .bashrc
  2. Inside 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.
  3. Save and close the .bashrc file
  4. Reload your bash profile using the following command: source .bashrc​
Picture
Here is the PS1 value that I used for mine:
​

    
Picture
You can use the following website to customize your prompt to your liking: ​https://www.howtogeek.com/307701/how-to-customize-and-colorize-your-bash-prompt/

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
2 Comments
    Picture

    François Vergès

    François Vergès is the founder of SemFio Networks. As a Network Engineer, he has a real passion for Wi-Fi.

    Picture Picture Picture

    Categories

    All
    5G
    5GHz
    6GHz
    802.11
    802.11ax
    802.11v
    802.1X
    AirConsole
    Aruba
    ArubaOS
    AutoCAD
    Automation
    Brand
    Capture
    Cisco
    Cisco WLC
    CLI
    Cloud
    Co-Channel Contention
    Controller Upgrade
    Course
    CWNE
    CWNP
    Design
    DFS
    Diagrams
    Ekahau
    FreeRADIUS
    Frequencies
    FSPL
    Hotspot
    Ideas
    Industry Canada
    Interference
    ISED
    Jetson Nano
    KRACK
    London
    MagicQuadrant
    MakeWi FiVisible
    MakeWi-FiVisible
    Market
    Meetup
    Mobility Express
    News
    Packet Analysis
    Programming
    Python
    Reference Guide
    Script
    Security
    SemFio
    Site-survey
    Site-survey
    Spectrum-analysis
    Technology
    Timeline
    Tip
    Training
    Validation
    Video
    Warehouse
    WiFi
    Wi-FI
    Wi-Fi
    Wi Fi 6
    Wi-Fi 6
    Wifitraining
    Wi Fi Troubleshooting
    Wi-Fi Troubleshooting
    Wireshark
    WLAN Pi
    WLPC
    WPA2

    Archives

    July 2020
    March 2020
    February 2020
    January 2020
    December 2019
    October 2019
    August 2019
    July 2019
    June 2019
    April 2019
    January 2019
    December 2018
    November 2018
    August 2018
    May 2018
    April 2018
    March 2018
    January 2018
    December 2017
    November 2017
    October 2017
    September 2017
    May 2017
    April 2017
    February 2017
    January 2017
    November 2016
    September 2016
    August 2016
    May 2016
    April 2016
    March 2016
    February 2016
    December 2015
    November 2015
    September 2015
    August 2015
    July 2015
    April 2015
    February 2015
    January 2015
    December 2014
    November 2014
    October 2014
    September 2014
    August 2014
    June 2014
    May 2014

    RSS Feed

SemFioNetworks-EmailContact SemFioNetworks-LinkedInProfile SemFioNetworks-YoutubeChannel

Let's Talk

Please get in touch with us if you have any questions. We offer a wide variety of professional Wi-Fi services that can help your wireless environment becoming faster, more secure and more efficient!
Get in touch
SemFioNetworks-Logo
Copyright © 2020 by SemFio Networks Inc.