Skip to content
Open
Show file tree
Hide file tree
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
47 changes: 47 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ I built cases out of 1x6 boards to give the poemBot a solid home.

To simplify set up, the basic GPIO pin connections are marked on a leaf [poembot_leaf.png](poembot_leaf.png) or printable [poembot_leaf.pdf](poembot_leaf.pdf), based on [simonmonk's Raspberry Leaf](http://www.doctormonk.com/2013/02/raspberry-pi-and-breadboard-raspberry.html) concept.

For Rasberry Pi Model A & B version, see where to plug-in GPIO pin connections at [jumper_diagram.png](images/jumper_diagram.png).

Here's what it looks like inside:

![poemBot insides](images/poemBot_inside.JPG)
Expand Down Expand Up @@ -78,6 +80,14 @@ Convert the encoding to CP437.

The Raspberry Pi needs to be set up to run headless (I used the official [Raspbian](https://www.raspberrypi.org/downloads/raspbian/) minimal image).
SSH in for set up and testing.

### Install Dependencies:
Install the serial python library to communicate with printer:
```
sudo apt install python-serial
```

### Start on Boot Method 1:
After testing the Python main loop and poem printing, set it to load on boot by editing rc.local:

```
Expand All @@ -91,10 +101,47 @@ cd /home/pi/poemBot
python poemsMain.py &
```

### Start on Boot Method 2:
If using `rc.local` does not work for you, then an alternative is to create a service with `systemctl`.

Create a service file:
```
sudo nano /etc/systemd/system/poems.service
```

Here is an example file. This assumes that the poemBot directory is located in `/home/pi/poemBot`.

```
[Unit]
Description=PoemBot
After=multi-user.target

[Service]
ExecStart=/home/pi/poemBot/poemsMain.py
WorkingDirectory=/home/pi/poemBot

[Install]
WantedBy=multi-user.target
```

Once the poems.service file is saved. Then you can run this command to start it:

```
sudo systemctl start poems.service
```

You can check to see if it is running proprerly (without errors) with this command:
```
systemctl status poems.service
```


### After Restarting:
Now, when you plug in the poemBot, it starts up after a minute ready to print poems.
When you press the button, it prints a poem.
When you hold the button for a few seconds, it will shutdown.


## Other uses in the wild

- Wooster [intro-to-dh course](https://jacobheil.github.io/intro-to-dh/prompts/poetry_month.html) (Jacob Heil), [github](https://github.com/WoosterDH/poemBot-Scripts), [tweet](https://twitter.com/dr_heil/status/989482390388117504)
Expand Down
Binary file added images/jumper_diagram.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.