Skip to content
/ HeyMac Public

A layered LoRa data modem stack for the Raspberry Pi 3. Written in Python3 using the farc hierarchical state machine framework.

License

Notifications You must be signed in to change notification settings

dwhall/HeyMac

Repository files navigation

HeyMac

HeyMac is a a frame definition, a protocol and and data communication stack designed to carry Data Link (Layer 2) and Network (Layer 3) frames between modest data rate, small payload radio modems such as the Semtech SX127x.

This prototype implementation of HeyMac is written in Python 3 using the farc state machine framework and is intended to run on a Raspberry Pi 3 running Linux. HeyMac requires Python 3.5 or later.

I am a licensed amateur radio operator in the USA. So I am using frequencies, modulations and antenna gains that are not allowed by unlicensed individuals or persons in other nations. Know your local regulations before duplicating these experiments.

Hardware

During the prototyping stage of development, I'm using a Raspberry Pi 3 Model B. The radio board is a Dragino LoRa/GPS Hat that I bought here. They sent me version 1.3 of the PCB even though there are later versions. So I had to make a couple fixes and a few additions. The first and most important fix is to connect the radio's SPI Chip Select (CS) signal to the Pi's SPI0 CS0. Without that, you have to programmatically control the radio's CS before and after every transaction (that's a PITA that slows hardware and software). It's better to connect the Pi's CS so the Pi's SPI peripheral (hardware) can control the CS signal automatically. The other additions to the PCB are direct connections from the radio's DIOn pins to the Pi's GPIO and the GPS's Pulse Per Second (PPS) signal to the Pi.

Below is a table of the connections between the Raspberry Pi, the LoRa radio and the GPS. The "Mod" column indicates where I needed to solder a wire to make the connection. If the Mod column is empty that means the connection is made by a trace in the Dragino PCB.

Device Signal pin pin Pi signal Mod

LoRa LoRa LoRa LoRa LoRa LoRa LoRa LoRa LoRa LoRa LoRa LoRa GPS GPS GPS

SPI MISO SPI MOSI SPI SCLK SPI SS SPI SS DIO0 DIO1 DIO2 DIO3 DIO4 DIO5 RESET RX TX PPS

10 11 12 13 13 6 7 8 3 4 15 14 1 2 6

21 19 23 22 24 7 16 18 31 29 15 11 8 10 37

SPI0 MISO SPI0 MOSI SPI0 SCLK GPIO 25 SPI0 CS0 GPIO 4 GPIO 23 GPIO 24 GPIO 6 GPIO 5 GPIO 22 GPIO 17 UART TX UART RX GPIO 26

1 W

W W W

W

Mod Explanation
W Added a fly wire

1

Either GPIO25 always remains an unusable input, or cut trace to Pi's pin22.

Getting Started

This project is meant to be run on a Raspberry Pi with a LoRa shield. However, it can also be run in a limited fashion on a PC (posix or windows) where some of the hardware peripherals are stubbed.

The following steps will get you going on a PC or a Pi:

  1. Use git to clone this project.
  2. Use Python's pip tool to install dependencies (see requirements.txt).
  3. Put the path heymac in your PYTHONPATH.
  4. Run example/tui_main.py from the command line for a text UI.

About

A layered LoRa data modem stack for the Raspberry Pi 3. Written in Python3 using the farc hierarchical state machine framework.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published