You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jun 9, 2021. It is now read-only.
Copy file name to clipboardexpand all lines: README.md
+12-13
Original file line number
Diff line number
Diff line change
@@ -20,11 +20,11 @@ We use:
20
20
* Official Raspberry Pi camera
21
21
* Motion sensor
22
22
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.
24
24
25
25
#### Precautions
26
26
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.
28
28
29
29
Plug the camera in and out when the Pi board is not powered only, as doing otherwise could damage it.
30
30
@@ -42,26 +42,26 @@ You can install the dependencies manually or run an automated script to get this
42
42
43
43
### External Services
44
44
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```
46
46
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.
50
50
51
51
## Run Bot
52
52
53
53
1. Run ```./ngrok http 8080``` to create a tunnel
54
54
2. Run ```python3.6 app/main.py``` to launch the bot
55
55
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.
57
57
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.
59
59
60
60
## Bot API
61
61
62
62
Bot responds to the commands stated below. Commands are case insensitive, which means that ```COMMAND```, ```command``` and ```CoMmanD``` are all the same thing.
63
63
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.
65
65
66
66
### Command Help
67
67
@@ -71,18 +71,17 @@ You can add a bot to a Spark space, or start an 1:1 chat - all cases are covered
71
71
72
72
*```camera photo``` - Take a photo with a Raspberry Pi camera and send it back as an attached image.
73
73
74
-
### Subsription
74
+
### Event Subscription
75
75
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.
77
77
78
-
*```unsubscribe security``` - Opt out from the subscription.
78
+
*```event unsubscribe security``` - Opt out from the subscription.
0 commit comments