This node.js library links the blink(1) mk2 to a websocket based, multi-client capable IPC mechanism called jet.
Use it to achieve any functionality you desire with the blink(1) mk2. It is easy controllable and websocket based. Clients can be either programs running in the RPi or browsers and services on other machines. I provide an RC-car example use case. The car is controlled completely over the jet protocol. One daemon runs on the RPi and several services like jetblink or motor-controls connect to it.
The implementation works on a Raspberry PI but can easily be updated to work on MAC or Windows.
- Install blink(1) mk2 console application on you RPi.
- Install the newest node.js version on your RPi
- checkout jetblink
- type
npm install
in the repository - add
/usr/local/bin/node /home/pi/jetblink/src/daemon.js &
andsudo /usr/local/bin/node /home/pi/jetblink/src/jetblink.js &
to /etc/rc.local or start as root from console - open demo and connect to your RPi IP address. The standard port is 11123
- control blink(1) mk2
The Media shows the really ugly control website for the car and the car itself.
There is one video showing the control of the blink(1) mk2 over the website. The delay is mostly due to the 1080p camera delay of the RPi. Light changes instantly. It can also be controlled from several clients simultaneuously.
There is another video showing my PiCar using the blink(1) mk2 and one of the driving car. For more info about the PiCar visit my homepage. Color codes are as follows:
red: no client connected -> car stops
Light 1 (motor):
- green: stop
- yellow: backward (intensity equals PWM motor speed)
- blue: forward (intensity equals PWM motor speed)
Light 2 (steering):
- green: front
- yellow: left
- blue: right
- blink patterns
- reshape interface
- make it run on Windows and MAC