Schedule Update of Stripped.csv File

I recently had a gentleman, Richie M6XRM, contact me on how to do this. It proved to be quite the challenge.

Instructions & Script

The information and how to has been posted on my GitHub page along with the script (you will need to supply your own URL to the stripped.csv file). Below I’ll explain the issues we encountered while trying to configure this automatic update. I can’t say that this is the best or only way to do this, however this is how I did it and I can confirm it works.

Issues & Fixes

Issue 1

One of the biggest issues was writing the script on Windows and converting/keeping the line endings of that script as unix line endings so they’re compatible with linux. I used Notepad++ to write and edit the script before uploading it to GitHub. Apparently it is not enough to save the file as a UNIX bash/sh file type. At the bottom of Notepad++ it says what the line endings are and I never noticed it. The DOS line endings created a lot of issues when the script was run on the Pi.

Fix 1

The fix for this in Notepad++ is to click Edit > EOL Conversion > Unix and then save the file as a UNIX bash/sh file with the extension “.sh”. The fix in the nano text editor is to press CTRL + x, then y, then ALT + d, then enter.

Issue 2

The other major issue was that system cron on the Pi does not understand rpi-rw even when it is run inside the script which is being run as root.

The cause of this is that rpi-rw is actually an alias set in the bash profile for the logged in user. Since cron runs as it’s own thing/shell separate from the logged in user (pi-star), it doesn’t understand rpi-rw or at least it didn’t understand it for me or Richie.

Fix 2

The fix for this is to put the actual command that rpi-rw points to in the script instead of using rpi-rw. That command is as follows:

sudo mount -o remount,rw / ; sudo mount -o remount,rw /boot

I came across this page on Medium which explained how to convert Raspbian to a read-only filesystem which is what Pi-Star uses. At the end of the page it talks about creating an ro and rw alias to quickly switch the filesystem between read-only and read-write. That’s when it dawned on me that this is the way the Pi-Star developers handled the read only operating system and that rpi-rw/rpi-ro are aliases.

A huge thank you to Richie M6XRM for his patience with me in figuring this out and for being so understanding while I was recovering from surgery.

We just hope this helps someone else and explains a bit of the mystery behind the rpi-rw and rpi-ro aliases.

73,
Tyler N3TDM

Week 11 – DMR Deviation & Case

I enabled DMR last week and spent some time configuring it. This week I had to set the DMR transmit deviation in order to get it to work.

Essentially setting the TX deviation for DMR is the same as how I set the transmit deviation for DSTAR in the beginning. I used a service monitor and checked the deviation level while the repeater was transmitting. It was lower than it should have been, so I increased the level in the expert MMDVMHost editor on the line that said DMR Level. This adjusted the deviation for just DMR, leaving the deviation alone for all other modes.

I also created a box/case for my project out of a large crayon box that I found at WalMart for about $3.

  1. I used a template for the Pi to drill four holes in this box for some #4 screws to mount the Pi and MMDVM duplex. I also put a piece of acrylic between the Pi and this case so that it wouldn’t be pressing against the back of the Pi.
  2. I then cut out a hole for the size of my 3.2in Nextion Display.
  3. I also drilled holes around the display cutout to mount the display in place.
  4. I used plastic from an old ice cream container to create a bezel to go around the display since part of the display doesn’t show anything and is instead used for the touch screen controller/wiring.
  5. I added two external antenna connectors. I bought two male to female jack/panel mount SMA connector extensions for about $6 each and then I added some right angle SMA connectors (male to female) 5 for about $4.
  6. For the external antennas I drilled the holes in the box as far apart as I could and installed the female jack connectors through the hole.
  7. Then I screwed a right angle SMA connector on each jack.
  8. Next, I used a couple right angle SMA connectors on the MMDVM hotspot/repeater board.
  9. Finally, I installed all of the electronics.Here is the finished case.

Week 9 – Many Problems

This week, I downloaded a Nextion Display layout created by PD0DIB and modified it to include a system control page and an information page. After trying out the Nextion Driver Installer created by ON7LDS, I could get the screen to display information one time, but after switching pages, the data would disappear. To solve this problem, I looked at the Nextion Driver Installer script and followed most of the steps manually. Doing it this way also allowed me to switch the displayed CPU temperature from celsius to Fahrenheit. This pretty much solved the issues with the display.

In the Nextion Driver Installer Script, I followed this section:

if [ "$ND" = "" ]; then
    echo "+ No NextionDriver found, trying to install one."
    compileer
    $SYSTEMCTL
    $NDSTOP
    $MMDVMSTOP
    killall -q -I MMDVMHost
    killall -9 -q -I MMDVMHost
    if [ "$CHECK" = "PISTAR" ]; then 
        cp $DIR"/mmdvmhost.service.pistar" /usr/local/sbin/mmdvmhost.service
    fi
    if [ "$CHECK" = "JESSIE" ]; then 
        cp $DIR"/mmdvmhost.service.jessie" /lib/systemd/system/mmdvmhost.service
        cp $DIR"/mmdvmhost.timer.jessie" /lib/systemd/system/mmdvmhost.timer
        cp $DIR"/nextion-helper.service.jessie" /lib/systemd/system/nextion-helper.service
        if [ -e /etc/systemd/system/nextion-helper.service ]; then
            echo "+ there is already a link /etc/systemd/system/nextion-helper.service"
            echo "+ I'll leave it like that."
        else
            ln -s /lib/systemd/system/nextion-helper.service /etc/systemd/system/nextion-helper.service 
        fi
    fi
    cp NextionDriver $BINDIR
    echo "+ Check version :"
    NextionDriver -V
    checkversion
    helpfiles
    echo -e "+ NextionDriver installed\n"
    echo -e "+ -----------------------------------------------"
    echo -e "+ We will now start the configuration program ...\n"
    $DIR/NextionDriver_ConvertConfig $CONFIGDIR$CONFIGFILE
    herstart
    exit
fi

Basically all I did was the following:

  1. Stop MMDVMHost with “sudo service mmdvmhost stop”
  2. Download the Nextion Driver from github into the /tmp folder
  3. rpi-rw
    cd /tmp
    git clone https://github.com/on7lds/NextionDriver.git
    cd NextionDriver
    
  4. Compile the driver by running “make”
  5. Then you should end up with a binary called “NextionDriver”.
  6. Copy the binary into /usr/local/bin with
    sudo cp NextionDriver /usr/local/bin/NextionDriver
    
  7. This was all done AFTER running NextionDriverInstaller.sh on its own. So, my installation had all the helper files already installed before I ran through these commands.

Problem 2

The hotspot/repeater doesn’t startup right away like it does at home. I’m guessing this is because of the enterprise WiFi at my University. Sometimes the repeater starts right up and works perfectly and other times it does not work.

Problem 2 Solutions

  1. Create a simple script to reset the WiFi connection on the Pi and create a button on the Nextion Display Layout that would allow me to run this script.
  2. Use the same script, but have it run after the Pi is completely booted and add a line to restart the MMDVMHost service.

Problem 3

I could not always access the PiStar dashboard through the ethernet/crossover cable or through the University’s WiFi. Again sometimes I had no issues and other times it would not connect. At first I thought this was due to having both the ethernet and the WiFi running on the Pi, but after removing the ethernet, I had the same issue. I’m growing more suspicious of the enterprise WiFi. As for it not working over the crossover cable, I believe this is due to the fact that the computer is addressing itself with a self-assigned IP address (a 169 address). The problem appears intermittent.

Problem 3 Solutions

  1. Use the solutions for problem 2 as I believe the two problems may be related.
  2. Create a static IP on the Pi and the Computer for the ethernet connection.
  3. Change the PiStar firewall rule for the dashboard from “Private” to “Public.”

Going Forward

  1. Enable DMR and configure it.
  2. Install the Brandmeister control panel on PiStar.
  3. Program the DMR Radio.
  4. Create a blog post about programming the DSTAR and DMR radios.

I also wanted to create a 3D printed case for this project, however I am not sure I will have enough time to do that, especially with encountering these problems.

Week 6 – Hardware

Last week I decided to purchase a little board called an MMDVM_HS_HAT_DUPLEX. What I purchased is a cheaper clone, but it should work about the same as it uses the same firmware. Essentially it is a tiny low-powered repeater on a single circuit board. It is designed to be a personal duplex hotspot.

