rio-server

command module
v0.0.0-...-f3700be Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 8, 2023 License: CC0-1.0 Imports: 1 Imported by: 0

README

golang license discord

rio-edge

RIO stands for Remote-IO. This rio-grpc repository shows a fully fledged edge device tool in accordance to the AGR-101 standard.

This is currently in alpha stage!

Dependencies

Since this is written in go, dependencies are resolved automatically by the go.mod file!

Installation

Installation really depends on the hardware you are building for. You will have to set the correct environment flags for your go build script, this will include setting the correct GOOS, GOARCH, and potentially GOARM. There are several resources available online, but this list by asukakenji is pretty awesome!

For a Raspberry Pi 4 running a 32 bit install of Arch Linux Arm this was proven to work:

env GOOS=linux GOARCH=arm GOARM=7 go build -o bin/edge-arm64 main.go

Configuration

Configuration is handled by a .yaml file. In this repo you can find a sample configuration file in the directory config. There is also a configuration for the Raspberry Pi 4, and as project progresses more and more prebuilt configuration files will be added!

The sample configuration file .edge.config.yaml is shown below:

# Server related config
server:
    port: 51232
    alias: testserver

# Hardware IO related config
pins:
  - io:
      gpiochip: gpiochip0
      lineOffset: 5
      alias: GPIO5
      value: 0
      output: false
  - io:
      gpiochip: gpiochip0
      lineOffset: 11
      alias: pin1
      value: 1
      output: true

The server: paragraph defines the various settings for the edge server.

  • port: is the network port over which the gRPC service will be served on.
  • alias: is a friendly name you want your gRPC service to go by.

The pins: paragraphs is composed of several io: entries. Each of these are hardware GPIO definitions which will be exported when the service starts. Filling out this information can be tricky, especially if you unfamiliar with Linux. Checkout libgpiod, an awesome command line utility for discovering and exercising GPIO!

  • gpiochip: is the gpiochip that manages the GPIO line you are interested in
  • lineOffset: is the line offset of the IO pin you are interested in as reported by gpioinfo.
  • alias: this is a friendly alias.
  • value: default value at which you want it to start as. Usually 0 is low and 1 is high, but check your hardware first.
  • output: wether the pin is going to be an output or an input, value will be ignored if this is set to false.

Usage

Usage:
  rio-edge [command]
join us
  serve       Start serving the remote-io edge server

Flags:
  -c, --config string      config file (default "./config/.edge.config.yaml")
  -h, --help               help for rio-edge
  -t, --toggle             Help message for toggle
  -v, --verbosity string   Log level (debug, info, warn, error, fatal, panic (default "warning")

Use "rio-edge [command] --help" for more information about a command.

Serve command:

  rio-edge serve [flags]

Flags:
  -h, --help   help for serve

Global Flags:
  -c, --config string      config file (default "./config/.edge.config.yaml")
  -v, --verbosity string   Log level (debug, info, warn, error, fatal, panic (default "warning")

Known issues

Checkout the issues tab for any known issues.

Getting help & Getting involved

We have a Discord server! Feel free to join us!

If you want to contribute, feel free to start an issue, create a fork with a branch following the issue, and submit a merge request when ready!


Open source licensing info

LICENSE

Documentation

Overview

Copyright © 2022 NAME HERE <EMAIL ADDRESS>

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL