Remote radio – client

How to set up the client side of the remote radio system.

(under construction) patches have not been uploaded to github

This client works with the sever described in the previous post. We are running a MacBook Pro OSx 10.11.4. with the following:

  • logmein hamachi VPN
  • Soundjack VOIP
  • Max/MSP
  • Novation launchpad
  • DJ-Tech CDJ-101 controller

VPN

Install and set up LogMein Hamachi. It is free, for a limited number of computers.  Set up a Hamachi server on both the server and client. It should look something like this:

 

VOIP

We are using Soundjack VOIP. It is also free. Use the following parameters on the client side.

  • mic: soundflower 2ch (or something that is not currently producing input!)
  • headphone: default output (or whatever you want to listen on)

Screen Shot 2016-04-05 at 12.23.54 AM

You can ignore the rest of the settings, since we are not sending audio. Most of the configuration is done on the server side.

Max

We are using several patches, depending on which hardware controllers you are using. Make sure that the hardware controllers are connected before opening Max.

patches:
  • eagle-ui5.maxpat – User interface and main entry point for client communication and CDJ-101 abstrations

Screen Shot 2016-04-05 at 12.28.56 AM

  • freqdb4.maxpat – database handler

Screen Shot 2016-04-05 at 12.29.17 AM

  • lp_radio2.maxpat – launchpad driver

Screen Shot 2016-04-05 at 12.28.41 AM

After the max patches are loaded, you should be able to control the radio using the UI and the CDJ-101 controller. The red Mixer button in the upper right corner of the Launchpad should be lit.

Instructions:

to be continued…

Remote radio – server

How to run the server side (base station) of the remote shortwave radio system.

(Under construction) The patches have not been uploaded to github yet.

Assuming that the radio and antenna system are operating. We are using an internet connected MacBook Pro running OSx 10.9.5, with a MOTU 828 MK3 audio interface.

VPN

Install and set up LogMein Hamachi. It is free, for a limited number of computers.  Set up a Hamachi server on both the server and client. It should look something like this:

 

VOIP

We are using Soundjack VOIP. It is also free. Use the following parameters on the server side.

Local Settings:
  • mic: audio interface channel that is connected to radio audio output
  • headphone: doesn’t matter
  • volume: 0
  • audio block samples: 512
  • channels: 2
  • network packet samples 512
  • quality: high
  • userlist: manual

Screen Shot 2016-04-05 at 12.38.03 AM

User list:

UDP/IP: enter hamachi IP of client.

When Soundjack is set up on the client. Press the green start button on the right side of the user list window on the server.

If all goes well, you should hear the radio on the client. Note: The input meter under local settings should be registering audio from your radio. If not, there is a problem with the audio interface.

Max Server

The Max/MSP server exchanges CAT commands via the server serial port to the radio. The command data is exchanged with a Max patch on the client using OSC (over UDP).

Screen Shot 2016-04-05 at 12.46.02 AM

patch:

eagle-cat8.maxpat

instructions:
  • select the radio serial port from the menu (for example: usbmodem 14531)
  • initialize port settings
  • set toggle to poll the serial port

At this point you should be able to try the example commands, for instance to get the version or set frequency. If the commands are not working, it indicates a problem with the serial connection to the radio.

Next, check the IP address of the udpsend object. It should be the hamachi IP of the client.

 

Remote controlled shortwave radio system

Under construction…

The first in a series describing a system for internet remote control of a shortwave radio station. Its not something new. There are commercial products that provide remote operation of amateur radio transceivers. The purpose of this project is to make it possible to use shortwave radio sounds in musical performance, without the need of an antenna system.

Features:

  • Max/MSP for USB serial control of radio, OSC remote interface, user interface, Midi device handling, and an SQLITE database of preset frequencies.
  • Low latency, good quality audio using Soundjack by Alex Carot.
  • Hardware control of radio using Midi controllers (CDJ-101 and Launchpad)
  • Bi-directional OSC and VOIP using Logmein Hamachi VPN
  • Additional hardware control of AC power and antenna selection using Arduino and a WeMo switch.
  • TouchOSC Ipad audio mixer control using MOTU Cuemix
  • TeamViewer remote desktop software for logging into to base station compuer
  • Optional radio user interface control with Ipod TouchOSC, Griffin Powermate dial, and Korg Nano-kontrol.
  • Optional VOIP backup using Mumble.

System diagram

base station:

remote-radio-sys1

remote control:

remote-radio-sys2

 

 

 

 

 

 

Hamlib and rigctl

