Skip to content

Commit 56e657e

Browse files
author
Jim Bennett
authored
Adding more on virtual environments. (#274)
* Update README.md * Spelling fixes * Update hardware.md * Adding IoT for beginners episode * Adding intro video * Fixing formatting of read more and self study sections. * Adding instructions for installing the ReSpeaker * Adding auth to language understanding * Adding Wio terminal timer setting * Update config.h * Fixing links and images * Increasing version numbers for SD card fix * Adding SD card requirement * speech and translations * Adding more on translations * All Wio Terminal now working except playing audio * Adding more details on virtual environments.
1 parent a122009 commit 56e657e

File tree

6 files changed

+20
-14
lines changed

6 files changed

+20
-14
lines changed

1-getting-started/lessons/1-introduction-to-iot/pi.md

+6-2
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,9 @@ To program the Pi using the Grove sensors and actuators, you will need to instal
4949
curl -sL https://github.com/Seeed-Studio/grove.py/raw/master/install.sh | sudo bash -s -
5050
```
5151

52-
One of the powerful features of Python is the ability to install [pip packages](https://pypi.org) - these are packages of code written by other people and published to the Internet. You can install a pip package onto your computer with one command, then use that package in your code. This Grove install script will install the pip packages you will use to work with the Grove hardware from Python.
52+
One of the powerful features of Python is the ability to install [Pip packages](https://pypi.org) - these are packages of code written by other people and published to the Internet. You can install a Pip package onto your computer with one command, then use that package in your code. This Grove install script will install the Pip packages you will use to work with the Grove hardware from Python.
53+
54+
> 💁 By default when you install a package it is available everywhere on your computer, and this can lead to problems with package versions - such as one application depending on one version of a package that breaks when you install a new version for a different application. To work around this problem, you can use a [Python virtual environment](https://docs.python.org/3/library/venv.html), essentially a copy of Python in a dedicated folder, and when you install Pip packages they get installed just to that folder. You won't be using virtual environments when using your Pi. The Grove install script installs the Grove Python packages globally, so to use a virtual environment you would need to set up a virtual environment then manually re-install the Grove packages inside that environment. It's easier to just use global packages, especially as a lot of Pi developers will re-flash a clean SD card for each project.
5355

5456
1. Reboot the Pi either using the menu or running the following command in the Terminal:
5557

@@ -163,7 +165,9 @@ Configure the installed Pi software and install the Grove libraries.
163165
curl -sL https://github.com/Seeed-Studio/grove.py/raw/master/install.sh | sudo bash -s -
164166
```
165167
166-
One of the powerful features of Python is the ability to install [pip packages](https://pypi.org) - these are packages of code written by other people and published to the Internet. You can install a pip package onto your computer with one command, then use that package in your code. This Grove install script will install the pip packages you will use to work with the Grove hardware from Python.
168+
One of the powerful features of Python is the ability to install [Pip packages](https://pypi.org) - these are packages of code written by other people and published to the Internet. You can install a Pip package onto your computer with one command, then use that package in your code. This Grove install script will install the Pip packages you will use to work with the Grove hardware from Python.
169+
170+
> 💁 By default when you install a package it is available everywhere on your computer, and this can lead to problems with package versions - such as one application depending on one version of a package that breaks when you install a new version for a different application. To work around this problem, you can use a [Python virtual environment](https://docs.python.org/3/library/venv.html), essentially a copy of Python in a dedicated folder, and when you install Pip packages they get installed just to that folder. You won't be using virtual environments when using your Pi. The Grove install script installs the Grove Python packages globally, so to use a virtual environment you would need to set up a virtual environment then manually re-install the Grove packages inside that environment. It's easier to just use global packages, especially as a lot of Pi developers will re-flash a clean SD card for each project.
167171
168172
1. Reboot the Pi by running the following command:
169173

1-getting-started/lessons/1-introduction-to-iot/virtual-device.md

+6-4
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,15 @@ This app will be in a folder called `nightlight`, and it will be re-used with di
3030

3131
### Configure a Python virtual environment
3232

33-
One of the powerful features of Python is the ability to install [pip packages](https://pypi.org) - these are packages of code written by other people and published to the Internet. You can install a pip package onto your computer with one command, then use that package in your code. You'll be using pip to install a package to talk to CounterFit.
33+
One of the powerful features of Python is the ability to install [Pip packages](https://pypi.org) - these are packages of code written by other people and published to the Internet. You can install a Pip package onto your computer with one command, then use that package in your code. You'll be using Pip to install a package to talk to CounterFit.
3434

35-
By default when you install a package it is available everywhere on your computer, and this can lead to problems with package versions - such as one application depending on one version of a package that breaks when you install a new version for a different application. To work around this problem, you can use a [Python virtual environment](https://docs.python.org/3/library/venv.html), essentially a copy of Python in a dedicated folder, and when you install pip packages they get installed just to that folder.
35+
By default when you install a package it is available everywhere on your computer, and this can lead to problems with package versions - such as one application depending on one version of a package that breaks when you install a new version for a different application. To work around this problem, you can use a [Python virtual environment](https://docs.python.org/3/library/venv.html), essentially a copy of Python in a dedicated folder, and when you install Pip packages they get installed just to that folder.
36+
37+
> 💁 If you are using a Raspberry Pi then you didn't set up a virtual environment on that device to manage Pip packages, instead you are using global packages, as the Grove packages are installed globally by the installer script.
3638
3739
#### Task - configure a Python virtual environment
3840

39-
Configure a Python virtual environment and install the pip packages for CounterFit.
41+
Configure a Python virtual environment and install the Pip packages for CounterFit.
4042

4143
1. From your terminal or command line, run the following at a location of your choice to create and navigate to a new directory:
4244

@@ -91,7 +93,7 @@ Configure a Python virtual environment and install the pip packages for CounterF
9193

9294
> 💁 Your Python version may be different - as long as it's version 3.6 or higher you are good. If not, delete this folder, install a newer version of Python and try again.
9395
94-
1. Run the following commands to install the pip packages for CounterFit. These packages include the main CounterFit app as well as shims for Grove hardware. These shims allow you to write code as if you were programming using physical sensors and actuators from the Grove ecosystem but connected to virtual IoT devices.
96+
1. Run the following commands to install the Pip packages for CounterFit. These packages include the main CounterFit app as well as shims for Grove hardware. These shims allow you to write code as if you were programming using physical sensors and actuators from the Grove ecosystem but connected to virtual IoT devices.
9597
9698
```sh
9799
pip install CounterFit

1-getting-started/lessons/4-connect-internet/README.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ The cloud service can then use this telemetry data to make decisions around what
124124

125125
The next part in adding Internet control to your nightlight is sending the light level telemetry to the MQTT broker on a telemetry topic.
126126

127-
#### Task
127+
#### Task - send telemetry from your IoT device
128128

129129
Send light level telemetry to the MQTT broker.
130130

@@ -145,9 +145,9 @@ There's no point in sending telemetry if there's nothing on the other end to lis
145145

146146
#### Install Python and VS Code
147147

148-
If you don't have Python and VS Code installed locally, you will need to install them both to code the server. If you are using a virtual device, or are working on your Raspberry Pi you can skip this step.
148+
If you don't have Python and VS Code installed locally, you will need to install them both to code the server. If you are using a virtual IoT device, or are working on your Raspberry Pi you can skip this step as you should already have this installed and configured.
149149

150-
##### Task
150+
##### Task - install Python and VS Code
151151

152152
Install Python and VS Code.
153153

@@ -165,7 +165,7 @@ One of the powerful features of Python is the ability to install [pip packages](
165165

166166
By default when you install a package it is available everywhere on your computer, and this can lead to problems with package versions - such as one application depending on one version of a package that breaks when you install a new version for a different application. To work around this problem, you can use a [Python virtual environment](https://docs.python.org/3/library/venv.html), essentially a copy of Python in a dedicated folder, and when you install pip packages they get installed just to that folder.
167167

168-
##### Task
168+
##### Task - configure a Python virtual environment
169169

170170
Configure a Python virtual environment and install the MQTT pip packages.
171171

@@ -234,7 +234,7 @@ Configure a Python virtual environment and install the MQTT pip packages.
234234
235235
The server code can now be written in Python.
236236
237-
##### Task
237+
##### Task - write the server code
238238
239239
Write the server code.
240240

1-getting-started/lessons/4-connect-internet/single-board-computer-commands.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Subscribe to commands.
1212

1313
1. Open the nightlight project in VS Code.
1414

15-
1. If you are using a virtual IoT device, ensure the terminal is running the virtual environment
15+
1. If you are using a virtual IoT device, ensure the terminal is running the virtual environment. If you are using a Raspberry Pi you won't be using a virtual environment.
1616

1717
1. Add the following code after the definitions of the `client_telemetry_topic`:
1818

1-getting-started/lessons/4-connect-internet/single-board-computer-mqtt.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ Install the pip package
1414

1515
1. Open the nightlight project in VS Code.
1616

17-
1. If you are using a virtual IoT device, ensure the terminal is running the virtual environment.
17+
1. If you are using a virtual IoT device, ensure the terminal is running the virtual environment. If you are using a Raspberry Pi you won't be using a virtual environment.
1818

1919
1. Run the following command to install the MQTT pip package:
2020

1-getting-started/lessons/4-connect-internet/single-board-computer-telemetry.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Publish telemetry to the MQTT broker.
1212

1313
1. Open the nightlight project in VS Code.
1414

15-
1. If you are using a virtual IoT device, ensure the terminal is running the virtual environment
15+
1. If you are using a virtual IoT device, ensure the terminal is running the virtual environment. If you are using a Raspberry Pi you won't be using a virtual environment.
1616

1717
1. Add the following import to the top of the `app.py` file:
1818

0 commit comments

Comments
 (0)