|
1 | 1 | # Raspberry PI GPIO Basic control with Python using Arduino Cloud
|
2 | 2 |
|
3 |
| -This project shows how to interact with the Raspberry Pi GPIOs from a dashboard created using Arduino Cloud. It can serve as an example to create your own applications that require access to RPI GPIOs and that can be ultimately controlled using a dashboard. |
| 3 | +This project shows how to interact with the Raspberry Pi GPIOs from a dashboard created using Arduino Cloud with an application programmed in Python. It can serve as an example to create your own applications that require access to RPI GPIOs and that can be ultimately controlled using a dashboard. |
4 | 4 |
|
5 | 5 | ## The setup
|
6 | 6 |
|
@@ -142,6 +142,32 @@ Enjoy!
|
142 | 142 |
|
143 | 143 | The platform allows for easy management and monitoring of connected devices through customizable dashboards, which provide real-time visualisations of the device's data. The dashboards can be accessed remotely through the mobile app Arduino IoT Cloud Remote, which is available for both Android and iOS devices, allowing users to manage their devices from anywhere.
|
144 | 144 |
|
| 145 | +#### Clone the dashboard using Cloud CLI |
| 146 | + |
| 147 | +As described in the tutorial, you can create the dashboard on your own, but here I will show you a very handy trick so that you can just make a copy of a template that I have created. For that, you need to use [Arduino Cloud CLI](https://docs.arduino.cc/arduino-cloud/arduino-cloud-cli/getting-started/). |
| 148 | + |
| 149 | +The steps are the following: |
| 150 | +1. Download and extract the latest release. |
| 151 | +Download it from [here](https://github.com/arduino/arduino-cloud-cli/releases) |
| 152 | +Make sure it is in your machine's PATH, so that it can be used globally. |
| 153 | +After installation, check that it is working by opening a terminal, and type: |
| 154 | + |
| 155 | +2. Set your credentials |
| 156 | +To authenticate with the Arduino Cloud, we will need to first set our credentials, using our clientId and clientSecret which are obtained from the Arduino Cloud [API keys section](https://app.arduino.cc/api-keys). Run the following command and introduce the credentials: |
| 157 | +``` |
| 158 | +arduino-cloud-cli credentials init |
| 159 | +``` |
| 160 | + |
| 161 | +3. Create the dashboard |
| 162 | + |
| 163 | +``` |
| 164 | +arduino-cloud-cli dashboard create \ |
| 165 | + --name <Your-Dashboard_Name> \ |
| 166 | + --template rpi-gpio-basic-dashboard.yaml \ |
| 167 | + --override Raspberry-Basic-GPIO=<Your-Thing-ID> |
| 168 | +``` |
| 169 | +Replace *<Your-Dashboard-Name>* and *<Your-Thing-ID>* with your actual data. |
| 170 | + |
145 | 171 | ### GPIOs and Raspberry Pi
|
146 | 172 | There are many GPIO libraries that can be used with Raspberry Pis. Among some of the most popular, we can find: gpiozero, gpiod, RPi.GPIO. One of the issues that I found is that some of the libraries only work for certain versions of RPI. For instance, the new RPI 5, has a brand new chipset for managing GPIOs, and not all the libraries work for it.
|
147 | 173 |
|
|
0 commit comments