-
Notifications
You must be signed in to change notification settings - Fork 0
/
instructions.txt
60 lines (46 loc) · 2.18 KB
/
instructions.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
First steps
-------------------------------------------------------------------------------
- Log into your Jetson Nano and clone this repository to some folder.
- Install docker if not already available in Jetson Nano (https://www.docker.com/)
- Install ngrok to your Jetson Nano (https://ngrok.com/)
- Install nodejs to your Jetson Nano (https://nodejs.org/en/)
Setting up the project in Jetson Nano
-------------------------------------------------------------------------------
1. ngrok proxy
Exposes the Slack integration api (localhost) to the Internet (for Slack)
- Start ngrok from the installation location:
./ngrok http 4390
2. redis
Acts as message broker between python script and nodejs script
- install and start the redis docker container
sudo docker run -d -p 6060:6379 --name coffee-queue redis
- if the container is alreary installed you can start the container directly
sudo docker start coffee-queue
3. python script
Capture images by calling web cam and does the inference
- cd to the project coffee-queue-detector/inference
- install requirements
sudo python3 -m pip install -r requirements.txt
- start the script
python3 queue-inference-jetson-client.py
4. nodejs script
Serves the API that is exposed to the Slack app
- cd to the project coffee-queue-detector/slack-integration
- Create a .env file and put the following values in it:
CLIENT_ID=id_of_the_slack_channel_app_take_this_from_slack
CLIENT_SECRET=secret_of_the_slack_channel_app_take_this_from_slack
SLACK_INTEGRATION_API_PORT=4390
REDIS_PORT=6060
REDIS_HOST=localhost
- Install dependencies by running:
npm install
- Start the server:
node app.js
Setting up the Slack app
-------------------------------------------------------------------------------
1. Go to https://slack.com/
2. Create a channel or use an existing one if you already have one ready
3. Create an app and configure a slash-command to send a request to the slack integration api
(via the URL generated by ngrok) and to receive the coffee queue status back.
https://api.slack.com/apps
https://api.slack.com/interactivity/slash-commands