Skip to content

Commit 2101182

Browse files
authored
Update README.md
1 parent 5b1d9a4 commit 2101182

File tree

1 file changed

+17
-14
lines changed

1 file changed

+17
-14
lines changed

README.md

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -40,30 +40,33 @@ network={
4040

4141
## Software Install Instructions
4242

43-
SSH into the Raspberry Pi after powering it. Make sure you are in the same Wifi network to SSH. The default hostname will be `raspberrypi` so you can login via `ssh [email protected]`. The default password is `raspberry`
43+
Run the following commands in the Terminal. To remote log in you will need to SSH into the Raspberry Pi after powering it. Make sure you are in the same Wifi network to SSH. The default hostname will be `raspberrypi` so you can login via `ssh [email protected]`. The default password is `raspberry`.
4444

4545
1. First change the password using `passwd`
4646
1. Then install docker using this command `curl -sSL https://get.docker.com | sh`
4747
1. Then make the pi user be able to executa commands as sudo user inside of the docker container via this command `sudo usermod -aG docker pi`
4848
1. Reboot raspberry pi using `sudo shutdown -r now`
49-
1. Then pull the docker container containing our code `docker pull encoreptl/thermostat-sensor:latest`
50-
1. Add the following to the `/etc/rc.local` before the `exit 0` line
51-
```
49+
1. Then ssh into the raspberry pi again and pull the docker container containing our code `docker pull encoreptl/thermostat-sensor:latest`
50+
1. Finally start the container using the command below and it will always run the container even when raspberry pi gets restarted
51+
52+
```sh
5253
docker run \
53-
--privileged \
54-
-e PYTHONUNBUFFERED=1 \
55-
-e SERVER_DOMAIN=thermostat.encoredevlabs.com \
56-
-e BUTTON_PIN=25 \
57-
-e TEMP_SENSOR_PIN=4 \
58-
-e REPORT_INTERVAL=60 \
59-
-v /sys:/sys \
60-
-d \
61-
encoreptl/thermostat-sensor
54+
--privileged \
55+
--restart=unless-stopped
56+
-e PYTHONUNBUFFERED=1 \
57+
-e SERVER_DOMAIN=thermostat.encoredevlabs.com \
58+
-e BUTTON_PIN=25 \
59+
-e TEMP_SENSOR_PIN=4 \
60+
-e REPORT_INTERVAL=60 \
61+
-v /sys:/sys \
62+
-d \
63+
encoreptl/thermostat-sensor
6264
```
6365

66+
6467
## Configure where to send Temperature Data, Reading Frequency and GPIO PIN numbers
6568

66-
You can configure by setting the following environment variables in the docker run command to your liking:
69+
You can configure the container by setting the following environment variables in the docker run command to your liking:
6770

6871
* `SERVER_DOMAIN` - Setting this will post the reading to this domain and it can container port number as well
6972
* `REPORT_INTERVAL` - Frequency of how often you want to send temperature readings in seconds

0 commit comments

Comments
 (0)