Friday, March 17, 2017

Communicating between multiple DVMegas or even OpenSpots on DMR without internet...revisited updated etc

 So the executive summary of this post is...

-SharkRF OpenSpots can communicate to HBlink (previous post)
-better install method for HBlink.


As far as the Openspot...the latest firmware (I have a v1.1 model) srf-osp-1.1-0101.bin improves the web interface and adds enough options to correctly link up to HBlink.
(I will admit, I only have one radio so right now I have not done a reception test...but the DVMega shows the traffic from the Openspot).

The Openspot manual shows how to do the settings...just point to the HBlink server, and use Homebrew/MMDVM Connector, and MMDVM Protocol.


The following is a cut and paste from a fellow ham, Mark who spent a lot of hours making a good repeatable installation process.  And in his setup, he runs HBlink on the same Pi that holds the DVMega...I am using a separate Pi.

-----------------------------------------------------------------------------------------------
This method does not require the loading of any specific versions of any of the components, which should allow it to continue to be usable in the future, even as the components are updated.

Note: I started with the latest 03/03/2017 raspbian release . . . even if you aren't currently using this release, the very first "sudo apt-get" step will actually update your RPi to the full equivalent of this release.

Note: if you have previously loaded other utilities (MMDVMHost, HBlink, or particularly ircddbgateway) on your RPi, you will need to edit any files in the /etc/apt/source.list.d/* folder (other than the standard raspi.list file . . . you can leave this one alone) & comment out any uncommented lines (e.g. particularly the references to nh6z.org, but also any others that may be present).  The uncommented lines in these files reference additional sources over & above those standard for raspbian & will very likely prevent you from successfully fully updating the raspbian OS on your RPi if they remain uncommented.

Here's the step-by-step that I followed to get HBlink installed & running:

sudo apt-get update && sudo apt-get dist-upgrade

cd /home/pi/Downloads

git clone http://github.com/n0mjs710/HBlink

git clone http://github.com/n0mjs710/dmr_utils

sudo apt-get install python-dev libffi-dev libssl-dev python-pyparsing python-appdirs

sudo pip install --upgrade pyOpenSSL pyparsing appdirs pyasn1 (that's digit one on the end of pyasn1)

sudo easy_install bitstring

sudo easy_install bitarray

sudo easy_install Twisted

sudo easy_install service_identity

cd dmr_utils

sudo python setup.py install

cd ../HBlink

cp hblink-SAMPLE.cfg hblink.cfg


(edit the hblink.cfg file for the following:)



under [MASTER-1]

change PASSPHRASE:
(to match brandmeister for convenience)

(passw0rd)

change PORT: (to match brandmeister for convenience)
(62031)


under [REPEATER-1]

change ENABLED: to False


Then, to run HBlink, you can use the same "startup script" + "autostart" method used for MMDVMHost.


Content of the /home/pi/.config/autostart/HBlink.desktop file is as follows:

[Desktop Entry]

Type=Application

Name=HBlink

Exec=lxterminal --geometry=120x32 -e "/home/pi/start_hblink"

StartupNotify=False

Content of the /home/pi/start_hblink script is as follows

(NOTE: in the command to kill HBlink, the character right after the "-9" & again at the very end of the command is a "back quote", which is typically somewhere to the left of the number "1" on most keyboards, whereas the character on either side of the "curly braces" after the "awk" command is a normal "single quote", usually located somewhere near the RETURN/ENTER key on most keyboards):


kill -9 `ps -ef | grep -v grep | grep "hblink.py" | awk '{print $2}'`

clear

echo -n "sleeping 10 seconds before (re)starting HBlink."

sleep 1

echo "."

sleep 1

echo "."

sleep 1

echo "."

sleep 1

echo "."

sleep 1

echo "."

sleep 1

echo "."

sleep 1

echo "."

sleep 1

echo "."

sleep 1

echo "."

sleep 1

echo "."

clear

cd /home/pi/Downloads/HBlink ; python hblink.py



In English, the command line to kill HBlink says to do the following (in this order):
1) [ps -ef] = get a list of all tasks that are running

2) [ps -ef | grep -v grep] = take the results from #1 & ignore any task that has the word "grep" in it

3) [ps -ef | grep -v grep | grep "hblink.py"] = take the results from #2 & filter it down to only those tasks that contain the text "hblink.py"

4) [ps -ef | grep -v grep | grep "hblink.py" | awk '{print $2}'] = take the results from #3 & print out the task ID number which is in the second field (where fields are considered to be separated by a "space" character by default)

5) kill -9 `ps -ef | grep -v grep | grep "hblink.py" | awk '{print $2}'` = execute the whole command string in #4, take the results from #4 (which is a task ID) & hard kill that particular task ID, no matter what

(If like Mark, you run HBlink on the same Pi that has the DVMega mounted then...)

When running MMDVMHost & HBlink on the same RPi, you must configure MMDVM.ini as follows:

[DMR Network]
Address=127.0.0.1

(Normally that points toward the remote brandmeister or whatever server)

I tried using the RPi hostname in this setting, but in that case, MMDVMHost does not fully complete the registration process with HBlink

Feel free to use this info however you see fit !!  -Mark