Skip to content

Commit de11541

Browse files
author
Brian Hines
committed
Add some info about Upstart
1 parent 046415f commit de11541

1 file changed

Lines changed: 37 additions & 2 deletions

File tree

README.md

Lines changed: 37 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
After installation and configuration (see below) the Raspberry Pi serves a single page demonstration app at: `http://your_raspberry_pi_hostname:5000/`.
1+
After following the installation and configuration steps below, your Raspberry Pi will serve a single page demonstration app at: `http://your_raspberry_pi_hostname:5000/`.
22

33
* Each pin defined as output will show up in the **controls** section with a button to toggle its state.
44
* Each pin with an input event displays a message in the **events** section each time it is triggered.
@@ -41,7 +41,7 @@ sudo reboot
4141

4242
------------------------------------------------------------------------------
4343

44-
### Pin Configuration
44+
#### Pin Configuration
4545

4646
A config file `config/pins.yml` is used to define the initial setup for pins that will be accessible to the API. If a pin is not defined here it will not have a URL route in the API. For full documentation about available GPIO input pin configurations see the [documentation](http://sourceforge.net/p/raspberry-gpio-python/wiki/Examples/).
4747

@@ -67,6 +67,17 @@ A config file `config/pins.yml` is used to define the initial setup for pins tha
6767
* `event` - This can only be used in combination with a pin set to input mode (`mode: IN`). If defined, the pin will use a socket.io connection and push data to the client when an event is detected. Accepted values are: `RISING`, `FALLING`, `BOTH`.
6868
* `bounce` - This can be used when an `event` is defined to prevent multiple callbacks being fired accidentally. The value is the number of milliseconds to wait before detecting another `event`.
6969

70+
##### Note:
71+
72+
An example configuration file is included in this project. It defines:
73+
74+
* **Pin 18** as an output pin
75+
* **Pin 23** as an input pin registered with a RISING event.
76+
77+
Using this configuration, all you need to do is wire a 1K resistor and LED to **pin 18**, and an button to **pin 23** to start using the demonstration app immediately.
78+
79+
![Raspberry Pi Bread Board](http://i.imgur.com/zhLKQqW.jpg)
80+
7081

7182
------------------------------------------------------------------------------
7283

@@ -243,6 +254,30 @@ socket.on( 'pin:event', function ( data ) {
243254
```
244255

245256

257+
------------------------------------------------------------------------------
258+
259+
### Upstart
260+
261+
------------------------------------------------------------------------------
262+
263+
This project uses [Upstart](http://upstart.ubuntu.com/) to automatically start the GPIO web server when the Raspberry Pi boots. If you make changes to the server code in this project on your Raspberry Pi, you will need to restart the GPIO server in order for those changes to take affect. If you want to do this without rebooting, you can use the following command:
264+
265+
```
266+
sudo service gpio-server restart
267+
```
268+
269+
If for any reason you wish to stop the GPIO server from running you can use:
270+
271+
```
272+
sudo service gpio-server stop
273+
```
274+
275+
If you want to start the GPIO server again, use:
276+
277+
```
278+
sudo service gpio-server start
279+
```
280+
246281
------------------------------------------------------------------------------
247282

248283
### TODO

0 commit comments

Comments
 (0)