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:

 

Teufelsberg

An acoustically interesting dome in an abandoned spy station at the highest point in Berlin.

dome

We ran into flutist Thomas Von Der Brücke in the woods around Teufelsberg. Thomas has often recorded and performed in the dome. He invited us to come along for a tour.

thomas

Thomas on Flute…

Thomas on vocals and flute, with me on percussion

 

Photographs by Rebecca Zicarelli

Glacier Sounds

Overlapping loops of varying duration to represent natural cycles.

glacier1

In October I collaborated with Wade Kavanaugh and Stephen P. Nguyen to compose and perform the sounds of a glacier for their installation at the Gem theatre in Bethel, Maine. The glacier was made from paper.

Wade and Stephen:

wadeandsteven

A time-lapse video of the project:

A time-lapse video of a similar project they did in Minnesota 2005:

The approach was to take a series of ambient loops and organize them by duration. The longer loops would represent the slow movement of time. Shorter loops would represent events like avalanches. One-shot samples would represent quick events, like the cracking of ice.

It took several iterations to produce something slow and boring enough to be convincing. I used samples from the Ron MacLeod’s Cyclic Waves library from Cycling 74 https://www.ableton.com/en/packs/cyclic-waves/. Samples were pitched down to imply largeness.

Screen Shot 2015-12-21 at 1.09.59 AM

Each vertical column in an Ableton Live set represents a time-frame of waves. That is, the far left column contains quick events and the far right column contains long cycle events. Left to right, the columns have gradually increasing cycle durations.  I used a Push controller to trigger samples in real time as people walked through the theatre to see the glacier.

The theatre speakers were arranged in stereo but from front to back. Since the glacier was also arranged along the same axis, a slow auto-panning effect sent sounds drifting off into the distance, or vice versa. Visually and sonically there was a sense that the space extended beyond the walls of the theatre.

In the “control room” above the theatre… using Push to trigger samples and a Korg NanoKontrol to set panning positions of each track:

glacer2

The performance lasted about 45 minutes. Occasionally the cracking of ice would startle people in the room. There were kids crawling around underneath the paper glacier. Afterwards we just let the sounds play on their own. A short excerpt:

 

Photographs by Rebecca Zicarelli.

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…

Motorized potentiometers

And other ways to remotely control existing dials.

Suggestions from robotshop.com: http://www.robotshop.com/forum/post-p101569

 

Motorized potentiometers

from p3america: http://www.p3america.com/motorized_potentiometers_text.htm?gclid=CJSetfSYusUCFdOQHwodPEUAaw

Screen Shot 2015-05-11 at 1.38.41 PM

 

From Online Controls: http://www.onlinecontrols.com/mpots.htm

 Motorized faders

Sparkfun motorized fader (like the kind used in DAW control surfaces) https://www.sparkfun.com/products/10976

10734-01

Servo control and sensing

from electronics stack exchange: http://electronics.stackexchange.com/questions/60272/servo-controlled-potentiometer-using-rotary-position-sensor

X4YLv

notes

The Potentiometer Handbook by Carl David Todd: https://www.bourns.com/pdfs/onlinepotentiometerhandbook.pdf

Google search: servo to turn a knob

Shower temperature control from SmithyTech: http://smithytech.com/?p=5

Arduino HVAC Servo Thermostat/Controller by tikka308: http://www.instructables.com/id/Arduino-HVAC-Servo-ThermostatController/

What kind of motor would I need to turn this central heating valve? http://electronics.stackexchange.com/questions/97269/what-kind-of-motor-would-i-need-to-turn-this-central-heating-valve – observations about the difficulty of using robots to turn knobs

Sous vide cooker with feedback control: http://www.nerdkits.com/videos/sous-vide/

servobox01_t

Homemade Electric Telescope Focuser: http://emediadesigns.com/focuser/

 

Use your Raspberry Pi to move parts of a robot or control anything that can rotate – by Rob Zwetsloot http://www.linuxuser.co.uk/tutorials/control-servos-with-a-raspberry-pi

