Go-turing-i2c-cmdline - Controlling the i2c management bus of the turing pi with i2c works fine

Overview

go-turing-i2c-cmdline

What is it?

Controlling the i2c management bus of the turing pi with i2c works fine. But it's not easy to remember the correct bit mask for the node. So this commandline easens a little the pain :-)

It's just a wrapper around i2c.

Enable i2c management bus access

see: https://docs.turingpi.com/cluster-management-bus-i2c

Build

go build

How to use

When you run this cmdline from a turing pi node you need to 'lock' this node. Without it you can easily turn off the node where you're running the cmdline(and lock you out)

Node numbering starts with 1

We use the env var TPI_LOCKED_NODES for it. It make sense to place it in /etc/profile.d/locked_nodes.sh

cat /etc/profile.d/locked_nodes.sh
#!/bin/bash
export TPI_LOCKED_NODES="NODENUMBER"

e.g. ignore 1 and 4 for commands

#!/bin/bash
export TPI_LOCKED_NODES="1,4"
# turn off node 2
go-turing-i2c-cmdline turnOff 2
# turn on node 3
go-turing-i2c-cmdline turnOn 3

# turn off all nodes(except locked nodes)
go-turing-i2c-cmdline turnOffAll
# turn on all nodes(except locked nodes)
go-turing-i2c-cmdline turnOnAll

State

I've just coded it in 2h and just tested it.

! Use with caution :) !

Resources

https://docs.turingpi.com/cluster-management-bus-i2c

You might also like...
The primary place where Optimism works on stuff related to Optimistic Ethereum
The primary place where Optimism works on stuff related to Optimistic Ethereum

The Optimism Monorepo TL;DR This is the primary place where Optimism works on stuff related to Optimistic Ethereum. Documentation Extensive documentat

Works with HashiCorp HCL. Allows to append the input file with blocks and attributes from the template file

About hclmergetool Works with HashiCorp HCL. Allows to append the input file with blocks and attributes from the template file Installation Binary Rel

Ghdl - A much more convenient way to download GitHub release binaries on the command line, works on Win & Unix-like systems

ghdl Memorize ghdl as github download ghdl is a fast and simple program (and als

literature management for bio programmers
literature management for bio programmers

literature management for bio programmers

Complete container management platform

Rancher Rancher is an open source project that provides a container management platform built for organizations that deploy containers in production.

An unified key management system to make life easier.
An unified key management system to make life easier.

Safebox An unified key management system to make life easier. The main goal of safebox is to make key backup easier with single main key to derive the

Transaction management tool for taxable investments

Market Lot Robot Transaction management tool for taxable investments. How it works Run the web socket server with the following command: go run . Visi

Small proof of concept project to try temporal.io with Dispatch Incident Management from Netflix.
Small proof of concept project to try temporal.io with Dispatch Incident Management from Netflix.

temporal-dispatch-poc Small POC project to try out the Temporal workflow engine together with Netflix's Dispatch Incident Management System. Supported

🕕Todo management through emails
🕕Todo management through emails

🕕Todo management through emails

Owner
null
Gitfofo - A cmdline tool utilized github api which can help you to explore your tech boundaries

why gitfofo gitfofo is a cmdline tool utilized github api which can help you to explore your tech boundaries, find more interest people in github. The

陈敏华 21 Sep 27, 2022
A fine gadget

go-ipldtool The multipurpose tool for wrangling data. IPLD is a data interchange standard, with emphasis on utility in the decentralized web. The ipld

IPLD 13 Sep 18, 2022
Keyboard-backlight - A utility for controlling keyboard backlight for System 76 computers

keyboard-backlight A utility for setting keyboard backlight on System 76 devices

Levi McGlone 1 Jan 12, 2022
Go application for controlling MuteSync button

goser This is a brief bit of hacking on the MuteSync button so that I could work out and prototype some alternate switching and illumination. Thanks t

Dj Walker-Morgan 4 Jul 15, 2022
Native Go bindings for D-Bus

go.dbus go.dbus is a simple library that implements native Go client bindings for the D-Bus message bus system. Features Complete native implementatio

Georg Reinke 122 Jul 18, 2022
Sensirion SCD30 CO2 sensor i2c driver module for Golang

Sensirion SCD30 CO2 sensor i2c driver module for Golang Overview With this module Sensirion SCD30 CO2 sensor can be accessed throug i2c bus. Implement

Pekka Vainio 3 Mar 8, 2022
A go driver for the adafruit I2C 7 Segment display

A go driver for the adafruit I2C 7 Segment display

Jackson Borneman 0 Nov 21, 2021
Some plain Go/Golang i2c sensor bindings to Waveshare Sense HAT for raspberry pi

i2c some plain Go/Golang i2c sensor bindings to Waveshare Sense HAT for raspberry pi using https://periph.io Supported hardware: Raspberry Zero W 1 ht

Torben Schinke 0 Dec 31, 2021
A simple LCD controller package for raspberry pi liquid crystal I²C displays.

A simple LCD controller package for raspberry pi liquid crystal I²C displays.

arian firoozfar 3 Feb 26, 2022
Yet another Go REPL that works nicely. Featured with line editing, code completion, and more.

gore Yet another Go REPL that works nicely. Featured with line editing, code completion, and more. (Screencast taken with cho45/KeyCast) Usage gore Af

Hironao OTSUBO 4.6k Sep 22, 2022