It is written in 'Go' by Google (golang.org).
What is this about?
Basically, this program allows you to remotely toggle your outputs or read input states of the things connected to your Pi. I plan to support built in entity linking, meaning 'when Input my_sensor goes high, it executes command X', but thats just planned.
The application listens on port 4200(UDP) default and requests are send as json encoded string.
I also made a small tool using node that listens on 8080 and allows you to simply execute commands via the web browser of your choice.
Pebble? Pebble!
I also created a simple Pebble app that allows me to execute all the commands:

I didnt put the code of that application to bitbucket yet.
How does it look like?
Here's a simple example: I have this in my config:
Code: Select all
{
"Board": 3,
"Entities": [
{
"Name": "desk_light",
"FriendlyName": "Desk Light",
"Pin": 1,
"Type": "Output"
}
]
}
I can also toggle it (/desk_light/toggle) or set the output low (/desk_light/state/0). As a note, my desk light is connected to a relay card of course
How can I do that and what do I need?
First, let's talk about what you actually need.
As I do not provide executables, you need to install it on your own. This results in the list of following dependencies:
- Go installed and set up
node.js
wiringPi (wiringpi.com)
Node Application
Main Program
Configuration
You have to customize the 'config.json' file.
Board (integer): the board revision. 1 is RPi 1 rev 1, 2 is RPi 1 rev 2 and 3 is RPi 2.
Entities (array of objects): the entities (inputs and outputs) you have connected. Example:
Code: Select all
"Entities": [
{
"Name": "desk_light",
"FriendlyName": "Desk Light",
"Pin": 1,
"Type": "Output"
}
]Any Questions?
Feel free to ask questions or just point out mistakes in the code.
With best regards,
Jan