A directory of hardware related libs, tools, and tutorials for Go

Go + hardware

This repo is a directory of tools, packages and tutorials to let you introduce Go in your hardware projects.

Why Go?

  • Go can target platforms and architectures that are primarily in the scope of non-real time embedded operating systems.

    • ARMv5, ARMv6, ARMv7 and ARMv8 support for Linux
    • ARMv7, ARMv8, x86 support for Android
    • Experimental OpenWRT
  • Out-of-the-box cross compilation story.

    • E.g. Run GOOS=linux GOARCH=arm go build to build a binary for ARM/linux boards from a Mac or Windows machine. No other configuration is required.
  • Built-in concurrency primitives in Go is making it easier to write concurrent programs.

    • Strong advantage in implementing hardware controllers.
    • Strong advantage in implementing networking devices.
  • Go is garbage collected language but the garbage collector footprint has been improved significantly since Go 1.4. The pause times are being targetted to be 10ms or less even with large heaps and is not a significant disadvantage on non-real time operating systems -- the preemptive nature of the OS scheduler is more of a major problem than pause times.

  • Go's network stack is high quality and maintained well. Networking is a core component in IoT.

  • Go provides out-of-the-box HTTP, HTTPS and HTTP/2 client/server implementations.

    • Standard library might be missing higher level implementations for P2P protocols, but the community works to fill that gap.
    • Community is also investing time to implement newer IoT-targeting networking protocols such as COAP.
  • Writing C bindings in Go is very trivial with cgo unlike other high level programming languages like Python and Java. It is so much easier to depend on an existing C/C++ library from the Go context.

    • E.g. portmidi bindings. See the source code to see how you can mix and match Go and C code in the same Go file.
  • C-like syntax enables the existing IoT/embedded programmers (mostly fluent in C) to read and write Go without much knowledge of the language.

  • Go programs compile to static binaries and doesn’t require a runtime on the host (e.g. a VM). Deployment is copy/pasting a binary.

  • Go had strong community figures who worked on the hardware aspects from the early days.

    • Gobot made its debut at the first GopherCon.
    • There are numerous libraries and frameworks around hardware and robotics already contributed by the community. A list can be found at go-hardware.
  • Go is efficient, fast and has low memory footprint.

  • Code reuse between server and client (connected device or mobile).

    • E.g. gRPC Go is working out of the box on servers, Android, iOS and embedded Linux.

Tutorials

Packages

Controllers

  • devices - A repository of high-level device/sensor packages for Go.
  • gobot - High level Go package with a variety of platform APIs to talk to popular drivers such as GPIO on Arduino and Raspberry Pi, Leap Motion or Pebble.
  • go-gpio - GPIO for Go, doesn't require cgo.
  • embd - Embedded programming framework for Go.
  • fadecandy - Dithering OPC-based LED controller
  • godrone - High level Parrot AR Drone 2.0 framework written in Go.
  • launchpad - High level controller library for Novation Launchpad.
  • littlebits - littleBits controller for Go. It requires USB I/O module.
  • piCamera - Capture the stream of Images for a Raspberry Pi Camera in GoLang
  • hwio - Hardware library for ARM boards such as Raspberry Pi and BeagleBone, loosely based on Arduino.
  • go-lepton - Streams images taken on a FLIR Lepton connected to a Raspberry Pi SPI port to over via WebSockets via embedded HTTP server.
  • go-embedded - Embedded Linux support for I2C, SPI, PWM, GPIO, ADC
  • go-beaglebone - Go package for the BeagleBone open source hardware
  • go-mavlink - MAVLink protocol implementation for Go (MAVLink is used to control drones)
  • joystick - a polled API to read the state of an attached joystick.
  • emgo - Go-like language for programming embedded systems (e.g. STM32 MCU).
  • go-rpi-rgb-led-matrix - Controlling up to three chains of 32x32 or 16x32 RGB LED displays using Raspberry Pi GPIO
  • go-rpi-ws281x - Go bindings for Raspberry Pi PWM library for WS281X LEDs Edit
  • ghw - Golang hardware discovery/inspection library
  • sysinfo - A pure Go library providing Linux OS / kernel / hardware system information.

Signal processing, computer vision, graphics, media

  • go-gl - OpenGL bindings for Go.
  • go-opc - Open Pixel Control bindings for Go.
  • go-opencv - OpenCV bindings for Go.
  • go-sox - SoX bindings for Go.
  • portaudio - PortAudio bindings for Go.
  • portmidi - PortMidi bindings for Go.
  • go-osc - Open Sound Control (OSC) bindings for Go.
  • openvg - 2D Graphics library wrapping the OpenVG API
  • lirc - Go Client for Linux Infra-red Remote Control. Allows sending and receiving IR commands.
  • gocv - OpenCV 3+ bindings for Go. Also supports OpenVINO.

Networking, peripheral communications

  • mdns - mDNS server and client implementation in Go. Multicast DNS can be used to discover services and message on the local network without the use of an authoritative DNS server.
  • gatt - Provides a Bluetooth Low Energy GATT implementation.
  • go.hid - Provides communication with USB Human Interface Devices.
  • goble - Bluetooth Low Energy (HM10) module for Go
  • serial - Serial Port Communication Package for Go
  • firmata - Firmata client for Go
  • periph - Peripherals I/O in Go
  • go-ckb - Corsair ckb-daemon communication in Go
  • ble - Bluetooth Low Energy communication wrapper for Linux/macOS.

Mobile (Go 1.5 or above)