Substituting components in parallel

Resistance and capacitance in an AM radio.

A first test to find out if its practical to ‘piggyback’ external controls on to an existing radio. The reason for doing this is to leave an original radio intact by clipping the remote components to the leads of the existing controls.

For example a varactor would be connected in parallel to the variable capacitor already in the circuit. The existing capacitor would be set low. The capacitance of the varactor would then be added to the total, using the formula for parallel capacitors.

For potentiometers, its not as easy because parallel resistors are divided:

ParallelWiderstaende

Formula:  Rtotal = R1×R2/(R1+R2)

For example if R1 is 10K, R2 would need to be 100K to get a total resistance of 9K. To get 99% of the existing resistance, the piggyback resistor needs to be 100 times the value of the existing resistor. 1 MegOhm if matched with 10K.

Practical considerations

What happens when the radio is not being controlled remotely?

  • For capacitance, the remote capacitor (varactor) should be set to 0.
  • For resistance, the remote resistor should be set as high as possible.

Conversely, how should the physical controls on the radio be set when operating remotely?

  • Variable capacitors should be set as low as possible.
  • Potentiometers should be set as high as possible. For a volume control this actually means turning the volume all the way down.

Switches

SPST switches can be considered as a form of potentiometer with infinite resistance. A piggybacked switch will only work if the existing switch is in the ‘off’ position. And vice-versa.

Double-Throw and Rotary switches present more difficulties as multiple states are maintained by the same device.

I don’t think multiple throw switches can be piggybacked. Two possible solutions:

  • mechanical connection to manual control (servo)
  • internal relays – requiring modification of the radio, so that the existing control and the remote control operate the same relays
  • Hybrid approach: Operate the switches manually while operating other controls remotely.

Testing

I piggybacked a tuning capacitor from an AM radio onto the tuning capacitor of a vintage Radio Shack Globe Patrol (regenerative receiver).

 

Varactors

Voltage controlled variable capacitors

Also called varicaps. They are diodes operated in a reverse bias condition. As voltage increases the capacitance decreases.

Read this first

Tutorial by Phillip Atchely, KO6BB http://www.qsl.net/ko6bb/varactor.html

More tutorials

Using Varactors by Stefan Hollos and Richard Hollos: http://www.exstrom.com/journal/varac/varac.pdf

Tutorial by Ian Poole at Radio-Electronics http://www.radio-electronics.com/info/data/semicond/varactor-varicap-diodes/basics-tutorial.php 

Another tutorial from Radio-Electronics?: http://www.radio-electronics.com/info/data/semicond/varactor-varicap-diodes/circuits.php

Threads from The RadioBoard Forum:

Varactor tuned regenerative radio by Tony G4WIF “The Two Dollar Regen” : http://www.cqham.ru/forum/attachment.ph … ntid=28430 More information here: http://theradioboard.com/rb/viewtopic.php?t=3568

 

Regenerative receiver design

Notes and circuits

Screen Shot 2015-04-30 at 1.30.02 AM

 

“The regenerative circuit (or regen) allows an electronic signal to be amplified many times by the same active device

From Wikipedia: http://en.wikipedia.org/wiki/Regenerative_circuit

In other words it uses feedback.

Charles Kitchin, N1TEV

“High Performance Regenerative Receiver Design”, QEX Nov/Dec 1998: http://www.arrl.org/files/file/Technology/tis/info/pdf/9811qex026.pdf

A Shortwave Regenerative Receiver Project”, http://www.electronics-tutorials.com/receivers/regen-radio-receiver.htm

A two part video presentation: https://youtu.be/gcr7hSjTqd8

Google search, kitchin regenerative receiver, https://www.google.com/?gws_rd=ssl#q=kitchin+regenerative+receiver

Derivatives

Makota, 7N3WVM

Derivatives

Circuit Salad

http://circuitsalad.com

By Ray Ring

More…