Skip to content

Instantly share code, notes, and snippets.

@sybip
sybip / frequency-correction.md
Last active June 16, 2023 15:21
Notes on frequency error correction in GTM-LAB radios

Frequency error and calibration in GTM-LAB radios

A disorderly collection of ideas, concepts and design decisions.

In theory

In simple terms, a crystal oscillator's frequency error is the difference between the nominal frequency as marked on the box, and the actual frequency that the oscillator delivers.

@sybip
sybip / 02-user-device.ino
Created February 10, 2023 13:31
Example code to emulate a goTenna Mesh device, network-side as well as client-side
//
// GTM User Device Firmware
// ------------------------
// Emulates a goTenna Mesh device, network-side as well as client-side,
// sufficiently realistic to function as a drop-in substitute for the
// genuine GTM with most existing GTM apps (goTenna, ATAK, txTenna etc)
//
// This GTM LAB example code uses gtmRadio, gtmBLE and gtmAPI from:
//
// GTM LAB - goTenna Mesh protocol playground
@sybip
sybip / labcounters.txt
Last active April 12, 2021 13:23
Packet and eror counters (!dc) from a gtm-lab device running for 2 weeks nonstop in a live environment with several GTM devices. Relaying was disabled, except for a few minutes. Posted as a reference data point for "how much is normal" in terms of packet errors.
SYS.UPTIME: 1209356.844s
RX PACKETS:
- SYNC: 447126
- DATA: 887328
- ACK: 323
- TIME: 0
TX PACKETS:
- SYNC: 51
- DATA: 86
- ACK: 10
@sybip
sybip / minilogger.py
Created March 26, 2021 13:14
goTenna Mesh traffic logger, similar to (and based on) metalogger, but also including cleartext dump when practical
#!/usr/bin/env python
"""
goTenna mesh message logger, using USB connected gtm-lab receiver
more info at: https://github.com/sybip/gtm-lab
"""
import serial
import sys
from time import gmtime, strftime
from binascii import unhexlify
@sybip
sybip / goTennaX.py
Created March 14, 2021 15:27
sdk emulator
"""
A placeholder for the official goTenna SDK, trying to implement just the
BARE minimum functionality needed to trick the sample app into not
throwing any fatal errors.
Obviously there's no actual goTenna action going on; only an empty shell
that imitates the "real thing", unsuccessfully so far (2021-03-14)
TODO: actually read the SDK spec, it's free! :)
"""
@sybip
sybip / instant-gratification-2021,py
Last active March 9, 2021 12:24
30-second, 60-line demo of pyGT library (2021 version)
#!/usr/bin/python
# Simple demo of the pyGT library - send a shout message via goTenna Mesh
import sys
# from https://github.com/sybip/pyGT
import gtdevice
from compatGTA import gtMakeGTABlobMsg
from gtapiobj import gtMakeAPIMsg
# One line of help
@sybip
sybip / metalogger.py
Created March 2, 2021 12:34
goTenna Mesh traffic metadata logger
#!/usr/bin/env python
"""
goTenna Mesh metadata logger, using USB connected gtm-lab receiver
more info at: https://github.com/sybip/gtm-lab
"""
import serial
import sys
from time import gmtime, strftime
from binascii import unhexlify
@sybip
sybip / instant-gratification.py
Created December 10, 2018 13:46
30-second, 110-line demo of pyGT library
#!/usr/bin/python
# Simple demo of the pyGT library - send a shout message via goTenna Mesh
import sys
import time
from struct import pack
# from https://github.com/sybip/pyGT
import gtdevice
from pycrc16 import crc