Hamlib provides a linux command-line API for amateur radios.

Hamlib_design

Installation

On Mac OS you can install using Mac Ports:

sudo port install hamlib

Usage

Get a list of “rig numbers” for supported radios:

rigctl -l

Find available serial ports:

ls /dev/tty.*

Set the frequency to 7.2 MHz and mode to LSB on a Tentec Eagle transceiver:

rigctl -m 1608 -r /dev/tty.usbmodem14531 -s 57600 F 7200000 M LSB 0

Use a rigctl command with no commands at the end to start an interactive command shell.

Network control with TCP/IP

First start the daemon. It uses port 4532 by default, but here we are setting it explicitly:

rigctld -m 1608 -r /dev/tty.usbmodem14531 -s 57600 -t 4532 &

Then in another window, send commands to the daemon using netcat. For set example, to set the frequency to 14.247:

echo ‘F 14247000’ | nc -w 1 localhost 4532

Max/MSP

Note: [mxj tcpClient] no longer functions in Max8 (1/25/2021)

This patch uses the mxj tcpClient object from https://cycling74.com/toolbox/tcpclient/#.Vnj_fpMrKuU by Arvid Tomayko to communicate with rigctld over TCP/IP. The patch below is a modified help file that connected to the radio using rigctld as configured above.

Screen Shot 2015-12-22 at 2.47.10 AM

Notes on grig and rpc.rigd

grig is a graphical rig front end for hamlib by Alex Csete. rpc.rigd is a daemon that allows multiple clients. I was able to get both of them sort of working together (use -m 1901 from grig) but the daemon starts streaming error messages “read_string timeout without reading a character”. Also the latency with grig over the LAN is high. Its possible that there are problems with the rig CAT file. I am using the file for the Tentec Orion – as I haven’t figured out how to add new devices. At any rate, the above methods (UDP or TCP command line) are way more responsive.

References:

 

Internet shortwave radio using Max, Hamachi, and Mumble

How to control an amateur radio transceiver over the internet, using Osc (Open Sound Control), VOIP (Voice over Internet Protocol) and VPN (Virtual Private Networks).

What problem does this solve?

Using a shortwave radio receiver in a  live performance without installing a large antenna system.

This method gives low-latency real-time access to audio, and radio control using a laptop computer from anywhere. I suppose it could also remote-control a synthesizer, if you’re into that kind of thing.

CAT

Modern ham radio receivers can be controlled using serial commands using the CAT (Computer Aided Transceiver) protocol. Usually this is done via a USB port. There are hardware solutions for remote controlling radios over the internet, like RemoteRig http://www.remoterig.com/wp/. But there is also a free, or low cost, solution using software.

System diagram

Screen Shot 2015-12-21 at 1.23.10 AM

The ‘base’ computer is connected to the radio/antenna. The ‘remote’ computer is a laptop that could be anywhere connected by WiFi

For this experiment we used a TenTec Eagle transceiver connected to a MacBook USB port. The audio output of the radio connects to the audio input of the MacBook. The MacBook is directly connected to an internet WiFi router using an ethernet cable.

VOIP

A mumble client runs on the base computer, https://en.wikipedia.org/wiki/Mumble_(software)  and also on the remote laptop. Both clients are connected to a Mumble server (Murmur) at Mumble.com http://www.mumble.com/mumble-download.php. You could also run your own server. I set the audio to the best quality and muted the microphone on the remote laptop. We are only using the laptop as a receiver. For transmitting, you could simply open up another channel on the Murmur server. Mumble has very low latency (compared to Skype) and decent audio quality.

Bi-directional commands using VPN and OSC

CAT commands go in both directions – to and from the radio. For example, you would send a command to the radio to change frequency. The radio would send acknowledgements back to the remote laptop.

This is a problem for networks that use NAT (Network Address Translation) because local IP addresses are private, hidden behind routers. The solution that eventually worked was using a VPN called Hamachi https://secure.logmein.com/products/hamachi/download.aspx on both the remote and base computers. Hamachi servers are setup on both computers and connected to each other. This allows the computers to ‘see’ each other as if they were on a local network.

Max and Osc

Max patches are run on both the base and remote computers. The Max patch on the base computer connects to the radio using the serial object and passes commands back and forth over the internet using udpsend and udpreceive (which use Osc).

The Max patch on the remote MacBook sends and receives commands from the base computer using updsend and udpreceive. With the Hamachi VPN, Osc works just like it does on a LAN (local area network).

Automatic reconfiguration of clients

