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








Friday, December 9, 2016

Laserdisc audio/video setup

Ok, so I have issues.   I enjoy the act of playing vinyl records...I like the fact they are fragile and require care and a bit of effort to play music.   It is part of the charm.

So in ancient times (late 80's) I was in a video store (remember those) and watched the U2 Live at Red Rocks: Under a Blood Red Sky concert playing on a laserdisc.   I was amazed at the picture and the sound (VHS was all you had then).   Some video stores had LaserDiscs to rent, but the machines were VERY expensive (twice what a VHS machine cost) and only played, no recording.   To buy a movie on laserdisc was another expensive proposition.  (first released around 1984)

(price $1200 in 1995, new)

Well since I didn't have any money, I didn't invest in that technology...but I remember lusting after it.

Fast forward to last year, I am watching some YouTube videos from a couple of different channels about old audio and video formats...and saw that there is still strong support for the laserdisc players and the discs themselves.   The format died around 2000, so there are no new disks past that point...and no new players after 2009.

Techmoan YouTube Channel

Culturedog YouTube Channel


For whatever reason, I decided that I wanted to join this hobby...there is no good reason to do so, but it seemed to make sense at the time...sort of like vinyl...there is an effort involved in watching a movie on laserdisc.


Some interesting things about the LD format...the video was pulled live directly from the films...live as in they would run a batch through to record it electronically, then check the quality...if they didn't like it they would change some settings and run it through again.   In most cases they had representatives of the move (directors etc) to evaluate the copy and approve or disapprove...in some cases it took 5 tries to get the copy they wanted.   So a LD is a permanent copy of a film the last time it was shown...film imperfections and all.   For me, it is like being back in the theater.

Audio is another subject.  There are 4 types of audio available depending on the disc...and again, for the most part it is whatever the movie had.  All audio is recorded as a kind of radio signal on the disc (you can research that yourself).  Your choices are plain old Stereo Analog.  Digital Stereo, AC-3 digital surround, DTS digital surround.


(BTW, to my ear the LD Digital audio is amazing...I am not a audiophile with $1000 speaker wires, but it sounds fuller and I hear details that I never noticed on DVD or BD of the same move)

Analog is those two plugs you stick in the back of the stereo.   Audio quality is as good as the converter on the player.
Digital Stereo is a digital conversion direct from the RF feed...so it is as good as your decoder (receiver) is.
AC-3 digital surround was a way to get the full 5.1 surround data to a decoder...right now almost no receivers have AC-3 decoders...so you need an additional decoder.
DTS digital surround was the other way to get full 5.1 surround data...most good receivers have DTS decoders built in...no additional decoder required.

Every disc has the Analog data on it.   Most have Digital Stereo outputs.   Quite a few newer releases have AC-3 versions available...but the packaging was similar to the Digital Stereo ones...so you have to look carefully...if there is an AC-3 version, then there is also a Digital Stereo only version.  DTS is very rare...I only have a couple myself...it was limited production, and only a few movies were released with it.





(use the LDDB.com to figure out what version is what)

The better than average LD players had the Digital outputs...so you can play DTS on most of them...only a few LD players had the AC-3 output...So it is hard to get DTS movies, easy to get players...hard to get AC-3 players, easy to get movies.



I ended up with the Pioneer CLD-D704 which is at the top end of the (now) affordable LD players...there are some sold in Japan at about 5 times the price that are better...if you can find them.   The CLD-D704 has the AC-3 output and arguably some of the best video playback.

Oh, about that.   All playback is composite.   The laserdiscs were encoded as composite video data...that means your S-Video plug doesn't improve anything.  The video output is comparable to DVD.

So what do you do with that in an HD world?   You buy more parts.  To sum it up...the composite output has issues, and up-scaling to HD makes more issues.   Many receivers can do it (mine included) but with varying degrees of quality.   Mine is tolerable...but not good.

So in following the forums I learned that the best machine for cleaning up the composite video signal (comb filter) is a DVD recorder (say what?)  So I got a Panasonic DMR-ES10 off ebay with a broken remote sensor that I was able to fix for cheap.



I have the composite video and analog audio going into the ES-10 from the LD.   Now to upscale it, I got a DVDO iScan HD+ which can up-scale to 1080P.  I send COMPONENT out from the ES-10 to the DVDO.   Yes, the ES-10 separates the composite input to component.

It only has DVI outputs, so I had to get a DVI to HDMI adapter to plug into my receiver.   Also the up-scaling creates a bit of delay, so I put the Digital Optical through this then to the receiver...it won't send audio over DVI.

Now for the audio...I need the ability to decode AC-3...but if no AC-3 then I need to send Digital Stereo/DTS ...and I don't want to have to switch audio inputs all the time.   So I got the Denon AVD-2000.


I have the AC-3 and Digital out plugged into this thing, and if there is AC-3 it automatically selects it...otherwise just the Digital Optical, and it sends that to the DVDO.   However some LDs have only Analog audio...so I put the Analog audio into the ES10, and plug the digital out from that into the AVD-2000...that way if I have to switch to Analog, I only have to hit one button, AND because I am sending the Analog though the same path as the digital, any delays in up-scaling will be synced.

So does it work...well whenever someone puts this much effort into a setup, they will of course say it looks great.   Well, the way I have everything hooked up, I had to select a lot of different inputs to make sure I had everything wired correctly...the LD player has two composite outputs, the ES-10 can output composite and component.   the DVDO can accept all sorts of inputs.   So I had one composite directly from the LD to the DVDO, one from the ES-10 to the DVDO and a component set from the ES-10 to the DVDO.

First test was LD and DVDO composite only.   Scaling was nice, no artifacts, but color seemed a bit washed out...I played with the DVDO settings but couldn't make much change.

Second was LD to ES-10 to DVDO using composite.   Everything else was the same but color looked a bit better, maybe still a bit washed out.

Third was LD to ES-10 to DVDO using component.   WOW that changed everything!   Color was good, but black level and contrast were amazing...

Now, my test disk was Pink Floyd live at Pompeii...a 70's concert movie...which already had some artifacts due to the film quality...but it looked good to me.


Here is how it is all wired up...fun huh.   (of course there are about a half dozen other components also plugged into the receiver...wiring clutter is fun.)