Svxlink Plug-in for DTMF remote IO control

 

echo_remote

 

This article introduces how to use F8ASB’s plugin to remote IO control of a Svxlink’s Echolink node via DTMF.

 

The Svxlink Plug-in from F8ASB

There are many Echolink solution, e.g.: Kenwood Echolink ready transceiver, Computer, Svxlink run at Raspberry Pi and so on.

Well, in my opinion, the Rpi Svxlink solution is the best: low long term operation costs; cheap Hardware with the flexibility by software Plug-in.

I found F8ASB upload a Module-Remote-Relay package to his Github. The link:

https://github.com/F8ASB/Module-Remote-Relay

However, I cannot found anymore useful information from web, except a demo in YouTube by a relay board, and a similar module for a svxlink project called Open Repeater.

They develop a svxlink board and F8ASB also a member of them.

svxcard_features

Courtesy of   http://svxcard.f5uii.net/doku.php?id=fr:start

The game is simple:

We sent DTMF command by a transmitter (e.g. handheld), the Svxlink decode and control a GPIO pin of Rpi to 0,1 or a positive 0.1s pulse.

wiring_pi_table

We using these 4 Port in this project

The module can handle up to 4 GPIO port (20-23) of Rpi.

0,1 suitable for on/off switch.

Pulse can be used as a trigger signal to INT pin of MCU.

 

Here is the DTMF commad set:

9# : turn on the module
xxY# : xx is GPIO port number (20-23), Y is the state:

1 means high level (3.3V)

0 means low level (0V)

2 means Pulse

* :  turn off the module

For example: we would like to turn the Port 20 to 1:

First turn on the module, then press 201# .

As Svxlink is software base decode incoming DTMF signal, we no need to found those discontinued rare DTMF decoder IC, such as Mitel 8870,8888, etc.

And by the benefit of software, we can turn the module on/off remotely by our own.

 

Plugin installation

The Hardware, software version is the original one from the previous Echolink article. It operates for half year and never hang up.

First of all, backup the SD card before the plugin installation.

Second, download the code in zip format from F8ASB Github. The file name is master.zip.

Unzip it, the unzip folder name should be Module-Remote-Relay-master.

Please enter the unzip folder, and copy the following 2 files to the destination folder. Please be remind that my path is different with official info.

RemoteRelay.tcl -> /usr/local/share/svxlink/events.d/

ModuleRemoteRelay.tcl –> /usr/local/share/svxlink/modules.d/

Although the sound clip files is French, we create a folder for the English sound clip:

/usr/local/share/svxlink/sounds/en_US/RemoteRelay

Copy all the sound clip files to this folder.

Tips:

If you are not fluent on the Linux commands, please refer my previous article. And of course the fastest method is handle those steps in windows environment. Please type the commands to enter the X windows:

sudo startx <=it must add sudo before startx to get the super user privilege

Then edit svxlink.conf by following command:

sudo nano /usr/local/etc/svxlink/svxlink.conf

remote_add

 

In the end of row MODULES, add ,ModuleRemoteRelay

 

We use the following command to add a new file to save the parameter of the new module:

sudo nano /usr/local/etc/svxlink/svxlink.d/ModuleRemoteRelay.conf

Add the content:

[ModuleRemoteRelay]
NAME=RemoteRelay
PLUGIN_NAME=Tcl
ID=9
TIMEOUT=60

 

remote_config

The basic setup was complete, please reboot.

 

Troubleshooting

I found the module are no function, even the sound clip play.

So I study the module files script. I found the critical file is
ModuleRemoteRelay.tcl

In this file, I found it use a command to set the port 20 to 0 (low level):

exec gpio -g write 20 0

 

OK, it is Wiring Pi command. As the Svxlink did not need this package before, we need install it for the IO prot control. Here is the official installation guide:

http://wiringpi.com/download-and-install/

When using Wiring Pi for IO Port control, we need declare the port as input/output before set to 0 or 1.

And I found the tcl file did not declare anything before action.

So we use the following commands on the activate section (row 58) to set the ports to OUT direction:

exec gpio -g mode 20 out

exec gpio -g mode 21 out

exec gpio -g mode 22 out

exec gpio -g mode 23 out

On the deactivated section (original row 67), if simply declare  the ports to IN direction, the IO port will resume the last status on next module activation. So we add 4 rows of command to set the port to 0 .

cod1

Here is the code to add

 

It cause some options:

If you want the ports kept the level state on next activation, you just declare the port to IN direction during deactivating, no need to set to 0.

In fact the 4 port dedicated to use as output port, we can simply set to 0 on the deactivating, no need to declare IN direction.

 

Another option is the length of pulse:

The positive pulse is formed by output set to 1, then wait 100mS, and set to 0.

you can change the pulse length by alter the number 100.

Please be remind that it is a delay loop,so do no set too long,say 200mS.

pulse

The section of the pulse handling

A typo was found and it will cause the Port 22 pulse output no function. Please amend the second 212 to 222.

 

YouTube Demo

I use a LED instead of a Relay. Output 1 the LED will bright, 0 to off. Pulse the LED flash once.

test-205x300

Courtesy of   https://developer-blog.net/raspberry-pi-gpio-schnittstelle-teil-2/

 

To driving a relay by a Rpi IO port, use a simple transistor circuit is OK. Please refer this site:

Relay-Sample

Courtesy of  http://www.susa.net/wordpress/2012/06/raspberry-pi-relay-using-gpio/


 

 

English Sound Clip

I found F8ASB’s another project Open repeater includes English sound clip files, and it contains all the necessary words for this project. I had stick some files and rename them for this project.

Here is the download link, simply overwrite the existing sound clip files on the folder.

https://db.tt/xMPNJDdX

 

Lesson to learn

TCL stand for Tool Command Language. It is a simple script language. F8ASB ‘s plug-in is a very good example for study purpose.

Although we need install WiringPi  library to make it work, we can try to do more by using the WiringPi library. e.g: read a IO port status or even add extension i2C IC for AD convention figure, and report the status in the air.

 

Conclusion

Svxlink used in Raspberry Pi to form an Echolink node, we can add plug-in to enhance the function, which a so call Echolink ready transceiver can’t.

The next article on Echolink should be try the latest svxlink ver 15.01 with SDR supporting.

This entry was posted in English Articles and tagged , , , , . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *