mawt

package module
v0.0.0-...-691a703 Latest Latest
Warning

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

Go to latest
Published: May 24, 2018 License: MIT Imports: 22 Imported by: 0

README

mawt - A ray of light

0.1.0-feature-01-techthulu-events-1f3aTX

This software implements a server that parses input from a Niantic Tecthulhu and uses it to build OPC frames that are then sent to another TCP/IP server.

Prerequistes

mawt relies upon the presence of the fadecandy server that accepts TCP/IP messages and interfaces with the USB based hardware controllers. The fade candy server can be downloaded as a single binary and run as documented later in this README file. The binary is available for Linux, Windows and OSX from https://github.com/scanlime/fadecandy/releases/tag/package-02. The compressed archives in these releases contain the binaries for the server inside the fc-server/bin directory.

mawt is compiled using golang 1.10.2 or later. Using apt-get to install golang can be made to work if the package expression is used correctly to set the specific version needed. In some cases however the presence of an older version of go if installed into the users local environment will override the system version. Versions on Ubuntu 14.06 or above and go versions 1.9 and below often took this approach. To deal with local installs you will need to delete the existing go installation, typically in ~/go and then download a new version tar unarchive from the golang.org website and unpack it into the same location, or at this point use apt-get to retrieve the latest version.

Source code preparation

cd ~
mkdir -p mawt/src/github.com/TeamNorCal/
export GOPATH=~/mawt
export PATH=$GOPATH/bin:$PATH
cd mawt/src/github.com/TeamNorCal/
git clone https://github.com/TeamNorCal/mawt
cd mawt
go get -u github.com/golang/dep
go install github.com/golang/dep/cmd/dep
go get github.com/karlmutch/duat
go install github.com/karlmutch/duat/cmd/semver
go install github.com/karlmutch/duat/cmd/github-release
go install github.com/karlmutch/duat/cmd/stencil

Build instructions

sudo apt-get install golang-go
sudo apt-get install -y portaudio19-dev libasound2-dev libvorbis-dev alsa-utils alsa-tools alsa-oss alsaplayer mpg321 alsaplayer-alsa alsa-base
go run build.go

Running mawt

LOGXI=*=DBG /home/pi/mawt/bin/mawt

mawt supports testing without fadecandy devices by specifying the -server option with the value /dev/null.

Using the 2018 test server for tecthulhu messages can be done using the -tecthulhus option with the value http://operation-wigwam.ingress.com:8080/v1/test-info.

Running the simulator using scenario files

LOGXI=*=DBG go run cmd/simulator/*.go -path assets/simulator/portal_builds

fcserver configuration

fcserver should be run using the following config.json file

{
    "listen": ["0.0.0.0", 7890],
    "relay":  [null, 7891],
    "verbose": true,

    "color": {
        "gamma": 2.5,
        "whitepoint": [1.0, 1.0, 1.0]
    },

    "devices": [
        {
            "type": "fadecandy",
            "serial": "AMWPGCSIYCRCKYHL",
            "map": [
                [ 1, 0, 0, 64 ],
                [ 2, 0, 64, 64 ],
                [ 3, 0, 128, 64 ],
                [ 4, 0, 192, 64 ],
                [ 6, 0, 256, 64 ],
                [ 7, 0, 320, 64 ],
                [ 8, 0, 384, 64 ],
                [ 9, 0, 448, 64 ]
            ]
        }
    ]
}

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CopyFile

func CopyFile(src, dst string) (err errors.Error)

CopyFile is used to create a mirror of the source. If a hard link can be used to mirror the file into a new location it will, otherwise a new duplicate of the file will be created.

func InitAudio

func InitAudio(ambientC <-chan string, sfxC <-chan []string, errorC chan<- errors.Error, quitC <-chan struct{}) (err errors.Error)

func NewSink

func NewSink() (sink *statusSink)

func NewTecthulu

func NewTecthulu(url url.URL, home bool, statusC chan<- *model.PortalMsg, errorC chan<- errors.Error) (tec *tecthulhu)

func StartSFX

func StartSFX(subscribeC chan chan *model.PortalMsg, errorC chan<- errors.Error, quitC <-chan struct{})

StartSFX will add itself to the subscriptions for portal messages

Types

type FadeCandy

type FadeCandy struct {
	// contains filtered or unexported fields
}

func StartFadeCandy

func StartFadeCandy(server string, subscribeC chan chan *model.PortalMsg, debug bool, errorC chan<- errors.Error, quitC <-chan struct{}) (fc *FadeCandy)

func (*FadeCandy) RunLoop

func (fc *FadeCandy) RunLoop(sink *statusSink, debug bool, errorC chan<- errors.Error, quitC <-chan struct{}) (err errors.Error)

func (*FadeCandy) Send

func (fc *FadeCandy) Send(m *opc.Message) (err errors.Error)

type Gateway

type Gateway struct {
}

func (*Gateway) Start

func (*Gateway) Start(server string, debug bool, errorC chan<- errors.Error, quitC <-chan struct{}) (tectC chan *model.PortalMsg, subscribeC chan chan *model.PortalMsg)

type LastStatus

type LastStatus struct {
	sync.Mutex
	// contains filtered or unexported fields
}

type PortalMon

type PortalMon interface {
	Run(quitC <-chan struct{})
}

type SFXState

type SFXState struct {
	sync.Mutex
	// contains filtered or unexported fields
}

type Subs

type Subs struct {
	sync.Mutex
	// contains filtered or unexported fields
}

Directories

Path Synopsis
cmd
mawt command
simulator command

Jump to

Keyboard shortcuts

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