golang-evdev icon indicating copy to clipboard operation
golang-evdev copied to clipboard

Can not open input device on Raspberry Pi 3B+ anymore

Open peterhellberg opened this issue 4 years ago • 4 comments

After b6f418b1fe5af0386c81f387227f36d4801883b0 there was some change that broke the usage of golang-evdev on my Raspberry Pi 3B+ running balenaOS. (With resin/scratch containers built with balenalib/raspberrypi3-alpine-golang)

In the latest version of this package the input device list is empty ([]*evdev.InputDevice{}) and /dev/input/event0 doesn’t exist.

For now my workaround is to lock the version of this package to b6f418b1fe5af0386c81f387227f36d4801883b0 but just wanted to give you a heads up.

(I’m using this package in combination with https://github.com/nathany/bobblehat on a RPi connected to a SenseHAT)

peterhellberg avatar Aug 28 '19 10:08 peterhellberg

Hi, can you give a try to : https://github.com/MaitreDede/golang-evdev/tree/err-checks ?

go get -v github.com/MaitreDede/golang-evdev@err-checks

maitredede avatar Aug 30 '19 02:08 maitredede

@MaitreDede Yes, your fork/branch seems to work as it should.

Got my RPi accessible via: https://6ea712a77b3b247831fcc102c606a54a.balena-devices.com/

Currently running code
package main

import (
	"context"
	"encoding/json"
	"flag"
	"fmt"
	"image/png"
	"io/ioutil"
	"log"
	"net/http"
	"os"
	"os/signal"
	"time"

	evdev "github.com/MaitreDede/golang-evdev"
	ble "github.com/go-ble/ble"
	dev "github.com/go-ble/ble/examples/lib/dev"
	screen "github.com/nathany/bobblehat/sense/screen"
	color "github.com/nathany/bobblehat/sense/screen/color"
	ruuvitag "github.com/peterhellberg/ruuvitag"
)

var (
	rawData     = map[string]timestampedRAWv1{}
	framebuffer = screen.NewFrameBuffer()
)

type timestampedRAWv1 struct {
	ruuvitag.RAWv1
	Time time.Time
}

func clear() {
	framebuffer = screen.NewFrameBuffer()

	// Clear the Sense HAT screen
	screen.Clear()
}

func main() {
	var path string

	flag.StringVar(&path, "path", "/dev/input/event0", "path to the event device")

	flag.Parse()

	clear()

	// Setup the logger
	logger := log.New(os.Stdout, "", 0)

	handleSignals(logger)

	hs := setup(logger)

	device, err := openInputDevice(path)
	if err != nil {
		logger.Printf("Unable to open input device: %s\nError: %v\n", path, err)
		os.Exit(1)
	}

	logger.Println(device)

	go hs.ListenAndServe()
	go bleScan(context.Background(), logger)

	for {
		events, err := device.Read()
		if err != nil {
			fmt.Printf("device.Read() Error: %v\n", err)
			os.Exit(1)
		}

		for _, ev := range events {
			switch ev.Type {
			case evdev.EV_KEY:
				ke := evdev.NewKeyEvent(&ev)

				if ke.State != evdev.KeyDown {
					continue
				}

				// Create a new framebuffer
				fb := screen.NewFrameBuffer()

				switch ke.Scancode {
				case evdev.KEY_ENTER:
					fmt.Println("⏎ ")
				case evdev.KEY_UP:
					fmt.Println("↑")
					draw(fb, 0, 0, 8, 4, color.New(255, 255, 0))
				case evdev.KEY_DOWN:
					fmt.Println("↓")
					draw(fb, 0, 4, 8, 8, color.New(255, 0, 0))
				case evdev.KEY_LEFT:
					fmt.Println("←")
					draw(fb, 0, 0, 4, 8, color.New(0, 0, 255))
				case evdev.KEY_RIGHT:
					fmt.Println("→")
					draw(fb, 4, 0, 8, 8, color.New(0, 255, 0))
				}

				framebuffer = fb

				screen.Draw(fb)
			}
		}
	}
}

func openInputDevice(path string) (*evdev.InputDevice, error) {
	if !evdev.IsInputDevice(path) {
		return nil, fmt.Errorf("not an input device")
	}

	return evdev.Open(path)
}

func handleSignals(logger *log.Logger) {
	c := make(chan os.Signal, 1)

	signal.Notify(c, os.Interrupt)

	go func() {
		for range c {
			logger.Println("Clearing the screen...")
			clear()
			os.Exit(0)
		}
	}()
}

func bleScan(ctx context.Context, logger *log.Logger) {
	d, err := dev.DefaultDevice()
	if err != nil {
		logger.Printf("DefaultDevice error: %v\n", err)

		return
	}

	ble.SetDefaultDevice(d)

	handler := func(a ble.Advertisement) {
		raw, err := ruuvitag.ParseRAWv1(a.ManufacturerData())
		if err == nil {
			rawData[a.Addr().String()] = timestampedRAWv1{raw, time.Now()}
		}
	}

	ctx = ble.WithSigHandler(context.WithCancel(ctx))

	ble.Scan(ctx, true, handler, func(a ble.Advertisement) bool {
		return ruuvitag.IsRAWv1(a.ManufacturerData())
	})
}

func draw(fb *screen.FrameBuffer, a, b, m, n int, c color.Color) {
	for i := a; i < m; i++ {
		for j := b; j < n; j++ {
			fb.SetPixel(i, j, c)
		}
	}
}

func setup(logger *log.Logger) *http.Server {
	return &http.Server{
		Addr:         getAddr(),
		Handler:      newServer(logWith(logger)),
		ReadTimeout:  5 * time.Second,
		WriteTimeout: 10 * time.Second,
		IdleTimeout:  60 * time.Second,
	}
}

func getAddr() string {
	if port := os.Getenv("PORT"); port != "" {
		return ":" + port
	}

	return ":80"
}

func newServer(options ...Option) *Server {
	s := &Server{logger: log.New(ioutil.Discard, "", 0)}

	for _, o := range options {
		o(s)
	}

	s.mux = http.NewServeMux()
	s.mux.HandleFunc("/", s.index)
	s.mux.HandleFunc("/framebuffer.png", s.framebuffer)
	s.mux.HandleFunc("/favicon.ico", s.favicon)

	return s
}

type Option func(*Server)

func logWith(logger *log.Logger) Option {
	return func(s *Server) {
		s.logger = logger
	}
}

type Server struct {
	mux    *http.ServeMux
	logger *log.Logger
}

func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request) {
	if r.Method != "GET" {
		w.WriteHeader(http.StatusMethodNotAllowed)
		return
	}

	s.log("%s %s", r.Method, r.URL.Path)

	s.mux.ServeHTTP(w, r)
}

