A library for sACN (ANSI E1.31) in Go
.
Fully supports and complies to the specification:
- All Packet types (Data, Sync and Discovery)
- Receiver with callbacks on sync packet reception
- Transmitter sending discovery packets
go get gitlab.com/patopest/go-sacn
- Receiver
package main
import (
"fmt"
"time"
"net"
"gitlab.com/patopest/go-sacn"
"gitlab.com/patopest/go-sacn/packet"
)
func main() {
fmt.Println("hello")
itf, _ := net.InterfaceByName("en0") // change based on your machine
receiver := sacn.NewReceiver(itf)
receiver.JoinUniverse(1)
receiver.RegisterPacketCallback(packet.PacketTypeData, dataPacketCallback)
receiver.Start()
for {
time.Sleep(1)
}
}
func dataPacketCallback(p packet.SACNPacket, source string) {
d, ok := p.(*packet.DataPacket)
if ok == false {
return
}
fmt.Printf("Received Data Packet for universe %d from %s\n", d.Universe, source)
}
- Transmitter
TODO
See examples directory for more examples.
- Run an example to test your code
go run examples/receiver/receiver.go
- Tests
go test ./...
- sACN-Monitor: An app to view data from all sACN universes, built using this library.
- Hundemeier's go-sacn: Only supports Data packets
- go-artnet
- Open Lighting Architecure (OLA) framework (C implementations of control protocols).
- sACN (ANSI E1.31) specification.
- DMX (ANSI E1.11) specification