Contributions are welcome, please fork and open a PR if you see a missing package, tutorial, etc.

Similar Resources

Mackerel SLI/SLO tools

shimesaba For SRE to operate and monitor services using Mackerel. Description shimesaba is a tool for tracking SLO/ErrorBudget using Mackerel as an SL

Nov 21, 2022

Like tools/cmd/stringer with bitmask features

Bitmasker Bitmasker is a tool used to automate the creation of helper methods when dealing with bitmask-type constant flags. Given the name of an unsi

Nov 25, 2021

Functional tools in Go 1.18 using newly introduced generics

functools functools is a simple Go library that brings you your favourite functi

Dec 5, 2022

Generic-based collection tools

go-collection go collection is a tool implemented using generic, it can help you process slice/map data quickly and easily convert between them. Note:

Dec 29, 2022

A full-featured license tool to check and fix license headers and resolve dependencies' licenses.

A full-featured license tool to check and fix license headers and resolve dependencies' licenses.

SkyWalking Eyes A full-featured license tool to check and fix license headers and resolve dependencies' licenses. Usage You can use License-Eye in Git

Dec 26, 2022

A Go (golang) library for parsing and verifying versions and version constraints.

go-version is a library for parsing versions and version constraints, and verifying versions against a set of constraints. go-version can sort a collection of versions properly, handles prerelease/beta versions, can increment versions, etc.

Jan 9, 2023

🤖🤝A tool to test and analyze storage and retrieval deal capability on the Filecoin network.

Dealbot A tool to test and analyze storage and retrieval deal capability on the Filecoin network. Getting Started Clone the repo and build: git clone

Sep 10, 2022

Continuous profiling for analysis of CPU, memory usage over time, and down to the line number. Saving infrastructure cost, improving performance, and increasing reliability.

Continuous profiling for analysis of CPU, memory usage over time, and down to the line number. Saving infrastructure cost, improving performance, and increasing reliability.

Continuous profiling for analysis of CPU, memory usage over time, and down to the line number. Saving infrastructure cost, improving performance, and increasing reliability.

Jan 2, 2023

CUE utilities and helpers for working with tree based objects in any combination of CUE, Yaml, and JSON.

Cuetils CUE utilities and helpers for working with tree based objects in any combination of CUE, Yaml, and JSON. Using As a command line binary The cu

Dec 24, 2022
Comments
  • Add go.hid?

    Add go.hid?

    Heya,

    I made go.hid which wraps hidapi, it's used to communicate with USB Human Interface Devices. github.com/GeertJohan/go.hid

    Do you think this is hardware-y enough to be on the list?

  • Some info from official Go wiki about mobile

    Some info from official Go wiki about mobile

    Added link to Go wiki - native and SDK applications. I guess these little links should be added to /awesome-go for growing this topic up. Less is more :)

  • Add piCamera to the list

    Add piCamera to the list

    I am hoping my Robotics team this year will use this but if not it may be helpful to others. Pretty easy to use. The difficult part is learning all the settings that can be set on the camera.

  • add TinyGo

    add TinyGo

    https://github.com/aykevl/tinygo

    It is a Go compiler for Microcontroller. The following architectures/systems are currently supported:

    • ARM (Cortex-M)
    • AVR (Arduino Uno)
    • Linux
    • WebAssembly
A program to create assembly 8086 strings to print without using any printing/strings related function but only mov-xchg-int and loops

Assembly String builder tool A program to create assembly 8086 strings to print without using any printing/strings related function but only mov-xchg-

Feb 1, 2022
LogAnalyzer - Analyze logs with custom regex patterns.Can search for particular patterns on multiple files in a directory.
LogAnalyzer - Analyze logs with custom regex patterns.Can search for particular patterns on multiple files in a directory.

LogAnalyzer Analyze logs with custom regex patterns.Can search for particular patterns on multiple files in a directory

May 31, 2022
Go tools sourcecode read and customize

Go Tools This subrepository holds the source for various packages and tools that support the Go programming language. Some of the tools, godoc and vet

Oct 24, 2021
Code generation tools for Go.

interfaces Code generation tools for Go's interfaces. Tools available in this repository: cmd/interfacer cmd/structer cmd/interfacer Generates an inte

Dec 23, 2022
gqlanalysis makes easy to develop static analysis tools for GraphQL in Go.
gqlanalysis makes easy to develop static analysis tools for GraphQL in Go.

gqlanalysis gqlanalysis defines the interface between a modular static analysis for GraphQL in Go. gqlanalysis is inspired by go/analysis. gqlanalysis

Dec 14, 2022
gopkg is a universal utility collection for Go, it complements offerings such as Boost, Better std, Cloud tools.

gopkg is a universal utility collection for Go, it complements offerings such as Boost, Better std, Cloud tools. Table of Contents Introduction

Jan 5, 2023
Little Bug Bounty & Hacking Tools⚔️

Little Bug Bounty & Hacking Tools ⚔️

Jan 7, 2023
common tools for golang

utils common tools for golang package main

Dec 27, 2021
Source code of Liteloader Tools

LiteLoader Tools This repository store the source code of some LiteLoader Tools Prebuilt Binary see /bin folder Image2Binary [Golang] convert Image(jp

Aug 30, 2022
A fully Go userland with Linux bootloaders! u-root can create a one-binary root file system (initramfs) containing a busybox-like set of tools written in Go.

u-root Description u-root embodies four different projects. Go versions of many standard Linux tools, such as ls, cp, or shutdown. See cmds/core for m

Dec 29, 2022