MMDVM_HS_HAT_DUPLEX

The board has an STM32 microcontroller and two ADF7021 radio microchips. The board should produce about 10mW of RF power output. The board has a number of LED’s to indicate various things such as, power, carrier operated squelch (COS), Push-To-Talk (PTT), and an LED for each digital mode the board is capable of such as DSTAR, DMR, YSF, P25, and NXDN.

MMDVM Digital Mode LEDs

The board is a hat so it sits directly on top of the Raspberry Pi and uses the Pi’s GPIO pins to communicate with the Pi-Star Software.

MMDVM & Raspberry Pi GPIO Connection

Fully assembled, this is what the Pi looks like with the MMDVM Duplex Hot Spot board attached.

MMDVM_HS_HAT_Duplex on Raspberry Pi 3b

The other piece of this project that I decided to add, was a screen. It has not arrived yet. This will solve the problem of not knowing the IP address of the Pi to connect to the dashboard. I did some reading and the MMDVM Duplex Board is capable of working with a small OLED display OR a Nextion touch screen. I opted for the touch screen which will give me more options for controlling the device. On most of the forums and Facebook groups for DSTAR hotspots, other hams seem to recommend the 3.5″ display most often. I opted for a slightly smaller 3.2″ display, specifically the NX4024K032_011R.

Nextion Display

It’s slightly cheaper than the 3.5″ screen and slightly smaller. This is an enhanced version with more flash memory and more RAM than the basic models.

Nextion Editor Layout

This display is a Human Machine Interface that is programmed using a piece of software called Nextion Editor. It’s a What You See Is What You Get (WYSIWYG) editor. The coding to make the screen work seems pretty simple, however I have not looked at the code in the Pi-Star software that actually sends the information to the screen.

Here I found a guide on using the Nextion Editor software, which I’m sure will be useful for creating my own display interface. Here is another guide on creating a screen layout/interface that is specific to the MMDVM and ham radio. The interface is designed, saved to an HMI file, and then compiled into a TFT file, which is then uploaded to the screen. You can upload the TFT file via a USB to TTL serial adapter or by using a microSD card with the TFT file on it, inserted into the microSD card slot on the Nextion Display.

USB to TTL Serial Adapter

You may also find *.TFT files that other amateur radio operators (hams) have made available on a few different MMDVM Hotspot groups. These files (as long as they’re made for the exact screen you’re using) can be downloaded to your computer and uploaded to your screen. If you can get the *.HMI file which is typically available with the *.TFT files, you can edit the HMI file in Nextion Editor to suit your needs and then upload it to your screen. Here is an example interface from the second guide that another ham has created.

UI sample from PD0DIB

Next week I’ll set up the MMDVM to work with the Raspberry Pi and update the MMDVM’s firmware.

Capstone Project Proposal

For my capstone project, I want to build a digital multimode amateur radio repeater.

Amateur Radio is a two way radio service which in the United States is licensed by the Federal Communications Commission (FCC). It allows amateur radio operators the ability to talk to one another around the world using radio and to experiment with/design radio(s) and radio antennas. Amateur radio is often called “ham” radio. Ham radio is also used during natural disasters/emergencies to communicate when all other means of communication have failed.

I earned my Extra Class license about nine years ago. The Extra Class license is the highest license class that one can earn. While I’m not very active on the air talking to people, I enjoy the electronics and technology side of ham radio. More recently I have been working with digital repeaters, mainly Digital Smart Technology Amateur Radio (DSTAR) repeaters and occasionally Digital Mobile Radio (DMR) repeaters.

For my capstone I want to setup a multimode digital repeater that will switch between DSTAR and DMR depending on the signal it receives. This will be accomplished through the use of readily available software running on a Raspberry Pi that will be interfaced with a radio operating in the 70cm band.

The project will include a Nextion display to display information about the repeater and who is currently talking & allow one to control the repeater via touchscreen. I will design a screen layout for the Nextion display using Nextion Editor.

I will also add or enable a few extra features such as remote control through the ircDDBRemote app for DSTAR, remote SSH access, automatic linking based on a schedule, and possibly a few more as time permits.

I would like to learn how to design or modify and print a 3D printed case for my project too. 3D printing is something I have very limited experience with and would like to learn more about.