Month: June 2022

Sending Pager POCSAG message

I’m using MMDVM as Hat/shield on Raspberry Pi 0 W to send POCSAG message to pager.

Frequency is configured to 433.450.000 and after running MMDVMHost I run:

$ sudo RemoteCommand 7642 page 1000001 “Teste”

On computer with a RTLSDR dongle I run the “gqrx” interface and configure to 433.450.000Hz and enable UDP button:

In other terminal I run this command to decode POCSAT:

$ nc -l -u 7355 | sox -t raw -esigned-integer -b16 -r 48000 – -esigned-integer -b16 -r 22050 -t raw – | multimon-ng -t raw -a SCOPE -a POCSAG512 -a POCSAG1200 -a POCSAG2400 -f alpha –

When the RemoteCommand above is executed on Raspy board I see it:

POCSAG1200: Address: 1000001 Function: 3 Alpha: Test<NUL>

Source: https://www.ronan.bzh/p/decoding-pocsag-on-ubuntu-with-a-rtl-sdr-dongle/

Useful links about pagers

These are nice references to Motorola Pagers (mainly Motorola Advisor) using POCSAG protocol:


https://goughlui.com/2016/01/15/tech-flashback-motorola-advisor-pocsag-5121200bps-pager/

https://spectrum.ieee.org/the-consumer-electronics-hall-of-fame-motorola-advisor-pager#toggle-gdpr

https://web.archive.org/web/20091216202650/https://www.hackcanada.com/blackcrawl/cell/pager/pager.html

http://www.hackersrussia.ru/Pagers/pagers.php

http://s-lab.se/motorola.html

https://blog.thelifeofkenneth.com/2012/02/sniffing-pager-network-traffic-hardware.html?m=1

https://mysku.club/blog/diy/88396.html

https://github.com/unsynchronized/gr-mixalot

https://www.qsl.net/n9zia/wireless/pager/index.html

https://www.qsl.net/kb9mwr/projects/pager/plan.html

http://winpe.com/gascop/

http://fringe.davesource.com/Fringe/Hacking/Phreaking/Pagers/Protocols/protocol.html

http://web.archive.org/web/20000820185325/http://www.motorola.com/MIMS/MSPG/FLEX/overview/overview.html

http://karbofos-zone.narod.ru/pagers-m.html

http://allpager.narod.ru/programmators/

http://jelmerbruijn.nl/pocsag-encoder/

http://www.rfcandy.biz/communication/pocsag.html

http://jelmerbruijn.nl/motorola-flex-p2000-decoding/

Graphics libraries for embedded systems

This is a small list of GUI for embedded system, mainly for microcontrollers, but some for Linux as well.

FBGraphics: https://github.com/grz0zrg/fbg

FLKT: https://www.fltk.org

GUIslice: https://github.com/ImpulseAdventure/GUIslice

imGUI: https://github.com/ocornut/imgui

LVGL: https://lvgl.io

micro-gui: https://github.com/ryankurte/micro-gui

Nano-X (previously known as Microwindows) : http://www.microwindows.org

NanoSVG: https://github.com/memononen/nanosvg

Nuklear: https://github.com/Immediate-Mode-UI/Nuklear

TIGR: https://github.com/erkkah/tigr

TouchGFX: https://www.touchgfx.com

u8glib: https://github.com/olikraus/u8glib

uGFX: https://ugfx.io/

uGUI: https://github.com/achimdoebler/UGUI

Using MMDVM Hat board to send Pager message

While searching for ways to transmit Pager messages I found this nice post:

https://debugger.medium.com/howto-using-a-pager-in-the-21st-century-6a57454ecde8

There are many ways to transmit to pager using the POCSAG protocol, but I decided to buy a MMDVM Raspberry Pi Hat board: https://aliexpress.com/item/32915442246.html

I bought the model “MMDVM OLED CASE” without the “Raspi 0 W” because I already have one! Then I spent around U$ 30,00 with free shipping, very good!

When it arrived I mounted it over my Raspi board running Raspbian 11.

Basically I cloned and compiled the MMDVMHost and its dependencies like WiringPi and “ArduiPi OLED”.

After compiling and installing I moved the file MMDVM.ini to /etc/ and edited it to enable POCSAG protocol and “Remote Control”.

Unfortunately while running the “RemoteCommand 7642 page 1000001 Ola Mundo” it was returning this error message:

“Received a NAK to the SET_FREQ command from the modem”

It was fixed changing RXFrequency, TXFrequency and POCSAG Frequency to 433450000.

Unfortunately many forums has this issue but nobody explain the root cause, some report the issue was caused by incompatible MMDVM_HS firmware version, duplex config enable for this board that doesn’t support duplex, etc. The only place where I found the right root cause was here:

https://github.com/juribeparada/MMDVM_HS/issues/74

Because of it I spent time testing many configurations, updating firmware, etc. At least I’m now using a more updated firmware, from MMDVM_HS_Hat-v1.4.17 to MMDVM_HS_Hat-v1.5.2

Compiling pic30-gcc on Linux

Some people don’t know, but Microchip uses GCC compiler on their MPLAB, they are using it for more than 15 years and never contributed back to mainline. Even worst: they have some non-free optimization that they don’t release as open-source. But don’t worry, Darwin is implacable, they are losing marketing share year after year (even after spent Billions to buy Atmel).

Now the good news is someone created some script to compile pic30-gcc to Linux (or Cygwin) with the patches that Microchip was obligated to release as open-source because the GPL license and put it here: https://github.com/makes/c30-linux but it is outdated for about 11 years.

Even so I decided to try to compile it and after some small modifications I succeeded, these are the steps:

$ git clone https://github.com/makes/c30-linux
$ cd c30-linux
$ git am /path/to/0001-Fix-pic30-linux-compilation-on-Ubuntu-21.10.patch
$ ./configure
$ make
$ sudo make install
$ sudo cp -a /usr/local/pic30/* /usr/local/

I don’t have plans to use it and I suggest you to avoid using it. It is better to use a microcontroller with a well supported GCC compiler from a company that contribute back to the open-source community.

Note: the above patch can be downloaded from here: https://pastebin.com/raw/9N7CiBYX

Update: PIC24 gcc is also available: https://github.com/fabio-d/xc16plusplus