The goal of this project is to develop a remotely controlled OLED screen.
- Raspberry Pi 3 Model B (to be potentially replaced with a cheaper alternative)
- SH1106-driven 128x64 OLED screen
- Golang
- Get the source code
go get github.com/samarkin/screen-server/cmd/oledd
go get github.com/samarkin/screen-server/cmd/create-user
- Disable go modules
go env -w GO111MODULE=auto
- Create user
cd $GOPATH/src/github.com/samarkin/screen-server/cmd/oledd
go run github.com/samarkin/screen-server/cmd/create-user
- Build and run
go run github.com/samarkin/screen-server/cmd/oledd
-
Find out IP of your Raspberry Pi. For example,
192.168.1.5
. -
From any computer connected to the same network make an HTTP request to port 6533 (OLED spelled on phone keypad)
-
Obtain the auth token first (using login in password that you provided previously):
tokenHeader=`curl -v --silent --data '{"login":"admin", "password":"admin"}' http://192.168.1.5:6533/api/login 2>&1 | grep X-Session-Token | cut -c 3- | tr -d '\r\n'`
-
Display a message
curl -v -H $tokenHeader --data '{"text": "Hello, world!"}' http://192.168.1.5:6533/api/messages
-