marlinbox

package module
v0.0.0-...-2964b28 Latest Latest
Warning

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

Go to latest
Published: Dec 30, 2022 License: Apache-2.0 Imports: 7 Imported by: 0

README

MARLIN Box

This project aims to take another approach at RFID-Jukeboxes like the toniebox.

Our goal is to empower parents to make their kids happy - on their own terms.

Prerequisites

The project is currently in the development but is already used in production.

If you wish to try the MARLIN Box in this state you will need the following:

Setup

  • Setup your Raspberry Pi Zero 2 W as usual or use the Raspberry Pi Imager on your Computer and insert the configured SD-Card into your Raspberry Pi Zero 2 W
  • Once online and connected to your network ssh into the Raspberry
  • Update and Restart the Pi using sudo apt-get -y update && sudo apt-get -y upgrade && sudo reboot now
  • ssh back
  • Install curl and portaudio19-dev if it's not already there using sudo apt-get -y install curl portaudio19-dev
  • Download golang using curl -OL https://go.dev/dl/go1.19.4.linux-armv6l.tar.gz
  • Extract the archive using tar -xf go.19.4.linux-arm6l.tar.gz
  • Clone this repository
    • git clone https://github.com/itsscb/marlinbox
    • cd marlinbox/cmd
  • Build the software ~/go/bin/go build main.go && mv cmd marlinbox
  • Create or modify the file playlist.json in the same directory
  • Create the systemd service with sudo nano /etc/systemd/system/marlinbox.service
[Unit]
Description=Runs the binary of the marlinbox

[Service]
ExecStart=/home/marlinbox/marlinbox/cmd/cmd
WorkingDirectory=/home/marlinbox/marlinbox/cmd
Type=simple
User=root

IMPORTANT: Update the path of ExecStart and WorkingDirectory according to your setup.

  • Enable the systemd service with sudo systemctl enable marlinbox.service
  • Restart the Pi with sudo reboot now

Your MARLINBOX should be up and running.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var KeyMap = map[uint16]string{
	2:  "1",
	3:  "2",
	4:  "3",
	5:  "4",
	6:  "5",
	7:  "6",
	8:  "7",
	9:  "8",
	10: "9",
	11: "0",
	28: "ENTER",
}

Functions

This section is empty.

Types

type ControlCard

type ControlCard struct {
	RFIDCard
	Function string `json:"function,omitempty"`
}

type MarlinBox

type MarlinBox struct {
	DeviceName      string             `json:"devicename"`
	DevicePath      string             `json:"devicepath,omitempty"`
	ConfigPath      string             `json:"configpath,omitempty"`
	CurrentID       string             `json:"-"`
	Volume          float64            `json:"-"`
	NextSong        bool               `json:"-"`
	Stop            bool               `json:"-"`
	Playlist        []*PlayCard        `json:"playlist,omitempty"`
	ControlCards    []*ControlCard     `json:"controlcards,omitempty"`
	Device          *evdev.InputDevice `json:"-"`
	CurrentPlayCard *PlayCard          `json:"-"`
	Player          oto.Player         `json:"-"`
	PlayerContext   *oto.Context       `json:"-"`
}

func New

func New(path string) *MarlinBox

func (*MarlinBox) GetCurrentCard

func (mb *MarlinBox) GetCurrentCard()

func (*MarlinBox) Play

func (mb *MarlinBox) Play()

func (*MarlinBox) Run

func (mb *MarlinBox) Run()

type PlayCard

type PlayCard struct {
	RFIDCard
	File []string `json:"file"`
}

type RFIDCard

type RFIDCard struct {
	ID string `json:"id"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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