Showing posts with label DMR. Show all posts
Showing posts with label DMR. Show all posts

Saturday, January 20, 2018

Pi-Star. Software for DVMega on Raspberry Pi

Ever since I first installed the DVMega on a Raspberry Pi, I have gone through many iterations of software...mostly because software was just being created at the same time I was trying it.

First I tried installing the packages myself on Raspian.  It worked, but was very kludgy to install, start, operate and update.

Next I started downloading premade images...again from many sources, (Westernstar,  Maryland D-star, DMR-Utah, etc)  each more polished than the last.  I was very happy with the package from KB5RAB...(apparently the link I had is no longer valid...not sure of it's status)

Anywho, I heard of another DVMega image for the Pi called Pi-Star, from Pi-Star UK.  I immediately liked this software package because it was so polished.

Pi-Star can admin DMR, D-Star, YSF  (Fusion), and P25...I don't know if they are all 100% functional right now, but DMR, and D-Star are for sure.

The biggest problem with Pi DVMega software packages is the ability to administrate them...you either SSL command line in, or VNC into the Pi.   Both still leave you with some effort to change the settings you want...starting with the challenge of finding the Pi on a new network, or getting it logged into your hotel wifi etc.

So,  Pi-Star boots up with a webserver running and advertises itself on the network as pi-star.local.


You point your web browser to pi-star.local, and you have the main screen, from there you can monitor on the dashboard, or dig into the system with other menu options.


INCLUDING, setting up the wifi and permanently saving the setting, or deleting the particular wifi connection.



Ok, all well and good, but what about at a hotel or other area?   It will be a bit more challenging at a hotel where you log into the wifi via a web page...probably have to share it off your computer...

...but for a regular open network...

So here is my scenario this weekend.  I am in a hotel room, with the open wifi, and need to get my Dvmega on it.   I plug my laptop ethernet (acutally usb dongle in my case) into the Raspberry Pi eithernet port.   I wait a bit, and see "PI-STAR" as an item on the local network...



...from there I just type pi-star.local into the browser, and I am in.


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


Tuesday, January 17, 2017

Communicating between two DVMEGAs without access to the internet

So previously I installed the DVMEGA hardware onto a Raspberry Pi, and installed an image running MMDVMHost which makes the DVMEGA-Pi into a digital radio hotspot...specifically in my case a DMR hotspot.

It is very handy in my application...that is my house is apparently a faraday cage and no radio signals shall pass.

But what if you are out in the field with no access to the internet (no Brandmeister) and too far remote to reach a repeater...how can you use your DMR capabilities?

I dug through the internets for a while until I stumbled over some open source software developed apparently to run full size repeaters.

HBlink   https://github.com/n0mjs710/HBlink

So here is the scenario.  You have your mesh network setup, but the internet is not connected to your MESH.   You have two or more DVMEGAs deployed at different locations...and obviously you have DMR radios at those locations.  With an additional Raspberry Pi running the HBlink software somewhere on the MESH, and the DVMEGAs pointed toward it, now your DMR radios are doing their DMR thing within your MESH network.  (or another way of looking at it is a private DMR network)

This will be a quick walkthough of the software install and config...pretty straight forward, and I am not a Pi genius.

I started with the latest Raspbian Jessie with Pixel.  https://www.raspberrypi.org/downloads/raspbian/

For my purposes I used raspi-config to enable SSH and VNC...

Once all the reboots are done and software updated...

--:   sudo apt-get update
--:   sudo apt-get update

and install the python-dev tools for our Jessie version of Raspbian.   If you don't do this step the rest of the installs will not work.

--:  sudo apt-get install -t jessie python-dev

Then I opened the Pi's browser and downloaded the following software. (in all cases I downloaded the zip or tar.bz2 or tar.gz file)

Bitstring 3.1.5
https://pypi.python.org/pypi/bitstring

Bitarray 0.8.1
https://pypi.python.org/pypi/bitarray/0.8.1

Twisted 16.3.0  (download the Source)
https://pypi.python.org/pypi/Twisted/16.3.0

service_identity 16.0.0  (download the Source)
https://pypi.python.org/pypi/service_identity

DMR_utils
https://github.com/n0mjs710/dmr_utils

HBlink
https://github.com/n0mjs710/HBlink


Then using the File Manager in Raspbian I went to the downloads folder, right clicked on each file individually and selected "Extract Here"

I did the following steps within the terminal window.  These were all python scripts, and all installed the same way.

--:  cd Downloads

We will start with service_identity.


--:  cd service_identity-16.0.0
--:  sudo python setup.py install

after it finishes downloading and installing

--: cd ..

and so on and so forth through the rest of the downloads

--:  cd bitarray-0.8.1
--:  sudo python setup.py install
--: cd ..

--:  cd bitstring-3.1.5
--:  sudo python setup.py install
--: cd ..

--:  cd Twisted-16.3.0
--:  sudo python setup.py install
--: cd ..

--:  cd dmr_utils-master
--:  sudo python setup.py install
--: cd ..

--:  cd HBlink-master
--:  sudo python setup.py install

now stay in the HBlink-master directory...we need to edit the hblink.cfg file...there is none, but there is a sample to be edited.

--:  nano hblink-SAMPLE.cfg

scroll down until you see [MASTER-1] ...make it look like this.

[MASTER-1]
MODE: MASTER
ENABLED: True
REPEAT: True
EXPORT_AMBE: False
IP:                                                             (I left this blank...seems to still work)
PORT: 54000
PASSPHRASE:                               (I use the same one I used for brandmeister...)


I also scrolled down to [REPEATER-1] and set ENABLED: False

now within nano save the file, but change the name to hblink.cfg

(for nano editing, the CTRL key and whatever option you want...so to save = CTRL-o   ; to quit = CTRL-x)

We are done installing and configuring.

To run, simply type (we are still in the HBlink-master directory)

--:  python hblink.py

You will see some messages like

-DEBUG - Logging system started.
-INFO - HBlink - SYSTEM STARTING...
-DEBUG - (MASTER-1) Master maintenance loop started
-DEBUG - MASTER instance created

if you see anything other than that especially with words like FAIL or ERROR...you probably have a problem...google is your friend.

After those start up messages you will simply see the 'DEBUG Master maintenance loop started'  message every few seconds...

Now on your DVMEGA, edit the MMDVM.ini file to have the DVMEGA use the HBlink machine as the server.

[DMR Network]
Enable=1
Address=xxx.xx.xx.xx        (your HBlink machine IP address goes here)
Port=54000                          (the HBlink port#...)
# Local=3350
Password=s3cr37w0rd      (make this password match the one you put in HBlink)
RSSI=0
Slot1=1
Slot2=1
Debug=1

At this point start up MMDVMHost  (personally I just reboot the DVMEGA pi)

If you are watching the HBlink screen you will see the following message when the DVMEGA logs into it.

-INFO (MASTER-1) Repeater Logging in with Radio ID: xxxxx,
-INFO (MASTER-1) Sent Challenge Response to (your DMR ID) for login:
-INFO (MASTER-1) Client (your DMR ID) has completed the login exchange successfully
-INFO (MASTER-1) Client (your callsign and DMR ID) has sent repeater configuration

now when you kerchunk your DMR radio to the DVMEGA you will get the following message on HBlink

-DEBUG (MASTER-1) Received and answered RPTPING from client (your callsign and DMR ID)

after some inactivity you will get

-INFO (MASTER-1) Client (your callsign and DMR ID) has timed out


that RPTPING is all you need to see to know it is working...of course the DVMEGA machine should successfully login to the DMR server also.


Now from this point all you have to do is point the DVMEGAs to the HBlink server and it is all up and running.   I successfully tested this using two DVMEGAs set 5Mhz apart in freq, connected through different nodes of the MESH, the server and the DVMEGAs were on different nodes.


Sunday, December 11, 2016

DVMEGA Raspberry Pi DMR with TYT-380

This is going to be one of those posts that if you don't know much about the subject...you won't know much more at the end.

Long story as short as I can...

The lastest technology available to Amateur Radio hobbyists is digital audio.   So same radio frequencies, but instead of analog audio like on your old walkie talkie...it is digital audio like your cellphone/skype/etc.  Why? More conversations on a frequency, better audio, 'caller id, internet connectivity. etc

So I picked up a cheap DMR HT the TYT-380 I wrote about before.   It works great, DMR programming is complicated due to the capabilities of DMR.



Unfortunately my house is a Faraday cage, and signals have a hard time making it through the walls...so I can only use the radio outside the house.

A technology that has been available for a while and are really maturing are Digital Voice hotspots.   This took me a while to understand the usefulness...because the job it did wasn't really well described.  I have a DV hotspot that has a small radio and connects to the internet...my radio can talk to this hotspot which puts my radio on the internet...most Repeater or other hotspots are ALSO on the internet...so this hotspot is my connection to the larger radio world.   This hotspot lets me use my DMR radio inside the house.

There are a lot of choices of  'gateway' or 'hotspot' depending on need and what digital radio technology you are using (DMR, DSTAR, FUSION, for a few examples)

So again the problem is I cannot use my DMR in the house.   The solution I chose is the DVMEGA board mounted on a Raspberry Pi.  There are other types...this is simply the one I chose.



I am not going to regurgitate all the well documented steps, I am simply going to list the links I used, and the problems I encountered...in all cases I made an error/didn't fully understand.

You will need the DVMEGA board...I got the dual band version(from Gigaparts) or. http://dvmega.auria.nl/
You need a Raspberry Pi...I have version 3s.
You need an antenna for the DVMEGA board (unless it comes with yours)  I am using a stubby rubber ducky style antenna.

One thing they don't tell you is the DVMEGA is a self contained Arduino powered board...so there will be firmware updates for it...unless you have some kind of special serial programmer (available separately) you will need another method to do the updates...and it involves soldering.   If you do not want to solder, then I would look at a different solution for your DV hotspot.

http://www.dvmega.auria.nl/Downloads.html

https://g0wfv.wordpress.com/how-to-update-dvmega-firmware-without-a-programmer-or-an-arduino/

https://www.florian-wolters.de/blog/2016/03/12/firmware-upgrade-on-dvmega-without-programmer/

So my first problem involved the soldering...I did it in my office (I don't have a magnifying glass here, and you are soldering on a SMD component) and apparently I didn't get a good connection...it took about a day of battle to troubleshoot that one.

https://www.florian-wolters.de/blog/2016/03/12/firmware-upgrade-on-dvmega-without-programmer/#imgModal-89

Once the firmware successfully updated, it was all pretty much straight forward.  The second part was getting the software that does the DV stuff onto the Raspberry Pi.  The two ways to do it are to use a standard RPi install and add the new software, or download an already created image...well I did both and downloaded 5 RPi images in the process...that took forever.

BTW the software that does the DMR (and others) is MMDVMHost

For the image, the last one I found (by accident...well hidden) is from DMR-UTAH   http://www.dmr-utah.net/support/mmdvm/images/

I recommend going straight to that one.  You still have to edit a file...but there is a shortcut to all the tools.

https://wiki.brandmeister.network/index.php/DVMEGA

The BrandMeister link has the best explanation for the settings...a VERY IMPORTANT SETTING IS Port=/dev/ttyAMA0   There are a variety of other ones in the settings...but this is the only one you want.

https://www.hamdigitaal.nl/?p=6122 (one of my attempts used a DSTAR Pi image)

So assuming the firmware update went well, and you are running the software on the Pi...how do you know if it is working...this also took a while for me to track down, but found simple solutions for that.

First, with the software running on the Pi, when I transmit with my radio, the Terminal window running on the Pi will show the transmission and my callsign...and if it is receiving data it will show those callsigns.   But what do I sound like...is anyone trying to call me?   Found an easy tester for that.

BrandMeister is the voluntary collective for DV through internet...they have some good info (not all, but some)  They also have a couple of good tools.   LastHeard shows all the current connections world wide...you can filter the results to your callsign.  Second one is Hoseline , you select a TalkGroup number (note I typed in 3100 in the URL) and it will play the live audio...so select the TalkGroup you will be transmitting on, and when you transmit, your audio will come from the webpage.  BTW between all the various moving parts...the audio I heard on the website of other transmission I also heard simultaneously on my HT through the DVMEGA-Pi.

Those two tools really gave me a warm fuzzy that everything on my end was working properly, and the final confirmation was a very positive signal report from an Amateur radio operator who was south of Milan Italy.

The last hard part about this setup is programming the radio...essentially your hotspot is a repeater, so add it to your radio settings like you would add any other DMR repeater.

Some TalkGroups.

http://www.trbo.org/talkgroups/

https://wiki.brandmeister.network/index.php/United_States_of_America








Monday, January 25, 2016

TYT MD-380 DMR Firmware hack etc...

I will apologize in advance for not having all the answers on the subject.   The purpose of this post is to give the background info, step through the programming, and results so far.


The Tytera MD-380.

So this is a DMR radio, comes in 2 versions, VHF and UHF.   I have the UHF one...mine cost $110.

A group of Amateur Radio hackers figured out how to get into the firmware, and wrote their own to reflash the radio...the future purpose is to hopefully add some additional digital features to the radio.

According to this article.

And this Hackaday article...with this link to the groups notes (near end of PDF)

 Not too long after the first hack,  a firmware was written that supposedly will allow the radio to act as a DMR scanner.

This article talks about it.

And here is the TYT MD-380 Yahoo Group.

I know nothing about DMR setups, but I wanted to learn, and this seemed like a interesting way to do it.

...DMR  is Digital Mobile Radio...voice calls are converted into packets of data and sent over the airwaves...Icom's D-STAR, Yaesu's System Fusion are two of the popular Amateur radio versions.

This PDF has all the background info.

And while I am listing links, this one shows all the DMR-MARC linked repeaters.

 That is all I know about DMR at this second...I just got the radio an hour ago or so, so that's my excuse.

But here is the meat of the post...how to get the hacked firmware loaded (and how to load future firmware) and how to program frequencies etc.

The same website with the news on the new firmware also had the various firmwares.

I needed the "Experimental Firmware" V1.0 as I write this.   And the Programming Software to program the channels...I used the latest which was 1.30.0

My radio came with a programming cable (looks exactly like my Baofung one) that worked with no drivers needed (Win7 64-bit...I am not sure if I have programmed the Baofung on this Windows install).   EDIT:   I did install the programming software before doing all this  MD-380 v130.exe ...that might be necessary.










I plugged the cable into my USB port, and with the radio off plugged it into the radio.

I held the top two buttons (PTT and the one above it...NOT "M")

As I held those buttons I turned the volume knob to power the radio on.

I heard the Win7 beeps as hardware was added...I think I already had the firmware uploading software running...but am not sure if that makes a difference.  (I did NOT have the radio programming software running)

If it is going good so far, the LED at the top will alternate Red/Green. throughout the process...and the colors hold
 steady a few times during the actual firmware load.



Now to the software.

When you unzip the "Experimental Firmware" file you get about 14 files...The TXT file will explain the same process I used.   The Upgrade.exe file is what we will use to load the firmware.




Not much to it...and note the gibberish characters...we will see more in a bit.

In the middle you see "Open Update File", click on that and select the file you want, the TXT file explains the choices...and if you ran the program from the same folder all the files were in, then you should see some ".bin" files.   I chose the "experiment.bin" file   ( "experiment.img and experiment.bin: patched to monitor all talk groups, private calls, and sideload alternate firmware")


Now click on "Download Update File"...that loads it into the radio.   The TXT file says it takes less than a minute...mine took more than a minute.

When it was done I got this...



Apparently it means the load was successful.   I clicked OK, turned off the radio, exited the program, unplugged the cable, and powered it back on.


Great Success!  (that is what the patched bootscreen looks like)


Now time to program some frequencies.



That is the Programming software MD-380.   I hooked the cable back up to the radio, turned it on normally (not holding any buttons).

Then on the software I selected the icon that looks shows yellow arrow away from the radio.


You click that then the radio shows this.



After a bit you get this...


Then do your editing...much like using Chirp or other radio software...I don't know all the ins and outs of DMR, so I don't have everything loaded...but it does receive.

When you are done editing, save a copy for yourself, then push the icon with the red arrow pointing toward the radio.



Looks like this while writing.   You can see the expanded menus on the left where I poked around trying to find where to put in frequencies.

That's about it for now,  I programmed the local DMR repeaters and have been listening to Amateur radio conversations from London and all points of the U.S.

Hopefully they will figure out some advanced firmware soon.