Skip to content
This repository was archived by the owner on Jun 9, 2021. It is now read-only.

Commit 0f2a524

Browse files
committed
More typos fixed and a few bits of information added
1 parent c77edf5 commit 0f2a524

File tree

2 files changed

+12
-14
lines changed

2 files changed

+12
-14
lines changed

README.md

+12-13
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,11 @@ We use:
2020
* Official Raspberry Pi camera
2121
* Motion sensor
2222

23-
The motion sensor is connected to the [GPIO port 23](https://pinout.xyz/pinout/pin16_gpio23) in our example, however you are free to choose any other port. Make sure to change ```app/config``` file accordingly.
23+
The motion sensor is connected to the [GPIO port 23](https://pinout.xyz/pinout/pin16_gpio23) in our example, however you are free to choose any other port. Make sure to change ```app/config.py``` file accordingly.
2424

2525
#### Precautions
2626

27-
Make sure to remove static electricity, when playing with the Pi Camera and motion sensors, as they might be damaged.
27+
Make sure to remove static electricity when playing with the Pi Camera and motion sensors, as they might be damaged, for example, you can touch grounded metal surface.
2828

2929
Plug the camera in and out when the Pi board is not powered only, as doing otherwise could damage it.
3030

@@ -42,26 +42,26 @@ You can install the dependencies manually or run an automated script to get this
4242

4343
### External Services
4444

45-
1. Sign up on [developer.ciscospark.com](https://developer.ciscospark.com) and [create a bot](https://developer.ciscospark.com/add-bot.html). Save the authorisation token into ```app/config.py``` (as bearer)
45+
1. Sign up on [developer.ciscospark.com](https://developer.ciscospark.com) and [create a bot](https://developer.ciscospark.com/add-bot.html). Save the authorisation token and the bot username (e.g. [email protected]) into ```app/config.py```
4646
2. Sign up on [ngrok.com](https://ngrok.com) and follow guidelines to run the tunnel to port 8080.
47-
3. Create a webhook.This will ensure that messages sent to your bot will be forwarded via ngrok to your localhost script. Make sure to enable test mode on and enter your bot information on the webpage.
48-
* Option 1. [Create a webhook](https://developer.ciscospark.com/endpoint-webhooks-post.html) for your Spark bot online.
49-
* Option 2. Just insert the authorisation token into ```app/config.py``` and the ngrok URL into ```target_url``` in ```app/register.py```. Then run it: ```python3.6 app/register.py```. If you see "OK", everything is good.
47+
3. Create a webhook.This will ensure that messages sent to your bot will be forwarded via ngrok to your localhost script.
48+
* Option 1. [Create a webhook](https://developer.ciscospark.com/endpoint-webhooks-post.html) for your Spark bot online. Make sure to enable test mode on and enter your bot information on the webpage.
49+
* Option 2. If you already saved the authorisation token (bearer) into ```app/config.py```, then write the ngrok URL into ```target_url``` in ```app/register.py```. Then run it: ```python3.6 app/register.py```. If you see "OK", everything is good and the bot has been registered.
5050

5151
## Run Bot
5252

5353
1. Run ```./ngrok http 8080``` to create a tunnel
5454
2. Run ```python3.6 app/main.py``` to launch the bot
5555

56-
Note: every time you run ngrok with a free plan, it changes the URL, which means that you need to reregister the bot. The easiest way is to simply insert the new URL into ```app/register.py``` and run it.
56+
**Note:** every time you run ngrok on a free plan, it changes the URL, which means that you need to re-register the bot. The easiest way is to simply insert the new URL into ```app/register.py``` and run it.
5757

58-
Now, you can access Cisco Spark on [web.ciscospark.com](https://web.ciscospark.com) or download the app to your device.
58+
Now, you can access Cisco Spark on [web.ciscospark.com](https://web.ciscospark.com) or download the app to your device. Add your bot to the contact list and start sending commands.
5959

6060
## Bot API
6161

6262
Bot responds to the commands stated below. Commands are case insensitive, which means that ```COMMAND```, ```command``` and ```CoMmanD``` are all the same thing.
6363

64-
You can add a bot to a Spark space, or start an 1:1 chat - all cases are covered.
64+
You can add a bot to a Spark space, or start a 1:1 chat - all cases are covered.
6565

6666
### Command Help
6767

@@ -71,18 +71,17 @@ You can add a bot to a Spark space, or start an 1:1 chat - all cases are covered
7171

7272
* ```camera photo``` - Take a photo with a Raspberry Pi camera and send it back as an attached image.
7373

74-
### Subsription
74+
### Event Subscription
7575

76-
* ```subscribe security``` - Add your current Spark account to a database to receive security updates. It includes sending you photos taken by camera, when the motion sensor fires up.
76+
* ```event subscribe security``` - When the motion sensor detects the motion, it notifies the bot about it. If you're subscribed to this event, you'll receive a notification.
7777

78-
* ```unsubscribe security``` - Opt out from the subscription.
78+
* ```event unsubscribe security``` - Opt out from the subscription.
7979

8080

8181
#### Example
8282

8383
![](readme/camera-photo.png)
8484

85-
8685
## File Structure
8786

8887
```

app/config.py

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
config = {
22
"bot_email": "",
3-
"bot_name": "",
43
"bearer": "",
54
"gpio_motion_sensor": 23
65
}

0 commit comments

Comments
 (0)