func (s *Server) log(format string, v ...interface{}) {
	s.logger.Printf(format+"\n", v...)
}

func (s *Server) index(w http.ResponseWriter, r *http.Request) {
	w.Header().Set("Content-Type", "application/json; charset=utf-8")

	json.NewEncoder(w).Encode(map[string]interface{}{
		"ruuvitags": rawData,
	})
}

func (s *Server) framebuffer(w http.ResponseWriter, r *http.Request) {
	if framebuffer == nil {
		w.WriteHeader(http.StatusNoContent)
		return
	}

	png.Encode(w, framebuffer)
}

func (s *Server) favicon(w http.ResponseWriter, r *http.Request) {
	w.Write(faviconData)
}

var faviconData = []byte{
	0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a, 0x00, 0x00, 0x00, 0x0d, 0x49, 0x48, 0x44, 0x52,
	0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x40, 0x08, 0x03, 0x00, 0x00, 0x00, 0x9d, 0xb7, 0x81,
	0xec, 0x00, 0x00, 0x02, 0x2b, 0x50, 0x4c, 0x54, 0x45, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00,
	0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x01,
	0x00, 0x00, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x01, 0x00,
	0x00, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00,
	0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
	0x00, 0x00, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x01, 0x00,
	0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00,
	0x00, 0xc9, 0x1e, 0x4a, 0x83, 0xc5, 0x5c, 0xc8, 0x1e, 0x49, 0xc4, 0x1d, 0x48, 0xc2, 0x1d, 0x47,
	0xff, 0x26, 0x5f, 0x81, 0xc3, 0x5b, 0xfa, 0x25, 0x5c, 0x80, 0xc1, 0x5a, 0xd1, 0x1f, 0x4d, 0xc6,
	0x1d, 0x49, 0x82, 0xc4, 0x5c, 0x7f, 0xbf, 0x59, 0xd9, 0x20, 0x50, 0xf9, 0x25,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, 0xd7, 0x64, 0x89, 0xce, 0x60, 0xfc, 0x25, 0x5c, 0x76, 0xb2,
	0x53, 0x5a, 0x89, 0x3f, 0x57, 0x83, 0x3d, 0xa6, 0x17, 0x3c, 0x25, 0x36, 0x1a, 0x3d, 0x09, 0x16,
	0x15, 0x1f, 0x0f, 0x04, 0x05, 0x03, 0xa3, 0xf4, 0x72, 0x9e, 0xed, 0x6f, 0x8b, 0xd2, 0x62, 0x6b,
	0xa1, 0x4b, 0x9a, 0x16, 0x38, 0x85, 0x13, 0x30, 0x79, 0x12, 0x2d, 0x60, 0x0c, 0x23, 0x42, 0x09,
	0x18, 0x33, 0x07, 0x13, 0x2f, 0x07, 0x11, 0x07, 0x0b, 0x05, 0xb3, 0xff, 0x7d, 0xac, 0xff, 0x78,
	0xff, 0x29, 0x65, 0x73, 0xac, 0x50, 0xb6, 0x1b, 0x43, 0x5d, 0x8c, 0x41, 0xac, 0x19, 0x3f, 0xa8,
	0x19, 0x3e, 0x51, 0x7b, 0x39, 0x4b, 0x72, 0x35, 0x94, 0x16, 0x35, 0x75, 0x11, 0x2b, 0x6e, 0x10,
	0x27, 0x37, 0x52, 0x26, 0x5a, 0x0c, 0x21, 0x2c, 0x43, 0x1f, 0x20, 0x2f, 0x16, 0x28, 0x06, 0x0f,
	0x12, 0x03, 0x06, 0xa0, 0xf1, 0x70, 0x6d, 0xa4, 0x4c, 0x62, 0x94, 0x45, 0x44, 0x66, 0x2f, 0x3a,
	0x57, 0x28, 0x2a, 0x3f, 0x1d, 0x18, 0x24, 0x11, 0x11, 0x1a, 0x0c, 0xa4, 0xf6, 0x73, 0xff, 0x2c,
	0x6b, 0xf7, 0x24, 0x5a, 0x41, 0x61, 0x2e, 0x71, 0x11, 0x29, 0x34, 0x4d, 0x24, 0x31, 0x48, 0x22,
	0x2a, 0x06, 0x0f, 0xa1, 0xf2, 0x71, 0x69, 0x9e, 0x49, 0x54, 0x7d, 0x3b, 0x4f, 0x75, 0x38, 0x3e,
	0x5a,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a, 0xcd, 0xd0, 0x3f, 0xb2, 0xb2, 0x04, 0x64,
	0x87, 0x25, 0x5d, 0x8f, 0x7c, 0x88, 0x03, 0x77, 0x9f, 0x86, 0xfe, 0x9d, 0x47, 0xb7, 0x01, 0x24,
	0x6b, 0x2c, 0xff, 0x2f, 0x42, 0xff, 0xc5, 0xb3, 0xc7, 0x77, 0xc2, 0xcb, 0xcb, 0xe1, 0x3b, 0x8f,
	0x56, 0x42, 0x8b, 0xf9, 0x05, 0xad, 0x63, 0x71, 0x95, 0x53, 0xb1, 0x7c, 0x98, 0x00, 0x00, 0x00,
	0x00, 0x49, 0x45, 0x4e, 0x44, 0xae, 0x42, 0x60, 0x82,
}

peterhellberg avatar Sep 02 '19 09:09 peterhellberg

@gvalkov Should I close this issue, or do you want to incorporate the changes made in https://github.com/MaitreDede/golang-evdev/tree/err-checks?

peterhellberg avatar Sep 11 '19 12:09 peterhellberg

Hi, I made a pull request : #17

maitredede avatar Oct 28 '19 19:10 maitredede