Showing posts with label pocsag. Show all posts
Showing posts with label pocsag. Show all posts

Wednesday, February 16, 2011

POCSAG encoder and Arduino modem published

Last spring I wrote a bit about our POCSAG paging network project, and published a Youtube video showing a 200W POCSAG transmitter being driven by my POCSAG encoder and an Arduino-based modem.

Well, I finally got around to documenting and publishing the code a couple weeks ago, open source. The answers to the FAQs are:
  1. I've run it on Linux and Mac OS X only, but it should run on any operating system with a Perl interpreter, including Windows, maybe. But I can't help you if it doesn't run on Windows - please find someone with Windows programming experience if you run into trouble.
  2. The POCSAG message encoding happens within the POCSAG::Encode Perl module. On the computer. Not within the Arduino modem. The Arduino modem software is not useful on it's own, the perl code is required to send POCSAG messages.
  3. The Arduino modem is needed because (1) my computers don't have serial ports any more, and (2) bit-banging synchronous 512/1200/2400 bit/s FSK using handshaking pins of a serial/parallel port, like the Baycoms did, is not possible using an USB serial adapter cable (the timing is too strict). The Arduino is a convenient and relatively low-cost platform with a good bunch of TTL level I/O pins and an USB port, and could be easily programmmed to drive the transmitter. If you wish, you can write a kernel driver to drive the FSK bits generated by the encoder, baycom-style, on a serial port (if you have one) and skip the Arduino part.
  4. If you feel the Arduino Duemilanove/Uno boards are too expensive, you can look at the other boards too. Just get one with enough SRAM. If you're brave, you can also put the CPU and a few necessary components on a breadboard or a custom printed board of your own. Instructions here and here and here.
  5. The POCSAG::Encode module is published on the CPAN, and the Arduino modem on the wiki.
  6. Yes, the POCSAG encoder can be connected to any VHF/UHF radio which has a suitable FSK input. Many radios (including some that do have a 9600 bit/s data input) aren't up to the task. I've tried the Motorola GM340 and the Teknomen POCSAG radio only. The GM340 needed some configuration (using the programming software) to make the data input work the way it should for this application. See the comments on the previous post for wiring tips.
  7. Yes, the POCSAG::Encode perl module should be useful when trying to transmit POCSAG with other kinds of modems.
Happy hacking!

Wednesday, April 28, 2010

POCSAG encoder and 200W transmitter

Lately I've been writing some more code for the amateur paging network project. On Sunday morning I wrote a new POCSAG encoder module in Perl, and on Sunday evening and Monday evening I wrote a simple "modem" for an Arduino card to drive the encoded messages at 512 (or 1200, or 2400) bit/s to an FSK transmitter.

I intend to release most of the bits and pieces as open source, starting with the POCSAG encoder and modem bits. Here's a little video showing the working setup:


As you can see, I haven't grown up enough to not put too many blinking LEDs in my designs. Unfortunately my electronics design skills are mostly limited to calculating the series resistor needed for the LED, so I have to focus my efforts in driving the LEDs from the software in a fancy way. The blue LED does serve a purpose - it shows that the FSK keying timer interrupt routine is working, and indicates it's state. Here's a photo of the Arduino card:


The Perl POCSAG encoder module (POCSAG::Encode) takes one or more messages and encodes them in a binary string. Unlike the other encoders we've found, this one can actually create a long burst with a number of messages, saving a lot of channel time. Only a single preamble is needed, and a lot of idle codewords can be saved between the messages, too.

The burst string is transmitted over USB serial to the Arduino board (the board has an USB-serial chip between the USB port and the Atmel chip) using a protocol which, in theory, resembles the KISS (Keep It Simple Stupid) protocol used with AX.25 packet radio. There are some differences so I've named it PISS, for POCSAG.

The "modem" software on the Arduino waits until the channel is clear, keys the transmitter, and simply sends the bits out through the transmitter's TX data (FSK in) pin. It currently has the usual txdelay and txtail settings hard-coded in the source code. It sends a report back to the host software when the burst string has been received by the modem, and when it has been transmitted, so that the host knows to send the next burst. The Arduino board costs some 20-30€ - if that's too much per transmitter, it's straightforward to just put the Atmel chip on a board alone with an RS-232 or USB transceiver. There are some plans to do just that and design a custom board for the purpose.

The traditional method would have been to drive the FSK out on one of the RS-232 or parallel port handshaking pins. During these days of multitasking and multi-user operating systems it requires a kernel driver, and I didn't quite feel like doing that right now.

The transmitter is a surplus 200W paging transmitter with real FSK keying, configured to run on 144.975 MHz. It happens to have TTL I/O pins, so it can be directly attached to the Arduino.

Erik, OH2LAK, the local repeater builder and coordinator, is also writing about the paging project in his blog. Check out the D-star repeater from a surplus VHF base station radio!

UPDATE 2010-01-31: I finally finished packaging and releasing the software last weekend, and documented it a bit.

Saturday, March 13, 2010

Project: POCSAG paging network infrastructure

Like OH2LAK reported on his blog, I've started implementing infrastructure code for an amateur radio paging network. Erik (OH2LAK), Weltto (OH7JEV) and Lasse (OH3HZB) got the POCSAG modem running, interfaced it to a Motorola radio, and configured a couple of pagers to receive it on 144.975 MHz.

I got the bits and pieces yesterday for development and debugging, started working on the server software at 6.30 PM yesterday evening, and now I have a working client-server paging network infrastructure with strong authentication, queuing, and support for multiple transmitters. I grabbed quite a bunch of code from the aprs.fi code base, of course.



The system consists of:
  • A server component which receives messages from authenticated message source clients, queues them, and provides them to the transmitter clients
  • A client library (Perl module) which is used to communicate with the API of the server
  • A transmitter client, which fetches messages from the server using the client library and feeds them to the POCSAG modem (and, optionally, transmits CWID at regular intervals)
  • And, for demonstration purposes, a DX cluster client which maintains a connection to a DX cluster server, filters DX spots, and sends them to the paging server using the client library. I think I've made a full circle now, over the past 15 years. Feels like home.
The next thing I'll write is an APRS-IS client to collect APRS messages from the APRS-IS and gateway the to the paging server (for those recipients who have a pager configured on the server).

The server is designed so that it's possible to run multiple instances of it at diverse network locations, so that losing one server will not break the whole network.

The network will probably be national, within Finland, coordinated by RATS (Radio amateur technology society of Finland). The system will be demonstrated at the RATS technology day in Otaniemi, Espoo, 20th of March, 2010 (that's next Saturday). I suppose the code and documentation will be published so that you can set up your own networks.