Ero sivun ”POCSAG encoder and modem.en” versioiden välillä

Radioamatööriwikistä
Siirry navigaatioon Siirry hakuun
>Oh7lzb
>Oh7lzb
Rivi 45: Rivi 45:
# Download POCSAG::Encoder from CPAN
# Download POCSAG::Encoder from CPAN
# perl Makefile.PL
# perl Makefile.PL
# make
# make test
# make test
# make install
# make install
Only the last step needs to be run as root.


To transmit your first testing message:
To transmit your first testing message:

Versio 30. tammikuuta 2011 kello 23.30

This page documents the POCSAG encoder Perl module POCSAG::Encode, the Arduino-based bit-banger modem used to drive FSK transmitters with the POCSAG data generated by the encoder, and the POCSAG::PISS perl module used to communicate with the bit-banger modem.

Background

We got hold of some Tecnomen HiQ 1000 paging transmitters. Then we bought some programmable paging receivers from Ebay (they're cheap now). And we can run the transmitters on an amateur VHF frequency. But we needed a way to drive the transmitters.

We found source code for a microcontroller-based POCSAG encoder. It would take in a message from the serial line, encode and transmit it. But it could only transmit short messages, and it would only transmit a single message at a time, which is very inefficient, because the preamble and synchronisation required in the beginning of each transmission is very long when compared to a single short message.

There was also a DOS program to send POCSAG. Needless to say, DOS is a bit out of the question for a networked transmitter solution.

So, something else was needed.

Here's a Youtube video of the Tecnomen paging transmitter with the Arduino modem prototype board - transmitting POCSAG messages successfully.

Encoder module

I've implemented a POCSAG encoder in Perl, and packaged it in a proper Perl module, POCSAG::Encode. It's available on the CPAN. It takes in a bunch of text messages, and returns a binary string which should be transmitted, bit-by-bit, using an FSK transmitter at 512 bit/s. The string does not include the mandatory preamble - it is generated by the modem to save buffer space. It also returns any messages which did not fit in the transmission (which has a limited length, depending on the buffer size of the modem), so that they can be put in the next transmission.

It can be used with the modem described here, or using some other software which can turn on a transmitter, and transmit the preamble and the encoded messages synchronously at 512 bit/s.

It's not very highly optimized yet, but it tries to do some message order sorting to reduce the amount of idle codewords needed in each transmission.

Modem

The reference modem for this POCSAG transmitter has been implemented on top of an Arduino Duemilanove microcontroller board. The traditional method to transmit synchronous FSK from a PC computer was to twiggle the handshaking lines (RTS/CTS/DTR...) of serial ports, or the I/O pins of the parallel port. That was easy in MS-DOS, but in proper operating systems that typically requires writing a kernel driver. And your average computer no long has serial or parallel ports. The Arduino board has an USB port, an FTDI USB-serial chip behind it, and a microcontroller which can be programmed over the USB. No programmer device required - and the same USB port can be used for communicating with the modem software. It also has a good amount of I/O pins which can be used to communicate with the FSK transmitter.

Hooking up the arduino with the transmitter

#define pttPin 2 // PTT, high = ON
#define fskOutPin 4 // drives FSK on the transmitter
#define fskInPin 3 // received FSK, do not change - must have an interrupt (see below)
#define happyLedPin 6 // happy led output, do not change - must have PCM
#define txFaultPin 7 // TX fault signal input, low = FAULT
#define antFaultPin 8 // ANT fault signal input, low = FAULT
#define ledPin 13 // led pin on the arduino board itself

The pin ordering can be altered, but the happy led needs to be run using a PCM pin, and the interrupt is only available on a few pins.

The Tecnomen transmitter uses TTL level I/O, which conveniently matches the Arduino's levels. The PTT is driven using a transistor, since the Tecnomen's PTT has a pull up and must be shorted to ground.

Software installation

  1. Download POCSAG::Encoder from CPAN
  2. perl Makefile.PL
  3. make test
  4. make install

Only the last step needs to be run as root.

To transmit your first testing message:

  • tools/pocsag-send /dev/ttyUSB0 123456 'Hello, world!'

Transmitting from command line