Go-based Telemetry Toolkit
Find a file
2023-05-25 13:01:50 -05:00
cmd cli fixes 2023-05-25 13:01:50 -05:00
mprpc rpc stuff 2023-05-20 14:53:34 -05:00
skylab add String() to packets 2023-05-22 12:16:48 -05:00
socketcan rename can frame type enums 2023-05-09 10:25:29 -05:00
xbee misc things 2023-05-13 10:38:35 -05:00
.gitignore move libraries out of internal 2023-05-04 19:15:03 -05:00
broker.go cli fixes 2023-05-25 13:01:50 -05:00
can_sqlite.go add String() to packets 2023-05-22 12:16:48 -05:00
frame.go move can logger and make it json 2023-05-22 09:10:34 -05:00
frame_gen.go cli fixes 2023-05-25 13:01:50 -05:00
frame_gen_test.go cli fixes 2023-05-25 13:01:50 -05:00
frame_kind.go add can frame messagepack 2023-05-20 14:53:49 -05:00
go.mod misc things 2023-05-13 10:38:35 -05:00
go.sum remove zap. use go slog instead 2023-05-03 00:29:02 -05:00
readme.md add partial readme 2023-05-07 00:01:08 -05:00
skylab_logger.go cli fixes 2023-05-25 13:01:50 -05:00

GoTelem: Golang-based telemetry tools

GoTelem is a toolkit and library to make working with solar car telemetry data fast, reliable, and insightful.

Features:

  • SocketCAN interface for connecting to physical hardware.
  • TCP streaming system based around MessagePack-RPC for LAN control/inspection.
  • XBee integration and control for long-range communication.
  • HTTP API for easy external tool integration.

GoTelem provides a flexible system for ingesting, storing, analyzing, and distributing telemetry information.

Rationale

There are probably two questions:

  1. Why a telemetry library that runs on an OS?
  2. Why is it written in Go?

To answer the first question, the needs of the telemetry board are ill-suited for a microcontroller since it requires doing multiple non-trivial tasks in parallel. The on-car system must ingest all can packets, write them to disk, and then transmit them over XBee if they match a filter. Doing fast disk I/O is difficult.

There are also significant advantages to moving to using a Linux system for telemetry. We gain Wifi/Bluetooth/network support easily, we can integrate USB devices like a USB GPS reciever, and we can share common tooling between the car code and the receiver code.

I chose to write this in Go because Go has good concurrency support, good cross-compilation, and relatively good performance.

C/C++ was eliminated due to being too close to the metal and having bad tooling/cross compilation.

Python was eliminated due to having poor concurrency support and difficult packaging/distribution. It also lacks a good http/networking story, instead relying on WSGI/ASGI packages which make Windows not viable. Futhermore, being dynamically typed leads to issues in asserting robustness of the code.

Rust was elminiated due to being too different from more common programming languages. Likewise for F#, C#, D, Zig, Nim, Julia, Racket, Elixr, and Common Lisp. Yes, I did seriouisly consider each of these.

Go has some quirks and -isms, like lacking "true" Object-Orientation, but the language is designed around being normal to look at, easy to write, and straightforward to understand.

Go has really good cross compilation support built in to the go binary. However, since this package uses some C libraries (SQLite), certain functionality will be missing if you don't have a cross-compiler set up. There's a way to make things easier on Linux using zig cc but this is not usually important since the user can pretty easily compile it on their own system, and it's a single executable to share to others with the same OS/architecture.

Building

There are build tags to enable/disable certain features, like the graphical GUI.