Adding an OLED to MMDVMHost images for DRM Radio
Well, once again I go find a process I want to accomplish and all the information is out there, however spread around in several places with each place seemingly leaving something out or not relevant to the exact thing I'm doing.
So I'm a happy lad running DMR radio with a Raspberry Pi 3, and a DVMega with Pi-Star OS and an external screen (OLED) that shows status.
Then this Ham I talk to invites me to view his YouTube page for information on adding an external screen to your setup. What this guy has done is amazing. His Ham Shack is amazing. And then he makes the statement that "Nah, I don't use Pi-Star, I use the KB5RAB image which uses MMDVMHost software".
It's just a compiled Raspbian Linux distribution that the developer added a bunch of ham tools to as well as MMDVMHost. Well, if this guy is using it, then by golly I should be using it because he sure seems to know a lot more than I do. So I go download it, burn the image file, boot it, configure it and everything works except the OLED screen that I thought was so cool. So then I find a couple of pages with directions for configuring the OLED and the MMDVMHost github page and try the directions on all three with no success. Then I start playing around with a combination of all three also with no success. Then at some point I start getting the drift of the minutia that the geeks are saying.
This is what I hate about the internet and people who figure things out. They know what they did so they say stuff like "patch this file or run a make on this file" but they don't tell you where the file is and leave out any number of important steps and clues. But hey, they know, right?
So here we go. How to add an OLED in MMDVMHost on the KB5RAB image (and probably other softwares that use MMDVMHost). First of all I got the information from here and here and mostly the directions were great with some detail being left out for my installation. The directions are great right up until the last step where you run the makefile on the MMDVMHost.
Assumption time. Assume you have have KB5RAB image installed and working with DRM and that you have an OLED wired up correctly to the DVMega. See here for details on wiring the OLED. Now log into your pi via ssh or attached monitor, keyboard, and mouse. I use ssh.
go to step 5 (Interfacing options and make sure SPI and I2C are enabled.
Now exit rapsi-config and issue this command:
sudo apt-get install build-essential git-core libi2c-dev i2c-tools lm-sensor
sudo nano /etc/modules
ensure i2c and spidev are added
Now hit CTL + X, then Y then enter to save the file
Now run the following two commands to ensure your devices exist.
root@raspberrypi:~# ls /dev/i2c* /dev/i2c-0 root@raspberrypi:~# ls /dev/spi* /dev/spidev0.0 /dev/spidev0.1
Now run these commands for the OLED library
git clone https://github.com/hallard/ArduiPi_OLED cd ArduiPi_OLED sudo make
"sudo make" also installs the libraries in this instance. Now here's where I ran into problems which are best solved by going into the GUI on the KB5RAB image. So boot into it or open a VNC session. Okay first stop the MMDVMHost
Now get the new MMDVMHost gitclone from the updates folder.
Now you'll notice that it put it in the Downloads folder.
then list the files
Now you can run the makefile here.
sudo make -f Makefile.Pi.OLED
this takes a few minutes. Once it builds go back to the GUI and select "Update MMDVMHost Script"
Now go to "Edit MMDVMHost.ini"
Now make sure under Display it says OLED
Now reboot and you should be looking at a pretty OLED
Now I used the GUI and some of you may scoff at that. Running headless and using the command line is where it is at, and I agree fully with that. This was an attempt to make it EASY for others. By all means, you can do this from the command line and the instructions are already written for you in the scripts files.
NOTE: ONCE YOU RUN THE COMMANDS IN THE SCRIPT FILE TO REFRESH MMDMVHOST FROM GITHUB YOU STILL HAVE TO RUN make -f Makefile.Pi.OLED BEFORE YOU UPDATE MMDVMHOST.
If you feel I cheated cd to /home/pi/Scripts and nano up your relevant script file (github refresh for MMDVMHost or Update MMDVMHost) and use the commands one at a time on the command line. (I've only shown the example of the Update_MMDVMHost file here). No need to run the commands that start with "echo".