Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs/crow/scripting: Update druid install/usage instructions #142

Merged
merged 1 commit into from
Oct 9, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 33 additions & 16 deletions docs/crow/scripting.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,50 +22,67 @@ To communicate with crow we'll use `druid` which is a command-line tool that let
First we'll collect & install a few tools, starting with `Python` which is the environment that runs `druid`. We need version 3.5+, but let's get the most recent version:

- Mac & Windows: [download from the Python website](https://www.python.org/downloads/)
- Linux: in a terminal run `sudo apt-get install python3 python3-pip`
- Linux: in a terminal run `sudo apt-get install python3 python3-pip` or equivalent

Now load up a terminal so we can check Python is installed and get the next pieces:

- Mac: Open `terminal`
- Windows: Use `PowerShell` and open by right-clicking and `Run as administrator`
- Linux: Your choice! `gnome-terminal` is likely your default

Check Python is installed and working:
Check if Python is installed and working:

```
> python3 -V
python3 -V
```

Which should print `Python 3.6.5` or something similar. If this doesn't work for you, try removing the `3` and just run `> python -V`. No luck? Post to the [lines thread](https://llllllll.co/t/crow-help-druid/25864) & we'll figure it out (and update this doc).
Which should print `Python 3.6.5` or something similar. If this doesn't work for you, try removing the `3` and just run `python -V`. No luck? Post to the [lines thread](https://llllllll.co/t/crow-help-druid/25864) & we'll figure it out (and update this doc).

Now we need some Python libraries which we collect with pip:

```
> pip3 install pyserial asyncio prompt_toolkit
pip3 install --upgrade setuptools
```

All going well, it's time to download `druid`. If you don't know `git` don't worry, you don't need to touch it!
All going well, it's time to install `druid`

- Navigate to the [`druid` repository](https://github.com/monome/druid)
- Click the green button to the right that says 'Clone or download'
- Click 'Download ZIP'
```
pip3 install monome-druid
```

Now decide where you want to put `druid` and unzip the folder to that location. This document will assume `~/druid` which means in your user directory.
Now druid should be ready to use, you might need to close and reopen the terminal to get access to it.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pip will warn you here if the binary location is not on your path, but it might be good to draw attention to that warning message?

Copy link
Member Author

@simonvanderveldt simonvanderveldt Oct 9, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You mean when ~/.local/bin or /usr/local/bin isn't on $PATH?
The hint I added here was more for tab-completion (as in someone expecting dr<tab> to show them druid but it isn't happening), but that's also a valid point. On the other hand if pip already tells the user do we need to document it as well?


For the command-line savvy:
Let's load up `druid` to test if everything works as expected

```
cd ~
git clone https://github.com/monome/druid.git
druid
```

If `druid` responds with `can't open serial port` you probably don't have the required permissions to open the device.
To remedy this add yourself to the correct group, which can be determined by running

```
ls -l /dev/ttyACM0
crw-rw---- 1 root dialout 166, 0 Oct 9 20:28 /dev/ttyACM0
```

In this case the group is called `dialout` but it's sometimes also called `uucp`.

To add yourself to the `dialout` group run

```
sudo gpasswd -a <your username> <the group name found above>
```

After this logout and login again or simply restart.


### Uploading

Let's load up `druid` so we can talk to crow. We need to enter the druid folder, then run it with python:
Let's load up `druid` so we can talk to crow.

```
cd ~/druid
python3 druid.py
druid
```

`druid` will start and your cursor will be at the bottom of the screen after `>` awaiting your input. The large empty window above the `////`s is the 'console' and this is where we'll see responses from crow.
Expand Down