The main advantage of this system is that when you move the remote MacBook to a new location – for example, a coffee shop with public Wifi – both the Mumble and Hamachi clients automatically reconfigure for the location. So you don’t need to know the actual IP address of your computer in the coffee shop. The reconfiguration usually happens within seconds after the Wifi connection is made.

Alternatives

If you are just working across a LAN, you don’t need a VPN. Osc will run on a local network using private IP’s.

You could also try Ross Bencina’s Oscgroups http://www.rossbencina.com/code/oscgroups. Although I was not able to get Oscgroups to work, other than in a LAN.

For uni-directional Osc communication from remote to base, in a WAN (wide area network) you can use a static IP address for the target.

Skype is another (free) solution for transmitting VOIP audio. Set the base computer in auto-answer mode and call it from the remote computer. Skype will process the audio more than mumble, with noise gates and such. And the latency is higher. But its very easy to set up.

Development

The next step is to build a remote interface for the radio that uses Midi/Osc controllers, so for example you can turn a dial on the Midi controller to change frequency or filter settings on a base radio.

to be continued…

SSTV in Max

Slow scan television simulation using Jitter.

See this Cycling 74 forum post for an explanation of how frame rate is limited by audio sample rate and  horizontal resolution: https://cycling74.com/forums/topic/jit-poke-vertical-bars-at-high-scan-frequencies/

Download

https://github.com/tkzic/max-projects

Screen Shot 2015-04-09 at 7.24.11 PM

Folder: sstv

Patches:

  • raster-scan4.maxpat (original)
  • raster-scan5.maxpat (better frame rate by lowering screen resolution to 160 x 120)
  • raster-poly-wrap5.maxpat (even better frame rate – up to 15 fps – by up sampling to 384 KHz)

Note – set your audio sample rate to 96KHz if possible, to get the results described above.

RF converter circuits

Notes and links.

down converters (shortwave to medium wave)

HF to CB/AM Broadcast Receive Converter kit, great for QRP!

Vectronics VEC-101k http://www.vectronics.com/Product.php?productid=VEC-101K

Shortwave converter for AM radio: https://books.google.com/books?id=rZDbnQ0siCYC&pg=PA307&lpg=PA307&dq=how+to++Intermediate+frequency+output+of+am+radio&source=bl&ots=sMJHJ1BecU&sig=QemPm07_g2Tyqk-SVrCD3CEAnpE&hl=en&sa=X&ei=pMsYVdeCH_i1sQTtp4L4DQ&ved=0CDYQ6AEwBTgU#v=onepage&q=how%20to%20%20Intermediate%20frequency%20output%20of%20am%20radio&f=false

40 meters to CB by vk3ye (includes BFO): https://www.youtube.com/watch?v=hCdt0aXj7bc

upconverters

kf7lze roundup of up converters: http://blog.kf7lze.net/2012/09/14/round-up-of-rtlsdr-upconverter-choices/

 

W9RAN Ranverter Pi: http://www.hayseedhamfest.com/ranverter_sdr_261668310.html

ct1ffu upconverter: http://www.ct1ffu.com/site/?option=com_content&view=article&id=178&Itemid=104

IF converters

455kHz -> AF Converter (DRM): http://users.belgacom.net/hamradio/schemas/DRM_455kHz_to_LF_Converter_FRG-100.htm

Any SDR that will receive 455 KHz (or whatever the IF is) plus a R-Pi would work. The Pi would need to  boot automatically into an SDR app with the frequency set to the IF.

455 kHz BFO Kit – Receive ssb and cw on an am receiver!

RADI0KIT-2 DRM SSB RADIO BROADCASTS DECODER KIT / IF CONVERTER.

 

IQ converters and panadapters

FST3253 is a commonly used chip for Tayloe mixers.

Babel Fish IF SDR Radio 1st IF I /Q software conversion module: http://www.ebay.com/itm/Babel-Fish-IF-SDR-Radio-1st-IF-I-Q-software-conversion-module-/231292143562

A Binaural IQ Receiver by Rick Campbell: http://www.arrl.org/files/file/History/History%20of%20QST%20Volume%201%20-%20Technology/QS03-99-Campbell.pdf

QSD By Ray Ring: http://circuitsalad.com/2013/12/30/my-phasing-receiver-is-a-success/

Thomas Nylund Tayloe detector and SDR http://tuomasnylund.fi/drupal6/content/software-defined-radio

Softrock Lite II 06 mixer: http://www.wb5rvz.com/sdr/sr_lite_ii/06_mix.htm

Other

1KHz to 33MHz Adjustable Oscillator Module, LTC1799