Previous Articles in this series:
In the previous posts in this series I took a look at how I installed and configured DietPi on my ODROID C2. I also went through the settings and some software packages that I wanted to install on the first boot. I should re-iterate here that one of the goals of this series is not to blandly show the reader how to do things, but also to try and learn more about how a machine like this fits together. So as I go along you may see me point out some things that have more to do with Linux or DietPi or other topics. They may also seem obvious to you or not worth explicit mention. I am doing this is in the spirit of sharing the totality what I learn along the way, so that you the reader may benefit. I am also doing it so I can come back and read it later when I forget… (it happens more often than not!)
Right so, at this stage, you have booted your ODROID or other SBC (Single Board Computer) for the first time, you have logged in and you are now at the command prompt. I am assuming you weren’t adventurous enough to add a desktop and you are simply booting into the standard command line. You may still have the ODROID connected to your screen and keyboard, and that’s fine too. Go ahead and login (if you haven’t already) and let’s take a look around.
You should be at the User@HostName~:# prompt. Let’s have a look at our present working directory and a few other things…
root@Droid-01:~# pwd /root
Ok, so our home directory is /root. Let’s go up to the top of the directory structure…
root@Droid-01:~# cd / root@Droid-01:/# pwd / root@Droid-01:/# ls -a . .. bin boot dev DietPi etc lib lost+found mnt opt proc root run sbin srv sys tmp usr var root@Droid-01:/#
Let’s go back to the home folder and have a look inside there…
root@Droid-01:/# cd root@Droid-01:~# pwd /root root@Droid-01:/# root@Droid-01:~# ls -al total 10 drwxr-xr-x 4 root root 1024 Feb 25 17:29 . drwxr-xr-x 20 root root 1024 Feb 25 16:58 .. -rw------- 1 root root 212 Mar 3 23:24 .bash_history -rw-r--r-- 1 root root 3526 Feb 25 17:29 .bashrc drwxr-xr-x 3 root root 1024 Feb 25 17:29 .config drwxr-xr-x 2 root root 1024 Feb 25 17:29 .local -rw-r--r-- 1 root root 140 Feb 25 17:29 .profile root@Droid-01:~#
Neat OK, so we have a 1000 mile view of where we are and what we are dealing with (actually, at this point we really have no idea!)
One of the cool things that DietPi OS comes with is a set of menu based tools for configuring your SBC and for installing optimized versions of software. Let’s go and find out where those are…
root@Droid-01:~# cd / root@Droid-01:/# ls bin boot dev DietPi etc lib lost+found mnt opt proc root run sbin srv sys tmp usr var root@Droid-01:/# cd DietPi root@Droid-01:/DietPi# ls boot.ini config.txt dietpi dietpi.txt root@Droid-01:/DietPi# cd dietpi root@Droid-01:/DietPi/dietpi# ls boot dietpi-backup dietpi-cleaner dietpi-cpuinfo dietpi-drive_manager dietpi-letsencrypt dietpi-obtain_hw_model dietpi-ramlog dietpi-survey finalise misc conf dietpi-banner dietpi-cloudshell dietpi-cpu_set dietpi-funtime dietpi-logclear dietpi-process_tool dietpi-services dietpi-sync func dietpi-autostart dietpi-bugreport dietpi-config dietpi-cron dietpi-launcher dietpi-morsecode dietpi-ramdisk dietpi-software dietpi-update login root@Droid-01:/DietPi/dietpi#
The three main applications you will use are:
- dietpi-launcher: A full menu for optimized software selection, HW config, autostart settings, cron jobs, management of external drives and updating dietpi
- dietpi-software: Allows you to run configuration and select software for dietpi to install. Also available in the dietpi-launcher menu.
- dietpi-config: This allows hardware configuration changes and optimizations. Also available in dietpi-launcher and dietpi-software menus.
Go ahead and try each of them, you will realize you’ve already used them to install other software during the first boot!
After the first boot and configuration, you should already have some network tools installed. You should be able to use iftop, iptraf, iperf, mtr, nload and tcpdump.
You should also have access to some useful text editors, I only have Vim and Vim-Tiny installed (I don’t need both, I was just being greedy!)
If you want to check out what other executable programs are included in your DietPi system, use cd /bin to open the /bin directory and use the ls command to have a look what’s there.
root@Droid-01:~# cd /bin root@Droid-01:/bin# ls -a . bzip2recover dash fbset ip login mount ntfscat pidof setfacl systemd-ask-password udevadm zdiff .. bzless date fgconsole journalctl loginctl mountpoint ntfscluster ping setfont systemd-escape ulockmgr_server zegrep bash bzmore dd fgrep kbd_mode lowntfs-3g mt ntfscmp ping6 setupcon systemd-inhibit umount zfgrep bunzip2 cat df findmnt kill ls mt-gnu ntfsfallocate ps sh systemd-machine-id-setup uname zforce bzcat chacl dir fuser kmod lsblk mv ntfsfix pwd sh.distrib systemd-notify uncompress zgrep bzcmp chgrp dmesg fusermount less lsmod nano ntfsinfo rbash sleep systemd-tmpfiles unicode_start zless bzdiff chmod dnsdomainname getfacl lessecho machinectl netstat ntfsls readlink ss systemd-tty-ask-password-agent vdir zmore bzegrep chown domainname grep lessfile mkdir nisdomainname ntfsmove rm stty tailf wdctl znew bzexe chvt dumpkeys gunzip lesskey mknod ntfs-3g ntfstruncate rmdir su tar which bzfgrep con2fbmap echo gzexe lesspipe mktemp ntfs-3g.probe ntfswipe rnano sync tempfile ypdomainname bzgrep cp egrep gzip ln modeline2fb ntfs-3g.secaudit open run-parts systemctl touch zcat bzip2 cpio false hostname loadkeys more ntfs-3g.usermap openvt sed systemd true zcmp root@Droid-01:/bin#
Of course, you can learn about these commands all by simply typing their name and –help at the end!
Installing New Software
The DietPi OS we are using is a stripped down variant of Debian OS and so it uses the apt-get command line interface for installing and managing software. If you want to learn more about apt-get, simply type apt-get –help into your command line on your SBC. We are going to be using apt-get to install some useful software packages on the ODROID
At this point in my installation, I want to start being able to connect to other types of networks and I want an easy way of configuring them. Linux typically uses the wpa_supplicant program to act as a network connection controller / manager and it is a very powerful tool. But there is a catch. The wpa_supplicant software comes with two front end programs to allow you to manage your network connections. The first, wpa_gui offers a graphical user interface that I assume should be eas(ier) to use, but I cannot test as it is not included in DietPi and besides, I am using the command line user interface exclusively at this point anyway. The second front end program wpa_cli offers a command line user interface. Don’t get me wrong, wpa_cli does have a help file, but learning all those commands right now seems a little ambitious. If you want to see what I mean try:
root@Droid-01:~# wpa_cli --help | less
The “less” command is a great tool for showing terminal output only one page at time!
Back to the point: easily changing my network settings with a wide array of choices and settings. ENTER wicd and wicd-curses! The key part about wicd is that it supports both a fully featured console interface as well as a graphical user interface and it should work across almost all Linux distributions! So let’s get this installed, the commands you will want to run are below!
root@Droid-01:~# apt-get install wicd root@Droid-01:~# apt-get install wicd-curses
DING! All done, so let’s go and have a look shall we? Let’s open the console interface:
You will see something like this.
Notes: When you enter the prefs menu, you will need to use something for page up / page down to tab between high level menus, best to Google that for your keyboard layout! I have also found that if you are accessing your SBC remotely via SSH, and you open up wicd-curses and start playing with the network connections you are quite likely to interrupt the ssh session. This is seems like a good tool to use with a display, keyboard and mouse… (cue my disappointed face!)
With that limitation in mind, feel free to wander around and use the tool to scan for networks (use the Refresh function), you can also set various preferences and configurations for different connections. Enjoy exploring! Interestingly enough in this setup, ODROID-1 is set to use WPA-Personal / AES and ROBROBSTATION is set to use WPA2-Personal / AES, but wicd reports both as WPA2 because they both use AES. You will also notice that wicd also gives you the ability to select the bssid that you want to connect to! That is VERY useful indeed.
That’s all for now… 🙂