diff --git a/content/_unlisted/11.power-consumption/assets/circuit.png b/content/_unlisted/11.power-consumption/assets/circuit.png new file mode 100644 index 0000000000..3b4b9887d1 Binary files /dev/null and b/content/_unlisted/11.power-consumption/assets/circuit.png differ diff --git a/content/_unlisted/11.power-consumption/assets/consumption.png b/content/_unlisted/11.power-consumption/assets/consumption.png new file mode 100644 index 0000000000..b06ca52c18 Binary files /dev/null and b/content/_unlisted/11.power-consumption/assets/consumption.png differ diff --git a/content/_unlisted/11.power-consumption/assets/formula.png b/content/_unlisted/11.power-consumption/assets/formula.png new file mode 100644 index 0000000000..9c1f688f33 Binary files /dev/null and b/content/_unlisted/11.power-consumption/assets/formula.png differ diff --git a/content/_unlisted/11.power-consumption/assets/powerOutput.png b/content/_unlisted/11.power-consumption/assets/powerOutput.png new file mode 100644 index 0000000000..446d262d40 Binary files /dev/null and b/content/_unlisted/11.power-consumption/assets/powerOutput.png differ diff --git a/content/_unlisted/11.power-consumption/assets/startSampling.png b/content/_unlisted/11.power-consumption/assets/startSampling.png new file mode 100644 index 0000000000..ebb4005679 Binary files /dev/null and b/content/_unlisted/11.power-consumption/assets/startSampling.png differ diff --git a/content/_unlisted/11.power-consumption/power-consumption.md b/content/_unlisted/11.power-consumption/power-consumption.md new file mode 100644 index 0000000000..e476e1ce11 --- /dev/null +++ b/content/_unlisted/11.power-consumption/power-consumption.md @@ -0,0 +1,194 @@ +--- +title: "Power Consumption on Arduino Boards" +description: "Learn about measuring power consumption on an Arduino board." +tags: [Power Consumption] +author: "Karl Söderby" +--- + +All electronic devices, including Arduino boards, consume power. The power consumption is measured in ampere-hours (Ah), and with low-voltage devices, it is typically measured in mAh. + +When creating projects that run on a battery or are power-constrained, taking power consumption into account can be critical. It will among other things help you decide which kind of battery you need to use. + +In this article, we will demonstrate how you can perform power consumption tests, using a **power profiler**. A power profiler is used to measure consumption over a specific time, where we record several thousand samples. You will find instructions for both the hardware setup, the software setup, and the actual power consumption tests in this article. + +**_Note that in this article, third-party products are being used._** + +## Hardware & Software Needed + +For the power consumption tests in this article, we used the following hardware & software. Note that there are many alternatives on the market. + +- [nRF Connect for Desktop](https://www.nordicsemi.com/Products/Development-tools/nRF-Connect-for-Desktop/Download) +- [Power Profiler Kit II](https://www.nordicsemi.com/Products/Development-hardware/Power-Profiler-Kit-2) +- [Arduino board (link to store)](https://store.arduino.cc/) +- Jumper wires + +## Measuring Power Consumption + +Power consumption measurements are done by connecting a power profiler between your Arduino board and computer. The power profiler is connected to the computer via USB, and then to the Arduino board via jumper wires. For power consumption measurements, we simply use two wires: **power** and **ground**. The power cable is connected to your Arduino board's power pins, and the ground cable goes to one of the GND pins on the board. + +When connected, the power profiler can measure the power consumption of your board with high accuracy. Any power that your board consumes can now be detected, and with a software tool (such as the [nRF Connect for Desktop](https://www.nordicsemi.com/Products/Development-tools/nRF-Connect-for-Desktop/Download)), we can record power consumption over time. + +So what is it that we are measuring? In very simple terms, all electronic devices draw current, whether it is small or big. A small LED can for example draw 10 mA (0.01 A), while a servo motor can draw up towards 1000 mA (1 A). If you have an LED on for an hour that draws 10 mA, we can express it as **mAh**, which means **milli-ampers consumed per hour**. + +### Power Consumption Example + +To provide a practical example, let's take the [Nano ESP32](https://store.arduino.cc/products/nano-esp32) and run a simple sketch on the board, which continuously runs the `analogRead()` function. Running the test for 60 seconds recording 100'000 samples, results in an average consumption of **31.05 mA**. + +Now, if we wanted to power this application using a 300 mAh battery we need to calculate the time with the following formula: + +![Formular](./assets/formula.png) + +With that information, we can make an educated guess of what type of battery we should get. For example, a battery with more capacity, let's say 600 mAh, would in theory last for twice the period. + +**_Note that there are other factors at play, such as the battery's discharge rate and the general quality of the battery. The above formulas and measurements are to be considered guidelines._** + +## Software Setup + +The software setup involves two steps: **uploading a sketch** and **installing nRF Connect for Desktop**. + +### Upload Sketch + +This step is rather straightforward. Upload the sketch that you want to measure the power consumption of. Below is a minimal sketch that reads an analog pin continuously. + +```arduino +void setup() {} + +void loop() { + int analog_value = analogRead(A0); + delay(1); +} +``` + +### Install Desktop App + +To measure the power consumption, we are going to use the [nRF Connect for Desktop](https://www.nordicsemi.com/Products/Development-tools/nRF-Connect-for-Desktop/Download) tool. This is a program that you install on your computer. + +## Hardware Setup + +The profiler we used is the [Power Profiler Kit II](https://www.nordicsemi.com/Products/Development-hardware/Power-Profiler-Kit-2). + +1. First, disconnect the USB cable from your board. You will be powering the board directly from the power profiler, so there's no need for the USB cable at this point. +2. Use the provided cable from the kit, and connect it to your board's GND and power pin, following the illustration below: + +![Connect the power profiler to the board.](./assets/circuit.png) + +**_Important note! In the software setup, you enable the "Power Output" of the power profiler. Make sure that the voltage (3.3 V or 5 V) matches the voltage on the power pin of the board. Applying 5 V to a 3.3 V pin will damage your board._** + +## Power Consumption Test + +With the hardware and software set up, let's take a look at how to record the power consumption of your device. + +1. Open the **nRF Desktop App** +2. instructions for setting up the PP +3. Enable the power output, by clicking the "Enable Power Output" option. + + ![Enable power output.](./assets/powerOutput.png) + +4. Select sample period (60 seconds) and number of samples (100k). +5. Click on "Begin Sampling" to start the power consumption test. + + ![Start sampling.](./assets/startSampling.png) + +6. During the test, you can see the power consumption in real-time. After 60 seconds (or when the specified sample period ends), you will have the data, which includes the **max** and **avg** consumption. You can also zoom in to view the data. + + ![Power consumption data.](./assets/consumption.png) + +You have now recorded the power consumption of your device. You can note down the results, export it as a `.csv` or take a screenshot for future reference. + +## Example Results + +In this section, you will find a number of tests we ran on a set of Arduino boards during different conditions. + +### Simple Analog Read + +The simple analog read sketch continuously reads an analog pin. + +```arduino +void setup() {} + +void loop() { + int analog_value = analogRead(A0); + delay(1); +} +``` + +In the table below, you can see the results of each board tested with the sketch: + +| Board | Min | Max | Average | +| ------------ | -------- | --------- | -------- | +| UNO R4 WiFi | 82.86 mA | 124.04 mA | 92.63 mA | +| GIGA R1 WiFi | 51.02 mA | 94.08 mA | 58.05 mA | +| Nano ESP32 | 29.18 mA | 46.58 mA | 31.05 mA | + +### Arduino Cloud Basic + +The **Arduino Cloud Basic** sketch sends sensor data to the Arduino Cloud and turns on the built-in LED whenever activated from a dashboard. + +```arduino +/* + Sketch generated by the Arduino IoT Cloud Thing "Cloud Blink" + + Arduino IoT Cloud Variables description + + The following variables are automatically generated and updated when changes are made to the Thing + + bool led; + + Variables which are marked as READ/WRITE in the Cloud Thing will also have functions + which are called when their values are changed from the Dashboard. + These functions are generated with the Thing and added at the end of this sketch. +*/ + +#include "thingProperties.h" + +void setup() { + // Initialize serial and wait for port to open: + Serial.begin(9600); + // This delay gives the chance to wait for a Serial Monitor without blocking if none is found + delay(1500); + + // Defined in thingProperties.h + initProperties(); + + // Connect to Arduino IoT Cloud + ArduinoCloud.begin(ArduinoIoTPreferredConnection); + + /* + The following function allows you to obtain more information + related to the state of network and IoT Cloud connection and errors + the higher number the more granular information you’ll get. + The default is 0 (only errors). + Maximum is 4 + */ + setDebugMessageLevel(2); + ArduinoCloud.printDebugInfo(); + pinMode(LED_BUILTIN, OUTPUT); +} + +void loop() { + ArduinoCloud.update(); + digitalWrite(LED_BUILTIN, led); +} + +/* + Since Led is READ_WRITE variable, onLedChange() is + executed every time a new value is received from IoT Cloud. +*/ +void onLedChange() { + Serial.print("Led status changed:"); + Serial.println(led); +} + +``` + +In the table below, you can see the results of each board tested with the sketch: + +| Board | Min | Max | Average | +| ------------ | --------- | --------- | --------- | +| UNO R4 WiFi | 94.07 mA | 513.70 mA | 140.19 mA | +| GIGA R1 WiFi | 121.00 mA | 477.44 mA | 139.83 mA | +| Nano ESP32 | 36.70 mA | 274.19 mA | 58.81 mA | + +## Summary + +In this guide, we have learned how to use a power profiler to record power consumption data. This is an incredibly good utility, as it helps you identify the power needs of your application, which can aid your decision in selecting the right power source. diff --git a/content/arduino-cloud/10.education/00.arduino-cloud-for-education/assets/add-billing-information.png b/content/arduino-cloud/10.education/00.arduino-cloud-for-education/assets/add-billing-information.png deleted file mode 100644 index 7922c878d9..0000000000 Binary files a/content/arduino-cloud/10.education/00.arduino-cloud-for-education/assets/add-billing-information.png and /dev/null differ diff --git a/content/arduino-cloud/10.education/00.arduino-cloud-for-education/assets/add-members.png b/content/arduino-cloud/10.education/00.arduino-cloud-for-education/assets/add-members.png deleted file mode 100644 index 7b617b4c78..0000000000 Binary files a/content/arduino-cloud/10.education/00.arduino-cloud-for-education/assets/add-members.png and /dev/null differ diff --git a/content/arduino-cloud/10.education/00.arduino-cloud-for-education/assets/add-tag.png b/content/arduino-cloud/10.education/00.arduino-cloud-for-education/assets/add-tag.png deleted file mode 100644 index 09f664182b..0000000000 Binary files a/content/arduino-cloud/10.education/00.arduino-cloud-for-education/assets/add-tag.png and /dev/null differ diff --git a/content/arduino-cloud/10.education/00.arduino-cloud-for-education/assets/add-variable-characteristic.png b/content/arduino-cloud/10.education/00.arduino-cloud-for-education/assets/add-variable-characteristic.png deleted file mode 100644 index d105309330..0000000000 Binary files a/content/arduino-cloud/10.education/00.arduino-cloud-for-education/assets/add-variable-characteristic.png and /dev/null differ diff --git a/content/arduino-cloud/10.education/00.arduino-cloud-for-education/assets/add-variable.png b/content/arduino-cloud/10.education/00.arduino-cloud-for-education/assets/add-variable.png deleted file mode 100644 index 0711656a5d..0000000000 Binary files a/content/arduino-cloud/10.education/00.arduino-cloud-for-education/assets/add-variable.png and /dev/null differ diff --git a/content/arduino-cloud/10.education/00.arduino-cloud-for-education/assets/add-widget.png b/content/arduino-cloud/10.education/00.arduino-cloud-for-education/assets/add-widget.png deleted file mode 100644 index 89073632a5..0000000000 Binary files a/content/arduino-cloud/10.education/00.arduino-cloud-for-education/assets/add-widget.png and /dev/null differ diff --git a/content/arduino-cloud/10.education/00.arduino-cloud-for-education/assets/advanced-chart.gif b/content/arduino-cloud/10.education/00.arduino-cloud-for-education/assets/advanced-chart.gif deleted file mode 100644 index cd643cea24..0000000000 Binary files a/content/arduino-cloud/10.education/00.arduino-cloud-for-education/assets/advanced-chart.gif and /dev/null differ diff --git a/content/arduino-cloud/10.education/00.arduino-cloud-for-education/assets/api-keys.png b/content/arduino-cloud/10.education/00.arduino-cloud-for-education/assets/api-keys.png deleted file mode 100644 index 69298bc0bd..0000000000 Binary files a/content/arduino-cloud/10.education/00.arduino-cloud-for-education/assets/api-keys.png and /dev/null differ diff --git a/content/arduino-cloud/10.education/00.arduino-cloud-for-education/assets/arduino-account-login.png b/content/arduino-cloud/10.education/00.arduino-cloud-for-education/assets/arduino-account-login.png deleted file mode 100644 index ce0ef7743e..0000000000 Binary files a/content/arduino-cloud/10.education/00.arduino-cloud-for-education/assets/arduino-account-login.png and /dev/null differ diff --git a/content/arduino-cloud/10.education/00.arduino-cloud-for-education/assets/available_triggers.png b/content/arduino-cloud/10.education/00.arduino-cloud-for-education/assets/available_triggers.png deleted file mode 100644 index 541b63a90d..0000000000 Binary files a/content/arduino-cloud/10.education/00.arduino-cloud-for-education/assets/available_triggers.png and /dev/null differ diff --git a/content/arduino-cloud/10.education/00.arduino-cloud-for-education/assets/been-configured.png b/content/arduino-cloud/10.education/00.arduino-cloud-for-education/assets/been-configured.png deleted file mode 100644 index 40d10fdbc1..0000000000 Binary files a/content/arduino-cloud/10.education/00.arduino-cloud-for-education/assets/been-configured.png and /dev/null differ diff --git a/content/arduino-cloud/10.education/00.arduino-cloud-for-education/assets/cloud-editor.png b/content/arduino-cloud/10.education/00.arduino-cloud-for-education/assets/cloud-editor.png new file mode 100644 index 0000000000..6af5e48ee9 Binary files /dev/null and b/content/arduino-cloud/10.education/00.arduino-cloud-for-education/assets/cloud-editor.png differ diff --git a/content/arduino-cloud/10.education/00.arduino-cloud-for-education/assets/create-dashboard.png b/content/arduino-cloud/10.education/00.arduino-cloud-for-education/assets/create-dashboard.png deleted file mode 100644 index bc62c91fbd..0000000000 Binary files a/content/arduino-cloud/10.education/00.arduino-cloud-for-education/assets/create-dashboard.png and /dev/null differ diff --git a/content/arduino-cloud/10.education/00.arduino-cloud-for-education/assets/dashboard-example.png b/content/arduino-cloud/10.education/00.arduino-cloud-for-education/assets/dashboard-example.png deleted file mode 100644 index caf91ab32a..0000000000 Binary files a/content/arduino-cloud/10.education/00.arduino-cloud-for-education/assets/dashboard-example.png and /dev/null differ diff --git a/content/arduino-cloud/10.education/00.arduino-cloud-for-education/assets/dashboard-sharing.png b/content/arduino-cloud/10.education/00.arduino-cloud-for-education/assets/dashboard-sharing.png deleted file mode 100644 index d9af168d35..0000000000 Binary files a/content/arduino-cloud/10.education/00.arduino-cloud-for-education/assets/dashboard-sharing.png and /dev/null differ diff --git a/content/arduino-cloud/10.education/00.arduino-cloud-for-education/assets/dashboard.png b/content/arduino-cloud/10.education/00.arduino-cloud-for-education/assets/dashboard.png new file mode 100644 index 0000000000..7f897bfc06 Binary files /dev/null and b/content/arduino-cloud/10.education/00.arduino-cloud-for-education/assets/dashboard.png differ diff --git a/content/arduino-cloud/10.education/00.arduino-cloud-for-education/assets/device-name-configuration.png b/content/arduino-cloud/10.education/00.arduino-cloud-for-education/assets/device-name-configuration.png deleted file mode 100644 index 555401ac8d..0000000000 Binary files a/content/arduino-cloud/10.education/00.arduino-cloud-for-education/assets/device-name-configuration.png and /dev/null differ diff --git a/content/arduino-cloud/10.education/00.arduino-cloud-for-education/assets/download-button.png b/content/arduino-cloud/10.education/00.arduino-cloud-for-education/assets/download-button.png deleted file mode 100644 index 7c6009f965..0000000000 Binary files a/content/arduino-cloud/10.education/00.arduino-cloud-for-education/assets/download-button.png and /dev/null differ diff --git a/content/arduino-cloud/10.education/00.arduino-cloud-for-education/assets/download-data.png b/content/arduino-cloud/10.education/00.arduino-cloud-for-education/assets/download-data.png deleted file mode 100644 index ec769930ab..0000000000 Binary files a/content/arduino-cloud/10.education/00.arduino-cloud-for-education/assets/download-data.png and /dev/null differ diff --git a/content/arduino-cloud/10.education/00.arduino-cloud-for-education/assets/email-data.png b/content/arduino-cloud/10.education/00.arduino-cloud-for-education/assets/email-data.png deleted file mode 100644 index 7c968b1aaa..0000000000 Binary files a/content/arduino-cloud/10.education/00.arduino-cloud-for-education/assets/email-data.png and /dev/null differ diff --git a/content/arduino-cloud/10.education/00.arduino-cloud-for-education/assets/features-usage.png b/content/arduino-cloud/10.education/00.arduino-cloud-for-education/assets/features-usage.png deleted file mode 100644 index 936d75b2a6..0000000000 Binary files a/content/arduino-cloud/10.education/00.arduino-cloud-for-education/assets/features-usage.png and /dev/null differ diff --git a/content/arduino-cloud/10.education/00.arduino-cloud-for-education/assets/fillschoolinfo.png b/content/arduino-cloud/10.education/00.arduino-cloud-for-education/assets/fillschoolinfo.png deleted file mode 100644 index 89c764bc47..0000000000 Binary files a/content/arduino-cloud/10.education/00.arduino-cloud-for-education/assets/fillschoolinfo.png and /dev/null differ diff --git a/content/arduino-cloud/10.education/00.arduino-cloud-for-education/assets/get-data.png b/content/arduino-cloud/10.education/00.arduino-cloud-for-education/assets/get-data.png deleted file mode 100644 index b7bc035d72..0000000000 Binary files a/content/arduino-cloud/10.education/00.arduino-cloud-for-education/assets/get-data.png and /dev/null differ diff --git a/content/arduino-cloud/10.education/00.arduino-cloud-for-education/assets/homepage-greenhouse.png b/content/arduino-cloud/10.education/00.arduino-cloud-for-education/assets/homepage-greenhouse.png new file mode 100644 index 0000000000..efc086d8dd Binary files /dev/null and b/content/arduino-cloud/10.education/00.arduino-cloud-for-education/assets/homepage-greenhouse.png differ diff --git a/content/arduino-cloud/10.education/00.arduino-cloud-for-education/assets/iot-cloud.png b/content/arduino-cloud/10.education/00.arduino-cloud-for-education/assets/iot-cloud.png deleted file mode 100644 index 36f9f066b6..0000000000 Binary files a/content/arduino-cloud/10.education/00.arduino-cloud-for-education/assets/iot-cloud.png and /dev/null differ diff --git a/content/arduino-cloud/10.education/00.arduino-cloud-for-education/assets/iot-projects-setup.png b/content/arduino-cloud/10.education/00.arduino-cloud-for-education/assets/iot-projects-setup.png new file mode 100644 index 0000000000..f114543511 Binary files /dev/null and b/content/arduino-cloud/10.education/00.arduino-cloud-for-education/assets/iot-projects-setup.png differ diff --git a/content/arduino-cloud/10.education/00.arduino-cloud-for-education/assets/lesson.png b/content/arduino-cloud/10.education/00.arduino-cloud-for-education/assets/lesson.png new file mode 100644 index 0000000000..c729b58e59 Binary files /dev/null and b/content/arduino-cloud/10.education/00.arduino-cloud-for-education/assets/lesson.png differ diff --git a/content/arduino-cloud/10.education/00.arduino-cloud-for-education/assets/my-cloud-space.png b/content/arduino-cloud/10.education/00.arduino-cloud-for-education/assets/my-cloud-space.png deleted file mode 100644 index a348f84543..0000000000 Binary files a/content/arduino-cloud/10.education/00.arduino-cloud-for-education/assets/my-cloud-space.png and /dev/null differ diff --git a/content/arduino-cloud/10.education/00.arduino-cloud-for-education/assets/name-device.png b/content/arduino-cloud/10.education/00.arduino-cloud-for-education/assets/name-device.png deleted file mode 100644 index 321fbc4929..0000000000 Binary files a/content/arduino-cloud/10.education/00.arduino-cloud-for-education/assets/name-device.png and /dev/null differ diff --git a/content/arduino-cloud/10.education/00.arduino-cloud-for-education/assets/plugin-device.png b/content/arduino-cloud/10.education/00.arduino-cloud-for-education/assets/plugin-device.png deleted file mode 100644 index 966cf8de10..0000000000 Binary files a/content/arduino-cloud/10.education/00.arduino-cloud-for-education/assets/plugin-device.png and /dev/null differ diff --git a/content/arduino-cloud/10.education/00.arduino-cloud-for-education/assets/portenta-found.png b/content/arduino-cloud/10.education/00.arduino-cloud-for-education/assets/portenta-found.png deleted file mode 100644 index 99ad40a296..0000000000 Binary files a/content/arduino-cloud/10.education/00.arduino-cloud-for-education/assets/portenta-found.png and /dev/null differ diff --git a/content/arduino-cloud/10.education/00.arduino-cloud-for-education/assets/private-space-details.png b/content/arduino-cloud/10.education/00.arduino-cloud-for-education/assets/private-space-details.png deleted file mode 100644 index 28c3594cfa..0000000000 Binary files a/content/arduino-cloud/10.education/00.arduino-cloud-for-education/assets/private-space-details.png and /dev/null differ diff --git a/content/arduino-cloud/10.education/00.arduino-cloud-for-education/assets/provisioning-success.png b/content/arduino-cloud/10.education/00.arduino-cloud-for-education/assets/provisioning-success.png deleted file mode 100644 index ca8bbb5775..0000000000 Binary files a/content/arduino-cloud/10.education/00.arduino-cloud-for-education/assets/provisioning-success.png and /dev/null differ diff --git a/content/arduino-cloud/10.education/00.arduino-cloud-for-education/assets/school-plan.png b/content/arduino-cloud/10.education/00.arduino-cloud-for-education/assets/school-plan.png deleted file mode 100644 index 532be723b7..0000000000 Binary files a/content/arduino-cloud/10.education/00.arduino-cloud-for-education/assets/school-plan.png and /dev/null differ diff --git a/content/arduino-cloud/10.education/00.arduino-cloud-for-education/assets/setup-cloud-board.png b/content/arduino-cloud/10.education/00.arduino-cloud-for-education/assets/setup-cloud-board.png deleted file mode 100644 index ed8ed53fd3..0000000000 Binary files a/content/arduino-cloud/10.education/00.arduino-cloud-for-education/assets/setup-cloud-board.png and /dev/null differ diff --git a/content/arduino-cloud/10.education/00.arduino-cloud-for-education/assets/setup-device.png b/content/arduino-cloud/10.education/00.arduino-cloud-for-education/assets/setup-device.png deleted file mode 100644 index 78d85a886d..0000000000 Binary files a/content/arduino-cloud/10.education/00.arduino-cloud-for-education/assets/setup-device.png and /dev/null differ diff --git a/content/arduino-cloud/10.education/00.arduino-cloud-for-education/assets/share-dashboards.png b/content/arduino-cloud/10.education/00.arduino-cloud-for-education/assets/share-dashboards.png deleted file mode 100644 index 2b4de8b673..0000000000 Binary files a/content/arduino-cloud/10.education/00.arduino-cloud-for-education/assets/share-dashboards.png and /dev/null differ diff --git a/content/arduino-cloud/10.education/00.arduino-cloud-for-education/assets/shared-space-type-selection.png b/content/arduino-cloud/10.education/00.arduino-cloud-for-education/assets/shared-space-type-selection.png deleted file mode 100644 index 80b8f88c6b..0000000000 Binary files a/content/arduino-cloud/10.education/00.arduino-cloud-for-education/assets/shared-space-type-selection.png and /dev/null differ diff --git a/content/arduino-cloud/10.education/00.arduino-cloud-for-education/assets/side-bar.png b/content/arduino-cloud/10.education/00.arduino-cloud-for-education/assets/side-bar.png new file mode 100644 index 0000000000..6ec6833937 Binary files /dev/null and b/content/arduino-cloud/10.education/00.arduino-cloud-for-education/assets/side-bar.png differ diff --git a/content/arduino-cloud/10.education/00.arduino-cloud-for-education/assets/sketches-list.png b/content/arduino-cloud/10.education/00.arduino-cloud-for-education/assets/sketches-list.png new file mode 100644 index 0000000000..7bb429916a Binary files /dev/null and b/content/arduino-cloud/10.education/00.arduino-cloud-for-education/assets/sketches-list.png differ diff --git a/content/arduino-cloud/10.education/00.arduino-cloud-for-education/assets/switch-space.png b/content/arduino-cloud/10.education/00.arduino-cloud-for-education/assets/switch-space.png deleted file mode 100644 index 1d38060e6d..0000000000 Binary files a/content/arduino-cloud/10.education/00.arduino-cloud-for-education/assets/switch-space.png and /dev/null differ diff --git a/content/arduino-cloud/10.education/00.arduino-cloud-for-education/assets/thing-interface.png b/content/arduino-cloud/10.education/00.arduino-cloud-for-education/assets/thing-interface.png new file mode 100644 index 0000000000..e44b40e7ed Binary files /dev/null and b/content/arduino-cloud/10.education/00.arduino-cloud-for-education/assets/thing-interface.png differ diff --git a/content/arduino-cloud/10.education/00.arduino-cloud-for-education/assets/thing-overview.png b/content/arduino-cloud/10.education/00.arduino-cloud-for-education/assets/thing-overview.png deleted file mode 100644 index be7e5a44a0..0000000000 Binary files a/content/arduino-cloud/10.education/00.arduino-cloud-for-education/assets/thing-overview.png and /dev/null differ diff --git a/content/arduino-cloud/10.education/00.arduino-cloud-for-education/assets/thing-sketchtab.png b/content/arduino-cloud/10.education/00.arduino-cloud-for-education/assets/thing-sketchtab.png deleted file mode 100644 index 3963a79000..0000000000 Binary files a/content/arduino-cloud/10.education/00.arduino-cloud-for-education/assets/thing-sketchtab.png and /dev/null differ diff --git a/content/arduino-cloud/10.education/00.arduino-cloud-for-education/assets/three-courses.png b/content/arduino-cloud/10.education/00.arduino-cloud-for-education/assets/three-courses.png new file mode 100644 index 0000000000..607e854732 Binary files /dev/null and b/content/arduino-cloud/10.education/00.arduino-cloud-for-education/assets/three-courses.png differ diff --git a/content/arduino-cloud/10.education/00.arduino-cloud-for-education/assets/triggers-freeplan.png b/content/arduino-cloud/10.education/00.arduino-cloud-for-education/assets/triggers-freeplan.png deleted file mode 100644 index 8b16f31b5e..0000000000 Binary files a/content/arduino-cloud/10.education/00.arduino-cloud-for-education/assets/triggers-freeplan.png and /dev/null differ diff --git a/content/arduino-cloud/10.education/00.arduino-cloud-for-education/assets/user-roles.png b/content/arduino-cloud/10.education/00.arduino-cloud-for-education/assets/user-roles.png deleted file mode 100644 index e56dfc24cc..0000000000 Binary files a/content/arduino-cloud/10.education/00.arduino-cloud-for-education/assets/user-roles.png and /dev/null differ diff --git a/content/arduino-cloud/10.education/00.arduino-cloud-for-education/content.md b/content/arduino-cloud/10.education/00.arduino-cloud-for-education/content.md index 9d9ab596bf..2220d1a760 100644 --- a/content/arduino-cloud/10.education/00.arduino-cloud-for-education/content.md +++ b/content/arduino-cloud/10.education/00.arduino-cloud-for-education/content.md @@ -1,6 +1,6 @@ --- title: 'Getting started with Arduino Cloud for Education' -description: 'Get a general overview of Arduino Cloud for Education and its features.' +description: 'Introduce teachers to Arduino Cloud for Education and its features.' difficulty: intermediate tags: - Cloud @@ -13,374 +13,184 @@ software: ## Introduction -The [Arduino Cloud for Schools](https://cloud.arduino.cc/schools/) is a tool that provides an online space for teachers and students. +The [Arduino Cloud](https://cloud.arduino.cc/schools/) helps teachers to effectively introduce, manage and facilitate Arduino STEAM projects in their classroom. -In this article, you will get a general overview of the major features of the Arduino Cloud for Education and the features *Free* and *School* plan can offer. +***In order to get started with Arduino Cloud, you need to [have an Arduino account](https://login.arduino.cc/login). If you do not have an account yet, feel free to create a new one. You can follow [this tutorial](https://support.arduino.cc/hc/en-us/articles/360016724040-Create-an-Arduino-account) for a step-by-step explanation on how to do it.*** -## What is Arduino Cloud? +## Goals -Arduino Cloud is an easy-to-use Internet of Things application platform. Arduino Cloud makes the creation of connected objects quick, simple, and secure. You can connect multiple devices and allow them to exchange real-time data. You can also monitor them from anywhere using a simple user interface. It is integrated with the online Arduino Web Editor. +- This guide gives an overview of some important cloud tools that are useful in an educational context. +- A glimpse on how Arduino Cloud can enhance both the teaching and learning experience related to coding, electronics and IoT projects. -## How to Create an Account +## Platform for Educators -In order to get started with Arduino Cloud, you need to [have an Arduino account](https://login.arduino.cc/login). An **Arduino account gives** you **full access to all Arduino websites, apps**, and **services**. +Arduino Cloud can be used to meet some of the basic needs of a teacher who wants to implement hands-on learning in the classroom using Arduino Educational kits or hardware. -If you do not have an account yet, feel free to create a new one. You can follow [this tutorial](https://support.arduino.cc/hc/en-us/articles/360016724040-Create-an-Arduino-account) for a step-by-step explanation on how to do it. +**Easy-to-use platform** -![Arduino Cloud login](assets/arduino-account-login.png) +The **Arduino Cloud Home** has been designed with the goal of offering a simple and straightforward experience for absolute beginners in order to be efficient in creating Arduino projects with the use of **Quick Actions** and **Sidebar**. -After the registration is completed, you should verify your email address by clicking CONFIRM NOW in the email that was automatically sent to your inbox. +**Code online using the Web-Editor** -Now let's explore https://app.arduino.cc/. +Low code entry using the **Cloud Editor** gets students started quickly. Instant results motivate students to go further and progress through limitless active learning pathways. -![Arduino Cloud Homepage view](assets/cloud-home-u.png) +**Get started with IoT Projects quickly** -The Arduino Cloud for Education consists of **two main subscriptions**: +Arduino Cloud makes the creation of connected objects quick, simple, and secure. You can connect multiple **devices**, allow them to exchange real-time data very easily and visualize data through interactive **dashboards**. Our extensive collection of pre-built **IoT Templates** gets your project up and running in two minutes. -* Free Plan -* [School Plan](https://cloud.arduino.cc/plans#school) +**Access rich and deep learning content** -By default, any new user who created an Arduino account has access to Arduino Cloud with a *Free Plan*. +We understand that it could be a daunting task to find a starting point especially when you are new to Arduino and running out of time to put together a lesson / project with new tools. **Cloud Courses** offer you over 30 different **lessons** and **projects** across various age groups and grades. -## Free Plan +**Organize, manage and track student progress** -### Access to free online courses content +Manage your classroom with ease and make collaboration easier through the use of shared spaces. Through a shared space you can keep tabs on students projects, create assignments through Google Classroom and share learning materials with your students. -Once you've logged in, you are free to check out our free content in `Arduino Cloud > Courses` or click [here](https://app.arduino.cc/courses). +## Cloud Home -![Free Content Courses in the Cloud](assets/content-courses.png) +The home page is more or less like a control panel where you can access all the important functionalities. From this interface you can create, monitor and navigate to different areas of the platform based on your application. -Here, you get access to several free online courses, for different age groups and topics. This library of courses gets widened and extended regularly with new releases. +![Cloud Sidebar Menu](assets/side-bar.png) -***With a School Plan you unlock access to extra online courses.*** +### Quick Actions +**Devices** & **Things** shows how many devices are connected and have been linked with your Cloud profile. -## Manage Your Spaces +**Create New** button allows you to quickly create Sketches, Dashboards or register new devices to your Cloud platform. -Your Arduino Cloud *Free plan* comes with one **space** by default: +### Sidebar -![Free courses in the Cloud](assets/private-space-details.png) +The **Sidebar** on the left provides you quick access to all the important tools such as the Editor (through Sketches), IoT Cloud (through Devices, Things and Dashboards), Templates and even learning materials such as **Courses** and **Resources**. Let's take a closer look at these components and what they are. +- **Sketches** - These are the programs you or your students will create. Here you can access all sketches that you have created in the past or wish to create. Your Sketchbook will be stored in the Cloud and accessible from any device. +- **IoT Tools** - One of the core functionalities of the Cloud Platform is to enable you to build IoT projects that allows you to collect, analyze and monitor data from the environment. +- **Resources, Courses & Templates** - These are learning materials and ready-made IoT projects to get you started with your educational kits or other Arduino hardware. +- **Integrations** - Integrate with third-party APIs and extend your projects functionality. +- **Plans** - Here you can track the usage of your free plans. You can always upgrade to a School Plan whenever you want. If you are curious, take a look at our [School Plans options](https://cloud.arduino.cc/#schools). -* **Private Space**. Private space is an *automatically* created private space once joined Arduino Cloud. You can use this space for personal projects you do not want to share with all your class. This space is free and includes - - * *two Things*, - * unlimited dashboards, - * 100 MB of sketch storage, - * 1-day data retention by default. - - You have a quick glance on Device and Things from the menu on the top right corner. - -* **Shared Space**. It's an easy tool to keep track of your students' recent activities on their IoT projects and monitor their project progress. - - * *Save online unlimited amount of sketches* and dashboards, and easily search for them later, - * Quickly share your data flow from sensors adding up to *five Things* - * Integrate your lesson plan with Google Classroom, assign tasks and share courses. - * Study data analysis with your students with 6 months of data retention by default +***If you are new to the platform, make sure you try out the interactive walkthrough for a faster onboarding experience.*** -### Create a Shared Space +## Cloud Editor -In order to create a shared space go to [this link](https://app.arduino.cc/space?spaceType=%22edu%22). +The [Arduino Cloud Editor](http://create.arduino.cc/editor) allows you to **write code** and **upload sketches** to any Arduino board after installing a [**simple plug-in**](https://create.arduino.cc/getting-started/plugin/welcome) **for your browser**. Your Sketchbook will be stored in the Cloud and accessible from any device. You can use this tool to create both basic and IoT sketches. -Then you will be asked which type of Shared Space you want to create (i.e. For Business or For Education). Click on **For Education** and proceed with creating a online space to share with your students or other colleagues. +![Cloud Editor](assets/cloud-editor.png) -![Shared Space type selection](assets/shared-space-type-selection.png) +You can import your Sketchbook via a .zip file. The Cloud Editor is part of Arduino Cloud, that simplifies a project by bringing all the different tools you need together in one place. This is a complementary solution for schools or institutions that don't want to install [Arduino IDE](https://www.arduino.cc/en/software) to program their devices. -Fill in additional information. +***Interested in getting started? Get to know more about Arduino Cloud Editor by [visiting this link](https://docs.arduino.cc/arduino-cloud/getting-started/getting-started-web-editor).*** -![Fill in school information for the new Space](assets/fillschoolinfo.png) +## IoT Tools -Congratulations! Now you own a Shared Space linked to your Arduino account. +### Devices -### Switch Between Spaces +Setting up an IoT projects can be time consuming and complex especially. With the Cloud platform, you can bring your IoT project ideas to life within in four steps. Before starting with a project we recommend you to familiarize yourself with the necessary tools that you will use during your building process. -You can switch to other Shared Spaces at any time using the corresponding menu, which you can find at the top left-corner, and click on it. +![IoT projects setup](assets/iot-projects-setup.png) -***With a Free Plan or School Plan there is no limitations in the number of Shared Space you can have.*** +The Arduino Cloud supports a range of official and third-party boards which are handled in the **"Devices"** tab. Devices are considered to be the digital replicas of your physical boards. -![Switch between Space Menu](assets/switch-space.png) +![Device tab in the Cloud homepage](assets/device-list.png) -### Change Shared Space Settings +The Arduino Cloud currently supports devices connected via Wi-Fi®, Ethernet, LoRaWAN® (via The Things Network), and cellular connectivity. You can check the [full list of compatible hardware here](https://support.arduino.cc/hc/en-us/articles/360016077320-What-devices-can-be-used-with-Arduino-IoT-Cloud-). -To change the current settings of your Shared Space, navigate to the **Space Settings** tab using the sidebar. +### Things -![Shared Space Side Bar](assets/space-setting-side-bar.png) +[Things](https://app.arduino.cc/things) are basically a representation of how your Arduino device, sensors, actuators and network is mapped and linked together. -Here you can **Edit** your information, change name or **Disband Shared Space**. From this menu you can also manage the members you've invited into your Shared Space. +![A Thing Overview](assets/thing-interface.png) -![Shared Space settings](assets/space-setting.png) +Each Thing is represented by a collection of properties, such as -From `Arduino Cloud > Space Setting` menu you can check your plan's limit and quota or upgrade it to a School Plan. +- **Variables** - they are very similar to the variables we create in a regular sketch where they are used to retrieve and store information. +- **Associated device** - The device that is used to collect data from the real world. +- **Network Credentials** - Contains information about Wi-Fi® name and password +- **Sketch** - A lite version of the Web Editor which is actually a preview of a sketch saved on the Web Editor. +- **Metadata** - such as tags, timezone and Thing ID. -### Invite Members Into Your Space +Read more about Things [here](https://docs.arduino.cc/arduino-cloud/cloud-interface/things). -You can add more members to your Shared Space from the `Cloud > Home`, clicking on the shortcut green button `INVITE MEMBERS` or you can [click here](https://app.arduino.cc/settings). +### Dashboards -![invite members to shared space](assets/invite-members.png) +Dashboards are used to visualize real-time data and to enable direct interaction with the board through the Cloud. -Once inside the Cloud homepage, from the card on the right top corner, you will find the complete list of all members who have access to your Shared Space, as well as the current role of each member. +![Dashboard button](assets/dashboard.png) -You can add members in **three possible ways**: +Typically a dashboard consists of easily configurable Widgets. Widgets are the ‘building blocks’ of a dashboard, and are directly linked to our properties. They allow us to visualize the data we get from sensors. There are several different widgets: gauges, sliders, switches, color palettes, messenger and more. -1. Type the **email addresses** of each user and define which role they will cover in your Space based on the available options. Click on **Invite**. The users you added will get the invitation by email with a link to join your Shared Space. +### IoT Templates -2. You can invite your students to the Space through **Code** invitation (check *Join Space* explained above). +If you want to quickly setup an IoT project, you don't have to start from scratch. [Templates](https://app.arduino.cc/templates) are ready-made projects that will automatically configure your hardware and set it up with our Cloud Environment. -3. **Copy pasting the link** and share it with the whole class. +It's the easiest way to proceed with a beginner class and you can checkout the collection of Templates to get inspiration for your own class project. -![Invite members through email](assets/add-members.png) +## Cloud Courses -**Join Space**. Here you copy and paste the space code that another admin or teacher shared with you to join their space. See image below: +Here, you get access to several free online courses, for different age groups and topics. This library of courses gets widened and extended regularly with new releases of educational kits. +For starters we have courses like [Explore Physics](https://courses.arduino.cc/explore-physics/), [Student Kit](https://edu-content-preview.arduino.cc/content-preview/middle_school/lesson/CONTENTPREVIEW+STUDENTKIT) and [Science Journal](https://science-journal.arduino.cc/) to get your students started with some basic coding and electronics challenges that are fun to learn. -![Join Space](assets/copy-code-join.png) +![Courses examples](assets/three-courses.png) -### Role types +### Lessons & Projects -There are three role types in Arduino Cloud for Schools: +Every course contains a couple of Lessons and Projects (Activities in some cases) that distinguishes technical activities from pedagogical ones. -* Admin -* Teacher -* Students +![Greenhouse Course](assets/homepage-greenhouse.png) -By default the member who has activated the plan and created the class-space is set as *Admin*. It is possible to have multiple Admins with same permissions. The admin has full control of the rights/permissions each user has in a Shared Space. +Lessons help students to understand how to connect sensors and actuators to an Arduino board and focuses on core programming skills, connecting electronics and troubleshooting. -The list of supported roles and corresponding permissions can be found here: https://cloud.arduino.cc/home/roles-permissions +![Lesson example](assets/lesson.png) -Important to remember are **Student role limitations:** +On the other hand projects focus on the application of core technical knowledge to a more real world context. Here students learn to think more critically about technology, the interactions between a user and the technology and understand the world around them in a more pedagogical manner. -* They are not allowed to add new members to your School organization -* They are not allowed to assign members roles -* They are not allowed to view the Plan Management and Payment information +### Free & Premium Course -![school user roles differences](assets/user-roles.png) +As you may have noticed some courses are available for free while others require you to have a school plan. Although you can always have a preview of a free chapter from any of the courses that you are interested in and can upgrade to a school plan if you think it's interesting for your class. -***There is no limitation on the numbers of members you can add into a Shared Space.*** +Explore our collection of Free and Premium courses [here](https://www.arduino.cc/education/courses/). -*** +***If you have purchased the Explore IoT Rev2 or the Greenhouse Kit, you already have a subscription for the Cloud included and can access all the courses.*** -## IoT Components +## Shared Spaces -On the left menu bar in https://app.arduino.cc/, all the elements you will use to set up your IoT projects for a quick access are listed: +Foster collaboration in your classroom through the use of Shared Spaces. A **shared space** is a virtual classroom environment where you can optimize classwork, keep track of student’s progress, boost learning and connect with peers and students seamlessly. -1. [Devices](https://app.arduino.cc/devices) -2. [Things](https://app.arduino.cc/things) -3. [Dashboards](https://app.arduino.cc/dashboards) -4. [Triggers](https://app.arduino.cc/triggers) +![Invite members to collaborate](assets/invite-members.png) -![Cloud left bar IoT components](assets/iot-cloud.png) +Now that you have logged in and have your own private space let's get you started with setting up a space for your classroom. In order to create a shared space go to [this link](https://docs.arduino.cc/arduino-cloud/education/shared-spaces). -| Cloud components | Free Plan | School Plan | -| :--------------: | :-------: | :---------: | -| Devices | x | x | -| Things | x | x | -| Dashboards | x | x | -| Triggers | | x | +### Share learning materials -With a *Free Plan* you won't have access to Cloud Triggers, so you'll see something similar to this: +Once you've created a space and added members, all of them will have access to the learning materials available on https://app.arduino.cc/courses. -![Triggers with a free plan](assets/triggers-freeplan.png) +![Courses Overview](assets/content-courses.png) -If you want to unlock this function, you'll need to upgrade to a [School Plan](https://digital-store.arduino.cc/education/purchase). +### Manage student projects +Quickly find all the recent sketch files and IoT Dashboards worked by your students right from the shared spaces dashboard manage your efficiently without unnecessary clicks or complex steps. -### Let's Setup a IoT Project +![Sketch tab from sidebar](assets/sketches-list.png) -In your IoT projects with Arduino you will need **three elements**: - -1. The [**Arduino Cloud**](https://docs.arduino.cc/arduino-cloud/guides/overview) -2. The [**Arduino Create Agent**](https://create.arduino.cc/getting-started/plugin/welcome) the middle man between Arduino’s Web Editor, Arduino Cloud and your computer. It allows you to use the browser to edit and deploy sketches to your Arduino board. -3. **A device** of your choice. - -### Setup a Device in Arduino Cloud - -Arduino Cloud is compatible with multiple Arduino boards or devices based on the ESP32 / ESP8266 microcontrollers. The Arduino Cloud currently supports devices connected via Wi-Fi®, Ethernet, LoRaWAN® (via The Things Network), and cellular connectivity. You can check the [full list of compatible hardware here](https://support.arduino.cc/hc/en-us/articles/360016077320-What-devices-can-be-used-with-Arduino-IoT-Cloud-). - -If your device is compatible with Arduino Cloud, you can start to **Setup Device** by connecting it to your computer through a USB cable, going to `Arduino Cloud Homepage > Devices > Add Device`. - -![Device selection](assets/plugin-device.png) - -The agent will start looking for your board, select the kind of device you're setting up and continue to follow the next guided steps. - -![Set up board in the Cloud](assets/setup-device.png) - -Select a board name to be able to correctly identify your device and click on **Next**. - -![Give a name to the device](assets/name-device.png) - -If the onboarding proceeds as expected, the following page will appear confirming that your device has been successfully set up. - -![Successfully set up device](assets/been-configured.png) - -When you click on a `Device`'s name it displays all the associated `Things`, more information about the device, such as its ID number, FQBN, serial number, firmware version, Device Status history, and the date when the device was added. - -![Details of a device when you click on it](assets/device-details.png) - -The device status indicates whether it is connected to the Arduino Cloud (online), or not connected (offline). Click on the three dots to rename your device. - -![List of devices added into Cloud](assets/device-list.png) - -### Link A Thing To Your Device - -To use a device in Arduino Cloud, you need to [create a Thing](https://app.arduino.cc/things), or associate it to an existing Thing. A Thing is the digital twin of your device, like a reference to the actual hardware used to implement them. Each Thing is represented by a collection of properties, the configuration of some variables and other settings, as well as the history of the data collected for those variables. - -Let's make your first Thing, going to Cloud homepage sidebar, click on the green button CREATE THING. - -![Create a thing from device tab](assets/create-thing.png) - -If you want to explore more on how Things work, check [here](https://docs.arduino.cc/arduino-cloud/guides/overview#3-creating-a-thing). - -***With a Free Plan you can only connect two Things with the Cloud at a time. With a School Plan, each member you've included in your plan can connect up to five Things to a Device.*** - -### Variables - -In order to retrieve and store information we need to create Variables in the Arduino Cloud, they are very similar to the variables we create in a regular sketch. - -![Variables associated to a Thing](assets/add-variable.png) - -When we create variables here, they are automatically generated in a sketch, and when we upload the code to the board, the variables used in the sketch synchronize with the variables in the Cloud. - -To learn more about the different types of variables, go to [this tutorial](https://docs.arduino.cc/arduino-cloud/getting-started/cloud-variables). - -***The Arduino Cloud - Free Plan allows a maximum number of 5 variables per Thing by default. The Arduino Cloud - School Plan allows an unlimited number of variables per Thing.*** - -### Dashboards - -Dashboards are used to visualize real-time data and to enable direct interaction with the board through the Cloud. Go to `Dashboard` and click the green button `Create`. We'll link `Variables` we've created before to a *Widget*. - -***With a Free Plan is not possible to share your Dashboard with other users. If you want to unlock this function, you'll need to upgrade to a [School Plan](https://digital-store.arduino.cc/education/purchase).*** - -![Dashboard example](assets/create-dashboard.png) - -**Widgets** are the ‘building blocks’ of a dashboard, and are directly linked to our properties. They allow us to visualize the data we get from sensors. There are several different widgets: gauges, sliders, switches, color palettes, messenger and more. - -![Widgets Selection](assets/add-widget.png) - -If you want to learn more on how to customize your dashboard and widgets, check [this link](https://docs.arduino.cc/arduino-cloud/getting-started/dashboard-widgets). - -***If want to use to Advanced Chart Widget for your IoT projects, that allows you to visualize multiple variables in one chart, you'll need access to the School Plan.*** - -![Advanced Chart Widget](assets/advanced-chart.gif) - -You can read more about Advance Chart Widget [here](https://docs.arduino.cc/arduino-cloud/features/advanced-chart). - -### Data Export - -Arduino Cloud, both with *Free* or *School Plan*, allows any user to download historical data from Arduino Cloud Things and Variables. The data are downloaded in **.csv** format to be ready for further editing. - -***The Arduino Cloud - Free Plan allows only 1 day of data retention by default. The Arduino Cloud - School Plan includes 6 months of data retention by default; this means that your data will be available and downloadable from your Arduino Cloud account for 6 months.*** - -To start exporting your data locally, navigate into one of your dashboards on the [Arduino Cloud](https://app.arduino.cc/dashboards). While inside a dashboard, press the **Download** icon in the upper right corner. This will open a new window that will allow you to select which historical data you would like to download. - -![Download icon](assets/download-button.png) - -From here you can select all the variables you want to download by checking the boxes as well as the time frame you are interested in. - -Read more about how to use on download collected data [in this tutorial](https://docs.arduino.cc/arduino-cloud/features/iot-cloud-historical-data). - -### What is Arduino Web Editor? - -[Arduino Web Editor](http://create.arduino.cc/editor) allows you to **write code** and **upload sketches** to any Arduino board after installing a **[simple plug-in](https://create.arduino.cc/getting-started/plugin/welcome) for your browser**. Your Sketchbook will be stored in the Cloud and accessible from any device. If you have a *Free Plan* you can store to a maximum of 100 MB of sketches. - -You can import your Sketchbook via a .zip file. Arduino Web Editor is part of Arduino Cloud, that simplifies a project by bringing all the different tools you need together in one place. This is a complementary solutions for schools or institutions that don't want to install [Arduino IDE](https://www.arduino.cc/en/software) to program their devices. - -If you want to know more about Arduino Web Editor [visit this link](https://docs.arduino.cc/arduino-cloud/getting-started/getting-started-web-editor). - -A **lite version of the Web Editor** is included in the Arduino Cloud, under `Things > Sketch`, which is actually a preview of a sketch saved on the Web Editor. - -![Arduino Cloud Lite Editor](assets/thing-sketchtab.png) - -***The Arduino Cloud - Free Plan allows a maximum online space to store your sketches and libraries of 100 MB and a maximum of 25 code compilations per day by default. The Arduino Cloud - School Plan allows unlimited online storage space and unlimited code compilations for your sketches.*** - -You can check how many times you have left to verify and upload your program from the [Arduino Cloud > Space Setting > Plan Usage](https://app.arduino.cc/plan-usage). - -![Feature usage menu](assets/features-usage.png) - - - -*** - -## School Plan - -As an Educator you might need: - -* To create and store in the Cloud more sketches -* To collaborate in your IoT projects sharing real-time data dashboards and programs -* To integrate your IoT Project with an LMS tool -* To customize your projects with additional functionalities provided by APIS -* To handle several students' accounts with one Admin - -### Buy a School Plan - -To upgrade from a *Free Plan* to *School Plan* and get access to the features mentioned in this article, go here: - -https://digital-store.arduino.cc/education/purchase/institution - -1. If you're not logged in with an Arduino account, you'll be redirected to the login page. If you've already created a Shared Space **select the institution Space you want to add your members' seats to** or click **Set up new shared Space** to make a brand new one. - - ![Select the institution space](assets/school-plan.png) - -2. **Add as many members seats** you need for your classes. - - ![add members to the school plan](assets/configure-your-plan.png) - -3. Then click on the button **Add Billing Information** and fill in with your educational institution information and payment method. - - ![add billing information](assets/add-billing-information.png) - -Then click on the green button `ACTIVATE PLAN`. - -Congratulations! Now you own a *School Plan* linked to your Arduino account. You should have received a confirmation email. Continue reading to discover more about the additional functions you've now unlocked. - -### Sharing Dashboards - -With a *School Plan* is possible to share any Dashboard with anyone. Go to the [Dashboard](https://app.arduino.cc/dashboards) tab in Arduino Cloud, go inside the Dashboard you would like to share, click on the three dots, next to the download button. - -As shown in the image below you can either send it directly to the user's *email* or *username*, or *share the link* with your class. - -![Share your dashboard](assets/share-dashboards.png) - -You can check [this tutorial](https://docs.arduino.cc/arduino-cloud/features/sharing-dashboards) to learn more about sharing a dashboard. - -### Google Classroom™ Integration - -With a *School plan* any educator that is part of a Shared Space can create assignments and share a sketch directly from the Arduino Web Editor. - -![Share sketch with Google Classroom](assets/google-integration-arduino-cloud02.png) - -It is also possible to share the content of a course or give it as an assignment. - -![Share content with Google Classroom](assets/google-classroom-content-share.png) - -## IoT Templates - -[Templates](https://app.arduino.cc/templates) are ready-made projects that will automatically configure your device, Thing, and variables. - -It's the easiest way to proceed with a beginner class and you can check that section to get inspiration for your own class project. - -### Over-the-air Uploads - -This feature, included in the Arduino Cloud *School Plan*, allows you to upload programs wirelessly to your Arduino boards. If you have a compatible board connected to a Wi-Fi®/Ethernet network and configured it to work with OTA (over-the-air), you won’t need to physically connect the board to the computer in order to upload new sketches to it. - -Check [this tutorial](https://docs.arduino.cc/arduino-cloud/features/ota-getting-started#how-does-it-work) to learn how to upload your program remotely to your board. - -### Billing & subscriptions - -![Billing & subscriptions menu](assets/my-cloud-space.png) - -School Plan is specifically designed for institutions that aim to cover a larger amount of users. The billing account can be managed by a single Arduino account that then will grant access to different users and assign a role. - -### Account settings - Junior Account - -If your students are **under the age of 14**, they need parental consent to sign up for an Arduino account. We recommend to read [this tutorial](https://support.arduino.cc/hc/en-us/articles/360022234360) to learn how to manage a Junior account. Arduino Education provides [several solutions for middle school](https://www.arduino.cc/education/middle-school/) students. The content courses included in the *School Plan* are only partially available for minor users. They will get access only to COPPA-compliant courses. +***If you are interested in knowing more about Shared Spaces, read this [tutorial](https://docs.arduino.cc/arduino-cloud/education/shared-spaces/).*** ## Cloud Remote App -Cloud Remote App allows you to monitor your dashboards anywhere, anytime, from a **mobile device** i.e. smartphone or tablet for **free**. Download it from either [Google Play Store](https://play.google.com/store/apps/details?id=cc.arduino.cloudiot&hl=en&gl=US) or the [Apple App Store](https://apps.apple.com/us/app/arduino-iot-cloud-remote/id1514358431) depending on your device. +The Cloud Remote App allows you to monitor your dashboards anywhere, anytime, from a **mobile device** i.e. smartphone or tablet for **free**. Download it from either [Google Play Store](https://play.google.com/store/apps/details?id=cc.arduino.cloudiot&hl=en&gl=US) or the [Apple App Store](https://apps.apple.com/us/app/arduino-iot-cloud-remote/id1514358431) depending on your device. -***Do you want to get started with Cloud Remote app? Read [this tutorial](https://docs.arduino.cc/arduino-cloud/tutorials/iot-remote-phone-sensors#phone-setup).*** +## Conclusions -## Arduino Cloud Tutorials +You have now an general overview of the different Cloud tools that are available on the Arduino Cloud platform. It could be a lot if you are using it for the first time, but the best way to learn is by doing. Let’s get you going by [setting up a Shared Space](https://docs.arduino.cc/arduino-cloud/education/shared-spaces/). + +## Learn More You can find a full list of tutorials on the [Arduino Cloud documentation page](https://docs.arduino.cc/arduino-cloud/). +If you are a enthusiast and would like to explore more about our Cloud platform, here are some documentation on all the important elements you can familiarize yourself with: + +- [ Sketches ](https://docs.arduino.cc/arduino-cloud/cloud-interface/sketches/) +- [Arduino Cloud Editor](https://docs.arduino.cc/arduino-cloud/getting-started/getting-started-web-editor) +- [Cloud Variables](https://docs.arduino.cc/arduino-cloud/cloud-interface/variables/) +- [Dashboards & Widgets](https://docs.arduino.cc/arduino-cloud/cloud-interface/dashboard-widgets) +- [Cloud Remote App](https://docs.arduino.cc/arduino-cloud/iot-remote-app/getting-started) +- [Setup a Shared Space for your class](https://docs.arduino.cc/arduino-cloud/education/shared-spaces) diff --git a/content/hardware/02.hero/boards/uno-wifi-rev2/tutorials/uno-wifi-rev-2/uno-wifi-r2-chromebook-installation/assets/board-discovered.png b/content/hardware/02.hero/boards/uno-wifi-rev2/tutorials/uno-wifi-r2-chromebook-installation/assets/board-discovered.png similarity index 100% rename from content/hardware/02.hero/boards/uno-wifi-rev2/tutorials/uno-wifi-rev-2/uno-wifi-r2-chromebook-installation/assets/board-discovered.png rename to content/hardware/02.hero/boards/uno-wifi-rev2/tutorials/uno-wifi-r2-chromebook-installation/assets/board-discovered.png diff --git a/content/hardware/02.hero/boards/uno-wifi-rev2/tutorials/uno-wifi-rev-2/uno-wifi-r2-chromebook-installation/assets/chromestore.png b/content/hardware/02.hero/boards/uno-wifi-rev2/tutorials/uno-wifi-r2-chromebook-installation/assets/chromestore.png similarity index 100% rename from content/hardware/02.hero/boards/uno-wifi-rev2/tutorials/uno-wifi-rev-2/uno-wifi-r2-chromebook-installation/assets/chromestore.png rename to content/hardware/02.hero/boards/uno-wifi-rev2/tutorials/uno-wifi-r2-chromebook-installation/assets/chromestore.png diff --git a/content/hardware/02.hero/boards/uno-wifi-rev2/tutorials/uno-wifi-rev-2/uno-wifi-r2-chromebook-installation/assets/circuit.png b/content/hardware/02.hero/boards/uno-wifi-rev2/tutorials/uno-wifi-r2-chromebook-installation/assets/circuit.png similarity index 100% rename from content/hardware/02.hero/boards/uno-wifi-rev2/tutorials/uno-wifi-rev-2/uno-wifi-r2-chromebook-installation/assets/circuit.png rename to content/hardware/02.hero/boards/uno-wifi-rev2/tutorials/uno-wifi-r2-chromebook-installation/assets/circuit.png diff --git a/content/hardware/02.hero/boards/uno-wifi-rev2/tutorials/uno-wifi-rev-2/uno-wifi-r2-chromebook-installation/assets/hex-file-desktop.png b/content/hardware/02.hero/boards/uno-wifi-rev2/tutorials/uno-wifi-r2-chromebook-installation/assets/hex-file-desktop.png similarity index 100% rename from content/hardware/02.hero/boards/uno-wifi-rev2/tutorials/uno-wifi-rev-2/uno-wifi-r2-chromebook-installation/assets/hex-file-desktop.png rename to content/hardware/02.hero/boards/uno-wifi-rev2/tutorials/uno-wifi-r2-chromebook-installation/assets/hex-file-desktop.png diff --git a/content/hardware/02.hero/boards/uno-wifi-rev2/tutorials/uno-wifi-rev-2/uno-wifi-r2-chromebook-installation/assets/windows-success.png b/content/hardware/02.hero/boards/uno-wifi-rev2/tutorials/uno-wifi-r2-chromebook-installation/assets/windows-success.png similarity index 100% rename from content/hardware/02.hero/boards/uno-wifi-rev2/tutorials/uno-wifi-rev-2/uno-wifi-r2-chromebook-installation/assets/windows-success.png rename to content/hardware/02.hero/boards/uno-wifi-rev2/tutorials/uno-wifi-r2-chromebook-installation/assets/windows-success.png diff --git a/content/hardware/02.hero/boards/uno-wifi-rev2/tutorials/uno-wifi-rev-2/uno-wifi-r2-chromebook-installation/uno-wifi-r2-chromebook-installation.md b/content/hardware/02.hero/boards/uno-wifi-rev2/tutorials/uno-wifi-r2-chromebook-installation/uno-wifi-r2-chromebook-installation.md similarity index 100% rename from content/hardware/02.hero/boards/uno-wifi-rev2/tutorials/uno-wifi-rev-2/uno-wifi-r2-chromebook-installation/uno-wifi-r2-chromebook-installation.md rename to content/hardware/02.hero/boards/uno-wifi-rev2/tutorials/uno-wifi-r2-chromebook-installation/uno-wifi-r2-chromebook-installation.md diff --git a/content/hardware/02.hero/boards/uno-wifi-rev2/tutorials/uno-wifi-rev-2/uno-wifi-r2-hosting-a-webserver/assets/UnoWiFiRev2_T1_IMG01.png b/content/hardware/02.hero/boards/uno-wifi-rev2/tutorials/uno-wifi-r2-hosting-a-webserver/assets/UnoWiFiRev2_T1_IMG01.png similarity index 100% rename from content/hardware/02.hero/boards/uno-wifi-rev2/tutorials/uno-wifi-rev-2/uno-wifi-r2-hosting-a-webserver/assets/UnoWiFiRev2_T1_IMG01.png rename to content/hardware/02.hero/boards/uno-wifi-rev2/tutorials/uno-wifi-r2-hosting-a-webserver/assets/UnoWiFiRev2_T1_IMG01.png diff --git a/content/hardware/02.hero/boards/uno-wifi-rev2/tutorials/uno-wifi-rev-2/uno-wifi-r2-hosting-a-webserver/assets/UnoWiFiRev2_T1_IMG02.png b/content/hardware/02.hero/boards/uno-wifi-rev2/tutorials/uno-wifi-r2-hosting-a-webserver/assets/UnoWiFiRev2_T1_IMG02.png similarity index 100% rename from content/hardware/02.hero/boards/uno-wifi-rev2/tutorials/uno-wifi-rev-2/uno-wifi-r2-hosting-a-webserver/assets/UnoWiFiRev2_T1_IMG02.png rename to content/hardware/02.hero/boards/uno-wifi-rev2/tutorials/uno-wifi-r2-hosting-a-webserver/assets/UnoWiFiRev2_T1_IMG02.png diff --git a/content/hardware/02.hero/boards/uno-wifi-rev2/tutorials/uno-wifi-rev-2/uno-wifi-r2-hosting-a-webserver/assets/UnoWiFiRev2_T1_IMG03.png b/content/hardware/02.hero/boards/uno-wifi-rev2/tutorials/uno-wifi-r2-hosting-a-webserver/assets/UnoWiFiRev2_T1_IMG03.png similarity index 100% rename from content/hardware/02.hero/boards/uno-wifi-rev2/tutorials/uno-wifi-rev-2/uno-wifi-r2-hosting-a-webserver/assets/UnoWiFiRev2_T1_IMG03.png rename to content/hardware/02.hero/boards/uno-wifi-rev2/tutorials/uno-wifi-r2-hosting-a-webserver/assets/UnoWiFiRev2_T1_IMG03.png diff --git a/content/hardware/02.hero/boards/uno-wifi-rev2/tutorials/uno-wifi-rev-2/uno-wifi-r2-hosting-a-webserver/uno-wifi-r2-hosting-a-webserver.md b/content/hardware/02.hero/boards/uno-wifi-rev2/tutorials/uno-wifi-r2-hosting-a-webserver/uno-wifi-r2-hosting-a-webserver.md similarity index 100% rename from content/hardware/02.hero/boards/uno-wifi-rev2/tutorials/uno-wifi-rev-2/uno-wifi-r2-hosting-a-webserver/uno-wifi-r2-hosting-a-webserver.md rename to content/hardware/02.hero/boards/uno-wifi-rev2/tutorials/uno-wifi-r2-hosting-a-webserver/uno-wifi-r2-hosting-a-webserver.md diff --git a/content/hardware/02.hero/boards/uno-wifi-rev2/tutorials/uno-wifi-rev-2/uno-wifi-r2-mqtt-device-to-device/assets/UnoWiFiRev2_T2_IMG01.png b/content/hardware/02.hero/boards/uno-wifi-rev2/tutorials/uno-wifi-r2-mqtt-device-to-device/assets/UnoWiFiRev2_T2_IMG01.png similarity index 100% rename from content/hardware/02.hero/boards/uno-wifi-rev2/tutorials/uno-wifi-rev-2/uno-wifi-r2-mqtt-device-to-device/assets/UnoWiFiRev2_T2_IMG01.png rename to content/hardware/02.hero/boards/uno-wifi-rev2/tutorials/uno-wifi-r2-mqtt-device-to-device/assets/UnoWiFiRev2_T2_IMG01.png diff --git a/content/hardware/02.hero/boards/uno-wifi-rev2/tutorials/uno-wifi-rev-2/uno-wifi-r2-mqtt-device-to-device/assets/UnoWiFiRev2_T2_IMG02.png b/content/hardware/02.hero/boards/uno-wifi-rev2/tutorials/uno-wifi-r2-mqtt-device-to-device/assets/UnoWiFiRev2_T2_IMG02.png similarity index 100% rename from content/hardware/02.hero/boards/uno-wifi-rev2/tutorials/uno-wifi-rev-2/uno-wifi-r2-mqtt-device-to-device/assets/UnoWiFiRev2_T2_IMG02.png rename to content/hardware/02.hero/boards/uno-wifi-rev2/tutorials/uno-wifi-r2-mqtt-device-to-device/assets/UnoWiFiRev2_T2_IMG02.png diff --git a/content/hardware/02.hero/boards/uno-wifi-rev2/tutorials/uno-wifi-rev-2/uno-wifi-r2-mqtt-device-to-device/assets/UnoWiFiRev2_T2_IMG03.png b/content/hardware/02.hero/boards/uno-wifi-rev2/tutorials/uno-wifi-r2-mqtt-device-to-device/assets/UnoWiFiRev2_T2_IMG03.png similarity index 100% rename from content/hardware/02.hero/boards/uno-wifi-rev2/tutorials/uno-wifi-rev-2/uno-wifi-r2-mqtt-device-to-device/assets/UnoWiFiRev2_T2_IMG03.png rename to content/hardware/02.hero/boards/uno-wifi-rev2/tutorials/uno-wifi-r2-mqtt-device-to-device/assets/UnoWiFiRev2_T2_IMG03.png diff --git a/content/hardware/02.hero/boards/uno-wifi-rev2/tutorials/uno-wifi-rev-2/uno-wifi-r2-mqtt-device-to-device/assets/UnoWiFiRev2_T2_IMG04.png b/content/hardware/02.hero/boards/uno-wifi-rev2/tutorials/uno-wifi-r2-mqtt-device-to-device/assets/UnoWiFiRev2_T2_IMG04.png similarity index 100% rename from content/hardware/02.hero/boards/uno-wifi-rev2/tutorials/uno-wifi-rev-2/uno-wifi-r2-mqtt-device-to-device/assets/UnoWiFiRev2_T2_IMG04.png rename to content/hardware/02.hero/boards/uno-wifi-rev2/tutorials/uno-wifi-r2-mqtt-device-to-device/assets/UnoWiFiRev2_T2_IMG04.png diff --git a/content/hardware/02.hero/boards/uno-wifi-rev2/tutorials/uno-wifi-rev-2/uno-wifi-r2-mqtt-device-to-device/assets/UnoWiFiRev2_T2_IMG05.png b/content/hardware/02.hero/boards/uno-wifi-rev2/tutorials/uno-wifi-r2-mqtt-device-to-device/assets/UnoWiFiRev2_T2_IMG05.png similarity index 100% rename from content/hardware/02.hero/boards/uno-wifi-rev2/tutorials/uno-wifi-rev-2/uno-wifi-r2-mqtt-device-to-device/assets/UnoWiFiRev2_T2_IMG05.png rename to content/hardware/02.hero/boards/uno-wifi-rev2/tutorials/uno-wifi-r2-mqtt-device-to-device/assets/UnoWiFiRev2_T2_IMG05.png diff --git a/content/hardware/02.hero/boards/uno-wifi-rev2/tutorials/uno-wifi-rev-2/uno-wifi-r2-mqtt-device-to-device/assets/UnoWiFiRev2_T2_IMG06.png b/content/hardware/02.hero/boards/uno-wifi-rev2/tutorials/uno-wifi-r2-mqtt-device-to-device/assets/UnoWiFiRev2_T2_IMG06.png similarity index 100% rename from content/hardware/02.hero/boards/uno-wifi-rev2/tutorials/uno-wifi-rev-2/uno-wifi-r2-mqtt-device-to-device/assets/UnoWiFiRev2_T2_IMG06.png rename to content/hardware/02.hero/boards/uno-wifi-rev2/tutorials/uno-wifi-r2-mqtt-device-to-device/assets/UnoWiFiRev2_T2_IMG06.png diff --git a/content/hardware/02.hero/boards/uno-wifi-rev2/tutorials/uno-wifi-rev-2/uno-wifi-r2-mqtt-device-to-device/assets/UnoWiFiRev2_T2_IMG07.png b/content/hardware/02.hero/boards/uno-wifi-rev2/tutorials/uno-wifi-r2-mqtt-device-to-device/assets/UnoWiFiRev2_T2_IMG07.png similarity index 100% rename from content/hardware/02.hero/boards/uno-wifi-rev2/tutorials/uno-wifi-rev-2/uno-wifi-r2-mqtt-device-to-device/assets/UnoWiFiRev2_T2_IMG07.png rename to content/hardware/02.hero/boards/uno-wifi-rev2/tutorials/uno-wifi-r2-mqtt-device-to-device/assets/UnoWiFiRev2_T2_IMG07.png diff --git a/content/hardware/02.hero/boards/uno-wifi-rev2/tutorials/uno-wifi-rev-2/uno-wifi-r2-mqtt-device-to-device/assets/UnoWiFiRev2_T2_IMG08.png b/content/hardware/02.hero/boards/uno-wifi-rev2/tutorials/uno-wifi-r2-mqtt-device-to-device/assets/UnoWiFiRev2_T2_IMG08.png similarity index 100% rename from content/hardware/02.hero/boards/uno-wifi-rev2/tutorials/uno-wifi-rev-2/uno-wifi-r2-mqtt-device-to-device/assets/UnoWiFiRev2_T2_IMG08.png rename to content/hardware/02.hero/boards/uno-wifi-rev2/tutorials/uno-wifi-r2-mqtt-device-to-device/assets/UnoWiFiRev2_T2_IMG08.png diff --git a/content/hardware/02.hero/boards/uno-wifi-rev2/tutorials/uno-wifi-rev-2/uno-wifi-r2-mqtt-device-to-device/uno-wifi-r2-mqtt-device-to-device.md b/content/hardware/02.hero/boards/uno-wifi-rev2/tutorials/uno-wifi-r2-mqtt-device-to-device/uno-wifi-r2-mqtt-device-to-device.md similarity index 100% rename from content/hardware/02.hero/boards/uno-wifi-rev2/tutorials/uno-wifi-rev-2/uno-wifi-r2-mqtt-device-to-device/uno-wifi-r2-mqtt-device-to-device.md rename to content/hardware/02.hero/boards/uno-wifi-rev2/tutorials/uno-wifi-r2-mqtt-device-to-device/uno-wifi-r2-mqtt-device-to-device.md diff --git a/content/hardware/02.hero/boards/uno-wifi-rev2/tutorials/uno-wifi-rev-2/uno-wifi-r2-scan-networks/assets/UnoWiFiRev2_T4_IMG01.png b/content/hardware/02.hero/boards/uno-wifi-rev2/tutorials/uno-wifi-r2-scan-networks/assets/UnoWiFiRev2_T4_IMG01.png similarity index 100% rename from content/hardware/02.hero/boards/uno-wifi-rev2/tutorials/uno-wifi-rev-2/uno-wifi-r2-scan-networks/assets/UnoWiFiRev2_T4_IMG01.png rename to content/hardware/02.hero/boards/uno-wifi-rev2/tutorials/uno-wifi-r2-scan-networks/assets/UnoWiFiRev2_T4_IMG01.png diff --git a/content/hardware/02.hero/boards/uno-wifi-rev2/tutorials/uno-wifi-rev-2/uno-wifi-r2-scan-networks/assets/UnoWiFiRev2_T4_IMG02.png b/content/hardware/02.hero/boards/uno-wifi-rev2/tutorials/uno-wifi-r2-scan-networks/assets/UnoWiFiRev2_T4_IMG02.png similarity index 100% rename from content/hardware/02.hero/boards/uno-wifi-rev2/tutorials/uno-wifi-rev-2/uno-wifi-r2-scan-networks/assets/UnoWiFiRev2_T4_IMG02.png rename to content/hardware/02.hero/boards/uno-wifi-rev2/tutorials/uno-wifi-r2-scan-networks/assets/UnoWiFiRev2_T4_IMG02.png diff --git a/content/hardware/02.hero/boards/uno-wifi-rev2/tutorials/uno-wifi-rev-2/uno-wifi-r2-scan-networks/assets/UnoWiFiRev2_T4_IMG03.png b/content/hardware/02.hero/boards/uno-wifi-rev2/tutorials/uno-wifi-r2-scan-networks/assets/UnoWiFiRev2_T4_IMG03.png similarity index 100% rename from content/hardware/02.hero/boards/uno-wifi-rev2/tutorials/uno-wifi-rev-2/uno-wifi-r2-scan-networks/assets/UnoWiFiRev2_T4_IMG03.png rename to content/hardware/02.hero/boards/uno-wifi-rev2/tutorials/uno-wifi-r2-scan-networks/assets/UnoWiFiRev2_T4_IMG03.png diff --git a/content/hardware/02.hero/boards/uno-wifi-rev2/tutorials/uno-wifi-rev-2/uno-wifi-r2-scan-networks/uno-wifi-r2-scan-networks.md b/content/hardware/02.hero/boards/uno-wifi-rev2/tutorials/uno-wifi-r2-scan-networks/uno-wifi-r2-scan-networks.md similarity index 100% rename from content/hardware/02.hero/boards/uno-wifi-rev2/tutorials/uno-wifi-rev-2/uno-wifi-r2-scan-networks/uno-wifi-r2-scan-networks.md rename to content/hardware/02.hero/boards/uno-wifi-rev2/tutorials/uno-wifi-r2-scan-networks/uno-wifi-r2-scan-networks.md diff --git a/content/hardware/02.hero/boards/uno-wifi-rev2/tutorials/uno-wifi-rev-2/uno-wifi-r2-web-server-ap-mode/assets/UnoWiFiRev2_T3_IMG01.png b/content/hardware/02.hero/boards/uno-wifi-rev2/tutorials/uno-wifi-r2-web-server-ap-mode/assets/UnoWiFiRev2_T3_IMG01.png similarity index 100% rename from content/hardware/02.hero/boards/uno-wifi-rev2/tutorials/uno-wifi-rev-2/uno-wifi-r2-web-server-ap-mode/assets/UnoWiFiRev2_T3_IMG01.png rename to content/hardware/02.hero/boards/uno-wifi-rev2/tutorials/uno-wifi-r2-web-server-ap-mode/assets/UnoWiFiRev2_T3_IMG01.png diff --git a/content/hardware/02.hero/boards/uno-wifi-rev2/tutorials/uno-wifi-rev-2/uno-wifi-r2-web-server-ap-mode/assets/UnoWiFiRev2_T3_IMG02.png b/content/hardware/02.hero/boards/uno-wifi-rev2/tutorials/uno-wifi-r2-web-server-ap-mode/assets/UnoWiFiRev2_T3_IMG02.png similarity index 100% rename from content/hardware/02.hero/boards/uno-wifi-rev2/tutorials/uno-wifi-rev-2/uno-wifi-r2-web-server-ap-mode/assets/UnoWiFiRev2_T3_IMG02.png rename to content/hardware/02.hero/boards/uno-wifi-rev2/tutorials/uno-wifi-r2-web-server-ap-mode/assets/UnoWiFiRev2_T3_IMG02.png diff --git a/content/hardware/02.hero/boards/uno-wifi-rev2/tutorials/uno-wifi-rev-2/uno-wifi-r2-web-server-ap-mode/assets/UnoWiFiRev2_T3_IMG03.png b/content/hardware/02.hero/boards/uno-wifi-rev2/tutorials/uno-wifi-r2-web-server-ap-mode/assets/UnoWiFiRev2_T3_IMG03.png similarity index 100% rename from content/hardware/02.hero/boards/uno-wifi-rev2/tutorials/uno-wifi-rev-2/uno-wifi-r2-web-server-ap-mode/assets/UnoWiFiRev2_T3_IMG03.png rename to content/hardware/02.hero/boards/uno-wifi-rev2/tutorials/uno-wifi-r2-web-server-ap-mode/assets/UnoWiFiRev2_T3_IMG03.png diff --git a/content/hardware/02.hero/boards/uno-wifi-rev2/tutorials/uno-wifi-rev-2/uno-wifi-r2-web-server-ap-mode/assets/UnoWiFiRev2_T3_IMG04.png b/content/hardware/02.hero/boards/uno-wifi-rev2/tutorials/uno-wifi-r2-web-server-ap-mode/assets/UnoWiFiRev2_T3_IMG04.png similarity index 100% rename from content/hardware/02.hero/boards/uno-wifi-rev2/tutorials/uno-wifi-rev-2/uno-wifi-r2-web-server-ap-mode/assets/UnoWiFiRev2_T3_IMG04.png rename to content/hardware/02.hero/boards/uno-wifi-rev2/tutorials/uno-wifi-r2-web-server-ap-mode/assets/UnoWiFiRev2_T3_IMG04.png diff --git a/content/hardware/02.hero/boards/uno-wifi-rev2/tutorials/uno-wifi-rev-2/uno-wifi-r2-web-server-ap-mode/assets/UnoWiFiRev2_T3_IMG05.png b/content/hardware/02.hero/boards/uno-wifi-rev2/tutorials/uno-wifi-r2-web-server-ap-mode/assets/UnoWiFiRev2_T3_IMG05.png similarity index 100% rename from content/hardware/02.hero/boards/uno-wifi-rev2/tutorials/uno-wifi-rev-2/uno-wifi-r2-web-server-ap-mode/assets/UnoWiFiRev2_T3_IMG05.png rename to content/hardware/02.hero/boards/uno-wifi-rev2/tutorials/uno-wifi-r2-web-server-ap-mode/assets/UnoWiFiRev2_T3_IMG05.png diff --git a/content/hardware/02.hero/boards/uno-wifi-rev2/tutorials/uno-wifi-rev-2/uno-wifi-r2-web-server-ap-mode/uno-wifi-r2-web-server-ap-mode.md b/content/hardware/02.hero/boards/uno-wifi-rev2/tutorials/uno-wifi-r2-web-server-ap-mode/uno-wifi-r2-web-server-ap-mode.md similarity index 100% rename from content/hardware/02.hero/boards/uno-wifi-rev2/tutorials/uno-wifi-rev-2/uno-wifi-r2-web-server-ap-mode/uno-wifi-r2-web-server-ap-mode.md rename to content/hardware/02.hero/boards/uno-wifi-rev2/tutorials/uno-wifi-r2-web-server-ap-mode/uno-wifi-r2-web-server-ap-mode.md diff --git a/content/hardware/03.nano/boards/nano-esp32/tutorials/cheat-sheet/cheat-sheet.md b/content/hardware/03.nano/boards/nano-esp32/tutorials/cheat-sheet/cheat-sheet.md index fcbf094957..eeb5e773b5 100644 --- a/content/hardware/03.nano/boards/nano-esp32/tutorials/cheat-sheet/cheat-sheet.md +++ b/content/hardware/03.nano/boards/nano-esp32/tutorials/cheat-sheet/cheat-sheet.md @@ -107,6 +107,52 @@ In addition to the normal bootloader-mode, the Arduino Nano ESP32 lets you enter If you need to reflash the bootloader, you can follow the steps of this [Help Center article](https://support.arduino.cc/hc/en-us/articles/9810414060188-Reset-the-Arduino-bootloader-on-the-Nano-ESP32) +### Default Sketch + +The default sketch loaded on the Nano ESP32 board is found in the code snippet below: + +```arduino +#define LEDR 46 +#define LEDG 45 +#define LEDB 0 +#ifdef LED_BUILTIN +#undef LED_BUILTIN +#define LED_BUILTIN 48 +#endif + +void setup() { + // put your setup code here, to run once: + pinMode(LEDR, OUTPUT); + pinMode(LEDG, OUTPUT); + pinMode(LEDB, OUTPUT); + pinMode(LED_BUILTIN, OUTPUT); +} + +void loop() { + digitalWrite(LED_BUILTIN, HIGH); + digitalWrite(LEDR, LOW); + digitalWrite(LEDG, HIGH); + digitalWrite(LEDB, HIGH); + + delay(1000); + + digitalWrite(LED_BUILTIN, LOW); + digitalWrite(LEDR, HIGH); + digitalWrite(LEDG, LOW); + digitalWrite(LEDB, HIGH); + + delay(1000); + + digitalWrite(LED_BUILTIN, HIGH); + digitalWrite(LEDR, HIGH); + digitalWrite(LEDG, HIGH); + digitalWrite(LEDB, LOW); + + delay(1000); + digitalWrite(LED_BUILTIN, LOW); +} +``` + ## MicroPython The Nano ESP32 has support for MicroPython, a micro-implementation of Python® that can easily be installed on your board. diff --git a/content/hardware/04.pro/boards/portenta-c33/tutorials/user-manual/content.md b/content/hardware/04.pro/boards/portenta-c33/tutorials/user-manual/content.md index b218f134e0..4d7096b6c5 100644 --- a/content/hardware/04.pro/boards/portenta-c33/tutorials/user-manual/content.md +++ b/content/hardware/04.pro/boards/portenta-c33/tutorials/user-manual/content.md @@ -72,7 +72,7 @@ The **Arduino Renesas Boards** core contains the libraries and examples to work The complete pinout is available and downloadable as PDF from the link below: -- [Portenta C33 pinout](https://docs.arduino.cc/static/903c16295f3bf076c2ed23eb1b38791c/ABX00074-full-pinout.pdf) +- [Portenta C33 pinout](https://docs.arduino.cc/resources/pinouts/ABX00074-full-pinout.pdf) ### Datasheet diff --git a/content/hardware/04.pro/boards/portenta-h7/tutorials/ble-connectivity/content.md b/content/hardware/04.pro/boards/portenta-h7/tutorials/ble-connectivity/content.md index 61286298ab..5500e8f7ca 100644 --- a/content/hardware/04.pro/boards/portenta-h7/tutorials/ble-connectivity/content.md +++ b/content/hardware/04.pro/boards/portenta-h7/tutorials/ble-connectivity/content.md @@ -50,7 +50,7 @@ To communicate with the Portenta H7 via Bluetooth®, you need to upload a pre-bu ### 1. The Basic Setup -Begin by plugging in your Portenta board to the computer using a USB-C® cable and open the Arduino IDE. If this is your first time running Arduino sketch files on the board, we suggest you check out how to [set up the Portenta H7 for Arduino](setting-up-portenta) before you proceed. +Begin by plugging in your Portenta board to the computer using a USB-C® cable and open the Arduino IDE. If this is your first time running Arduino sketch files on the board, we suggest you check out how to [set up the Portenta H7 for Arduino](https://docs.arduino.cc/tutorials/portenta-h7/setting-up-portenta/) before you proceed. ![The Portenta H7 can be connected to the computer using an appropriate USB-C® cable](assets/por_ard_ble_basic_setup.svg) @@ -184,18 +184,18 @@ On your mobile device install **nRF Connect** or an equivalent app that allows f Once you have downloaded the nRF application on your mobile device, look for your Portenta in the device list. You may filter the list by "Portenta" to easierly find your board in case you are using **nRF Connect**. -- When you found your board in the list tap "Connect". +- When you find your board in the list tap "Connect". - Navigate to the "Services" screen and tap the arrow up button. - Switch to "Bool" type and move the toggle to "True". Confirm the dialog with a tap on "Write" and you should see the built-in LED turned on. If you do the same procedure again but setting the toggle switch to "False", it will turn off the LED. ![In the nRF Connect app use a Bool toggle switch to toggle the built-in LED.](assets/por_ard_ble_nrf_connect.png) ## Conclusion -This tutorial shows how to connect and control the built-in LED using a Bluetooth® Low Energy connection. You have learnt how a simple Bluetooth® Low Energy connection between your Portenta and your cell phone, which has basic communication abilities between the two devices, works. +This tutorial shows how to connect and control the built-in LED using a Bluetooth® Low Energy connection. You have learned how a simple Bluetooth® Low Energy connection between your Portenta and your cell phone, which has basic communication abilities between the two devices, works. ### Next Steps -Now that you learnt how to configure the Portenta as a Bluetooth® Low Energy endpoint, you can try with two Portentas (or other Bluetooth® Low Energy capable Arduino devices), to facilitate bidirectional communication. More information on how to achieve that can be found on the [BLE library reference page](https://www.arduino.cc/en/Reference/ArduinoBLE). +Now that you learned how to configure the Portenta as a Bluetooth® Low Energy endpoint, you can try with two Portentas (or other Bluetooth® Low Energy capable Arduino devices), to facilitate bidirectional communication. More information on how to achieve that can be found on the [BLE library reference page](https://www.arduino.cc/en/Reference/ArduinoBLE). ## Troubleshooting diff --git a/content/hardware/04.pro/boards/portenta-h7/tutorials/creating-gui-with-lvgl/content.md b/content/hardware/04.pro/boards/portenta-h7/tutorials/creating-gui-with-lvgl/content.md index 9ebab73243..312212038a 100644 --- a/content/hardware/04.pro/boards/portenta-h7/tutorials/creating-gui-with-lvgl/content.md +++ b/content/hardware/04.pro/boards/portenta-h7/tutorials/creating-gui-with-lvgl/content.md @@ -54,7 +54,7 @@ This tutorial will guide you through building a basic user interface using the L ### 1. The Basic Setup -Begin by plugging your Portenta board into the computer using a USB-C® cable and open the Arduino IDE. If this is your first time running Arduino sketch files on the board, we suggest you check out how to [set up the Portenta H7 for Arduino](setting-up-portenta) before you proceed. +Begin by plugging your Portenta board into the computer using a USB-C® cable and open the Arduino IDE. If this is your first time running Arduino sketch files on the board, we suggest you check out how to [set up the Portenta H7 for Arduino](https://docs.arduino.cc/tutorials/portenta-h7/setting-up-portenta/) before you proceed. ![The Portenta H7 can be connected to the computer using an appropriate USB-C® cable](assets/por_ard_lvgl_basic_setup.svg) diff --git a/content/hardware/04.pro/boards/portenta-h7/tutorials/dual-core-processing/content.md b/content/hardware/04.pro/boards/portenta-h7/tutorials/dual-core-processing/content.md index 127d421f71..dd18ec5e25 100644 --- a/content/hardware/04.pro/boards/portenta-h7/tutorials/dual-core-processing/content.md +++ b/content/hardware/04.pro/boards/portenta-h7/tutorials/dual-core-processing/content.md @@ -31,7 +31,7 @@ The Portenta H7 is equipped with a processor that has two processing units calle ### Required Hardware and Software -- [Portenta H7 (ABX00042)](https://store.arduino.cc/portenta-h7) or [Portenta H7 Lite Connected (ABX00046)](https://store.arduino.cc/products/portenta-h7-lite-connected) +- [Portenta H7 (ABX00042)](https://store.arduino.cc/portenta-h7), [Portenta H7 Lite (ABX00045)](https://store.arduino.cc/products/portenta-h7-lite) or [Portenta H7 Lite Connected (ABX00046)](https://store.arduino.cc/products/portenta-h7-lite-connected) - USB-C® cable (either USB A to USB-C® or USB-C® to USB-C®) - Arduino IDE 1.8.10+  @@ -192,4 +192,4 @@ This tutorial introduces the idea of dual core processing and illustrates the co ### Next Steps -- Proceed with the next tutorial [Setting Up a Wi-Fi Access Point](wifi-access-point) to learn how to make use of the built-in Wi-Fi module and configure your Portenta H7 as a Wi-Fi access point. +- Proceed with the next tutorial [Setting Up a Wi-Fi Access Point](https://docs.arduino.cc/tutorials/portenta-h7/wifi-access-point/) to learn how to make use of the built-in Wi-Fi module and configure your Portenta H7 as a Wi-Fi access point. diff --git a/content/hardware/04.pro/boards/portenta-h7/tutorials/flash-optimized-key-value-store/content.md b/content/hardware/04.pro/boards/portenta-h7/tutorials/flash-optimized-key-value-store/content.md index 7900f0addb..565dbba21f 100644 --- a/content/hardware/04.pro/boards/portenta-h7/tutorials/flash-optimized-key-value-store/content.md +++ b/content/hardware/04.pro/boards/portenta-h7/tutorials/flash-optimized-key-value-store/content.md @@ -30,7 +30,7 @@ In this tutorial you will learn how to use the Mbed OS [TDBStore API](https://os - [Portenta H7 (ABX00042)](https://store.arduino.cc/products/portenta-h7), [Portenta H7 Lite (ABX00045)](https://store.arduino.cc/products/portenta-h7-lite) or [Portenta H7 Lite Connected (ABX00046)](https://store.arduino.cc/products/portenta-h7-lite-connected) - USB-C® cable (either USB-A to USB-C® or USB-C® to USB-C®) -- Arduino IDE 1.8.10+ or Arduino Pro IDE 0.0.4+ or Arduino CLI 0.13.0+ +- [Arduino IDE 2.0+](https://www.arduino.cc/en/software) or [Arduino CLI 0.13.0+](https://www.arduino.cc/pro/software-pro-cli/) ## Instructions diff --git a/content/hardware/04.pro/boards/portenta-h7/tutorials/getting-started-openmv-micropython/content.md b/content/hardware/04.pro/boards/portenta-h7/tutorials/getting-started-openmv-micropython/content.md index 304ac0486c..67b040c00e 100644 --- a/content/hardware/04.pro/boards/portenta-h7/tutorials/getting-started-openmv-micropython/content.md +++ b/content/hardware/04.pro/boards/portenta-h7/tutorials/getting-started-openmv-micropython/content.md @@ -162,7 +162,7 @@ In this tutorial you learned how to use the OpenMV IDE with your Portenta board. ### Next Steps - Experiment with MicroPythons capabilities. If you want some examples of what to do, take a look at the examples included in the OpenMV IDE. Go to: **File > Examples > Arduino > Portenta H7** in the OpenMV IDE. -- Take a look at the other Portenta H7 tutorials which showcase its many uses. You can find them [here](https://docs.arduino.cc/hardware/portenta-h7#tutorials). +- Take a look at the other Portenta H7 tutorials which showcase its many uses. You can find them [here](https://docs.arduino.cc/hardware/portenta-h7/#tutorials). ## Troubleshooting diff --git a/content/hardware/04.pro/boards/portenta-h7/tutorials/openmv-cheat-sheet/openmv-cheat-sheet.md b/content/hardware/04.pro/boards/portenta-h7/tutorials/openmv-cheat-sheet/openmv-cheat-sheet.md index 3726df94ce..4bbf0931f5 100644 --- a/content/hardware/04.pro/boards/portenta-h7/tutorials/openmv-cheat-sheet/openmv-cheat-sheet.md +++ b/content/hardware/04.pro/boards/portenta-h7/tutorials/openmv-cheat-sheet/openmv-cheat-sheet.md @@ -1,6 +1,7 @@ --- title: 'Arduino Portenta H7 MicroPython Cheat Sheet' description: 'Learn how to set up the Arduino Portenta H7 for OpenMV. Obtain information regarding pins and how to use OpenMV and MicroPython.' +difficulty: beginner tags: - Installation - MicroPython diff --git a/content/hardware/04.pro/boards/portenta-h7/tutorials/over-the-air-update/content.md b/content/hardware/04.pro/boards/portenta-h7/tutorials/over-the-air-update/content.md index 64ee549dd3..fe54aa18c3 100644 --- a/content/hardware/04.pro/boards/portenta-h7/tutorials/over-the-air-update/content.md +++ b/content/hardware/04.pro/boards/portenta-h7/tutorials/over-the-air-update/content.md @@ -1,440 +1,441 @@ ---- -title: 'Over-The-Air (OTA) Updates with the Arduino Portenta H7' -description: 'Learn how to perform an OTA update of the firmware on the Arduino Portenta H7' -tags: - - OTA - - Over-The-Air - - Wi-Fi - - Cloud -author: 'Taddy Chung, José Bagur' -libraries: - - name: Arduino IoT Cloud - url: https://www.arduino.cc/reference/en/libraries/arduinoiotcloud/ - - name: Arduino_Portenta_OTA - url: https://github.com/arduino-libraries/Arduino_Portenta_OTA -hardware: - - hardware/04.pro/boards/portenta-h7 - - hardware/04.pro/boards/portenta-h7-lite-connected -software: - - ide-v1 - - ide-v2 - - web-editor - - cli ---- - -## Overview -In this tutorial, you will learn how to use and allow firmware updates via **OTA (Over-The-Air)** feature with the **Arduino Portenta H7**. With this tutorial, you will be able to create a binary file to be used with the OTA feature and use the internal **QSPI** or a external **SD card** to accomplish the OTA (Over-The-Air) process. - -***To proceed with OTA using a SD Card, you will need to use a carrier or shield with a SD card slot, e.g Portenta Breakout, Portenta Max Carrier, Portenta Vision shield.*** - -## Goals -The goals of this tutorial are: -- Create an OTA file required to use the OTA (Over-The-Air) feature. -- Use QSPI or SD card storage to load the firmware downloaded using the OTA feature. - -## Hardware and Software Needed -- [Arduino Portenta H7](https://store.arduino.cc/portenta-h7) -- Operative System: Linux or MacOS system, this procedure is not 100% compatible on Windows. -- Arduino IDE 1.8.10+ or Arduino Pro IDE 0.0.4+ -- USB-C® type cable (either USB-A to USB-C® or USB-C® to USB-C®) -- Arduino IoT Cloud and Arduino_Portenta_OTA libraries -- SD card (optional, you can use QSPI instead) -- Carrier or shield compatible with the Portenta H7 with a SD Card slot, in case you choose to use the SD Card. - -## What OTA Means -**OTA** (Over-The-Air) is a method of distributing wirelessly to end devices to update their firmware, configuration or security-related protocols. The purpose of this method is to change a device’s behavior or its settings for better performance, for adding new features or to change its targeted usage. - -## Instructions - -We will explain briefly the steps required to be able to use OTA (Over-The-Air) process with Arduino Portenta H7. It will consist of firmware OTA file creation and use of preferred storage mode (QSPI or SD card). - -### Firmware OTA File Creation -You will need to create the binary file required for the OTA (Over-The-Air) process to be able use it with either storage option stated previously. For the purpose of this tutorial, you will have to use the following script to create the binary file. - -```cpp -/* - This sketch can be used to generate an example binary that can be uploaded to Portenta via OTA. - It needs to be used together with - - 'OTA_Qspi_Flash.ino' if you want to use the Qspi Flash as storage system - OR - - 'SD_Qspi_Flash.ino' if you want to use the SD card as storage system - - Steps to test OTA on Portenta: - 1) Upload this sketch or any other sketch (this one lights up the RGB LED with different colours). - 2) In the IDE select: Sketch -> Export compiled Binary - 3) Upload the exported binary to a server - 4) Choose a storage mechanism (SD or QSPI), open the related OTA_*_Portenta.ino sketch, - eventually update the OTA_FILE_LOCATION - 5) Upload the sketch OTA_*_Portenta.ino to perform OTA via SD or QSPI Flash -*/ - -void setLed(int blue, int green, int red) { - digitalWrite(LEDB, blue); - digitalWrite(LEDG, green); - digitalWrite(LEDR, red); -} - - -void setup() -{ - pinMode(LEDB, OUTPUT); - pinMode(LEDG, OUTPUT); - pinMode(LEDR, OUTPUT); -} - -void loop() -{ //led BLUE ON - setLed(1, 0, 0); - delay(1000); - //led GREEN ON - setLed(0, 1, 0); - delay(1000); - //led RED ON - setLed(0, 0, 1); - delay(1000); -} -``` - -This script will light up the RGB LED with 3 different colors in sequence. This code will need to be uploaded to the Arduino Portenta H7 firsthand. This is to verify whether the sketch compiles and is working correctly. After verifying this, in Arduino IDE, you will search for **Sketch > Export Compiled Binary**. - -![Exporting Binary for the Sketch](assets/binary_export.png) - -With the binary file ready, you can now create the OTA file needed to enable Over-The-Air process. - -To continue, macOS or Linux environment is required. For Windows environment, it is possible to use virtualization software such as [Oracle VM Virtualbox](https://www.virtualbox.org/) using your preferred choice of compatible Linux distribution. If you're not familiar with Linux environments, [Ubuntu](https://ubuntu.com/) is one of many distributions that can help you explore Linux environment with ease of access. - -Once you're comfortable with an environment, you will need a tool which can be found at the following link. - -***Arduino IoT Cloud Library - Over-The-Air Tools: https://github.com/arduino-libraries/ArduinoIoTCloud/tree/master/extras/tools*** - -You will have to extract the library at a preferred location to be able to use the tools. Then, you will need to run on the terminal the following commands in sequence to be able to create the OTA file. - -Copy the binary file into the library tool's folder - -```cpp -// Exported binary format reference: sketch.bin -cp OTA_Usage_Portenta.ino.PORTENTA_H7_M7.bin ~/Arduino/libraries/ArduinoIoTCloud/extras/tools/ -``` - -Go inside that directory - -```cpp -cd ~/Arduino/libraries/ArduinoIoTCloud/extras/tools -``` - -Encode your binary file into `OTA_Usage_Portenta.ino.PORTENTA_H7_M7.lzss` - -```cpp -// Argument format: ./lzss.py --encode sketch.bin sketch.lzss -./lzss.py --encode OTA_Usage_Portenta.ino.PORTENTA_H7_M7.bin OTA_Usage_Portenta.ino.PORTENTA_H7_M7.lzss -``` - -Convert your encoded file into `.ota` format - -```cpp -// Argument format: ./bin2ota.py PORTENTA_H7_M7 sketch.lzss sketch.ota -./bin2ota.py PORTENTA_H7_M7 OTA_Usage_Portenta.ino.PORTENTA_H7_M7.lzss OTA_Usage_Portenta.ino.PORTENTA_H7_M7.ota -``` - -You can use `OTA_Usage_Portenta.ino.PORTENTA_H7_M7` as a sketch name for facilitated identification of the file. After this, you will have the `.ota` file of the sketch that you will use with the OTA process. - -### Installing Python 3 On Linux - -If you are using Linux, maybe you cannot run the **bin2ota.py** script. This may be because you need to install [Python 3](https://www.python.org/) and the necessary modules. To do it execute the next command on your **Linux terminal**: - -```cpp -sudo apt install python-is-python3 -`````` - -You will also need to install the **crccheck** module on python by following the next instructions: - -Installing pip on python: -```cpp -//Necessary to install python modules: -sudo apt install python3-pip -``` -Installing the crccheck necessary module on python: - -```cpp -//Necessary to run the script: -pip install crccheck -``` -Once you have done it, you should be able to run the bin2ota.py script successfully. - -### Uploading OTA file to the net ### - -Now you can upload your .OTA file to an online reachable location, e.g. *OTA_Usage_Portenta.ino.PORTENTA_H7_M7.ota* has been uploaded to: - -https://downloads.arduino.cc/ota/OTA_Usage_Portenta.ino.PORTENTA_H7_M7.ota - -You can change the default file location on the code by modifying the next line on the ***"OTA_Qspi_Flash"** sketch or in the **"OTA_SD_Portenta"** sketch depending on which method are you going to follow: - -```cpp -static char const OTA_FILE_LOCATION[] = "Introduce here your online OTA file location"; -``` -It is important to know that if your OTA file is uploaded to an HTTPS website you will need to modify the next line in the code: - -```cpp - int const ota_download = ota.download(OTA_FILE_LOCATION, true /* is_https */); -``` -This line is in **line 87** for the **"OTA_Qspi_Flash"** sketch or in **line 88** on the **"OTA_SD_Portenta"** sketch. - -If you are going to use the example OTA file used in this tutorial you don't need to follow the steps in this section, just execute the sketch with the default file location. - - -***Now you have two options to choose, use QSPI or use an SD Card to storage your OTA file. You can use the left side index to jump to the option that you may need.*** - -### QSPI Storage Mode - -#### Setting Up -To use internal **QSPI** storage for downloading the binary file via OTA (Over-The-Air), you will only need the Arduino Portenta H7 board connected to the computer with the [Arduino IDE](https://www.arduino.cc/en/software). With it, you will need to have selected the **Arduino Portenta H7 (M7 Core)** with the Flash split of **1 MB M7 + 1 MB M4** for the purpose of this tutorial and the corresponding port. - -![Arduino Portenta H7 Board Connection](assets/portenta_h7_board_selection.png) - -#### Writing the Script -To proceed with a OTA using the QSPI flash, you can open the sketch from **Examples >Arduino_Portenta_OTA > OTA_Qspi_Flash**. - -***Do not forget to fill your Wi-Fi AP SSID and password on the `arduino_secrets.h` tab.*** - -This sketch will connect to your Wi-Fi, verify whether the OTA feature is available by checking the installed firmware on your Portenta. - -Then prepare the OTA storage, download the .ota file from the internet, decompress it, reset the board so after the reboot it will swipe the new firmware and you will notice it by checking the Built-in LED flashing on red, green and blue. - -### SD Card Storage Mode - -#### Setting Up -To use the **SD card** as the preferred OTA (Over-The-Air) storage device, you can use the Arduino Portenta Vision Shield and Portenta H7 connected via **HD (High-Density)** Connectors. - -![Arduino Portenta H7 with Vision Shield (Ethernet)](assets/portenta_h7_plus_vision_shield.svg) - -With this, you will need the Arduino Portenta H7 board connected to the computer with the Arduino IDE. You will need to have selected the **Arduino Portenta H7 (M7 Core)** with the Flash split of **1MB M7 + 1 MB M4** for the purpose of this tutorial and the corresponding port. - -#### Writing the Script -As same as QSPI storage mode, to proceed with a OTA using the SD Card, you can open the sketch from **Examples > Arduino_Portenta_OTA > OTA_SD_Portenta**. - -***Do not forget to fill your Wi-Fi AP SSID and password on the `arduino_secrets.h` tab.*** - -This sketch will connect to your Wi-Fi, verify whether the OTA feature is available by checking the installed firmware on your Portenta. - -Then prepare the OTA storage, download the .ota file from the internet, decompress it, reset the board so after the reboot it will swipe the new firmware and you will notice it by checking the Built-in LED flashing on red, green and blue. - -## Testing the Code -Having successfully uploaded the code and completed the OTA process, you will be able to see the Arduino Portenta H7 blinking LED Red, Blue, Green in a cyclic manner. You will also be able to see process log in the Serial Monitor provided by Arduino IDE for more details. - -![Arduino Portenta H7 OTA Completion with Cyclic RGB Blink](assets/portenta_h7_ota_blink_cycle.svg) - -![Arduino Portenta H7 OTA QSPI Serial Monitor Log](assets/portenta_ota_qspi_result.png) - -![Arduino Portenta H7 OTA SD Card Serial Monitor Log](assets/portenta_ota_sd_result.png) - -## Conclusion -You have now learned how to use the OTA feature provided by the Arduino Portenta H7, by updating its firmware. You will now be able to create the OTA file with the sketch designed by yourself and use this to update Arduino Portenta H7’s firmware via OTA (Over-The-Air) feature with either QSPI or SD card storage mechanism. - -### Next Steps -Now, with the OTA capability in place, you can design future-proof system based on Arduino Portenta H7 or try different system disciplines using the OTA capability. - -## Full Sketches -The complete script is as follows. - -### QSPI Storage Mode - -```cpp -#include -#include -#include "arduino_secrets.h" - -static char const SSID[] = SSID_NAME; /* your network SSID (name) */ -static char const PASS[] = SSID_PASS; /* your network password (use for WPA, or use as key for WEP) */ - -static char const OTA_FILE_LOCATION[] = "https://downloads.arduino.cc/ota/OTA_Usage_Portenta.ino.PORTENTA_H7_M7.ota"; - -void setup() -{ - Serial.begin(115200); - while (!Serial) {} - - if (WiFi.status() == WL_NO_SHIELD) - { - Serial.println("Communication with WiFi module failed!"); - return; - } - - int status = WL_IDLE_STATUS; - while (status != WL_CONNECTED) - { - Serial.print ("Attempting to connect to '"); - Serial.print (SSID); - Serial.println("'"); - status = WiFi.begin(SSID, PASS); - delay(10000); - } - Serial.print ("You're connected to '"); - Serial.print (WiFi.SSID()); - Serial.println("'"); - - Arduino_Portenta_OTA_QSPI ota(QSPI_FLASH_FATFS_MBR, 2); - Arduino_Portenta_OTA::Error ota_err = Arduino_Portenta_OTA::Error::None; - - if (!ota.isOtaCapable()) - { - Serial.println("Higher version bootloader required to perform OTA."); - Serial.println("Please update the bootloader."); - Serial.println("File -> Examples -> STM32H747_System -> STM32H747_updateBootloader"); - return; - } - - Serial.println("Initializing OTA storage"); - if ((ota_err = ota.begin()) != Arduino_Portenta_OTA::Error::None) - { - Serial.print ("Arduino_Portenta_OTA::begin() failed with error code "); - Serial.println((int)ota_err); - return; - } - - Serial.println("Starting download to QSPI ..."); - int const ota_download = ota.download(OTA_FILE_LOCATION, false /* is_https */); - if (ota_download <= 0) - { - Serial.print ("Arduino_Portenta_OTA_QSPI::download failed with error code "); - Serial.println(ota_download); - return; - } - Serial.print (ota_download); - Serial.println(" bytes stored."); - - - Serial.println("Decompressing LZSS compressed file ..."); - int const ota_decompress = ota.decompress(); - if (ota_decompress < 0) - { - Serial.print("Arduino_Portenta_OTA_QSPI::decompress() failed with error code"); - Serial.println(ota_decompress); - return; - } - Serial.print(ota_decompress); - Serial.println(" bytes decompressed."); - - - Serial.println("Storing parameters for firmware update in bootloader accessible non-volatile memory ..."); - if ((ota_err = ota.update()) != Arduino_Portenta_OTA::Error::None) - { - Serial.print ("ota.update() failed with error code "); - Serial.println((int)ota_err); - return; - } - - Serial.println("Performing a reset after which the bootloader will update the firmware."); - Serial.println("Hint: Portenta H7 LED will blink Red-Blue-Green."); - delay(1000); /* Make sure the serial message gets out before the reset. */ - ota.reset(); -} - -void loop() -{ -} -``` - -### SD Card Storage Mode - -```cpp -#include -#include -#include "arduino_secrets.h" - -static char const SSID[] = SSID_NAME; /* your network SSID (name) */ -static char const PASS[] = SSID_PASS; /* your network password (use for WPA, or use as key for WEP) */ - -static char const OTA_FILE_LOCATION[] = "https://downloads.arduino.cc/ota/OTA_Usage_Portenta.ino.PORTENTA_H7_M7.ota"; - -void setup() -{ - Serial.begin(115200); - while (!Serial) {} - - if (WiFi.status() == WL_NO_SHIELD) - { - Serial.println("Communication with WiFi module failed!"); - return; - } - - int status = WL_IDLE_STATUS; - while (status != WL_CONNECTED) - { - Serial.print ("Attempting to connect to '"); - Serial.print (SSID); - Serial.println("'"); - status = WiFi.begin(SSID, PASS); - delay(10000); - } - Serial.print ("You're connected to '"); - Serial.print (WiFi.SSID()); - Serial.println("'"); - - Arduino_Portenta_OTA_SD ota(SD_FATFS_MBR, 1); - Arduino_Portenta_OTA::Error ota_err = Arduino_Portenta_OTA::Error::None; - - if (!ota.isOtaCapable()) - { - Serial.println("Higher version bootloader required to perform OTA."); - Serial.println("Please update the bootloader."); - Serial.println("File -> Examples -> STM32H747_System -> STM32H747_updateBootloader "); - return; - } - - Serial.println("Initializing OTA storage"); - if ((ota_err = ota.begin()) != Arduino_Portenta_OTA::Error::None) - { - Serial.print ("Arduino_Portenta_OTA::begin() failed with error code "); - Serial.println((int)ota_err); - return; - } - - - Serial.println("Starting download to SD ..."); - int const ota_download = ota.download(OTA_FILE_LOCATION, false /* is_https */); - if (ota_download <= 0) - { - Serial.print ("Arduino_Portenta_OTA_SD::download failed with error code "); - Serial.println(ota_download); - return; - } - Serial.print (ota_download); - Serial.println(" bytes stored."); - - - Serial.println("Decompressing LZSS compressed file ..."); - int const ota_decompress = ota.decompress(); - if (ota_decompress < 0) - { - Serial.print("Arduino_Portenta_OTA_SD::decompress() failed with error code"); - Serial.println(ota_decompress); - return; - } - Serial.print(ota_decompress); - Serial.println(" bytes decompressed."); - - - Serial.println("Storing parameters for firmware update in bootloader accessible non-volatile memory"); - if ((ota_err = ota.update()) != Arduino_Portenta_OTA::Error::None) - { - Serial.print ("Arduino_Portenta_OTA::update() failed with error code "); - Serial.println((int)ota_err); - return; - } - - Serial.println("Performing a reset after which the bootloader will update the firmware."); - Serial.println("Hint: Portenta H7 LED will blink Red-Blue-Green."); - delay(1000); - ota.reset(); -} - -void loop() -{ -} -``` - -## Troubleshooting -For troubleshooting the issues that might have arose following the tutorial, you can use following tips to solve the issue. - -- If there has been an issue with Wi-Fi module, it means the device may have suffered from losing the Wi-Fi firmware partition. To solve this, you will have to use **PortentaWiFiFirmwareupdater** sketch found on Arduino IDE examples to fix the issue. -- QSPI storage may throw error -3 while running Portenta H7 OTA QSPI example. To fix this, you can use this guide of [Reading and Writing Flash Memory](https://docs.arduino.cc/tutorials/portenta-h7/reading-writing-flash-memory) in the section **Programming the QSPI Flash**. At this point, run the example and it should have been solved by eliminating error -3 (OTA Storage initialization error). +--- +title: 'Over-The-Air (OTA) Updates with the Arduino Portenta H7' +description: 'Learn how to perform an OTA update of the firmware on the Arduino Portenta H7' +difficulty: intermediate +tags: + - OTA + - Over-The-Air + - Wi-Fi + - Cloud +author: 'Taddy Chung, José Bagur' +libraries: + - name: Arduino IoT Cloud + url: https://www.arduino.cc/reference/en/libraries/arduinoiotcloud/ + - name: Arduino_Portenta_OTA + url: https://github.com/arduino-libraries/Arduino_Portenta_OTA +hardware: + - hardware/04.pro/boards/portenta-h7 + - hardware/04.pro/boards/portenta-h7-lite-connected +software: + - ide-v1 + - ide-v2 + - web-editor + - cli +--- + +## Overview +In this tutorial, you will learn how to use and allow firmware updates via **OTA (Over-The-Air)** feature with the **Arduino Portenta H7**. With this tutorial, you will be able to create a binary file to be used with the OTA feature and use the internal **QSPI** or a external **SD card** to accomplish the OTA (Over-The-Air) process. + +***To proceed with OTA using a SD Card, you will need to use a carrier or shield with a SD card slot, e.g Portenta Breakout, Portenta Max Carrier, Portenta Vision Shield.*** + +## Goals +The goals of this tutorial are: +- Create an OTA file required to use the OTA (Over-The-Air) feature. +- Use QSPI or SD card storage to load the firmware downloaded using the OTA feature. + +## Hardware and Software Needed +- [Arduino Portenta H7](https://store.arduino.cc/portenta-h7) +- Operative System: Linux or MacOS system, this procedure is not 100% compatible on Windows. +- Arduino IDE 1.8.10+ or Arduino Pro IDE 0.0.4+ +- USB-C® type cable (either USB-A to USB-C® or USB-C® to USB-C®) +- Arduino IoT Cloud and Arduino_Portenta_OTA libraries +- SD card (optional, you can use QSPI instead) +- Carrier or shield compatible with the Portenta H7 with a SD Card slot, in case you choose to use the SD Card. + +## What OTA Means +**OTA** (Over-The-Air) is a method of distributing wirelessly to end devices to update their firmware, configuration or security-related protocols. The purpose of this method is to change a device’s behavior or its settings for better performance, for adding new features or to change its targeted usage. + +## Instructions + +We will explain briefly the steps required to be able to use OTA (Over-The-Air) process with Arduino Portenta H7. It will consist of firmware OTA file creation and use of preferred storage mode (QSPI or SD card). + +### Firmware OTA File Creation +You will need to create the binary file required for the OTA (Over-The-Air) process to be able use it with either storage option stated previously. For the purpose of this tutorial, you will have to use the following script to create the binary file. + +```cpp +/* + This sketch can be used to generate an example binary that can be uploaded to Portenta via OTA. + It needs to be used together with + - 'OTA_Qspi_Flash.ino' if you want to use the Qspi Flash as storage system + OR + - 'SD_Qspi_Flash.ino' if you want to use the SD card as storage system + + Steps to test OTA on Portenta: + 1) Upload this sketch or any other sketch (this one lights up the RGB LED with different colours). + 2) In the IDE select: Sketch -> Export compiled Binary + 3) Upload the exported binary to a server + 4) Choose a storage mechanism (SD or QSPI), open the related OTA_*_Portenta.ino sketch, + eventually update the OTA_FILE_LOCATION + 5) Upload the sketch OTA_*_Portenta.ino to perform OTA via SD or QSPI Flash +*/ + +void setLed(int blue, int green, int red) { + digitalWrite(LEDB, blue); + digitalWrite(LEDG, green); + digitalWrite(LEDR, red); +} + + +void setup() +{ + pinMode(LEDB, OUTPUT); + pinMode(LEDG, OUTPUT); + pinMode(LEDR, OUTPUT); +} + +void loop() +{ //led BLUE ON + setLed(1, 0, 0); + delay(1000); + //led GREEN ON + setLed(0, 1, 0); + delay(1000); + //led RED ON + setLed(0, 0, 1); + delay(1000); +} +``` + +This script will light up the RGB LED with 3 different colors in sequence. This code will need to be uploaded to the Arduino Portenta H7 firsthand. This is to verify whether the sketch compiles and is working correctly. After verifying this, in Arduino IDE, you will search for **Sketch > Export Compiled Binary**. + +![Exporting Binary for the Sketch](assets/binary_export.png) + +With the binary file ready, you can now create the OTA file needed to enable Over-The-Air process. + +To continue, macOS or Linux environment is required. For Windows environment, it is possible to use virtualization software such as [Oracle VM Virtualbox](https://www.virtualbox.org/) using your preferred choice of compatible Linux distribution. If you're not familiar with Linux environments, [Ubuntu](https://ubuntu.com/) is one of many distributions that can help you explore Linux environment with ease of access. + +Once you're comfortable with an environment, you will need a tool which can be found at the following link. + +***[Arduino IoT Cloud Library - Over-The-Air Tools](https://github.com/arduino-libraries/ArduinoIoTCloud/tree/master/extras/tools)*** + +You will have to extract the library at a preferred location to be able to use the tools. Then, you will need to run on the terminal the following commands in sequence to be able to create the OTA file. + +Copy the binary file into the library tool's folder + +```cpp +// Exported binary format reference: sketch.bin +cp OTA_Usage_Portenta.ino.PORTENTA_H7_M7.bin ~/Arduino/libraries/ArduinoIoTCloud/extras/tools/ +``` + +Go inside that directory + +```cpp +cd ~/Arduino/libraries/ArduinoIoTCloud/extras/tools +``` + +Encode your binary file into `OTA_Usage_Portenta.ino.PORTENTA_H7_M7.lzss` + +```cpp +// Argument format: ./lzss.py --encode sketch.bin sketch.lzss +./lzss.py --encode OTA_Usage_Portenta.ino.PORTENTA_H7_M7.bin OTA_Usage_Portenta.ino.PORTENTA_H7_M7.lzss +``` + +Convert your encoded file into `.ota` format + +```cpp +// Argument format: ./bin2ota.py PORTENTA_H7_M7 sketch.lzss sketch.ota +./bin2ota.py PORTENTA_H7_M7 OTA_Usage_Portenta.ino.PORTENTA_H7_M7.lzss OTA_Usage_Portenta.ino.PORTENTA_H7_M7.ota +``` + +You can use `OTA_Usage_Portenta.ino.PORTENTA_H7_M7` as a sketch name for facilitated identification of the file. After this, you will have the `.ota` file of the sketch that you will use with the OTA process. + +### Installing Python 3 On Linux + +If you are using Linux, maybe you cannot run the **bin2ota.py** script. This may be because you need to install [Python 3](https://www.python.org/) and the necessary modules. To do it execute the next command on your **Linux terminal**: + +```cpp +sudo apt install python-is-python3 +`````` + +You will also need to install the **crccheck** module on python by following the next instructions: + +Installing pip on python: +```cpp +//Necessary to install python modules: +sudo apt install python3-pip +``` +Installing the crccheck necessary module on python: + +```cpp +//Necessary to run the script: +pip install crccheck +``` +Once you have done it, you should be able to run the bin2ota.py script successfully. + +### Uploading OTA file to the net ### + +Now you can upload your .OTA file to an online reachable location, e.g. *OTA_Usage_Portenta.ino.PORTENTA_H7_M7.ota* has been uploaded to: + +https://downloads.arduino.cc/ota/OTA_Usage_Portenta.ino.PORTENTA_H7_M7.ota + +You can change the default file location on the code by modifying the next line on the ***"OTA_Qspi_Flash"** sketch or in the **"OTA_SD_Portenta"** sketch depending on which method are you going to follow: + +```cpp +static char const OTA_FILE_LOCATION[] = "Introduce here your online OTA file location"; +``` +It is important to know that if your OTA file is uploaded to an HTTPS website you will need to modify the next line in the code: + +```cpp + int const ota_download = ota.download(OTA_FILE_LOCATION, true /* is_https */); +``` +This line is in **line 87** for the **"OTA_Qspi_Flash"** sketch or in **line 88** on the **"OTA_SD_Portenta"** sketch. + +If you are going to use the example OTA file used in this tutorial you don't need to follow the steps in this section, just execute the sketch with the default file location. + + +***Now you have two options to choose, use QSPI or use an SD Card to storage your OTA file. You can use the left side index to jump to the option that you may need.*** + +### QSPI Storage Mode + +#### Setting Up +To use internal **QSPI** storage for downloading the binary file via OTA (Over-The-Air), you will only need the Arduino Portenta H7 board connected to the computer with the [Arduino IDE](https://www.arduino.cc/en/software). With it, you will need to have selected the **Arduino Portenta H7 (M7 Core)** with the Flash split of **1 MB M7 + 1 MB M4** for the purpose of this tutorial and the corresponding port. + +![Arduino Portenta H7 Board Connection](assets/portenta_h7_board_selection.png) + +#### Writing the Script +To proceed with a OTA using the QSPI flash, you can open the sketch from **Examples >Arduino_Portenta_OTA > OTA_Qspi_Flash**. + +***Do not forget to fill your Wi-Fi AP SSID and password on the `arduino_secrets.h` tab.*** + +This sketch will connect to your Wi-Fi, verify whether the OTA feature is available by checking the installed firmware on your Portenta. + +Then prepare the OTA storage, download the .ota file from the internet, decompress it, reset the board so after the reboot it will swipe the new firmware and you will notice it by checking the Built-in LED flashing on red, green and blue. + +### SD Card Storage Mode + +#### Setting Up +To use the **SD card** as the preferred OTA (Over-The-Air) storage device, you can use the Arduino Portenta Vision Shield and Portenta H7 connected via **HD (High-Density)** Connectors. + +![Arduino Portenta H7 with Portenta Vision Shield - Ethernet](assets/portenta_h7_plus_vision_shield.svg) + +With this, you will need the Arduino Portenta H7 board connected to the computer with the Arduino IDE. You will need to have selected the **Arduino Portenta H7 (M7 Core)** with the Flash split of **1MB M7 + 1 MB M4** for the purpose of this tutorial and the corresponding port. + +#### Writing the Script +As same as QSPI storage mode, to proceed with a OTA using the SD Card, you can open the sketch from **Examples > Arduino_Portenta_OTA > OTA_SD_Portenta**. + +***Do not forget to fill your Wi-Fi AP SSID and password on the `arduino_secrets.h` tab.*** + +This sketch will connect to your Wi-Fi, verify whether the OTA feature is available by checking the installed firmware on your Portenta. + +Then prepare the OTA storage, download the .ota file from the internet, decompress it, reset the board so after the reboot it will swipe the new firmware and you will notice it by checking the Built-in LED flashing on red, green and blue. + +## Testing the Code +Having successfully uploaded the code and completed the OTA process, you will be able to see the Arduino Portenta H7 blinking LED Red, Blue, Green in a cyclic manner. You will also be able to see process log in the Serial Monitor provided by Arduino IDE for more details. + +![Arduino Portenta H7 OTA Completion with Cyclic RGB Blink](assets/portenta_h7_ota_blink_cycle.svg) + +![Arduino Portenta H7 OTA QSPI Serial Monitor Log](assets/portenta_ota_qspi_result.png) + +![Arduino Portenta H7 OTA SD Card Serial Monitor Log](assets/portenta_ota_sd_result.png) + +## Conclusion +You have now learned how to use the OTA feature provided by the Arduino Portenta H7, by updating its firmware. You will now be able to create the OTA file with the sketch designed by yourself and use this to update Arduino Portenta H7’s firmware via OTA (Over-The-Air) feature with either QSPI or SD card storage mechanism. + +### Next Steps +Now, with the OTA capability in place, you can design future-proof system based on Arduino Portenta H7 or try different system disciplines using the OTA capability. + +## Full Sketches +The complete script is as follows. + +### QSPI Storage Mode + +```cpp +#include +#include +#include "arduino_secrets.h" + +static char const SSID[] = SSID_NAME; /* your network SSID (name) */ +static char const PASS[] = SSID_PASS; /* your network password (use for WPA, or use as key for WEP) */ + +static char const OTA_FILE_LOCATION[] = "https://downloads.arduino.cc/ota/OTA_Usage_Portenta.ino.PORTENTA_H7_M7.ota"; + +void setup() +{ + Serial.begin(115200); + while (!Serial) {} + + if (WiFi.status() == WL_NO_SHIELD) + { + Serial.println("Communication with WiFi module failed!"); + return; + } + + int status = WL_IDLE_STATUS; + while (status != WL_CONNECTED) + { + Serial.print ("Attempting to connect to '"); + Serial.print (SSID); + Serial.println("'"); + status = WiFi.begin(SSID, PASS); + delay(10000); + } + Serial.print ("You're connected to '"); + Serial.print (WiFi.SSID()); + Serial.println("'"); + + Arduino_Portenta_OTA_QSPI ota(QSPI_FLASH_FATFS_MBR, 2); + Arduino_Portenta_OTA::Error ota_err = Arduino_Portenta_OTA::Error::None; + + if (!ota.isOtaCapable()) + { + Serial.println("Higher version bootloader required to perform OTA."); + Serial.println("Please update the bootloader."); + Serial.println("File -> Examples -> STM32H747_System -> STM32H747_updateBootloader"); + return; + } + + Serial.println("Initializing OTA storage"); + if ((ota_err = ota.begin()) != Arduino_Portenta_OTA::Error::None) + { + Serial.print ("Arduino_Portenta_OTA::begin() failed with error code "); + Serial.println((int)ota_err); + return; + } + + Serial.println("Starting download to QSPI ..."); + int const ota_download = ota.download(OTA_FILE_LOCATION, false /* is_https */); + if (ota_download <= 0) + { + Serial.print ("Arduino_Portenta_OTA_QSPI::download failed with error code "); + Serial.println(ota_download); + return; + } + Serial.print (ota_download); + Serial.println(" bytes stored."); + + + Serial.println("Decompressing LZSS compressed file ..."); + int const ota_decompress = ota.decompress(); + if (ota_decompress < 0) + { + Serial.print("Arduino_Portenta_OTA_QSPI::decompress() failed with error code"); + Serial.println(ota_decompress); + return; + } + Serial.print(ota_decompress); + Serial.println(" bytes decompressed."); + + + Serial.println("Storing parameters for firmware update in bootloader accessible non-volatile memory ..."); + if ((ota_err = ota.update()) != Arduino_Portenta_OTA::Error::None) + { + Serial.print ("ota.update() failed with error code "); + Serial.println((int)ota_err); + return; + } + + Serial.println("Performing a reset after which the bootloader will update the firmware."); + Serial.println("Hint: Portenta H7 LED will blink Red-Blue-Green."); + delay(1000); /* Make sure the serial message gets out before the reset. */ + ota.reset(); +} + +void loop() +{ +} +``` + +### SD Card Storage Mode + +```cpp +#include +#include +#include "arduino_secrets.h" + +static char const SSID[] = SSID_NAME; /* your network SSID (name) */ +static char const PASS[] = SSID_PASS; /* your network password (use for WPA, or use as key for WEP) */ + +static char const OTA_FILE_LOCATION[] = "https://downloads.arduino.cc/ota/OTA_Usage_Portenta.ino.PORTENTA_H7_M7.ota"; + +void setup() +{ + Serial.begin(115200); + while (!Serial) {} + + if (WiFi.status() == WL_NO_SHIELD) + { + Serial.println("Communication with WiFi module failed!"); + return; + } + + int status = WL_IDLE_STATUS; + while (status != WL_CONNECTED) + { + Serial.print ("Attempting to connect to '"); + Serial.print (SSID); + Serial.println("'"); + status = WiFi.begin(SSID, PASS); + delay(10000); + } + Serial.print ("You're connected to '"); + Serial.print (WiFi.SSID()); + Serial.println("'"); + + Arduino_Portenta_OTA_SD ota(SD_FATFS_MBR, 1); + Arduino_Portenta_OTA::Error ota_err = Arduino_Portenta_OTA::Error::None; + + if (!ota.isOtaCapable()) + { + Serial.println("Higher version bootloader required to perform OTA."); + Serial.println("Please update the bootloader."); + Serial.println("File -> Examples -> STM32H747_System -> STM32H747_updateBootloader "); + return; + } + + Serial.println("Initializing OTA storage"); + if ((ota_err = ota.begin()) != Arduino_Portenta_OTA::Error::None) + { + Serial.print ("Arduino_Portenta_OTA::begin() failed with error code "); + Serial.println((int)ota_err); + return; + } + + + Serial.println("Starting download to SD ..."); + int const ota_download = ota.download(OTA_FILE_LOCATION, false /* is_https */); + if (ota_download <= 0) + { + Serial.print ("Arduino_Portenta_OTA_SD::download failed with error code "); + Serial.println(ota_download); + return; + } + Serial.print (ota_download); + Serial.println(" bytes stored."); + + + Serial.println("Decompressing LZSS compressed file ..."); + int const ota_decompress = ota.decompress(); + if (ota_decompress < 0) + { + Serial.print("Arduino_Portenta_OTA_SD::decompress() failed with error code"); + Serial.println(ota_decompress); + return; + } + Serial.print(ota_decompress); + Serial.println(" bytes decompressed."); + + + Serial.println("Storing parameters for firmware update in bootloader accessible non-volatile memory"); + if ((ota_err = ota.update()) != Arduino_Portenta_OTA::Error::None) + { + Serial.print ("Arduino_Portenta_OTA::update() failed with error code "); + Serial.println((int)ota_err); + return; + } + + Serial.println("Performing a reset after which the bootloader will update the firmware."); + Serial.println("Hint: Portenta H7 LED will blink Red-Blue-Green."); + delay(1000); + ota.reset(); +} + +void loop() +{ +} +``` + +## Troubleshooting +For troubleshooting the issues that might have arose following the tutorial, you can use following tips to solve the issue. + +- If there has been an issue with Wi-Fi module, it means the device may have suffered from losing the Wi-Fi firmware partition. To solve this, you will have to use **PortentaWiFiFirmwareupdater** sketch found on Arduino IDE examples to fix the issue. +- QSPI storage may throw error -3 while running Portenta H7 OTA QSPI example. To fix this, you can use this guide of [Reading and Writing Flash Memory](https://docs.arduino.cc/tutorials/portenta-h7/reading-writing-flash-memory) in the section **Programming the QSPI Flash**. At this point, run the example and it should have been solved by eliminating error -3 (OTA Storage initialization error). diff --git a/content/hardware/04.pro/boards/portenta-h7/tutorials/secure-boot/secure-boot.md b/content/hardware/04.pro/boards/portenta-h7/tutorials/secure-boot/secure-boot.md index 30fc3b0ddb..ebd35d51b8 100644 --- a/content/hardware/04.pro/boards/portenta-h7/tutorials/secure-boot/secure-boot.md +++ b/content/hardware/04.pro/boards/portenta-h7/tutorials/secure-boot/secure-boot.md @@ -1,6 +1,7 @@ --- title: 'Secure Boot on Portenta H7' description: 'Learn how to use secure boot on the Arduino Portenta H7.' +difficulty: beginner tags: - Secure Boot author: 'Umberto Baldi' @@ -46,7 +47,8 @@ This can be done with **imgtool**. You can download and install it directly from ***`imgtool` is already installed by the mbed platform and can be found in the `%LOCALAPPDATA%\Arduino15\packages\arduino\tools\imgtool` directory on Windows, in `~/.arduino15/packages/arduino/tools/imgtool` on Linux and in `~/Library/Arduino15/packages/arduino/tools/imgtool` on macOS.*** To generate the new keys you can use this command line: -``` + +```bash imgtool keygen --key my-sign-keyfile.pem -t ecdsa-p256 imgtool keygen --key my-encrypt-keyfile.pem -t ecdsa-p256 ``` @@ -56,7 +58,8 @@ Remember to **save the keys and keep them in a secure location** and not to lose ### 2. Upload the Custom Keys to the Board Once the keys have been generated, they have to be uploaded to the Portenta H7. This procedure has to be done only once, because it is persistent. To extract the public\private key and encode it in to a "C" byte array inside a `.h` header file you can use: -``` + +```bash imgtool getpriv -k my-encrypt-keyfile.pem > ecsda-p256-encrypt-priv-key.h imgtool getpub -k my-sign-keyfile.pem > ecsda-p256-signing-pub-key.h ``` @@ -70,7 +73,8 @@ To do so, just save the sketch to another location and replace the `ecsda-p256-e Since the default keys have been changed in favour of custom generated ones, the new ones have to be used when compiling and uploading a sketch, because the compiled sketch is signed and encrypted using such keys. To override the security keys used during the compile, you have to use the Arduino CLI and specify the keys with: -``` + +```bash arduino-cli compile -b arduino:mbed_portenta:envie_m7 --board-options security=sien --keys-keychain --sign-key ecdsa-p256-signing-priv-key.pem --encrypt-key ecdsa-p256-encrypt-pub-key.pem /home/user/Arduino/MySketch ``` diff --git a/content/hardware/04.pro/boards/portenta-h7/tutorials/setting-up-portenta/content.md b/content/hardware/04.pro/boards/portenta-h7/tutorials/setting-up-portenta/content.md index 77b657e371..d38a9d5e61 100644 --- a/content/hardware/04.pro/boards/portenta-h7/tutorials/setting-up-portenta/content.md +++ b/content/hardware/04.pro/boards/portenta-h7/tutorials/setting-up-portenta/content.md @@ -51,7 +51,7 @@ The Arduino core for the Portenta H7 sits on top of the Mbed OS and allows to de ### Configuring the Development Environment In this section, we will guide you through a step-by-step process of setting up your Portenta board for running an Arduino Sketch that blinks the built-in RGB LED. -***IMPORTANT: Please make sure to update the bootloader to the most recent version to benefit from the latest improvements. Follow [these steps](updating-the-bootloader) before you proceed with the next step of this tutorial.*** +***IMPORTANT: Please make sure to update the bootloader to the most recent version to benefit from the latest improvements. Follow [these steps](https://docs.arduino.cc/tutorials/portenta-h7/updating-the-bootloader/) before you proceed with the next step of this tutorial.*** ### 1. The Basic Setup Let's begin by Plug-in your Portenta to your computer using the appropriate USB-C® cable. Next, open your IDE and make sure that you have the right version of the Arduino IDE downloaded on to your computer. @@ -92,12 +92,12 @@ void loop() { For Portenta H7 LED_BUILTIN represents the built-in RGB LED on the board in green color. -**Note:** The individual colors of the built-in RGB LED can be accessed and controlled separately. In the tutorial [Dual core processing](dual-core-processing) you will learn how to control the LED to light it in different colors +**Note:** The individual colors of the built-in RGB LED can be accessed and controlled separately. In the tutorial [Dual core processing](https://docs.arduino.cc/tutorials/portenta-h7/dual-core-processing/) you will learn how to control the LED to light it in different colors ### 4. Upload the Blink Sketch Now it's time to upload the sketch and see if the LED will start to blink. Make sure you select Arduino Portenta H7 (M7 core) as the board and the port to which the Portenta H7 is connected. If the Portenta H7 doesn't show up in the list of ports, go back to step 1 and make sure that the drivers are installed correctly. Once selected click Upload. Once uploaded the built-in LED should start blinking with an interval of 1 second. -**Note:** The Portenta H7 has an M7 and an M4 processor which run separate cores. That's why you need to select the one to which you want to upload your sketch to (check out the tutorial [Dual core processing](dual-core-processing) to learn more about Portenta's processors). +**Note:** The Portenta H7 has an M7 and an M4 processor which run separate cores. That's why you need to select the one to which you want to upload your sketch to (check out the tutorial [Dual core processing](https://docs.arduino.cc/tutorials/portenta-h7/dual-core-processing/) to learn more about Portenta's processors). ![Select the Arduino Portenta H7 (M7 core) in the board selector.](assets/por_ard_gs_upload_sketch.png) @@ -107,7 +107,7 @@ Now it's time to upload the sketch and see if the LED will start to blink. Make You have now configured your Portenta board to run Arduino sketches. Along with that you gained an understanding of how the Arduino Core runs on top of Mbed OS. ### Next Steps -- Proceed with the next tutorial [Dual core processing](dual-core-processing) to learn how to make use of Portenta H7's two processors to do two separate tasks simultaneously. +- Proceed with the next tutorial [Dual core processing](https://docs.arduino.cc/tutorials/portenta-h7/dual-core-processing/) to learn how to make use of Portenta H7's two processors to do two separate tasks simultaneously. - Read more about why we chose Mbed as as the foundation [here](https://blog.arduino.cc/2019/07/31/why-we-chose-to-build-the-arduino-nano-33-ble-core-on-mbed-os/). ## Troubleshooting diff --git a/content/hardware/04.pro/boards/portenta-x8/essentials.md b/content/hardware/04.pro/boards/portenta-x8/essentials.md index fad4dbd5db..022940bf76 100644 --- a/content/hardware/04.pro/boards/portenta-x8/essentials.md +++ b/content/hardware/04.pro/boards/portenta-x8/essentials.md @@ -26,7 +26,7 @@ Download the latest firmware for Portenta X8 (Recommended). - + All available Portenta X8 firmware release notes. diff --git a/content/hardware/04.pro/boards/portenta-x8/tutorials/03.uploading-sketches-m4/content.md b/content/hardware/04.pro/boards/portenta-x8/tutorials/03.uploading-sketches-m4/content.md index d8175e04a5..ec5f5c4f65 100644 --- a/content/hardware/04.pro/boards/portenta-x8/tutorials/03.uploading-sketches-m4/content.md +++ b/content/hardware/04.pro/boards/portenta-x8/tutorials/03.uploading-sketches-m4/content.md @@ -66,7 +66,7 @@ To upload the firmware, you can use the ADB tool that has been installed as part From that directory, you can use the `adb` tool. To upload your compiled sketch, you will need to use the following command: -``` +```bash adb push /tmp/arduino/m4-user-sketch.elf ``` diff --git a/content/hardware/04.pro/boards/portenta-x8/tutorials/04.python-arduino-data-exchange/content.md b/content/hardware/04.pro/boards/portenta-x8/tutorials/04.python-arduino-data-exchange/content.md index 5088a916c8..bbcf9b798e 100644 --- a/content/hardware/04.pro/boards/portenta-x8/tutorials/04.python-arduino-data-exchange/content.md +++ b/content/hardware/04.pro/boards/portenta-x8/tutorials/04.python-arduino-data-exchange/content.md @@ -1,6 +1,7 @@ --- title: '04. Data Exchange Between Python® on Linux & Arduino Sketch' description: 'This tutorial will show you how to run a Python® application that exchanges data with an Arduino Sketch.' +difficulty: intermediate tags: - RPC - Python® @@ -98,7 +99,7 @@ temperature = rpc_client.call('temperature') The complete Python® application files are in the same package as the Arduino sketch (see above). Like in the previous step, upload the `python-sensor-rpc` folder to the X8 via `adb push /python-sensor-rpc /home/fio`. Log into the X8 via `adb shell`. Then navigate into the `python-sensor-rpc` folder and execute `sudo docker build . -t python-sensor-rpc`. When it is finished, you can run the container with `sudo docker-compose up`. After a few seconds, you should see the output from the Python application featuring the sensor readings on the M4 that exchanges through the RPC mechanism. The output should look similar to the following: -``` +```bash python-sensor-rpc_1 | ============================================ python-sensor-rpc_1 | == Portenta X8 Sensor reading == python-sensor-rpc_1 | ============================================ @@ -112,10 +113,12 @@ python-sensor-rpc_1 | Altitude: 311.0769348144531 Whenever you change anything in the Python® script on your computer, you will have to sync it back to the X8 and re-build the container. Following command sequence will help you to do this process: -``` +```bash # On your computer adb push python-sensor-rpc /home/fio +``` +```bash # On X8 sudo docker-compose down sudo docker build . -t python-sensor-rpc diff --git a/content/hardware/04.pro/boards/portenta-x8/tutorials/05.docker-container/content.md b/content/hardware/04.pro/boards/portenta-x8/tutorials/05.docker-container/content.md index 0a51c339f9..2d840c52db 100644 --- a/content/hardware/04.pro/boards/portenta-x8/tutorials/05.docker-container/content.md +++ b/content/hardware/04.pro/boards/portenta-x8/tutorials/05.docker-container/content.md @@ -43,7 +43,7 @@ In this tutorial, we will go through the steps of how to install, run and remove The Portenta X8 provides Docker CLI by default. The following command will help you verify if it is installed correctly: -``` +```bash docker -v ``` @@ -63,7 +63,7 @@ First, you will need to search for ["Hello World" container image](https://hub.d The following command must be used to pull the `hello-world` image. The Docker hub page for images has the instructions to pull the image and deploy the container. -``` +```bash docker pull hello-world ``` @@ -73,7 +73,7 @@ docker pull hello-world This is the command to begin the container instance. -``` +```bash docker run hello-world ``` @@ -85,7 +85,7 @@ docker run hello-world The following command will display the active containers and will show the `hello-world` container if it was able to run successfully. The `STATUS` message will let you know if the container is active or has finished operation depending on its purpose. -``` +```bash docker ps -a ``` @@ -93,7 +93,7 @@ docker ps -a The list of available images, including installed `hello-world` image, can be verified using the following command: -``` +```bash docker images ``` @@ -103,7 +103,7 @@ docker images You will need to obtain an assigned `CONTAINER ID` to be able to remove a container of your choice. The list of active containers provides this information. The remove (`rm`) command is then used with the desired container identifier to proceed with the removal process. -``` +```bash docker container rm ``` @@ -111,7 +111,7 @@ For this example, the command `docker ps -a` will show the `CONTAINER ID` of the Granted that this is the case, you will need to stop the container and verify with `STATUS` message that it has exited successfully. To do this, the following command is used: -``` +```bash docker stop ``` @@ -123,7 +123,7 @@ Using the `docker ps -a` after container removal, the `hello-world` container sh The same goes for the images if you would like to free some space. The removal command will now be as follows using `IMAGE ID` found within the image table: -``` +```bash docker rmi ``` diff --git a/content/hardware/04.pro/boards/portenta-x8/tutorials/06.waves-fleet-managment/content.md b/content/hardware/04.pro/boards/portenta-x8/tutorials/06.waves-fleet-managment/content.md index cc1a021a16..adf4fe68d1 100644 --- a/content/hardware/04.pro/boards/portenta-x8/tutorials/06.waves-fleet-managment/content.md +++ b/content/hardware/04.pro/boards/portenta-x8/tutorials/06.waves-fleet-managment/content.md @@ -46,19 +46,19 @@ For security purposes, we recommend that you rotate your FoundriesFactory keys. First, we will rotate the root keys. These are the most important keys, as they are used to create new target keys. Rotate them with the command: -``` +```bash fioctl keys rotate-root --initial /absolute/path/to/root.keys.tgz ``` Now we can rotate the target-only keys with following command: -``` +```bash fioctl keys rotate-targets /absolute/path/to/root.keys.tgz ``` And finally, for security reasons, we separating the target keys from the root using the following command: -``` +```bash fioctl keys copy-targets /absolute/path/to/root.keys.tgz /path/to/target.only.key.tgz ``` @@ -68,13 +68,13 @@ Now we can move on to creating our Wave. Before a Factory can start making production OTAs, an initial production Targets file must be created. For more information, please check out [here](https://docs.foundries.io/latest/reference-manual/ota/production-targets.html). We can begin by creating a dummy wave with the command: -``` +```bash fioctl wave init -k /absolute/path/to/targets.only.key.tgz populate-targets ``` Then complete the Wave with: -``` +```bash fioctl wave complete populate-targets ``` @@ -84,19 +84,19 @@ This creates a new `targets.json` file for production devices, subscribing to th Now we can start creating our Wave. The command below will create a Wave that is pushable to our devices. To create a Wave, we will sign it with a key, and here we will use the targets-only key. Then we give the Wave a name, target number, and tag. The `target number` needs to correspond to the target that we want the Wave to contain for our devices. The `tag` can be set as production or development. -``` +```bash fioctl wave init -k /absolute/path/to/targets.only.key.tgz ``` And then we can complete the Wave by passing the name to the "complete" function: -``` +```bash fioctl wave complete ``` If you decide to cancel, the following command will help you to do that: -``` +```bash fioctl waves cancel ``` @@ -108,13 +108,13 @@ After creating the Wave, you should see it on your Factory page. It should also With this command, we create our group, giving it a name and a short description: -``` +```bash fioctl config device-group create "" ``` The name and the short description should be as explicit and concise as possible to highlight its group. Now to assign a device to our group we use the following command: -``` +```bash fioctl device config group ``` @@ -124,7 +124,7 @@ On your FoundriesFactory device page, you can sort and view devices by the group To roll out our Wave to our device group, use the following command: -``` +```bash fioctl waves rollout ``` diff --git a/content/hardware/04.pro/boards/portenta-x8/tutorials/07.custom-container/content.md b/content/hardware/04.pro/boards/portenta-x8/tutorials/07.custom-container/content.md index abb7d43c44..2ea2c6d1aa 100644 --- a/content/hardware/04.pro/boards/portenta-x8/tutorials/07.custom-container/content.md +++ b/content/hardware/04.pro/boards/portenta-x8/tutorials/07.custom-container/content.md @@ -147,7 +147,7 @@ To pull or push repositories, you have to generate an API key. This is done by g Use the following command in git on your machine. To get the repository on your machine, replace "YOUR_FACTORY" with the name of your Factory. The "-b" parameter specifies a branch to checkout after cloning the repository. Running this command will get the container repository, where we will put our folder. -``` +```bash git clone https://source.foundries.io/factories/YOUR_FACTORY/containers.git -b devel ``` @@ -157,13 +157,13 @@ Put the "x8-custom-test" folder in the repository and push it with git. When you After the build finishes, it can take up to 10 minutes for your device to update over-the-air to this new version. You can inspect it via the "Devices" tab of your FoundriesFactory. After your device takes the update, navigate into the "x8-custom-test" folder, which should be located on your board now. This allows us to build our container with a simple command. Using ```docker build``` with a ```--tag``` will let us give the container a tag so we can easily keep track of what version of the build this is. -```python +```bash docker build --tag "x8-custom-test:latest" . ``` Now that it is built, we can run it with ```docker run```, finding it with the tag that we chose to give to the build we want to run. Here we need to enter the user information into the --user tag. This information is found inside the "docker-compose.yml" file. -```python +```bash docker run -it --rm --user "63" x8-custom-test:latest ``` @@ -171,19 +171,19 @@ docker run -it --rm --user "63" x8-custom-test:latest An option for testing an app or container is to use "docker-compose". It is helpful when we have a lot of settings in our "docker-compose.yml" file since we don't have to use those settings in the run argument with this method. First, navigate into the container folder. -```python +```bash cd /home/fio/x8-custom-test ``` This docker-compose command will start your application and register it as a systemd service that will persist even when a reboot occurs. So at the next boot, your docker-compose app will run automatically. -```python +```bash docker-compose up --detach ``` To stop the docker-compose app from running, use the following command: -```python +```bash docker-compose stop ``` @@ -191,14 +191,17 @@ docker-compose stop An alternative method to deploy the custom container is by using the Docker Hub platform. For this, it needs a [Docker Hub account](https://hub.docker.com/) to have your own repository to have the custom container uploaded. When you have the repository ready, the following command will let you upload the custom container image. -``` +```bash docker push HUB_USERNAME/x8-custom-test ``` The custom container image can now be found within `HUB_USERNAME` Docker Hub repository. The image can be accessed whenever any connectivity type grants access to the container image. To pull the image and deploy the container, you will need to connect the Portenta X8 via ADB and use following commands in sequence: -``` +```bash adb shell +``` + +```bash docker pull x8-custom-test ``` diff --git a/content/hardware/04.pro/boards/portenta-x8/tutorials/08.image-building/content.md b/content/hardware/04.pro/boards/portenta-x8/tutorials/08.image-building/content.md index c486284991..adca8dcac1 100644 --- a/content/hardware/04.pro/boards/portenta-x8/tutorials/08.image-building/content.md +++ b/content/hardware/04.pro/boards/portenta-x8/tutorials/08.image-building/content.md @@ -44,7 +44,7 @@ You will create a Docker image that has the dependencies needed to build your de First, clone the lmp-manifest repository with the following command: -``` +```bash git clone https://github.com/arduino/lmp-manifest.git ``` @@ -52,8 +52,11 @@ git clone https://github.com/arduino/lmp-manifest.git After cloning the lmp-manifest repository successfully, we will proceed to build the Docker Image using following command sequence: -``` +```bash cd lmp-manifest +``` + +```bash docker build -t yocto-build ./lmp-manifest ``` @@ -69,13 +72,13 @@ Once the *Docker Image* is ready, we will run the image with the `-v` argument t Run the `yocto-build` builder image with following command: -``` +```bash docker run -v :/dockerVolume -it yocto-build bash ``` We need to switch to the `builder` user with the following command after the previous process, and the password is **builder**: -``` +```bash su builder ``` @@ -89,7 +92,7 @@ Now that you are running inside the Docker Image, you can use tools like **git-r First, configure git with your credentials. They don't need to be the real ones but are required by `git-repo` to pull. The following commands can be used for this example: -``` +```bash git config --global user.email "you@example.com" git config --global user.name "Your Name" ``` @@ -98,7 +101,7 @@ git config --global user.name "Your Name" Change to the home directory, and initialize the repository using **repo**: -``` +```bash cd /dockerVolume repo init -u https://github.com/arduino/lmp-manifest.git -m arduino.xml -b release ``` @@ -107,7 +110,7 @@ repo init -u https://github.com/arduino/lmp-manifest.git -m arduino.xml -b relea Then pull the needed files with: -``` +```bash repo sync ``` @@ -149,7 +152,7 @@ You will be able to see similar output as following after the previous steps: To start building the image, following command is used: -``` +```bash bitbake lmp-partner-arduino-image ``` @@ -174,7 +177,7 @@ If possible, it is a good practice to understand the available threads of your c To flash your board, you will need to compile **lmp-mfgtool distro** to get additional tools. First, go into your home folder and change `DISTRO` following the command sequence: -``` +```bash cd .. DISTRO=lmp-mfgtool MACHINE=portenta-x8 . setup-environment echo "ACCEPT_FSL_EULA = \"1\"" >> conf/local.conf @@ -189,7 +192,7 @@ You should be able to see similar results as following image when successful: To compile and get the tools required, we will use following command: -``` +```bash bitbake mfgtool-files ``` @@ -205,7 +208,7 @@ After completion: After a successful build, save the needed files to the host volume you mounted with `docker run`. Use the following commands to copy the files to your storage unit: -``` +```bash cd .. mkdir ../../dockerVolume/flashing DEPLOY_FOLDER=../../dockerVolume/flashing @@ -232,7 +235,7 @@ In this tutorial, you have learned how to build a "builder" Docker image, get it ## Next Steps -Please follow the [Flashing tutorial](image-flashing) to flash your device with your custom image. You can use the files provided from this build to flash the Portenta X8 following the tutorial's steps. +Please follow the [Flashing tutorial](https://docs.arduino.cc/tutorials/portenta-x8/image-flashing/) to flash your device with your custom image. You can use the files provided from this build to flash the Portenta X8 following the tutorial's steps. ## Troubleshooting diff --git a/content/hardware/04.pro/boards/portenta-x8/tutorials/09.image-flashing/content.md b/content/hardware/04.pro/boards/portenta-x8/tutorials/09.image-flashing/content.md index 4d38954c4c..7a636d7eea 100644 --- a/content/hardware/04.pro/boards/portenta-x8/tutorials/09.image-flashing/content.md +++ b/content/hardware/04.pro/boards/portenta-x8/tutorials/09.image-flashing/content.md @@ -91,19 +91,19 @@ You must connect one USB-C® end to the Portenta X8 and the other (USB-C® or US If *Portenta Breakout* or *Portenta Max Carrier* is unavailable, the Portenta X8 can be configured for programming mode using a few command lines inside the Portenta X8's terminal via ADB. Please use the following commands in exact sequence while in the root environment with root permission. -```arduino +```bash echo 0 > /sys/block/mmcblk2boot0/force_ro ``` -```arduino +```bash dd if=/dev/zero of=/dev/mmcblk2boot0 bs=1024 count=4096 && sync ``` -```arduino +```bash echo 0 > /sys/block/mmcblk2boot1/force_ro ``` -```arduino +```bash dd if=/dev/zero of=/dev/mmcblk2boot1 bs=1024 count=4096 && sync ``` @@ -113,7 +113,7 @@ This sequence of commands will allow you to reset Portenta X8's bootloader secto To flash the Portenta X8, you need to begin by opening a terminal. Within the terminal, you need to change the directory to where the `mfgtool-files-portenta-x8` file is located using the `cd` command. Once it is inside the directory where the previous file is included, the following command is used: -``` +```bash uuu full_image.uuu ``` diff --git a/content/hardware/04.pro/boards/portenta-x8/tutorials/10.datalogging-iot/content.md b/content/hardware/04.pro/boards/portenta-x8/tutorials/10.datalogging-iot/content.md index 89c52e8457..acc65cf956 100644 --- a/content/hardware/04.pro/boards/portenta-x8/tutorials/10.datalogging-iot/content.md +++ b/content/hardware/04.pro/boards/portenta-x8/tutorials/10.datalogging-iot/content.md @@ -77,23 +77,23 @@ Let's start by configuring the MQTT broker! Let's start by creating a new directory in our Portenta X8 `home` directory called `mqtt`; inside this directory, we are going to make a file named `docker-compose.yml` using the following commands: -``` +```bash mkdir mqtt ``` -``` +```bash cd mqtt ``` -``` +```bash export TERM=xterm ``` -``` +```bash stty rows 36 cols 150 ``` -``` +```bash sudo vi docker-compose.yml ``` @@ -101,7 +101,7 @@ sudo vi docker-compose.yml Inside the VI editor, copy and paste the following: -``` +```yaml services: mqtt: container_name: mosquitto @@ -125,7 +125,7 @@ volumes: Save the file and exit the VI editor. Return to the `mqtt` directory and run the following command: -``` +```bash docker-compose up -d ``` @@ -133,13 +133,13 @@ The Mosquitto broker should be available on your Portenta X8 `IP address`. You c We should see inside the `mqtt` directory three folders (`config`, `data`, and `log`) and the `docker-compose.yml` file we created before. When we launch the Mosquitto container using the `docker-compose up -d` command, the logs will fill with errors about being unable to open the configuration file. To fix this issue, we can download a default configuration file and store it in the newly created `config` directory: -``` +```bash sudo wget https://raw.githubusercontent.com/eclipse/mosquitto/master/mosquitto.conf ``` Let's add the following lines at the end of the `config` file -``` +```bash # Listen on port 1883 listener 1883 listener 9001 @@ -159,7 +159,7 @@ Save the file and exit the VI editor. Now, let's restart the Mosquitto container Now, we need to manage password files by adding a user to a new password file. For this, we need to run the `sh` command in the mosquitto container with the mosquitto `CONTAINER ID` found before, as shown below: -``` +```bash docker exec -it CONTAINER ID sh ``` @@ -170,20 +170,20 @@ Let's dissect that command: Now, in the terminal session with the Mosquitto container, run the following command: -``` +```bash mosquitto_passwd -c /mosquitto/config/mosquitto.passwd guest ``` This command creates a new password file (`mosquitto.passwd`); if the file already exists, it will overwrite; `guest` is the username. After entering the `username` we want, we must define a password for the username and then exit the terminal session with the `exit` command. Now, let's return to the `config` directory; you should see now inside this directory the `mosquitto.passwd` file. Open the `mosquitto.config` file and add the following information to it: -``` +```bash password_file /mosquitto/config/mosquitto.passwd allow_anonymous true ``` The file should see now like this: -``` +```bash # Password file password_file /mosquitto/config/mosquitto.passwd allow_anonymous true @@ -225,7 +225,7 @@ When MQTTBox client connects to the local Mosquitto broker deployed in our Porte Node-RED is an open-source programming tool that connects hardware with API's and online services. It is a visual tool designed for Internet of Things devices and applications, but it can also be used for other applications. The simplest form to run Node-RED with Docker is by using the following command: -``` +```bash docker run -it -p 1880:1880 -v node_red_data:/data --name mynodered nodered/node-red ``` @@ -284,7 +284,7 @@ InfluxDB is an open-source, high-performance, time series database; with InfluxD The simplest form to run InfluxDB with Docker is by using the following command: -``` +```bash docker run --detach --name influxdb -p 8086:8086 influxdb:2.2.0 ``` @@ -353,7 +353,7 @@ Grafana is an open-source, multi-platform data analytics and interactive data vi The simplest form to run Grafana with Docker is by using the following command: -``` +```bash docker run -d --name=grafana -p 3000:3000 grafana/grafana ``` diff --git a/content/hardware/04.pro/boards/portenta-x8/tutorials/11.display-output-webgl/content.md b/content/hardware/04.pro/boards/portenta-x8/tutorials/11.display-output-webgl/content.md index 0a63f556f1..a279efd22f 100644 --- a/content/hardware/04.pro/boards/portenta-x8/tutorials/11.display-output-webgl/content.md +++ b/content/hardware/04.pro/boards/portenta-x8/tutorials/11.display-output-webgl/content.md @@ -46,7 +46,7 @@ There are two ways to get the container, either through `foundriesFactories` or If you use [Foundries.io](https://www.foundries.io), you can switch the current `target` of your device to `x-kiosk-imx8-webgl` by switching the app from a terminal on your computer: -``` +```bash //Change the app to an existing one fioctl devices config updates --apps "x-kiosk-imx8-webgl" -f @@ -71,7 +71,7 @@ If you downloaded the [portenta-containers repository](https://github.com/arduin Check the available Wi-Fi® access points by using the `nmcli de wifi` command. You will be able to see an output laying out `BSSID`, `SSID`, and its other elements. -``` +```bash nmcli de wifi //Output @@ -81,7 +81,7 @@ IN-USE BSSID SSID MODE CHAN RATE SIGNAL BAR The Wi-Fi® details can be saved using the following commands in sequence: -``` +```bash nmcli c add type wifi con-name ifname wlan0 ssid nmcli con modify wifi-sec.key-mgmt wpa-psk nmcli con modify wifi-sec.psk @@ -96,7 +96,7 @@ nmcli c delete If the LED is illuminating Green, then we know it has been correctly connected. If you want to check it in your terminal, you can use the following commands: -``` +```bash nmcli de //Output @@ -113,7 +113,7 @@ The output table will display information regarding active connections as well a The IP information of the board can be obtained using `ifconfig wlan0` command. It will show different IP information composed of `inet`, `netmask`, and `broadcastIP`. -``` +```bash ifconfig wlan0 //Output @@ -123,7 +123,7 @@ wlan0: flags=4163 mtu 1500 Test your IP connection by exiting the `adb shell`, you can use **CTRL+Z** or type `exit`, then try to connect through **SSH** using following command: -``` +```bash ssh fio@ ``` @@ -133,7 +133,7 @@ ssh fio@ You can push the container from your computer using a terminal on the container's directory. The following command is used to send the container to the Portenta X8: -``` +```bash scp fio@: ``` @@ -159,13 +159,13 @@ To get started in modifying the resolution of your display, connect to your Port At this point, you are ready to modify the `/etc/xdg/weston/weston.ini` file with `Vim` command as follows: -```arduino +```bash sudo vim /etc/xdg/weston/weston.ini ``` You can now add the following lines to the `weston.ini` file: -```arduino +```bash [output] name=DP-1 mode=98.00 1600 1680 1840 2080 758 761 771 787 -hsync +vsync @@ -178,7 +178,7 @@ If you obtained the container from **Foundries.io**, it will run automatically a On the other hand, if you copied from the repository, you will need to initialize with **docker** by accessing your Portenta X8 through SSH, going to the directory where you have copied it, and running it from that directory using following commands: -``` +```bash //Connect to your device ssh fio@ @@ -196,7 +196,7 @@ docker-compose stop It is possible to change the web output URL by editing the `docker-compose.yml` file, using the following commands: -``` +```bash //Connect to your device ssh fio@ @@ -226,6 +226,6 @@ In this tutorial, we went through how to connect the board and display something - If you tried to connect with `ssh` and you get a **fingerprint** issue, you will need to remove the IP and fingerprint on your `.ssh` file. On Windows, the file is located at `C:\Users\\.ssh\known_hosts` and try again with the **ssh** connection. An example is as follows: -``` +```bash $portenta-x8: ssh-keygen -R ``` diff --git a/content/hardware/04.pro/boards/portenta-x8/tutorials/12.multi-protocol-gateway/content.md b/content/hardware/04.pro/boards/portenta-x8/tutorials/12.multi-protocol-gateway/content.md index 20e6469afe..0d152e7067 100644 --- a/content/hardware/04.pro/boards/portenta-x8/tutorials/12.multi-protocol-gateway/content.md +++ b/content/hardware/04.pro/boards/portenta-x8/tutorials/12.multi-protocol-gateway/content.md @@ -1,6 +1,7 @@ --- title: '12. Multi-Protocol Gateway With Portenta X8 & Max Carrier' description: 'This tutorial shows how to setup a multi-protocol gateway environment on Portenta X8 using Max Carrier' +difficulty: intermediate tags: - Containers - Docker @@ -111,7 +112,7 @@ Before you begin diving deep into creating a Multi-protocol gateway, and having The `m4-proxy` is a service that manages data exchange between these layers. You can use the following command in the terminal to observe if the service is running correctly. -``` +```bash sudo journalctl -fu m4-proxy ``` @@ -119,7 +120,7 @@ Now you will implement RPC (Remote Procedure Call) to establish communication be **You will not be able to check messages via `Serial.println()` statements** to check if the Arduino sketch is running in the desired manner. You will have to use instead **`py-serialrpc`**, which is a service that will assist you in listening to those messages, and printing them on a console on the Linux layer. To have the service active, please download [this compressed file](assets/py-serialrpc.zip) to build and run the container on the Linux side of Portenta X8. Please execute the following commands to have the service running. -``` +```bash // Copy the decompressed files in ../adb/32.0.0 adb push py-serialrpc /home/fio adb shell @@ -134,7 +135,7 @@ cd /home/fio/py-serialrpc To access the logs of `py-serialrpc` service, while maintaining the same directory, execute the following command. -``` +```bash sudo docker-compose logs -f --tail 20 ``` @@ -142,7 +143,7 @@ sudo docker-compose logs -f --tail 20 If you have not configured internal Wi-Fi® connectivity within the system, please use the following command line: -``` +```bash nmcli device wifi connect "SSID" password "PASSWORD" ``` @@ -172,7 +173,7 @@ You can access the files [here](assets/Multi_Protocol_Gateway_X8.zip). Meanwhile The `docker-compose.yml` file is where you define permissions and settings for the involved container. This helps to define service dependencies and provide an easy configuration. It will allow to deploy and configure for multiple containers within its defined instructions. -``` +```yaml version: '3.6' services: @@ -195,7 +196,7 @@ In this scenario, we are granting the Portenta a major permission if it needs to Here you will define which additional components are required to run the script built inside the container. If you decide to develop further with a different protocol, you will have to add the package to be able to use them for development. -``` +```cpp msgpack-rpc-python pyserial==3.4 python-periphery==2.3.0 @@ -495,22 +496,22 @@ It is now time to make the multi-protocol gateway run and for this, you will nee You will need to have the files ready in a folder inside the `adb` directory within Arduino root. -``` +```bash C:\Users\#USERNAME#\AppData\Local\Arduino15\packages\arduino\tools\adb\32.0.0 ``` Having the files ready in that directory, you can use the following commands to push the files to the `fio` directory inside the Portenta X8. The second command will let you navigate inside the Portenta X8. -``` +```bash adb push multi-protocol-gateway /home/fio adb shell ``` You will now build the container using the following commands. The following command will tag the container with `Multi_Protocol_Gateway_X8` as its name. -``` +```bash cd ../home/fio/Multi_Protocol_Gateway_X8 -#Multi_Protocol_Gateway_X8 sudo docker build . -t multi_gateway +sudo docker build . -t multi_gateway ``` You will be able to see the following results when the image is built successfully. @@ -521,20 +522,23 @@ You will be able to see the following results when the image is built successful After a successful container build, you will run the image. To do that, you can use the following command. This command will immediately give an output in your terminal, telling you how the Python® script is running. If you wish to have it running in the background, please add the `-d` flag at the end of the command. -``` -#Multi_Protocol_Gateway_X8 sudo docker-compose up +```bash +sudo docker compose up ``` Finally, you will have the multi-protocol gateway running, which uses Wi-Fi® and LoRa® connectivity. Also, RPC for exchanging data between its layers. However, there are cases where you would wish to make changes by adding more functionalities, such as including Cat. M1 or NB-IoT to expand its communication spectrum. For this, you will need to stop the image. To stop the image from running, you can use the following command. -``` -#Multi_Protocol_Gateway_X8 sudo docker-compose down +```bash +sudo docker compose down ``` Getting to know the status of the image is also crucial as it is the indicator of the state of operation. The following command brings up **active** containers and shows the status if the container restarted or stopped due to certain reasons. The second command lists built images and it will show you the components that go with the main image that you're building. -``` +```bash docker ps -a +``` + +```bash docker images ``` diff --git a/content/hardware/04.pro/boards/portenta-x8/tutorials/13.wordpress-webserver/content.md b/content/hardware/04.pro/boards/portenta-x8/tutorials/13.wordpress-webserver/content.md index 51a50c88d8..b56e05fabe 100644 --- a/content/hardware/04.pro/boards/portenta-x8/tutorials/13.wordpress-webserver/content.md +++ b/content/hardware/04.pro/boards/portenta-x8/tutorials/13.wordpress-webserver/content.md @@ -44,7 +44,7 @@ This container can run on the Portenta X8's architecture. To start using these c In this section, you can find the complete **docker-compose.yml** file that we will be using for this tutorial. -``` +```yaml version: "3.9" services: @@ -90,13 +90,13 @@ First, we create a directory where we want to add our **docker-compose.yml** fil To create the file, we can use `cat > docker-compose.yml`, this will create the file, so you can copy the content of the file from above and paste it. Push enter once to go to a new line and press `ctrl C` to exit the file editor. To copy the file from your computer onto the device use: -``` +```bash adb push /home/fio/wordpress-test ``` Alternatively, you could place the `docker-compose.yml` file inside the `wordpress-test` directory and push the file using the following command: -``` +```bash adb push .\wordpress-test\ /home/fio ``` @@ -120,7 +120,7 @@ When the command is executed it will start installing the **WordPress** and **Ma To connect to the WordPress setup site, you simply need to access it with your Portenta X8's unique id and port. So we can use the following address format: -``` +```bash http://portenta-x8-.local: ``` @@ -142,13 +142,13 @@ If you want to remove the container, you have to go to ```/home/fio/wordpress-te Remove the container but preserves your WordPress database: -``` +```bash docker compose down ``` Remove the container and the database: -``` +```bash docker compose down --volumes ``` diff --git a/content/hardware/04.pro/carriers/portenta-hat-carrier/tutorials/user-manual/content.md b/content/hardware/04.pro/carriers/portenta-hat-carrier/tutorials/user-manual/content.md index 948e0ac610..da0a483e6f 100644 --- a/content/hardware/04.pro/carriers/portenta-hat-carrier/tutorials/user-manual/content.md +++ b/content/hardware/04.pro/carriers/portenta-hat-carrier/tutorials/user-manual/content.md @@ -275,7 +275,7 @@ The following commands will help you set and control the GPIO3, which connects t Let us begin with the commands to access the Portenta X8's shell: -``` +```bash adb shell sudo su - ``` @@ -290,37 +290,37 @@ The aforementioned commands allow you to access the Portenta X8's shell with ele Subsequently, use the following command to export the gpio device located under `/sys/class/`. In this context, _GPIO3_ corresponds to _GPIO 163_, which is associated with the user-programmable LED we aim to access. -``` +```bash echo 163 > /sys/class/gpio/export ``` Using the following commands will help you verify the available GPIO elements. -``` +```bash ls /sys/class/gpio ``` It lists all the GPIOs previously initialized by the system. Meanwhile, the following command lists the details of _GPIO 163_, corresponding to _GPIO3_, which was previously imported: -``` +```bash ls /sys/class/gpio/gpio163 ``` The GPIO can now be configured verifying that GPIO3 elements were successfully exported. The following command with the `I/O` field will set the I/O state of the pin. The pin can be set either as Input using `in` or Output using `out` value. -``` +```bash echo >/sys/class/gpio/gpio163/direction ``` For this example, we will replace the `` field with `out` value within the following command: -``` +```bash echo out >/sys/class/gpio/gpio163/direction ``` To verify the pin setting, use the `cat` command. If correctly configured, this command will display the set value: -``` +```bash cat /sys/class/gpio/gpio163/direction ``` @@ -330,26 +330,25 @@ To set the pin High, you need to assign the value `1`, or `0` to set the pin `HI To set the pin to `HIGH`: -``` +```bash echo 1 >/sys/class/gpio/gpio163/value -echo 0 >/sys/class/gpio/gpio163/value ``` To set the pin to `LOW`: -``` +```bash echo 0 >/sys/class/gpio/gpio163/value ``` If you have finished controlling the GPIO, you can use the following command to _unexport_ it, ensuring it no longer appears in the userspace: -``` +```bash echo 163 >/sys/class/gpio/unexport ``` To confirm that the specified GPIO has been properly unexported, you can use the following command: -``` +```bash ls /sys/class/gpio ``` @@ -554,9 +553,9 @@ This sub-section introduces the essential hardware connection points and interfa The Portenta X8, H7, and C33 enhance functionality through High-Density connectors. For a comprehensive understanding of these connectors, please refer to the complete pinout documentation for each Portenta model. -- [Complete Portenta X8 pinout information](https://docs.arduino.cc/static/019dd9ac3b08f48192dcb1291d37aab9/ABX00049-full-pinout.pdf) -- [Complete Portenta H7 pinout information](https://docs.arduino.cc/static/2d38006e78d2abc588a80f12bb9c0c70/ABX00042-full-pinout.pdf) -- [Complete Portenta C33 pinout information](https://docs.arduino.cc/static/903c16295f3bf076c2ed23eb1b38791c/ABX00074-full-pinout.pdf) +- [Complete Portenta X8 pinout information](https://docs.arduino.cc/resources/pinouts/ABX00049-full-pinout.pdf) +- [Complete Portenta H7 pinout information](https://docs.arduino.cc/resources/pinouts/ABX00042-full-pinout.pdf) +- [Complete Portenta C33 pinout information](https://docs.arduino.cc/resources/pinouts/ABX00074-full-pinout.pdf) ### USB Interface @@ -969,13 +968,13 @@ Please, refer to the [board pinout section](#pinout) of the user manual to find Using the Portenta X8, you can obtain a voltage reading that falls within a _0 - 65535_ range. This reading corresponds to a voltage between 0 and 3.3 V. To fetch this reading, use the command: -``` +```bash cat /sys/bus/iio/devices/iio\:device0/in_voltage_raw ``` Where `` is the number of the analog pin to read. For example, in the case of `A0`: -``` +```bash cat /sys/bus/iio/devices/iio\:device0/in_voltage0_raw ``` @@ -1123,14 +1122,14 @@ The following commands, using the Portenta X8 environment, allow you to capture First, we need to set environment variables and specify the overlays for our camera and board setup: -``` +```bash fw_setenv carrier_custom 1 fw_setenv overlays ov_som_lbee5kl1dx ov_som_x8h7 ov_carrier_rasptenta_base ov_carrier_rasptenta_ov5647_camera_mipi ``` The U-Boot environment variables are modified with the above commands and `fw_setenv` sets the changes which are already persistent. The following command sequences can be used on the U-boot shell. -``` +```bash setenv carrier_custom 1 setenv overlays ov_som_lbee5kl1dx ov_som_x8h7 ov_carrier_rasptenta_base ov_carrier_rasptenta_ov5647_camera_mipi saveenv @@ -1138,28 +1137,28 @@ saveenv Define the runtime directory for `Wayland` and load the necessary module for the OV5647 camera: -``` +```bash export XDG_RUNTIME_DIR=/run # location of wayland-0 socket modprobe ov5647_mipi ``` Before capturing or streaming, we need to check the supported formats and controls of the connected video device: -``` +```bash v4l2-ctl --list-formats-ext --device /dev/video0 v4l2-ctl -d /dev/video0 --list-ctrls ``` Using `GStreamer`, capture a single frame in `JPEG` format: -``` +```bash export GST_DEBUG=3 gst-top-1.0 gst-launch-1.0 -v v4l2src device=/dev/video0 num-buffers=1 ! "video/x-bayer, format=bggr, width=640, height=480, bpp=8, framerate=30/1" ! bayer2rgbneon reduce-bpp=t ! jpegenc ! filesink location=/tmp/test.jpg ``` This command allows the user to capture one frame and save it as `/tmp/test.jpg`. The following command is used to stream video at 30FPS for approximately 10 seconds using `GStreamer`: -``` +```bash gst-top-1.0 gst-launch-1.0 -v v4l2src device=/dev/video0 num-buffers=300 ! "video/x-bayer, format=bggr, width=640, height=480, bpp=8, framerate=30/1" ! bayer2rgbneon reduce-bpp=t ! queue ! waylandsink ``` @@ -1192,31 +1191,31 @@ The fan's speed can be controlled using the following code sequence when you are Export the PWM channel: -``` +```bash echo 9 > /sys/class/pwm/pwmchip0/export ``` Set the PWM period. By defining the period, you determine the duration of one PWM "cycle". Here, we set it to 100,000, representing 100,000 nanoseconds or 100 microseconds: -``` +```bash echo 100000 > /sys/class/pwm/pwmchip0/pwm9/period ``` The following command sets the "ON" duration within the given period. A 50% duty cycle, for instance, means the signal is on for half the period and off for the other half: -``` +```bash echo 50000 > /sys/class/pwm/pwmchip0/pwm9/duty_cycle #50% duty ``` We will then enable the PWM channel exported previously: -``` +```bash echo 1 > /sys/class/pwm/pwmchip0/pwm9/enable ``` You can use the following command if you want to monitor the temperature of the device or environment (optional step): -``` +```bash cat /sys/devices/virtual/thermal/thermal_zone0/temp ``` @@ -1258,25 +1257,25 @@ if __name__ == "__main__": If you are logged in with normal privileges, the speed of the fan can be controlled using the following instruction sequence. Export the PWM channel using the command below: -``` +```bash echo 9 | sudo tee /sys/class/pwm/pwmchip0/export ``` Set the PWM period: -``` +```bash echo 100000 | sudo tee /sys/class/pwm/pwmchip0/pwm9/period ``` Determine the duty cycle at 50%: -``` +```bash echo 50000 | sudo tee /sys/class/pwm/pwmchip0/pwm9/duty_cycle #50% duty ``` And activate the PWM channel: -``` +```bash echo 1 | sudo tee /sys/class/pwm/pwmchip0/pwm9/enable ``` @@ -1856,13 +1855,13 @@ chmod 700 ~/bin/iperf3 Once installed, _iperf3_ will be ready on your device. To ensure it operates without issues, run: -``` +```bash chmod +x iperf3 ``` By following the provided instructions, the tool should be located in the Linux shell at: -``` +```bash # ~bin/ ``` @@ -3010,20 +3009,20 @@ Please, refer to the [board pinout section](#pinout) of the user manual to find With admin (root) access, you can use the following commands within the shell for the Portenta X8: -``` +```bash sudo modprobe spidev ``` Present sequence of commands is used to enable the SPI device interface on the Portenta X8. After adding the `spidev` module to the system's configuration, the system is rebooted to apply the changes. -``` +```bash echo "spidev" | sudo tee > /etc/modules-load.d/spidev.conf sudo systemctl reboot ``` Following section configures a service named `my_spi_service` to use the SPI device available at `/dev/spidev0.0`. -``` +```yaml services: my_spi_service: devices: @@ -3141,20 +3140,20 @@ Please, refer to the [pinout section](#pinout) of the user manual to find them o For the Portenta X8, it is possible to use the following commands within the shell when you have admin (root) access: -``` +```bash sudo modprobe i2c-dev ``` Present sequence of commands is used to enable the I2C device interface on the Portenta X8. After adding the `i2c-dev` module to the system's configuration, the system is rebooted to apply the changes. -``` +```bash echo "i2c-dev" | sudo tee > /etc/modules-load.d/i2c-dev.conf sudo systemctl reboot ``` Following section configures a service named `my_i2c_service` to use the I2C device available at `/dev/i2c-3`. -``` +```yaml services: my_i2c_service: devices: @@ -3327,7 +3326,7 @@ Since the CAN bus pins are integrated within the High-Density connectors, they a For the Portenta X8, when you have admin (root) access, you can execute the following commands within the shell to control the CAN bus protocol. The CAN transceiver can be enabled using the following command -``` +```bash echo 164 > /sys/class/gpio/export && echo out > /sys/class/gpio/gpio164/direction && echo 0 > /sys/class/gpio/gpio164/value ``` @@ -3335,13 +3334,13 @@ This command sequence activates the CAN transceiver. It does so by exporting _GP For Portenta X8, it is possible to use the following commands: -``` +```bash sudo modprobe can-dev ``` The necessary modules for CAN (Controller Area Network) support on the Portenta X8 are loaded. The `can-dev` module is added to the system configuration, after which the system is rebooted to apply the changes. -``` +```bash echo "can-dev" | sudo tee > /etc/modules-load.d/can-dev.conf sudo systemctl reboot ``` @@ -3642,8 +3641,11 @@ Please, refer to the board pinout section of the user manual to find them on the For the Portenta X8, when you have admin (root) access, you can execute the command `ls /dev/ttyUSB* /dev/ttyACM* /dev/ttymxc*` within the shell to list available serial ports in Linux. Typically, USB serial devices could appear as _/dev/ttyUSBx_, _/dev/ttyACMx_, or _/dev/ttymxcx_. -``` +```bash ls /dev/ttyUSB* /dev/ttyACM* /dev/ttymxc* +``` + +```bash /dev/ttymxc2 // Something similar ``` diff --git a/content/hardware/04.pro/carriers/portenta-max-carrier/essentials.md b/content/hardware/04.pro/carriers/portenta-max-carrier/essentials.md index 207fa80be4..149dc3d775 100644 --- a/content/hardware/04.pro/carriers/portenta-max-carrier/essentials.md +++ b/content/hardware/04.pro/carriers/portenta-max-carrier/essentials.md @@ -14,7 +14,7 @@ The complete Arduino sketches from the Pro tutorials. - + Read files and/or output sound. diff --git a/content/hardware/04.pro/carriers/portenta-max-carrier/tutorials/x8-getting-started/content.md b/content/hardware/04.pro/carriers/portenta-max-carrier/tutorials/x8-getting-started/content.md index b82f004beb..d2626dc6ec 100644 --- a/content/hardware/04.pro/carriers/portenta-max-carrier/tutorials/x8-getting-started/content.md +++ b/content/hardware/04.pro/carriers/portenta-max-carrier/tutorials/x8-getting-started/content.md @@ -62,7 +62,8 @@ To make use of the Portenta Max Carrier you will need to power it through either The Portenta Max Carrier equips two different memory units onboard, a flash memory and a mini SD card slot. The Flash memory onboard the Portenta Max Carrier has 2 MB of storage via QSPI. The Mini SD card interface makes it possible to extend the storage size. It can be used to process log data, from sensors or programmed on-board computer registry. If you have an SD card connected to the Max Carrier you can create a directory on the SD card by using the following command: -```python + +```bash mkdir -p /tmp/sdcard ``` @@ -73,7 +74,8 @@ The Portenta Max Carrier features the CS42L52 from Cirrus Logic®, a stereo CODE ![Audio connections on the Portenta Max Carrier](assets/audio-interface-max-carrier.svg) To use this feature with Linux, you could use something like the [alsa-lib](https://github.com/alsa-project/alsa-lib). You can run it with this command: -```python + +```bash apk update && apk add alsa-utils alsa-utils-doc alsa-lib alsaconf alsa-ucm-conf && speaker-test -t sine -f 440 -c 2 -r 48000 -D hw:0,0 ``` @@ -100,7 +102,8 @@ For more in-depth information about LoRa® and LoRaWAN®, please read [The Ardui The Gigabit Ethernet physical interface is directly connected to the high-density connector to the Portenta X8 board. The connector includes an LED for indicating activity using the color orange, there is also a LED using the color green to indicate speed. To access the 1 Gbps connection Ethernet peripheral on the Max Carrier you can use the following command: -```python + +```bash ETH_1G=`dmesg | grep "fec 30be0000.ethernet eth0: Link is Up - 1Gbps/Full"` ``` diff --git a/content/hardware/04.pro/shields/portenta-cat-m1-nb-iot-gnss-shield/tutorials/cheat-sheet/cheat-sheet.md b/content/hardware/04.pro/shields/portenta-cat-m1-nb-iot-gnss-shield/tutorials/cheat-sheet/cheat-sheet.md index 38795e7bd6..5f7d43cae3 100644 --- a/content/hardware/04.pro/shields/portenta-cat-m1-nb-iot-gnss-shield/tutorials/cheat-sheet/cheat-sheet.md +++ b/content/hardware/04.pro/shields/portenta-cat-m1-nb-iot-gnss-shield/tutorials/cheat-sheet/cheat-sheet.md @@ -1,6 +1,7 @@ --- title: 'Arduino® Portenta Cat. M1/NB IoT GNSS Shield Cheat Sheet' description: 'Learn how to set up the Portenta Cat. M1/NB IoT GNSS Shield and get a quick overview of its functionality. Obtain information regarding pins and how to use the different communication technologies.' +difficulty: beginner tags: - Installation - Cat. M1 diff --git a/content/hardware/04.pro/shields/portenta-vision-shield/essentials.md b/content/hardware/04.pro/shields/portenta-vision-shield/essentials.md index 2e0a8dd9c4..1877ca206e 100644 --- a/content/hardware/04.pro/shields/portenta-vision-shield/essentials.md +++ b/content/hardware/04.pro/shields/portenta-vision-shield/essentials.md @@ -6,7 +6,7 @@ - + A library for sending and receiving data using LoRa® radios. diff --git a/content/hardware/04.pro/shields/portenta-vision-shield/tech-specs.yml b/content/hardware/04.pro/shields/portenta-vision-shield/tech-specs.yml index 1b80ad8cb0..fed85d2cda 100644 --- a/content/hardware/04.pro/shields/portenta-vision-shield/tech-specs.yml +++ b/content/hardware/04.pro/shields/portenta-vision-shield/tech-specs.yml @@ -1,9 +1,9 @@ Shield: Name: Arduino® Portenta Vision Shield SKU (Ethernet): ASX00021 - SKU (LoRa): ASX00026 + SKU (LoRa®): ASX00026 Connectivity: - LoRa: 868/915MHz ABZ-093 LoRa® Module with ARM Cortex-M0+ + LoRa®: 868/915MHz ABZ-093 LoRa® Module with ARM Cortex-M0+ Sensors: Microphone: MP34DT05 Camera: Himax HM-01B0 camera module diff --git a/content/hardware/04.pro/shields/portenta-vision-shield/tutorials/speech-recognition-engine/content.md b/content/hardware/04.pro/shields/portenta-vision-shield/tutorials/speech-recognition-engine/content.md index 65bcad4f8e..2c503e7d00 100644 --- a/content/hardware/04.pro/shields/portenta-vision-shield/tutorials/speech-recognition-engine/content.md +++ b/content/hardware/04.pro/shields/portenta-vision-shield/tutorials/speech-recognition-engine/content.md @@ -56,7 +56,7 @@ In case you are interested in unlocking the full potential of the tool, the tuto To use the Arduino Speech Recognition Engine, you will need one of the following boards: -- [Arduino Portenta H7 (any variant)](https://store.arduino.cc/portenta-h7) + Portenta Vision Shield ([LoRa](https://store.arduino.cc/portenta-vision-shield-lora) or [Ethernet](https://store.arduino.cc/portenta-vision-shield)) +- [Arduino Portenta H7 (any variant)](https://store.arduino.cc/portenta-h7) + Portenta Vision Shield ([LoRa](https://store.arduino.cc/products/arduino-portenta-vision-shield-lora%C2%AE) or [Ethernet](https://store.arduino.cc/products/arduino-portenta-vision-shield-ethernet)) - [Arduino Nano 33 BLE Sense Rev 1](https://store.arduino.cc/products/arduino-nano-33-ble-sense) - [Arduino Nano 33 BLE Sense Rev 2](https://store.arduino.cc/products/nano-33-ble-sense-rev2) - [Arduino Nano RP2040](https://store.arduino.cc/products/arduino-nano-rp2040-connect) @@ -91,7 +91,7 @@ There are three libraries, you will need to install one or another depending on Go to the Library Manager, search for the library that you need for your board and install it. -In case you need more instructions about how to install libraries, visit: https://docs.arduino.cc/hacking/software/Libraries +In case you need more instructions about how to install libraries, read this [guide](https://docs.arduino.cc/software/ide-v2/tutorials/ide-v2-installing-a-library/). #### Get The Serial Number diff --git a/content/hardware/05.pro-solutions/solutions-and-kits/portenta-machine-control/tutorials/pmc-opta-temp-ctrl/content.md b/content/hardware/05.pro-solutions/solutions-and-kits/portenta-machine-control/tutorials/pmc-opta-temp-ctrl/content.md index 86eb5e5181..b0e29a806d 100644 --- a/content/hardware/05.pro-solutions/solutions-and-kits/portenta-machine-control/tutorials/pmc-opta-temp-ctrl/content.md +++ b/content/hardware/05.pro-solutions/solutions-and-kits/portenta-machine-control/tutorials/pmc-opta-temp-ctrl/content.md @@ -153,7 +153,7 @@ Inside the `Project` window, double-click on the `Main` program located under `T In the code section, you have to write the following code: -``` +```cpp temp0 := sysTempProbes[0].temperature; temp_send := temp0 * 100.00; ``` @@ -262,7 +262,7 @@ Now that we have created the global variable where we are going to store the tem In the code window, paste the next code: -``` +```cpp //Set the temperature threshold to trigger on the relay threshold := 30.00; diff --git a/content/hardware/05.pro-solutions/solutions-and-kits/portenta-machine-control/tutorials/rtd-thermocouple-pmc/content.md b/content/hardware/05.pro-solutions/solutions-and-kits/portenta-machine-control/tutorials/rtd-thermocouple-pmc/content.md index eb0bc21b55..2f761b44b4 100644 --- a/content/hardware/05.pro-solutions/solutions-and-kits/portenta-machine-control/tutorials/rtd-thermocouple-pmc/content.md +++ b/content/hardware/05.pro-solutions/solutions-and-kits/portenta-machine-control/tutorials/rtd-thermocouple-pmc/content.md @@ -187,7 +187,7 @@ If everything is correct, when you double-click on **Global_vars**, a table with Now that we have created the variables, we have to make it work by defining the variables in the **main** program code. To do this, double-click on "main" and write the next lines in the code box: -``` +```cpp TP00 := sysTempProbes[0]; temp0:= systempProbes[0].temperature; ``` diff --git a/content/hardware/05.pro-solutions/solutions-and-kits/wisgate-edge-lite-2/tutorials/update-firmware/assets/wisgate-essentials.png b/content/hardware/05.pro-solutions/solutions-and-kits/wisgate-edge-lite-2/tutorials/update-firmware/assets/wisgate-essentials.png deleted file mode 100644 index 9ddbc0971d..0000000000 Binary files a/content/hardware/05.pro-solutions/solutions-and-kits/wisgate-edge-lite-2/tutorials/update-firmware/assets/wisgate-essentials.png and /dev/null differ diff --git a/content/hardware/05.pro-solutions/solutions-and-kits/wisgate-edge-lite-2/tutorials/update-firmware/content.md b/content/hardware/05.pro-solutions/solutions-and-kits/wisgate-edge-lite-2/tutorials/update-firmware/content.md index a8d2d49f1e..be6d19d4b4 100644 --- a/content/hardware/05.pro-solutions/solutions-and-kits/wisgate-edge-lite-2/tutorials/update-firmware/content.md +++ b/content/hardware/05.pro-solutions/solutions-and-kits/wisgate-edge-lite-2/tutorials/update-firmware/content.md @@ -28,17 +28,15 @@ The goals of this article are: ## Requirements -We assume that you already connected the gateway to your local network, and you can connect to it using your favourite method. +We assume that you already connected the gateway to your local network, and you can connect to it using your favorite method. -You can check out the needed steps on the [Getting Started tutorial](./getting-started). +You can check out the needed steps on the [Getting Started tutorial](../getting-started/). ## Instructions ### Download the Latest Firmware Version -Go to your gateway's ([WisGate Edge Lite 2](../../hardware/wisgate-edge-lite-2#essentials) or [WisGate Edge Pro](../../hardware/wisgate-edge-pro#essentials)) Arduino Docs Product Page. On the page go to the Essentials section and click the **Latest Firmware Version** link. - -![Product Page Essentials section](assets/wisgate-essentials.png) +To update the firmware of your product click here to download the [**Latest Firmware Version**](https://content.arduino.cc/assets/WisGateOS_2.1.8_ARDUINO_b108_RAK636.zip). You will get a zip file called `WisGateOS__ARDUINO_RAK.zip`. Unzip it and you will have the required firmware files. diff --git a/content/hardware/06.nicla/boards/nicla-sense-me/tutorials/cli-tool/content.md b/content/hardware/06.nicla/boards/nicla-sense-me/tutorials/cli-tool/content.md index 720b2892a8..82de62777f 100644 --- a/content/hardware/06.nicla/boards/nicla-sense-me/tutorials/cli-tool/content.md +++ b/content/hardware/06.nicla/boards/nicla-sense-me/tutorials/cli-tool/content.md @@ -99,27 +99,37 @@ You can set the rate and the latency of each sensor, please check the [Nicla Sen The syntax for configuring a sensor is: -`bhy sensor config -p -sensor -rate -latency ` +```bash +bhy sensor config -p -sensor -rate -latency +``` For example, if you want to configure the **Gyroscope passthrough** which has the sensor ID #**10** connected on the port `COM01` with a rate of 1Hz and a latency of 0ms, you will enter: -`bhy sensor config -p /dev/ttyACM2 -sensor 10 -rate 1 -latency 0` +```bash +bhy sensor config -p /dev/ttyACM2 -sensor 10 -rate 1 -latency 0 +``` Now it is configured to output the reading every second (1Hz). ### Disable If you set the latency and rate to **0**, the sensor will be disabled and it will not output any data. -`bhy sensor config -p -sensor -rate 0 -latency 0` +```bash +bhy sensor config -p -sensor -rate 0 -latency 0 +``` ### Read Data From a Sensor If you want to read data from a sensor and print it once, you can use: -`bhy sensor read -p ` +```bash +bhy sensor read -p +``` To do it continuously, you can add the parameter `-live` -`bhy sensor read -live -p ` +```bash +bhy sensor read -live -p +``` ## Using a Passthrough Board with CLI When you have a firmware for the BHI module or a sketch for the MCU already compiled in a **.bin** file, you can upload them through a MKR or Portenta board directly using the terminal. You need to upload a passthrough sketch to the MKR or Portenta board, allowing the Nicla to communicate with the computer through the host board. The sketch can be found at **Examples > Arduino_BHY_HOST > Passthrough.ino**. @@ -129,12 +139,16 @@ You then need to connect the Nicla board to the desired passthrough board either ### Upload a Sketch Syntax for uploading a sketch: -`bhy dfu -t nicla -bin -p ` +```bash +bhy dfu -t nicla -bin -p +``` ### Updating the Firmware Syntax for uploading the firmware: -`bhy dfu -t bhi -bin -p ` +```bash +bhy dfu -t bhi -bin -p +``` ## Conclusion diff --git a/content/hardware/06.nicla/boards/nicla-sense-me/tutorials/web-ble-dashboard/content.md b/content/hardware/06.nicla/boards/nicla-sense-me/tutorials/web-ble-dashboard/content.md index 4236368fde..9ac87f9a86 100644 --- a/content/hardware/06.nicla/boards/nicla-sense-me/tutorials/web-ble-dashboard/content.md +++ b/content/hardware/06.nicla/boards/nicla-sense-me/tutorials/web-ble-dashboard/content.md @@ -1,6 +1,7 @@ --- title: 'Displaying on-Board Sensor Values on a WebBLE Dashboard' coverImage: hero-banner.svg +difficulty: beginner tags: - Bluetooth® - WEB-BLE @@ -54,216 +55,217 @@ If you use the Web Editor to upload the [sketch](https://create.arduino.cc/edito These libraries can be found within the Library Manager in the Arduino IDE, or it can be downloaded separately following the links attached within required hardware and software section. If you use a local IDE, you can copy & paste the following sketch: -```arduino - /* - Arduino Nicla Sense ME WEB Bluetooth® Low Energy Sense dashboard demo - Hardware required: https://store.arduino.cc/nicla-sense-me - 1) Upload this sketch to the Arduino Nano Bluetooth® Low Energy sense board - 2) Open the following web page in the Chrome browser: - https://arduino.github.io/ArduinoAI/NiclaSenseME-dashboard/ - 3) Click on the green button in the web page to connect the browser to the board over Bluetooth® Low Energy - Web dashboard by D. Pajak - Device sketch based on example by Sandeep Mistry and Massimo Banzi - Sketch and web dashboard copy-fixed to be used with the Nicla Sense ME by Pablo Marquínez - */ - - #include "Nicla_System.h" - #include "Arduino_BHY2.h" - #include - - #define BLE_SENSE_UUID(val) ("19b10000-" val "-537e-4f6c-d104768a1214") - - const int VERSION = 0x00000000; - - BLEService service(BLE_SENSE_UUID("0000")); - - BLEUnsignedIntCharacteristic versionCharacteristic(BLE_SENSE_UUID("1001"), BLERead); - BLEFloatCharacteristic temperatureCharacteristic(BLE_SENSE_UUID("2001"), BLERead); - BLEUnsignedIntCharacteristic humidityCharacteristic(BLE_SENSE_UUID("3001"), BLERead); - BLEFloatCharacteristic pressureCharacteristic(BLE_SENSE_UUID("4001"), BLERead); - - BLECharacteristic accelerometerCharacteristic(BLE_SENSE_UUID("5001"), BLERead | BLENotify, 3 * sizeof(float)); // Array of 3x 2 Bytes, XY - BLECharacteristic gyroscopeCharacteristic(BLE_SENSE_UUID("6001"), BLERead | BLENotify, 3 * sizeof(float)); // Array of 3x 2 Bytes, XYZ - BLECharacteristic quaternionCharacteristic(BLE_SENSE_UUID("7001"), BLERead | BLENotify, 4 * sizeof(float)); // Array of 4x 2 Bytes, XYZW - - BLECharacteristic rgbLedCharacteristic(BLE_SENSE_UUID("8001"), BLERead | BLEWrite, 3 * sizeof(byte)); // Array of 3 bytes, RGB - - BLEFloatCharacteristic bsecCharacteristic(BLE_SENSE_UUID("9001"), BLERead); - BLEIntCharacteristic co2Characteristic(BLE_SENSE_UUID("9002"), BLERead); - BLEUnsignedIntCharacteristic gasCharacteristic(BLE_SENSE_UUID("9003"), BLERead); - - // String to calculate the local and device name - String name; - - Sensor temperature(SENSOR_ID_TEMP); - Sensor humidity(SENSOR_ID_HUM); - Sensor pressure(SENSOR_ID_BARO); - Sensor gas(SENSOR_ID_GAS); - SensorXYZ gyroscope(SENSOR_ID_GYRO); - SensorXYZ accelerometer(SENSOR_ID_ACC); - SensorQuaternion quaternion(SENSOR_ID_RV); - SensorBSEC bsec(SENSOR_ID_BSEC); - - void setup(){ - Serial.begin(115200); - - Serial.println("Start"); - - nicla::begin(); - nicla::leds.begin(); - nicla::leds.setColor(green); - - //Sensors initialization - BHY2.begin(NICLA_STANDALONE); - temperature.begin(); - humidity.begin(); - pressure.begin(); - gyroscope.begin(); - accelerometer.begin(); - quaternion.begin(); - bsec.begin(); - gas.begin(); - - if (!BLE.begin()){ - Serial.println("Failed to initialized BLE!"); - - while (1) - ; - } - - String address = BLE.address(); - - Serial.print("address = "); - Serial.println(address); - - address.toUpperCase(); - - name = "NiclaSenseME-"; - name += address[address.length() - 5]; - name += address[address.length() - 4]; - name += address[address.length() - 2]; - name += address[address.length() - 1]; - Serial.print("name = "); - Serial.println(name); +```arduino +/* +Arduino Nicla Sense ME WEB Bluetooth® Low Energy Sense dashboard demo +Hardware required: https://store.arduino.cc/nicla-sense-me +1) Upload this sketch to the Arduino Nano Bluetooth® Low Energy sense board +2) Open the following web page in the Chrome browser: +https://arduino.github.io/ArduinoAI/NiclaSenseME-dashboard/ +3) Click on the green button in the web page to connect the browser to the board over Bluetooth® Low Energy +Web dashboard by D. Pajak +Device sketch based on example by Sandeep Mistry and Massimo Banzi +Sketch and web dashboard copy-fixed to be used with the Nicla Sense ME by Pablo Marquínez +*/ + +#include "Nicla_System.h" +#include "Arduino_BHY2.h" +#include + +#define BLE_SENSE_UUID(val) ("19b10000-" val "-537e-4f6c-d104768a1214") + +const int VERSION = 0x00000000; + +BLEService service(BLE_SENSE_UUID("0000")); + +BLEUnsignedIntCharacteristic versionCharacteristic(BLE_SENSE_UUID("1001"), BLERead); +BLEFloatCharacteristic temperatureCharacteristic(BLE_SENSE_UUID("2001"), BLERead); +BLEUnsignedIntCharacteristic humidityCharacteristic(BLE_SENSE_UUID("3001"), BLERead); +BLEFloatCharacteristic pressureCharacteristic(BLE_SENSE_UUID("4001"), BLERead); + +BLECharacteristic accelerometerCharacteristic(BLE_SENSE_UUID("5001"), BLERead | BLENotify, 3 * sizeof(float)); // Array of 3x 2 Bytes, XY +BLECharacteristic gyroscopeCharacteristic(BLE_SENSE_UUID("6001"), BLERead | BLENotify, 3 * sizeof(float)); // Array of 3x 2 Bytes, XYZ +BLECharacteristic quaternionCharacteristic(BLE_SENSE_UUID("7001"), BLERead | BLENotify, 4 * sizeof(float)); // Array of 4x 2 Bytes, XYZW + +BLECharacteristic rgbLedCharacteristic(BLE_SENSE_UUID("8001"), BLERead | BLEWrite, 3 * sizeof(byte)); // Array of 3 bytes, RGB + +BLEFloatCharacteristic bsecCharacteristic(BLE_SENSE_UUID("9001"), BLERead); +BLEIntCharacteristic co2Characteristic(BLE_SENSE_UUID("9002"), BLERead); +BLEUnsignedIntCharacteristic gasCharacteristic(BLE_SENSE_UUID("9003"), BLERead); + +// String to calculate the local and device name +String name; + +Sensor temperature(SENSOR_ID_TEMP); +Sensor humidity(SENSOR_ID_HUM); +Sensor pressure(SENSOR_ID_BARO); +Sensor gas(SENSOR_ID_GAS); +SensorXYZ gyroscope(SENSOR_ID_GYRO); +SensorXYZ accelerometer(SENSOR_ID_ACC); +SensorQuaternion quaternion(SENSOR_ID_RV); +SensorBSEC bsec(SENSOR_ID_BSEC); + +void setup(){ + Serial.begin(115200); + + Serial.println("Start"); + + nicla::begin(); + nicla::leds.begin(); + nicla::leds.setColor(green); + + //Sensors initialization + BHY2.begin(NICLA_STANDALONE); + temperature.begin(); + humidity.begin(); + pressure.begin(); + gyroscope.begin(); + accelerometer.begin(); + quaternion.begin(); + bsec.begin(); + gas.begin(); + + if (!BLE.begin()){ + Serial.println("Failed to initialized BLE!"); + + while (1) + ; + } - BLE.setLocalName(name.c_str()); - BLE.setDeviceName(name.c_str()); - BLE.setAdvertisedService(service); + String address = BLE.address(); - // Add all the previously defined Characteristics - service.addCharacteristic(temperatureCharacteristic); - service.addCharacteristic(humidityCharacteristic); - service.addCharacteristic(pressureCharacteristic); - service.addCharacteristic(versionCharacteristic); - service.addCharacteristic(accelerometerCharacteristic); - service.addCharacteristic(gyroscopeCharacteristic); - service.addCharacteristic(quaternionCharacteristic); - service.addCharacteristic(bsecCharacteristic); - service.addCharacteristic(co2Characteristic); - service.addCharacteristic(gasCharacteristic); - service.addCharacteristic(rgbLedCharacteristic); + Serial.print("address = "); + Serial.println(address); - // Disconnect event handler - BLE.setEventHandler(BLEDisconnected, blePeripheralDisconnectHandler); + address.toUpperCase(); - // Sensors event handlers - temperatureCharacteristic.setEventHandler(BLERead, onTemperatureCharacteristicRead); - humidityCharacteristic.setEventHandler(BLERead, onHumidityCharacteristicRead); - pressureCharacteristic.setEventHandler(BLERead, onPressureCharacteristicRead); - bsecCharacteristic.setEventHandler(BLERead, onBsecCharacteristicRead); - co2Characteristic.setEventHandler(BLERead, onCo2CharacteristicRead); - gasCharacteristic.setEventHandler(BLERead, onGasCharacteristicRead); + name = "NiclaSenseME-"; + name += address[address.length() - 5]; + name += address[address.length() - 4]; + name += address[address.length() - 2]; + name += address[address.length() - 1]; - rgbLedCharacteristic.setEventHandler(BLEWritten, onRgbLedCharacteristicWrite); + Serial.print("name = "); + Serial.println(name); - versionCharacteristic.setValue(VERSION); + BLE.setLocalName(name.c_str()); + BLE.setDeviceName(name.c_str()); + BLE.setAdvertisedService(service); - BLE.addService(service); - BLE.advertise(); - } + // Add all the previously defined Characteristics + service.addCharacteristic(temperatureCharacteristic); + service.addCharacteristic(humidityCharacteristic); + service.addCharacteristic(pressureCharacteristic); + service.addCharacteristic(versionCharacteristic); + service.addCharacteristic(accelerometerCharacteristic); + service.addCharacteristic(gyroscopeCharacteristic); + service.addCharacteristic(quaternionCharacteristic); + service.addCharacteristic(bsecCharacteristic); + service.addCharacteristic(co2Characteristic); + service.addCharacteristic(gasCharacteristic); + service.addCharacteristic(rgbLedCharacteristic); - void loop(){ - while (BLE.connected()){ - BHY2.update(); + // Disconnect event handler + BLE.setEventHandler(BLEDisconnected, blePeripheralDisconnectHandler); - if (gyroscopeCharacteristic.subscribed()){ - float x, y, z; + // Sensors event handlers + temperatureCharacteristic.setEventHandler(BLERead, onTemperatureCharacteristicRead); + humidityCharacteristic.setEventHandler(BLERead, onHumidityCharacteristicRead); + pressureCharacteristic.setEventHandler(BLERead, onPressureCharacteristicRead); + bsecCharacteristic.setEventHandler(BLERead, onBsecCharacteristicRead); + co2Characteristic.setEventHandler(BLERead, onCo2CharacteristicRead); + gasCharacteristic.setEventHandler(BLERead, onGasCharacteristicRead); - x = gyroscope.x(); - y = gyroscope.y(); - z = gyroscope.z(); + rgbLedCharacteristic.setEventHandler(BLEWritten, onRgbLedCharacteristicWrite); - float gyroscopeValues[3] = {x, y, z}; + versionCharacteristic.setValue(VERSION); - gyroscopeCharacteristic.writeValue(gyroscopeValues, sizeof(gyroscopeValues)); - } + BLE.addService(service); + BLE.advertise(); +} - if (accelerometerCharacteristic.subscribed()){ - float x, y, z; - x = accelerometer.x(); - y = accelerometer.y(); - z = accelerometer.z(); +void loop(){ + while (BLE.connected()){ + BHY2.update(); - float accelerometerValues[] = {x, y, z}; - accelerometerCharacteristic.writeValue(accelerometerValues, sizeof(accelerometerValues)); - } + if (gyroscopeCharacteristic.subscribed()){ + float x, y, z; - if(quaternionCharacteristic.subscribed()){ - float x, y, z, w; - x = quaternion.x(); - y = quaternion.y(); - z = quaternion.z(); - w = quaternion.w(); + x = gyroscope.x(); + y = gyroscope.y(); + z = gyroscope.z(); - float quaternionValues[] = {x,y,z,w}; - quaternionCharacteristic.writeValue(quaternionValues, sizeof(quaternionValues)); - } + float gyroscopeValues[3] = {x, y, z}; + gyroscopeCharacteristic.writeValue(gyroscopeValues, sizeof(gyroscopeValues)); } - } - void blePeripheralDisconnectHandler(BLEDevice central){ - nicla::leds.setColor(red); - } + if (accelerometerCharacteristic.subscribed()){ + float x, y, z; + x = accelerometer.x(); + y = accelerometer.y(); + z = accelerometer.z(); - void onTemperatureCharacteristicRead(BLEDevice central, BLECharacteristic characteristic){ - float temperatureValue = temperature.value(); - temperatureCharacteristic.writeValue(temperatureValue); - } - - void onHumidityCharacteristicRead(BLEDevice central, BLECharacteristic characteristic){ - uint8_t humidityValue = humidity.value() + 0.5f; //since we are truncating the float type to a uint8_t, we want to round it - humidityCharacteristic.writeValue(humidityValue); - } - - void onPressureCharacteristicRead(BLEDevice central, BLECharacteristic characteristic){ - float pressureValue = pressure.value(); - pressureCharacteristic.writeValue(pressureValue); - } - - void onBsecCharacteristicRead(BLEDevice central, BLECharacteristic characteristic){ - float airQuality = float(bsec.iaq()); - bsecCharacteristic.writeValue(airQuality); - } + float accelerometerValues[] = {x, y, z}; + accelerometerCharacteristic.writeValue(accelerometerValues, sizeof(accelerometerValues)); + } - void onCo2CharacteristicRead(BLEDevice central, BLECharacteristic characteristic){ - uint32_t co2 = bsec.co2_eq(); - co2Characteristic.writeValue(co2); - } + if(quaternionCharacteristic.subscribed()){ + float x, y, z, w; + x = quaternion.x(); + y = quaternion.y(); + z = quaternion.z(); + w = quaternion.w(); - void onGasCharacteristicRead(BLEDevice central, BLECharacteristic characteristic){ - unsigned int g = gas.value(); - gasCharacteristic.writeValue(g); - } - - void onRgbLedCharacteristicWrite(BLEDevice central, BLECharacteristic characteristic){ - byte r = rgbLedCharacteristic[0]; - byte g = rgbLedCharacteristic[1]; - byte b = rgbLedCharacteristic[2]; + float quaternionValues[] = {x,y,z,w}; + quaternionCharacteristic.writeValue(quaternionValues, sizeof(quaternionValues)); + } - nicla::leds.setColor(r, g, b); } +} + +void blePeripheralDisconnectHandler(BLEDevice central){ + nicla::leds.setColor(red); +} + +void onTemperatureCharacteristicRead(BLEDevice central, BLECharacteristic characteristic){ + float temperatureValue = temperature.value(); + temperatureCharacteristic.writeValue(temperatureValue); +} + +void onHumidityCharacteristicRead(BLEDevice central, BLECharacteristic characteristic){ + uint8_t humidityValue = humidity.value() + 0.5f; //since we are truncating the float type to a uint8_t, we want to round it + humidityCharacteristic.writeValue(humidityValue); +} + +void onPressureCharacteristicRead(BLEDevice central, BLECharacteristic characteristic){ + float pressureValue = pressure.value(); + pressureCharacteristic.writeValue(pressureValue); +} + +void onBsecCharacteristicRead(BLEDevice central, BLECharacteristic characteristic){ + float airQuality = float(bsec.iaq()); + bsecCharacteristic.writeValue(airQuality); +} + +void onCo2CharacteristicRead(BLEDevice central, BLECharacteristic characteristic){ + uint32_t co2 = bsec.co2_eq(); + co2Characteristic.writeValue(co2); +} + +void onGasCharacteristicRead(BLEDevice central, BLECharacteristic characteristic){ + unsigned int g = gas.value(); + gasCharacteristic.writeValue(g); +} + +void onRgbLedCharacteristicWrite(BLEDevice central, BLECharacteristic characteristic){ + byte r = rgbLedCharacteristic[0]; + byte g = rgbLedCharacteristic[1]; + byte b = rgbLedCharacteristic[2]; + + nicla::leds.setColor(r, g, b); +} ``` Once you have these tools, you can select the Nicla Sense ME as target board and its corresponding port. Now you are ready to upload the sketch. diff --git a/content/hardware/06.nicla/boards/nicla-vision/product.md b/content/hardware/06.nicla/boards/nicla-vision/product.md index 13f26e3b3b..fda6331e7b 100644 --- a/content/hardware/06.nicla/boards/nicla-vision/product.md +++ b/content/hardware/06.nicla/boards/nicla-vision/product.md @@ -4,8 +4,8 @@ url_shop: https://store.arduino.cc/products/nicla-vision url_guide: /tutorials/nicla-vision/user-manual primary_button_url: /tutorials/nicla-vision/user-manual primary_button_title: User Manual -secondary_button_url: /tutorials/nicla-vision/getting-started -secondary_button_title: Get Started +secondary_button_url: /hardware/nicla-vision/#tutorials +secondary_button_title: All Tutorials core: arduino:mbed_nicla certifications: [CE, UKCA] productCode: '120' diff --git a/content/hardware/06.nicla/boards/nicla-vision/tutorials/user-manual/content.md b/content/hardware/06.nicla/boards/nicla-vision/tutorials/user-manual/content.md index ea4e0ecd7a..95c1bd8e3f 100644 --- a/content/hardware/06.nicla/boards/nicla-vision/tutorials/user-manual/content.md +++ b/content/hardware/06.nicla/boards/nicla-vision/tutorials/user-manual/content.md @@ -1729,10 +1729,10 @@ The example code shown above creates a Bluetooth® Low Energy service and charac - The code begins by importing all the necessary modules and defining the Bluetooth® Low Energy service and characteristics for an environment-sensing application. - | **Description** | **ID** | - |:------------------------------:|:------------------:| - | Environmental Sensing Service | 181A | - | Temperature Characteristic | 2A6E | +| **Description** | **ID** | +|:-----------------------------:|:------:| +| Environmental Sensing Service | 181A | +| Temperature Characteristic | 2A6E | - Then sets up the Bluetooth® Low Energy service and characteristics; and begins advertising the defined Bluetooth® Low Energy service. @@ -1856,11 +1856,10 @@ The example code shown above creates a Bluetooth® Low Energy service and charac - The code begins by importing all the necessary libraries and defining the Bluetooth® Low Energy service and characteristics for an environment sensing application. - - | **Description** | **ID** | - |:------------------------------:|:------------------:| - | Environmental Sensing Service | 181A | - | Temperature Characteristic | 2A6E | +| **Description** | **ID** | +|:------------------------------:|:------------------:| +| Environmental Sensing Service | 181A | +| Temperature Characteristic | 2A6E | - In the `setup()` function, the code initializes the Nicla Vision board and sets up the Bluetooth® Low Energy service and characteristics; then, it begins advertising the defined Bluetooth® Low Energy service. diff --git a/content/hardware/06.nicla/boards/nicla-voice/tutorials/getting-started-ml/content.md b/content/hardware/06.nicla/boards/nicla-voice/tutorials/getting-started-ml/content.md index 771fa1de5e..6516d448ce 100644 --- a/content/hardware/06.nicla/boards/nicla-voice/tutorials/getting-started-ml/content.md +++ b/content/hardware/06.nicla/boards/nicla-voice/tutorials/getting-started-ml/content.md @@ -1,6 +1,7 @@ --- title: 'Audio Analysis with Machine Learning and the Nicla Voice' description: 'Learn to use the Nicla Voice to create your own Machine Learning audio models with this getting started tutorial.' +difficulty: intermediate tags: - Getting started - Machine Learning tools @@ -55,21 +56,21 @@ The Nicla Voice has a built-in speech recognition example: **the Alexa demo**. Y 2. Extract [this .zip file](assets/nicla_voice_uploader_and_firmwares.zip), which contains the compiled uploaders for various operating systems, as well as the updated NDP120 processor firmware and speech recognition model. 3. Open a new terminal where the .zip file was extracted and execute the following command: - ``` + ```bash ./syntiant-uploader send -m "Y" -w "Y" -p $portName $filename ``` Replace `portName` and `filename` with the relevant information. Three different files must be uploaded to the board by executing the following three commands: - ``` + ```bash ./syntiant-uploader send -m "Y" -w "Y" -p COM6 mcu_fw_120_v91.synpkg ``` - ``` + ```bash ./syntiant-uploader send -m "Y" -w "Y" -p COM6 dsp_firmware_v91.synpkg ``` - ``` + ```bash ./syntiant-uploader send -m "Y" -w "Y" -p COM6 model_name.synpkg ``` diff --git a/content/hardware/06.nicla/boards/nicla-voice/tutorials/motion-detection-ml/content.md b/content/hardware/06.nicla/boards/nicla-voice/tutorials/motion-detection-ml/content.md index 6d1e3a0648..81b808259d 100644 --- a/content/hardware/06.nicla/boards/nicla-voice/tutorials/motion-detection-ml/content.md +++ b/content/hardware/06.nicla/boards/nicla-voice/tutorials/motion-detection-ml/content.md @@ -178,8 +178,8 @@ After unzipping the downloaded file, run the appropriate flashing script for you With your Nicla Voice board flashed, open a new terminal window and run the following command: -``` -$ edge-impulse-run-impulse +```bash +edge-impulse-run-impulse ``` This command will sample data from your Nicla's Voice onboard IMU, make inferences, and then classify the movement made on your board. You should see the following output in the terminal window when your Nicla Voice board is moved in horizontal movements, from left to right. diff --git a/content/hardware/06.nicla/boards/nicla-voice/tutorials/user-manual/content.md b/content/hardware/06.nicla/boards/nicla-voice/tutorials/user-manual/content.md index 1ef00e2e24..1b039046f2 100644 --- a/content/hardware/06.nicla/boards/nicla-voice/tutorials/user-manual/content.md +++ b/content/hardware/06.nicla/boards/nicla-voice/tutorials/user-manual/content.md @@ -135,21 +135,21 @@ It is recommended to update the NDP120 processor firmware and the built-in speec 3. Extract [this .zip file](assets/nicla_voice_uploader_and_firmwares.zip), which contains the compiled uploaders for various operating systems, and the updated NDP120 processor firmware and speech recognition model, in a known location on your computer. 4. Open a new terminal in the location where the .zip file was extracted and execute the following command: - ``` + ```bash syntiant-uploader send -m "Y" -w "Y" -p $portName $filename ``` Replace `portName` and `filename` with the relevant information. Three different files must be uploaded to the board by executing the following three commands, for example in Windows the commands are the following: - ``` + ```bash ./syntiant-uploader send -m "Y" -w "Y" -p COM6 mcu_fw_120_v91.synpkg ``` - ``` + ```bash ./syntiant-uploader send -m "Y" -w "Y" -p COM6 dsp_firmware_v91.synpkg ``` - ``` + ```bash ./syntiant-uploader send -m "Y" -w "Y" -p COM6 model_name.synpkg ``` diff --git a/content/hardware/07.opta/opta-family/opta/tutorials/opta-azure-iot-tutorial-en/content.md b/content/hardware/07.opta/opta-family/opta/tutorials/opta-azure-iot-tutorial-en/content.md index 75450b246a..7ea1bb852f 100644 --- a/content/hardware/07.opta/opta-family/opta/tutorials/opta-azure-iot-tutorial-en/content.md +++ b/content/hardware/07.opta/opta-family/opta/tutorials/opta-azure-iot-tutorial-en/content.md @@ -172,7 +172,7 @@ In particular, the information to be customized for the connection is represente You will need some of the information present on the device configuration page on Azure. As mentioned earlier, you can copy the necessary information and modify the code accordingly: -``` arduino +```arduino // Wifi #define IOT_CONFIG_WIFI_SSID "MyWifi" // Change it to your Wi-Fi network name #define IOT_CONFIG_WIFI_PASSWORD "12345678" // Change it to your Wi-Fi network password @@ -202,7 +202,7 @@ In the code, it is set to 300,000 milliseconds or 5 minutes: ![Opta™ Azure IoT Tutorial Sketch - Telemetry frequency](assets/opta-azure-iot-tutorial-202105.png) -``` arduino +```arduino // Publish 1 message every 5 minutes #define IOT_CONFIG_TELEMETRY_FREQUENCY_MS 300000 ``` @@ -213,7 +213,7 @@ In the **Azure_IoT_Hub_Opta.ino** file, you find a portion of code represented b ![Opta™ Azure IoT Tutorial Sketch - Telemetry payload](assets/opta-azure-iot-tutorial-202627.png) -``` arduino +```arduino /* * generateTelemetry: * Simulated telemetry. @@ -233,7 +233,7 @@ You can modify this function by changing the value of **telemetryPayload** and s You can modify this function to send a different message, for example, a classic "Hello, World": -``` arduino +```arduino static char* generateTelemetry() { telemetryPayload = String("Hello, World!"); diff --git a/content/hardware/10.mega/boards/giga-r1-wifi/tutorials/cheat-sheet/cheat-sheet.md b/content/hardware/10.mega/boards/giga-r1-wifi/tutorials/cheat-sheet/cheat-sheet.md index a67553000f..0888fc49aa 100644 --- a/content/hardware/10.mega/boards/giga-r1-wifi/tutorials/cheat-sheet/cheat-sheet.md +++ b/content/hardware/10.mega/boards/giga-r1-wifi/tutorials/cheat-sheet/cheat-sheet.md @@ -383,7 +383,7 @@ String getLocaltime() To get accurate time, you'll want to change the values in `void RTCset()` to whatever time it is when you're starting this clock. As long as the VRTC pin is connected to power, the clock will keep ticking and time will be kept accurately. -### RTC Wi-Fi® Example +### RTC / UDP / NTP Example With the following sketch, you can automatically set the time by requesting the time from a Network Time Protocol (NTP), using the UDP protocol. @@ -571,9 +571,195 @@ void printWifiStatus() Serial.print(rssi); Serial.println(" dBm"); } - ``` +### RTC / UDP / NTP Example (Timezone) + +This example provides an option to set the timezone. As the received epoch is based on GMT time, you can input e.g. `-1` or `5` which represents the hours. The `timezone` variable is changed at the top of the example. + +```arduino +/* + Udp NTP Client with Timezone Adjustment + + Get the time from a Network Time Protocol (NTP) time server + Demonstrates use of UDP sendPacket and ReceivePacket + For more on NTP time servers and the messages needed to communicate with them, + see http://en.wikipedia.org/wiki/Network_Time_Protocol + + created 4 Sep 2010 + by Michael Margolis + modified 9 Apr 2012 + by Tom Igoe + modified 28 Dec 2022 + by Giampaolo Mancini + modified 29 Jan 2024 + by Karl Söderby + +This code is in the public domain. + */ + +#include +#include +#include + +int timezone = -1; //this is GMT -1. + +int status = WL_IDLE_STATUS; + +char ssid[] = "Flen"; // your network SSID (name) +char pass[] = ""; // your network password (use for WPA, or use as key for WEP) + +int keyIndex = 0; // your network key index number (needed only for WEP) + +unsigned int localPort = 2390; // local port to listen for UDP packets + +// IPAddress timeServer(162, 159, 200, 123); // pool.ntp.org NTP server + +constexpr auto timeServer{ "pool.ntp.org" }; + +const int NTP_PACKET_SIZE = 48; // NTP timestamp is in the first 48 bytes of the message + +byte packetBuffer[NTP_PACKET_SIZE]; // buffer to hold incoming and outgoing packets + +// A UDP instance to let us send and receive packets over UDP +WiFiUDP Udp; + +constexpr unsigned long printInterval{ 1000 }; +unsigned long printNow{}; +void setup() { + // Open serial communications and wait for port to open: + Serial.begin(9600); + while (!Serial) { + ; // wait for serial port to connect. Needed for native USB port only + } + + // check for the WiFi module: + if (WiFi.status() == WL_NO_SHIELD) { + Serial.println("Communication with WiFi module failed!"); + // don't continue + while (true) + ; + } + + // attempt to connect to WiFi network: + while (status != WL_CONNECTED) { + Serial.print("Attempting to connect to SSID: "); + Serial.println(ssid); + // Connect to WPA/WPA2 network. Change this line if using open or WEP network: + status = WiFi.begin(ssid, pass); + + // wait 10 seconds for connection: + delay(10000); + } + + Serial.println("Connected to WiFi"); + printWifiStatus(); + + setNtpTime(); +} + +void loop() { + if (millis() > printNow) { + Serial.print("System Clock: "); + Serial.println(getLocaltime()); + printNow = millis() + printInterval; + } +} + +void setNtpTime() { + Udp.begin(localPort); + sendNTPpacket(timeServer); + delay(1000); + parseNtpPacket(); +} + +// send an NTP request to the time server at the given address +unsigned long sendNTPpacket(const char* address) { + memset(packetBuffer, 0, NTP_PACKET_SIZE); + packetBuffer[0] = 0b11100011; // LI, Version, Mode + packetBuffer[1] = 0; // Stratum, or type of clock + packetBuffer[2] = 6; // Polling Interval + packetBuffer[3] = 0xEC; // Peer Clock Precision + // 8 bytes of zero for Root Delay & Root Dispersion + packetBuffer[12] = 49; + packetBuffer[13] = 0x4E; + packetBuffer[14] = 49; + packetBuffer[15] = 52; + + Udp.beginPacket(address, 123); // NTP requests are to port 123 + Udp.write(packetBuffer, NTP_PACKET_SIZE); + Udp.endPacket(); +} + +unsigned long parseNtpPacket() { + if (!Udp.parsePacket()) + return 0; + + Udp.read(packetBuffer, NTP_PACKET_SIZE); + const unsigned long highWord = word(packetBuffer[40], packetBuffer[41]); + const unsigned long lowWord = word(packetBuffer[42], packetBuffer[43]); + const unsigned long secsSince1900 = highWord << 16 | lowWord; + constexpr unsigned long seventyYears = 2208988800UL; + const unsigned long epoch = secsSince1900 - seventyYears; + + const unsigned long new_epoch = epoch + (3600 * timezone); //multiply the timezone with 3600 (1 hour) + + set_time(new_epoch); + +#if defined(VERBOSE) + Serial.print("Seconds since Jan 1 1900 = "); + Serial.println(secsSince1900); + + // now convert NTP time into everyday time: + Serial.print("Unix time = "); + // print Unix time: + Serial.println(epoch); + + // print the hour, minute and second: + Serial.print("The UTC time is "); // UTC is the time at Greenwich Meridian (GMT) + Serial.print((epoch % 86400L) / 3600); // print the hour (86400 equals secs per day) + Serial.print(':'); + if (((epoch % 3600) / 60) < 10) { + // In the first 10 minutes of each hour, we'll want a leading '0' + Serial.print('0'); + } + Serial.print((epoch % 3600) / 60); // print the minute (3600 equals secs per minute) + Serial.print(':'); + if ((epoch % 60) < 10) { + // In the first 10 seconds of each minute, we'll want a leading '0' + Serial.print('0'); + } + Serial.println(epoch % 60); // print the second +#endif + + return epoch; +} + +String getLocaltime() { + char buffer[32]; + tm t; + _rtc_localtime(time(NULL), &t, RTC_FULL_LEAP_YEAR_SUPPORT); + strftime(buffer, 32, "%Y-%m-%d %k:%M:%S", &t); + return String(buffer); +} + +void printWifiStatus() { + // print the SSID of the network you're attached to: + Serial.print("SSID: "); + Serial.println(WiFi.SSID()); + + // print your board's IP address: + IPAddress ip = WiFi.localIP(); + Serial.print("IP Address: "); + Serial.println(ip); + + // print the received signal strength: + long rssi = WiFi.RSSI(); + Serial.print("signal strength (RSSI):"); + Serial.print(rssi); + Serial.println(" dBm"); +} +``` ### VRTC Pin diff --git a/content/hardware/10.mega/boards/giga-r1-wifi/tutorials/giga-wifi/giga-wifi.md b/content/hardware/10.mega/boards/giga-r1-wifi/tutorials/giga-wifi/giga-wifi.md index f76fba2f37..aa4f73115c 100644 --- a/content/hardware/10.mega/boards/giga-r1-wifi/tutorials/giga-wifi/giga-wifi.md +++ b/content/hardware/10.mega/boards/giga-r1-wifi/tutorials/giga-wifi/giga-wifi.md @@ -158,7 +158,7 @@ void printMacAddress(byte mac[]) { } ``` -### Wi-Fi RTC Example +### RTC / UDP / NTP Example ```arduino /* @@ -346,13 +346,13 @@ void printWifiStatus() } ``` -### Wi-Fi RTC Example with Timezone Adjustment +### RTC / UDP / NTP Example (Timezone) This example provides an option to set the timezone. As the received epoch is based on GMT time, you can input e.g. `-1` or `5` which represents the hours. The `timezone` variable is changed at the top of the example. ```arduino /* - Udp NTP Client + Udp NTP Client with Timezone Adjustment Get the time from a Network Time Protocol (NTP) time server Demonstrates use of UDP sendPacket and ReceivePacket @@ -365,6 +365,8 @@ This example provides an option to set the timezone. As the received epoch is ba by Tom Igoe modified 28 Dec 2022 by Giampaolo Mancini + modified 29 Jan 2024 + by Karl Söderby This code is in the public domain. */ @@ -474,7 +476,7 @@ unsigned long parseNtpPacket() { constexpr unsigned long seventyYears = 2208988800UL; const unsigned long epoch = secsSince1900 - seventyYears; - new_epoch = epoch + (3600 * timezone); //multiply the timezone with 3600 (1 hour) + const unsigned long new_epoch = epoch + (3600 * timezone); //multiply the timezone with 3600 (1 hour) set_time(new_epoch); diff --git a/content/hardware/10.mega/shields/giga-display-shield/tutorials/01.getting-started/getting-started.md b/content/hardware/10.mega/shields/giga-display-shield/tutorials/01.getting-started/getting-started.md index d6bfa1f0f7..932a2af5de 100644 --- a/content/hardware/10.mega/shields/giga-display-shield/tutorials/01.getting-started/getting-started.md +++ b/content/hardware/10.mega/shields/giga-display-shield/tutorials/01.getting-started/getting-started.md @@ -312,4 +312,24 @@ void loop() { rgb.off(); //turn off all pixels delay(1000); } -``` \ No newline at end of file +``` + +## Power Consumption + +The following test results were recorded with some sample sketches. The setup consist of a GIGA R1 WiFi and a GIGA Display Shield mounted, using the following equipment & software: +- [nRF Connect for Desktop](https://www.nordicsemi.com/Products/Development-tools/nRF-Connect-for-Desktop/Download) +- [Power Profiler Kit II](https://www.nordicsemi.com/Products/Development-hardware/Power-Profiler-Kit-2) + +| Sketch | Min | Max | Average | +| ------ | --------- | --------- | --------- | +| GFX | 327.20 mA | 382.15 mA | 363.50 mA | +| LVGL | 294.90 mA | 412.49 mA | 347.97 mA | + +Links to the sketches used for these tests are found below: + +- [GFX Hello World](https://github.com/arduino-libraries/Arduino_GigaDisplay/blob/main/examples/gfx/hello-world/hello-world.ino) +- [LVGL Demo](https://github.com/arduino/ArduinoCore-mbed/blob/main/libraries/Arduino_H7_Video/examples/LVGLDemo/LVGLDemo.ino) + +When selecting an appropriate power source (battery), use the measurements above as guidelines. For example, running one of the above sketches with a 1000 mAh battery will only last approx. 2 hours. + +***Note that there are other factors at play, such as the battery's discharge rate and the general quality of the battery. The above formulas and measurements are to be considered guidelines, please consult the technical information of your battery for more accurate results.*** \ No newline at end of file diff --git a/content/hacking/01.software/Bootloader/Bootloader.md b/content/retired/08.hacking/01.software/Bootloader/Bootloader.md similarity index 100% rename from content/hacking/01.software/Bootloader/Bootloader.md rename to content/retired/08.hacking/01.software/Bootloader/Bootloader.md diff --git a/content/hacking/01.software/DFUProgramming8U2/DFUProgramming8U2.md b/content/retired/08.hacking/01.software/DFUProgramming8U2/DFUProgramming8U2.md similarity index 100% rename from content/hacking/01.software/DFUProgramming8U2/DFUProgramming8U2.md rename to content/retired/08.hacking/01.software/DFUProgramming8U2/DFUProgramming8U2.md diff --git a/content/hacking/01.software/DFUProgramming8U2/assets/Uno-back-DFU-resistor.png b/content/retired/08.hacking/01.software/DFUProgramming8U2/assets/Uno-back-DFU-resistor.png similarity index 100% rename from content/hacking/01.software/DFUProgramming8U2/assets/Uno-back-DFU-resistor.png rename to content/retired/08.hacking/01.software/DFUProgramming8U2/assets/Uno-back-DFU-resistor.png diff --git a/content/hacking/01.software/DFUProgramming8U2/assets/Uno-front-DFU-reset.png b/content/retired/08.hacking/01.software/DFUProgramming8U2/assets/Uno-front-DFU-reset.png similarity index 100% rename from content/hacking/01.software/DFUProgramming8U2/assets/Uno-front-DFU-reset.png rename to content/retired/08.hacking/01.software/DFUProgramming8U2/assets/Uno-front-DFU-reset.png diff --git a/content/hacking/01.software/FirmataLibrary/FirmataLibrary.md b/content/retired/08.hacking/01.software/FirmataLibrary/FirmataLibrary.md similarity index 100% rename from content/hacking/01.software/FirmataLibrary/FirmataLibrary.md rename to content/retired/08.hacking/01.software/FirmataLibrary/FirmataLibrary.md diff --git a/content/hacking/01.software/Libraries/Libraries.md b/content/retired/08.hacking/01.software/Libraries/Libraries.md similarity index 100% rename from content/hacking/01.software/Libraries/Libraries.md rename to content/retired/08.hacking/01.software/Libraries/Libraries.md diff --git a/content/hacking/01.software/MidiWith8U2Firmware/MidiWith8U2Firmware.md b/content/retired/08.hacking/01.software/MidiWith8U2Firmware/MidiWith8U2Firmware.md similarity index 97% rename from content/hacking/01.software/MidiWith8U2Firmware/MidiWith8U2Firmware.md rename to content/retired/08.hacking/01.software/MidiWith8U2Firmware/MidiWith8U2Firmware.md index 134da85e35..8c857fe426 100644 --- a/content/hacking/01.software/MidiWith8U2Firmware/MidiWith8U2Firmware.md +++ b/content/retired/08.hacking/01.software/MidiWith8U2Firmware/MidiWith8U2Firmware.md @@ -1,87 +1,87 @@ ---- -title: 'MIDI Note Player using the MIDI firmware for the 8U2 (Uno and Mega2560 only)' -description: 'This tutorial shows how to play MIDI notes from an Arduino programmed to appear as a general MIDI device.' -tags: - - MIDI ---- -This tutorial shows how to play MIDI notes from an Arduino programmed to appear as a general MIDI device. This tutorial is only applicable to Arduinos with the 8U2 chip, the UNO and Mega2560 boards. This will not work with earlier models that use the FTDI chip (Duemilanove and previous). - -Following the instructions on the [Programming 8U2 instructions](/hacking/software/DFUProgramming8U2) using the [MocoLUFA](http://web.mac.com/kuwatay/morecat_lab./MocoLUFA.html) firmware, your Arduino will appear to the computer as a native MIDI device without any additional hardware. - -You can read the Wikipedia [MIDI](http://en.wikipedia.org/wiki/MIDI) entry for complete information on the specification, but in a nutshell, MIDI is a useful protocol for controlling synthesizers, sequencers, and other musical devices. MIDI devices are generally grouped in two broad classes: controllers (i.e. devices that generate MIDI signals based on human actions) and synthesizers (including samplers, sequencers, and so forth). - -For more information, see this [introduction to MIDI](https://www.tigoe.com/pcomp/code/communication/midi/) or this [example](http://itp.nyu.edu/physcomp/Labs/MIDIOutput). - -The Serial.print() function will send a MIDI command to the software synthesizer of your choice (in this example we will use Cycling74's Max/MSP, but any application that accepts MIDI will do). - -Before programming the 8U2 firmware, you will need to program the Atmega 328 on your Arduino, the same way you usually do with the IDE. We will be using the MIDI communication example that comes with the Arduino software. It can be found in File>Examples>Communication>MIDI. - -## Code -``` -/* - MIDI note player - - This sketch shows how to use the serial transmit pin (pin 1) to send MIDI note data. - If this circuit is connected to a MIDI synth, it will play - the notes F#-0 (0x1E) to F#-5 (0x5A) in sequence. - - - The circuit: - * digital in 1 connected to MIDI jack pin 5 - * MIDI jack pin 2 connected to ground - * MIDI jack pin 4 connected to +5V through 220-ohm resistor - Attach a MIDI cable to the jack, then to a MIDI synth, and play music. - - created 13 Jun 2006 - modified 13 Aug 2012 - by Tom Igoe - - This example code is in the public domain. - - http://www.arduino.cc/en/Tutorial/Midi - - */ - -void setup() { - // Set MIDI baud rate: - Serial.begin(31250); -} - -void loop() { - // play notes from F#-0 (0x1E) to F#-5 (0x5A): - for (int note = 0x1E; note < 0x5A; note ++) { - //Note on channel 1 (0x90), some note value (note), middle velocity (0x45): - noteOn(0x90, note, 0x45); - delay(100); - //Note on channel 1 (0x90), some note value (note), silent velocity (0x00): - noteOn(0x90, note, 0x00); - delay(100); - } -} - -// plays a MIDI note. Doesn't check to see that -// cmd is greater than 127, or that data values are less than 127: -void noteOn(int cmd, int pitch, int velocity) { - Serial.write(cmd); - Serial.write(pitch); - Serial.write(velocity); -} -``` -Program your Arduino, and prepare to program the 8U2 chip. Follow the instructions on the [Programming 8U2](/hacking/software/DFUProgramming8U2/) page, replacing the Arduino firmware with the [MocoLUFA](http://web.mac.com/kuwatay/morecat_lab./MocoLUFA.html) firmware. - -After the 8U2 has been updated with the MIDI firmware, disconnect and reconnect the USB cable. - -Open your MIDI application of choice and look for connected devices. You should see the Arduino appear as an input and output device named "MIDI/MOCO for LUFA". - -![MIDI device list](./assets/MIDI_device_list.png) - - -A simple Max patch that will allow you to hear the notes generated by the MIDI commands looks like this : -![Max patch](./assets/MIDI_MaxPatch.png) - - -To change the program on the Arduino, you must first reset the firmware on the 8U2 to the Arduino's default. - -See Also: - +--- +title: 'MIDI Note Player using the MIDI firmware for the 8U2 (Uno and Mega2560 only)' +description: 'This tutorial shows how to play MIDI notes from an Arduino programmed to appear as a general MIDI device.' +tags: + - MIDI +--- +This tutorial shows how to play MIDI notes from an Arduino programmed to appear as a general MIDI device. This tutorial is only applicable to Arduinos with the 8U2 chip, the UNO and Mega2560 boards. This will not work with earlier models that use the FTDI chip (Duemilanove and previous). + +Following the instructions on the [Programming 8U2 instructions](/hacking/software/DFUProgramming8U2) using the [MocoLUFA](http://web.mac.com/kuwatay/morecat_lab./MocoLUFA.html) firmware, your Arduino will appear to the computer as a native MIDI device without any additional hardware. + +You can read the Wikipedia [MIDI](http://en.wikipedia.org/wiki/MIDI) entry for complete information on the specification, but in a nutshell, MIDI is a useful protocol for controlling synthesizers, sequencers, and other musical devices. MIDI devices are generally grouped in two broad classes: controllers (i.e. devices that generate MIDI signals based on human actions) and synthesizers (including samplers, sequencers, and so forth). + +For more information, see this [introduction to MIDI](https://www.tigoe.com/pcomp/code/communication/midi/) or this [example](http://itp.nyu.edu/physcomp/Labs/MIDIOutput). + +The Serial.print() function will send a MIDI command to the software synthesizer of your choice (in this example we will use Cycling74's Max/MSP, but any application that accepts MIDI will do). + +Before programming the 8U2 firmware, you will need to program the Atmega 328 on your Arduino, the same way you usually do with the IDE. We will be using the MIDI communication example that comes with the Arduino software. It can be found in File>Examples>Communication>MIDI. + +## Code +``` +/* + MIDI note player + + This sketch shows how to use the serial transmit pin (pin 1) to send MIDI note data. + If this circuit is connected to a MIDI synth, it will play + the notes F#-0 (0x1E) to F#-5 (0x5A) in sequence. + + + The circuit: + * digital in 1 connected to MIDI jack pin 5 + * MIDI jack pin 2 connected to ground + * MIDI jack pin 4 connected to +5V through 220-ohm resistor + Attach a MIDI cable to the jack, then to a MIDI synth, and play music. + + created 13 Jun 2006 + modified 13 Aug 2012 + by Tom Igoe + + This example code is in the public domain. + + http://www.arduino.cc/en/Tutorial/Midi + + */ + +void setup() { + // Set MIDI baud rate: + Serial.begin(31250); +} + +void loop() { + // play notes from F#-0 (0x1E) to F#-5 (0x5A): + for (int note = 0x1E; note < 0x5A; note ++) { + //Note on channel 1 (0x90), some note value (note), middle velocity (0x45): + noteOn(0x90, note, 0x45); + delay(100); + //Note on channel 1 (0x90), some note value (note), silent velocity (0x00): + noteOn(0x90, note, 0x00); + delay(100); + } +} + +// plays a MIDI note. Doesn't check to see that +// cmd is greater than 127, or that data values are less than 127: +void noteOn(int cmd, int pitch, int velocity) { + Serial.write(cmd); + Serial.write(pitch); + Serial.write(velocity); +} +``` +Program your Arduino, and prepare to program the 8U2 chip. Follow the instructions on the [Programming 8U2](/hacking/software/DFUProgramming8U2/) page, replacing the Arduino firmware with the [MocoLUFA](http://web.mac.com/kuwatay/morecat_lab./MocoLUFA.html) firmware. + +After the 8U2 has been updated with the MIDI firmware, disconnect and reconnect the USB cable. + +Open your MIDI application of choice and look for connected devices. You should see the Arduino appear as an input and output device named "MIDI/MOCO for LUFA". + +![MIDI device list](./assets/MIDI_device_list.png) + + +A simple Max patch that will allow you to hear the notes generated by the MIDI commands looks like this : +![Max patch](./assets/MIDI_MaxPatch.png) + + +To change the program on the Arduino, you must first reset the firmware on the 8U2 to the Arduino's default. + +See Also: + - [MIDI](https://www.arduino.cc/en/Tutorial/Midi) \ No newline at end of file diff --git a/content/hacking/01.software/MidiWith8U2Firmware/assets/MIDI_MaxPatch.png b/content/retired/08.hacking/01.software/MidiWith8U2Firmware/assets/MIDI_MaxPatch.png similarity index 100% rename from content/hacking/01.software/MidiWith8U2Firmware/assets/MIDI_MaxPatch.png rename to content/retired/08.hacking/01.software/MidiWith8U2Firmware/assets/MIDI_MaxPatch.png diff --git a/content/hacking/01.software/MidiWith8U2Firmware/assets/MIDI_device_list.png b/content/retired/08.hacking/01.software/MidiWith8U2Firmware/assets/MIDI_device_list.png similarity index 100% rename from content/hacking/01.software/MidiWith8U2Firmware/assets/MIDI_device_list.png rename to content/retired/08.hacking/01.software/MidiWith8U2Firmware/assets/MIDI_device_list.png diff --git a/content/hacking/01.software/MiniBootloader/MiniBootloader.md b/content/retired/08.hacking/01.software/MiniBootloader/MiniBootloader.md similarity index 100% rename from content/hacking/01.software/MiniBootloader/MiniBootloader.md rename to content/retired/08.hacking/01.software/MiniBootloader/MiniBootloader.md diff --git a/content/hacking/01.software/MiniBootloader/assets/image002.jpg b/content/retired/08.hacking/01.software/MiniBootloader/assets/image002.jpg similarity index 100% rename from content/hacking/01.software/MiniBootloader/assets/image002.jpg rename to content/retired/08.hacking/01.software/MiniBootloader/assets/image002.jpg diff --git a/content/hacking/01.software/MiniBootloader/assets/image004.jpg b/content/retired/08.hacking/01.software/MiniBootloader/assets/image004.jpg similarity index 100% rename from content/hacking/01.software/MiniBootloader/assets/image004.jpg rename to content/retired/08.hacking/01.software/MiniBootloader/assets/image004.jpg diff --git a/content/hacking/01.software/MiniBootloader/assets/image006.jpg b/content/retired/08.hacking/01.software/MiniBootloader/assets/image006.jpg similarity index 100% rename from content/hacking/01.software/MiniBootloader/assets/image006.jpg rename to content/retired/08.hacking/01.software/MiniBootloader/assets/image006.jpg diff --git a/content/hacking/01.software/MiniBootloader/assets/image008.jpg b/content/retired/08.hacking/01.software/MiniBootloader/assets/image008.jpg similarity index 100% rename from content/hacking/01.software/MiniBootloader/assets/image008.jpg rename to content/retired/08.hacking/01.software/MiniBootloader/assets/image008.jpg diff --git a/content/hacking/01.software/MiniBootloader/assets/image010.jpg b/content/retired/08.hacking/01.software/MiniBootloader/assets/image010.jpg similarity index 100% rename from content/hacking/01.software/MiniBootloader/assets/image010.jpg rename to content/retired/08.hacking/01.software/MiniBootloader/assets/image010.jpg diff --git a/content/hacking/01.software/MiniBootloader/assets/image012.jpg b/content/retired/08.hacking/01.software/MiniBootloader/assets/image012.jpg similarity index 100% rename from content/hacking/01.software/MiniBootloader/assets/image012.jpg rename to content/retired/08.hacking/01.software/MiniBootloader/assets/image012.jpg diff --git a/content/hacking/01.software/MiniBootloader/assets/image014.jpg b/content/retired/08.hacking/01.software/MiniBootloader/assets/image014.jpg similarity index 100% rename from content/hacking/01.software/MiniBootloader/assets/image014.jpg rename to content/retired/08.hacking/01.software/MiniBootloader/assets/image014.jpg diff --git a/content/hacking/01.software/MiniBootloader/assets/image016.jpg b/content/retired/08.hacking/01.software/MiniBootloader/assets/image016.jpg similarity index 100% rename from content/hacking/01.software/MiniBootloader/assets/image016.jpg rename to content/retired/08.hacking/01.software/MiniBootloader/assets/image016.jpg diff --git a/content/hacking/01.software/MiniBootloader/assets/image018.jpg b/content/retired/08.hacking/01.software/MiniBootloader/assets/image018.jpg similarity index 100% rename from content/hacking/01.software/MiniBootloader/assets/image018.jpg rename to content/retired/08.hacking/01.software/MiniBootloader/assets/image018.jpg diff --git a/content/hacking/01.software/MiniBootloader/assets/image020.jpg b/content/retired/08.hacking/01.software/MiniBootloader/assets/image020.jpg similarity index 100% rename from content/hacking/01.software/MiniBootloader/assets/image020.jpg rename to content/retired/08.hacking/01.software/MiniBootloader/assets/image020.jpg diff --git a/content/hacking/01.software/PortManipulation/content.md b/content/retired/08.hacking/01.software/PortManipulation/content.md similarity index 98% rename from content/hacking/01.software/PortManipulation/content.md rename to content/retired/08.hacking/01.software/PortManipulation/content.md index c55b931ca9..b4095e4b48 100644 --- a/content/hacking/01.software/PortManipulation/content.md +++ b/content/retired/08.hacking/01.software/PortManipulation/content.md @@ -1,87 +1,87 @@ ---- -title: "Arduino - PortManipulation" -source: "https://arduino.cc/en/Reference/PortManipulation" -description: Learn how to control pins on an Arduino through three different registers (DDR, PORT, PIN). ---- - -## Port Registers - -Port registers allow for lower-level and faster manipulation of the i/o pins of the microcontroller on an Arduino board. The chips used on the Arduino board (the ATmega8 and ATmega168) have three ports: - -* B (digital pin 8 to 13) -* C (analog input pins) -* D (digital pins 0 to 7) - -Each port is controlled by three registers, which are also defined variables in the arduino language. The DDR register, determines whether the pin is an INPUT or OUTPUT. The PORT register controls whether the pin is HIGH or LOW, and the PIN register reads the state of INPUT pins set to input with pinMode(). The maps of the [ATmega8](/hacking/hardware/PinMapping) and [ATmega168](/hacking/hardware/Atmega168Hardware) chips show the ports. The newer Atmega328p chip follows the pinout of the Atmega168 exactly. - -DDR and PORT registers may be both written to, and read. PIN registers correspond to the state of inputs and may only be read. - -**PORTD** maps to Arduino digital pins 0 to 7 - -DDRD - The Port D Data Direction Register - read/write - -PORTD - The Port D Data Register - read/write - -PIND - The Port D Input Pins Register - read only - -**PORTB** maps to Arduino digital pins 8 to 13 The two high bits (6 & 7) map to the crystal pins and are not usable - -DDRB - The Port B Data Direction Register - read/write - -PORTB - The Port B Data Register - read/write - -PINB - The Port B Input Pins Register - read only - -**PORTC** maps to Arduino analog pins 0 to 5\. Pins 6 & 7 are only accessible on the Arduino Mini - -DDRC - The Port C Data Direction Register - read/write - -PORTC - The Port C Data Register - read/write - -PINC - The Port C Input Pins Register - read only - -Each bit of these registers corresponds to a single pin; e.g. the low bit of DDRB, PORTB, and PINB refers to pin PB0 (digital pin 8). For a complete mapping of Arduino pin numbers to ports and bits, see the diagram for your chip: [ATmega8](/hacking/hardware/PinMapping), [ATmega168](/hacking/hardware/PinMapping168). (Note that some bits of a port may be used for things other than i/o; be careful not to change the values of the register bits corresponding to them.) - -## Examples - -Referring to the pin map above, the PortD registers control Arduino digital pins 0 to 7\. - -You should note, however, that pins 0 & 1 are used for serial communications for programming and debugging the Arduino, so changing these pins should usually be avoided unless needed for serial input or output functions. Be aware that this can interfere with program download or debugging. - -DDRD is the direction register for Port D (Arduino digital pins 0-7). The bits in this register control whether the pins in PORTD are configured as inputs or outputs so, for example: - -```arduino -DDRD = B11111110; // sets Arduino pins 1 to 7 as outputs, pin 0 as input -DDRD = DDRD | B11111100; // this is safer as it sets pins 2 to 7 as outputs - // without changing the value of pins 0 & 1, which are RX & TX -``` - -See the bitwise operators reference pages and [The Bitmath Tutorial](http://www.arduino.cc/playground/Code/BitMath) in the Playground - -PORTD is the register for the state of the outputs. For example; - -`PORTD = B10101000; // sets digital pins 7,5,3 HIGH` - -You will only see 5 volts on these pins however if the pins have been set as outputs using the DDRD register or with pinMode(). - -PIND is the input register variable It will read all of the digital input pins at the same time. - -## Why Use Port Manipulation? - -From [The Bitmath Tutorial](http://www.arduino.cc/playground/Code/BitMath) - -Generally speaking, doing this sort of thing is **not** a good idea. Why not? Here are a few reasons: - -* The code is much more difficult for you to debug and maintain, and is a lot harder for other people to understand. It only takes a few microseconds for the processor to execute code, but it might take hours for you to figure out why it isn't working right and fix it! Your time is valuable, right? But the computer's time is very cheap, measured in the cost of the electricity you feed it. Usually it is much better to write code the most obvious way. -* The code is less portable. If you use digitalRead() and digitalWrite(), it is much easier to write code that will run on all of the Atmel microcontrollers, whereas the control and port registers can be different on each kind of microcontroller. -* It is a lot easier to cause unintentional malfunctions with direct port access. Notice how the line DDRD = B11111110; above mentions that it must leave pin 0 as an input pin. Pin 0 is the receive line (RX) on the serial port. It would be very easy to accidentally cause your serial port to stop working by changing pin 0 into an output pin! Now that would be very confusing when you suddenly are unable to receive serial data, wouldn't it? - -So you might be saying to yourself, great, why would I ever want to use this stuff then? Here are some of the positive aspects of direct port access: - -* You may need to be able to turn pins on and off very quickly, meaning within fractions of a microsecond. If you look at the source code in lib/targets/arduino/wiring.c, you will see that digitalRead() and digitalWrite() are each about a dozen or so lines of code, which get compiled into quite a few machine instructions. Each machine instruction requires one clock cycle at 16MHz, which can add up in time-sensitive applications. Direct port access can do the same job in a lot fewer clock cycles. -* Sometimes you might need to set multiple output pins at exactly the same time. Calling digitalWrite(10,HIGH); followed by digitalWrite(11,HIGH); will cause pin 10 to go HIGH several microseconds before pin 11, which may confuse certain time-sensitive external digital circuits you have hooked up. Alternatively, you could set both pins high at exactly the same moment in time using PORTB |= B1100; -* If you are running low on program memory, you can use these tricks to make your code smaller. It requires a lot fewer bytes of compiled code to simultaneously write a bunch of hardware pins simultaneously via the port registers than it would using a for loop to set each pin separately. In some cases, this might make the difference between your program fitting in flash memory or not! - -### Read More - -* [Pin Mapping of Atmega 168/328](http://arduino.cc/en/Hacking/Atmega168Hardware) +--- +title: "Arduino - PortManipulation" +source: "https://arduino.cc/en/Reference/PortManipulation" +description: Learn how to control pins on an Arduino through three different registers (DDR, PORT, PIN). +--- + +## Port Registers + +Port registers allow for lower-level and faster manipulation of the i/o pins of the microcontroller on an Arduino board. The chips used on the Arduino board (the ATmega8 and ATmega168) have three ports: + +* B (digital pin 8 to 13) +* C (analog input pins) +* D (digital pins 0 to 7) + +Each port is controlled by three registers, which are also defined variables in the arduino language. The DDR register, determines whether the pin is an INPUT or OUTPUT. The PORT register controls whether the pin is HIGH or LOW, and the PIN register reads the state of INPUT pins set to input with pinMode(). The maps of the [ATmega8](/hacking/hardware/PinMapping) and [ATmega168](/hacking/hardware/Atmega168Hardware) chips show the ports. The newer Atmega328p chip follows the pinout of the Atmega168 exactly. + +DDR and PORT registers may be both written to, and read. PIN registers correspond to the state of inputs and may only be read. + +**PORTD** maps to Arduino digital pins 0 to 7 + +DDRD - The Port D Data Direction Register - read/write + +PORTD - The Port D Data Register - read/write + +PIND - The Port D Input Pins Register - read only + +**PORTB** maps to Arduino digital pins 8 to 13 The two high bits (6 & 7) map to the crystal pins and are not usable + +DDRB - The Port B Data Direction Register - read/write + +PORTB - The Port B Data Register - read/write + +PINB - The Port B Input Pins Register - read only + +**PORTC** maps to Arduino analog pins 0 to 5\. Pins 6 & 7 are only accessible on the Arduino Mini + +DDRC - The Port C Data Direction Register - read/write + +PORTC - The Port C Data Register - read/write + +PINC - The Port C Input Pins Register - read only + +Each bit of these registers corresponds to a single pin; e.g. the low bit of DDRB, PORTB, and PINB refers to pin PB0 (digital pin 8). For a complete mapping of Arduino pin numbers to ports and bits, see the diagram for your chip: [ATmega8](/hacking/hardware/PinMapping), [ATmega168](/hacking/hardware/PinMapping168). (Note that some bits of a port may be used for things other than i/o; be careful not to change the values of the register bits corresponding to them.) + +## Examples + +Referring to the pin map above, the PortD registers control Arduino digital pins 0 to 7\. + +You should note, however, that pins 0 & 1 are used for serial communications for programming and debugging the Arduino, so changing these pins should usually be avoided unless needed for serial input or output functions. Be aware that this can interfere with program download or debugging. + +DDRD is the direction register for Port D (Arduino digital pins 0-7). The bits in this register control whether the pins in PORTD are configured as inputs or outputs so, for example: + +```arduino +DDRD = B11111110; // sets Arduino pins 1 to 7 as outputs, pin 0 as input +DDRD = DDRD | B11111100; // this is safer as it sets pins 2 to 7 as outputs + // without changing the value of pins 0 & 1, which are RX & TX +``` + +See the bitwise operators reference pages and [The Bitmath Tutorial](http://www.arduino.cc/playground/Code/BitMath) in the Playground + +PORTD is the register for the state of the outputs. For example; + +`PORTD = B10101000; // sets digital pins 7,5,3 HIGH` + +You will only see 5 volts on these pins however if the pins have been set as outputs using the DDRD register or with pinMode(). + +PIND is the input register variable It will read all of the digital input pins at the same time. + +## Why Use Port Manipulation? + +From [The Bitmath Tutorial](http://www.arduino.cc/playground/Code/BitMath) + +Generally speaking, doing this sort of thing is **not** a good idea. Why not? Here are a few reasons: + +* The code is much more difficult for you to debug and maintain, and is a lot harder for other people to understand. It only takes a few microseconds for the processor to execute code, but it might take hours for you to figure out why it isn't working right and fix it! Your time is valuable, right? But the computer's time is very cheap, measured in the cost of the electricity you feed it. Usually it is much better to write code the most obvious way. +* The code is less portable. If you use digitalRead() and digitalWrite(), it is much easier to write code that will run on all of the Atmel microcontrollers, whereas the control and port registers can be different on each kind of microcontroller. +* It is a lot easier to cause unintentional malfunctions with direct port access. Notice how the line DDRD = B11111110; above mentions that it must leave pin 0 as an input pin. Pin 0 is the receive line (RX) on the serial port. It would be very easy to accidentally cause your serial port to stop working by changing pin 0 into an output pin! Now that would be very confusing when you suddenly are unable to receive serial data, wouldn't it? + +So you might be saying to yourself, great, why would I ever want to use this stuff then? Here are some of the positive aspects of direct port access: + +* You may need to be able to turn pins on and off very quickly, meaning within fractions of a microsecond. If you look at the source code in lib/targets/arduino/wiring.c, you will see that digitalRead() and digitalWrite() are each about a dozen or so lines of code, which get compiled into quite a few machine instructions. Each machine instruction requires one clock cycle at 16MHz, which can add up in time-sensitive applications. Direct port access can do the same job in a lot fewer clock cycles. +* Sometimes you might need to set multiple output pins at exactly the same time. Calling digitalWrite(10,HIGH); followed by digitalWrite(11,HIGH); will cause pin 10 to go HIGH several microseconds before pin 11, which may confuse certain time-sensitive external digital circuits you have hooked up. Alternatively, you could set both pins high at exactly the same moment in time using PORTB |= B1100; +* If you are running low on program memory, you can use these tricks to make your code smaller. It requires a lot fewer bytes of compiled code to simultaneously write a bunch of hardware pins simultaneously via the port registers than it would using a for loop to set each pin separately. In some cases, this might make the difference between your program fitting in flash memory or not! + +### Read More + +* [Pin Mapping of Atmega 168/328](http://arduino.cc/en/Hacking/Atmega168Hardware) diff --git a/content/hacking/01.software/Preferences/Preferences.md b/content/retired/08.hacking/01.software/Preferences/Preferences.md similarity index 100% rename from content/hacking/01.software/Preferences/Preferences.md rename to content/retired/08.hacking/01.software/Preferences/Preferences.md diff --git a/content/hacking/01.software/Programmer/Programmer.md b/content/retired/08.hacking/01.software/Programmer/Programmer.md similarity index 100% rename from content/hacking/01.software/Programmer/Programmer.md rename to content/retired/08.hacking/01.software/Programmer/Programmer.md diff --git a/content/hacking/01.software/WiFiShieldFirmwareUpgrading/WiFiShieldFirmwareUpgrading.md b/content/retired/08.hacking/01.software/WiFiShieldFirmwareUpgrading/WiFiShieldFirmwareUpgrading.md similarity index 100% rename from content/hacking/01.software/WiFiShieldFirmwareUpgrading/WiFiShieldFirmwareUpgrading.md rename to content/retired/08.hacking/01.software/WiFiShieldFirmwareUpgrading/WiFiShieldFirmwareUpgrading.md diff --git a/content/hacking/01.software/software.md b/content/retired/08.hacking/01.software/software.md similarity index 100% rename from content/hacking/01.software/software.md rename to content/retired/08.hacking/01.software/software.md diff --git a/content/hacking/02.hardware/ATMEGA328P/ATMEGA328P.md b/content/retired/08.hacking/02.hardware/ATMEGA328P/ATMEGA328P.md similarity index 100% rename from content/hacking/02.hardware/ATMEGA328P/ATMEGA328P.md rename to content/retired/08.hacking/02.hardware/ATMEGA328P/ATMEGA328P.md diff --git a/content/hacking/02.hardware/ATMEGA328P/assets/Pinout-Atmega328p_latest.png b/content/retired/08.hacking/02.hardware/ATMEGA328P/assets/Pinout-Atmega328p_latest.png similarity index 100% rename from content/hacking/02.hardware/ATMEGA328P/assets/Pinout-Atmega328p_latest.png rename to content/retired/08.hacking/02.hardware/ATMEGA328P/assets/Pinout-Atmega328p_latest.png diff --git a/content/hacking/02.hardware/Atmega168Hardware/Atmega168Hardware.md b/content/retired/08.hacking/02.hardware/Atmega168Hardware/Atmega168Hardware.md similarity index 100% rename from content/hacking/02.hardware/Atmega168Hardware/Atmega168Hardware.md rename to content/retired/08.hacking/02.hardware/Atmega168Hardware/Atmega168Hardware.md diff --git a/content/hacking/02.hardware/Atmega168Hardware/assets/Atmega168PinMap2.png b/content/retired/08.hacking/02.hardware/Atmega168Hardware/assets/Atmega168PinMap2.png similarity index 100% rename from content/hacking/02.hardware/Atmega168Hardware/assets/Atmega168PinMap2.png rename to content/retired/08.hacking/02.hardware/Atmega168Hardware/assets/Atmega168PinMap2.png diff --git a/content/hacking/02.hardware/NGAutoReset/NGAutoReset.md b/content/retired/08.hacking/02.hardware/NGAutoReset/NGAutoReset.md similarity index 100% rename from content/hacking/02.hardware/NGAutoReset/NGAutoReset.md rename to content/retired/08.hacking/02.hardware/NGAutoReset/NGAutoReset.md diff --git a/content/hacking/02.hardware/ParallelProgrammer/ParallelProgrammer.md b/content/retired/08.hacking/02.hardware/ParallelProgrammer/ParallelProgrammer.md similarity index 100% rename from content/hacking/02.hardware/ParallelProgrammer/ParallelProgrammer.md rename to content/retired/08.hacking/02.hardware/ParallelProgrammer/ParallelProgrammer.md diff --git a/content/hacking/02.hardware/ParallelProgrammer/assets/ParallelProgrammer.png b/content/retired/08.hacking/02.hardware/ParallelProgrammer/assets/ParallelProgrammer.png similarity index 100% rename from content/hacking/02.hardware/ParallelProgrammer/assets/ParallelProgrammer.png rename to content/retired/08.hacking/02.hardware/ParallelProgrammer/assets/ParallelProgrammer.png diff --git a/content/hacking/02.hardware/ParallelProgrammer/assets/parallel_programmer.jpg b/content/retired/08.hacking/02.hardware/ParallelProgrammer/assets/parallel_programmer.jpg similarity index 100% rename from content/hacking/02.hardware/ParallelProgrammer/assets/parallel_programmer.jpg rename to content/retired/08.hacking/02.hardware/ParallelProgrammer/assets/parallel_programmer.jpg diff --git a/content/hacking/02.hardware/ParallelProgrammer/assets/programmer_in_adapter.jpg b/content/retired/08.hacking/02.hardware/ParallelProgrammer/assets/programmer_in_adapter.jpg similarity index 100% rename from content/hacking/02.hardware/ParallelProgrammer/assets/programmer_in_adapter.jpg rename to content/retired/08.hacking/02.hardware/ParallelProgrammer/assets/programmer_in_adapter.jpg diff --git a/content/hacking/02.hardware/ParallelProgrammer/assets/programmer_one_resistor.jpg b/content/retired/08.hacking/02.hardware/ParallelProgrammer/assets/programmer_one_resistor.jpg similarity index 100% rename from content/hacking/02.hardware/ParallelProgrammer/assets/programmer_one_resistor.jpg rename to content/retired/08.hacking/02.hardware/ParallelProgrammer/assets/programmer_one_resistor.jpg diff --git a/content/hacking/02.hardware/ParallelProgrammer/assets/programmer_parts.jpg b/content/retired/08.hacking/02.hardware/ParallelProgrammer/assets/programmer_parts.jpg similarity index 100% rename from content/hacking/02.hardware/ParallelProgrammer/assets/programmer_parts.jpg rename to content/retired/08.hacking/02.hardware/ParallelProgrammer/assets/programmer_parts.jpg diff --git a/content/hacking/02.hardware/ParallelProgrammer/assets/programmer_with_cable.jpg b/content/retired/08.hacking/02.hardware/ParallelProgrammer/assets/programmer_with_cable.jpg similarity index 100% rename from content/hacking/02.hardware/ParallelProgrammer/assets/programmer_with_cable.jpg rename to content/retired/08.hacking/02.hardware/ParallelProgrammer/assets/programmer_with_cable.jpg diff --git a/content/hacking/02.hardware/ParallelProgrammer/assets/programmer_with_cables.jpg b/content/retired/08.hacking/02.hardware/ParallelProgrammer/assets/programmer_with_cables.jpg similarity index 100% rename from content/hacking/02.hardware/ParallelProgrammer/assets/programmer_with_cables.jpg rename to content/retired/08.hacking/02.hardware/ParallelProgrammer/assets/programmer_with_cables.jpg diff --git a/content/hacking/02.hardware/PinMapping/PinMapping.md b/content/retired/08.hacking/02.hardware/PinMapping/PinMapping.md similarity index 100% rename from content/hacking/02.hardware/PinMapping/PinMapping.md rename to content/retired/08.hacking/02.hardware/PinMapping/PinMapping.md diff --git a/content/hacking/02.hardware/PinMapping/assets/Arduino-To-Atmega8-Pins.png b/content/retired/08.hacking/02.hardware/PinMapping/assets/Arduino-To-Atmega8-Pins.png similarity index 100% rename from content/hacking/02.hardware/PinMapping/assets/Arduino-To-Atmega8-Pins.png rename to content/retired/08.hacking/02.hardware/PinMapping/assets/Arduino-To-Atmega8-Pins.png diff --git a/content/hacking/02.hardware/PinMapping168/PinMapping168.md b/content/retired/08.hacking/02.hardware/PinMapping168/PinMapping168.md similarity index 100% rename from content/hacking/02.hardware/PinMapping168/PinMapping168.md rename to content/retired/08.hacking/02.hardware/PinMapping168/PinMapping168.md diff --git a/content/hacking/02.hardware/PinMapping168/assets/Atmega168PinMap2.png b/content/retired/08.hacking/02.hardware/PinMapping168/assets/Atmega168PinMap2.png similarity index 100% rename from content/hacking/02.hardware/PinMapping168/assets/Atmega168PinMap2.png rename to content/retired/08.hacking/02.hardware/PinMapping168/assets/Atmega168PinMap2.png diff --git a/content/hacking/02.hardware/PinMapping2560/PinMapping2560.md b/content/retired/08.hacking/02.hardware/PinMapping2560/PinMapping2560.md similarity index 98% rename from content/hacking/02.hardware/PinMapping2560/PinMapping2560.md rename to content/retired/08.hacking/02.hardware/PinMapping2560/PinMapping2560.md index 797b1bcd1a..01959247eb 100644 --- a/content/hacking/02.hardware/PinMapping2560/PinMapping2560.md +++ b/content/retired/08.hacking/02.hardware/PinMapping2560/PinMapping2560.md @@ -1,115 +1,115 @@ ---- -title: 'ATmega2560-Arduino Pin Mapping' -description: 'A diagram showing the correspondence between the pins on an Arduino board and those of the ATmega2560 microcontroller.' -tags: - - ATmega2560 ---- - -Below is the pin mapping for the Atmega2560. The chip used in Arduino 2560. There are pin mappings to [Atmega8](/hacking/hardware/PinMapping) and [Atmega 168/328](/hacking/hardware/PinMapping168) as well. - -![Arduino Mega 2560 PIN diagram.](./assets/PinMap2560big_Rev2.png) - -**Arduino Mega 2560 PIN mapping table** - -| Pin Number | Pin Name | Mapped Pin Name | -| ---------- | ------------------------ | --------------------- | -| 1 | PG5 ( OC0B ) | Digital pin 4 (PWM) | -| 2 | PE0 ( RXD0/PCINT8 ) | Digital pin 0 (RX0) | -| 3 | PE1 ( TXD0 ) | Digital pin 1 (TX0) | -| 4 | PE2 ( XCK0/AIN0 ) | | -| 5 | PE3 ( OC3A/AIN1 ) | Digital pin 5 (PWM) | -| 6 | PE4 ( OC3B/INT4 ) | Digital pin 2 (PWM) | -| 7 | PE5 ( OC3C/INT5 ) | Digital pin 3 (PWM) | -| 8 | PE6 ( T3/INT6 ) | | -| 9 | PE7 ( CLKO/ICP3/INT7 ) | -| 10 | VCC | VCC | -| 11 | GND | GND | -| 12 | PH0 ( RXD2 ) | Digital pin 17 (RX2) | -| 13 | PH1 ( TXD2 ) | Digital pin 16 (TX2) | -| 14 | PH2 ( XCK2 ) | | -| 15 | PH3 ( OC4A ) | Digital pin 6 (PWM) | -| 16 | PH4 ( OC4B ) | Digital pin 7 (PWM) | -| 17 | PH5 ( OC4C ) | Digital pin 8 (PWM) | -| 18 | PH6 ( OC2B ) | Digital pin 9 (PWM) | -| 19 | PB0 ( SS/PCINT0 ) | Digital pin 53 (SS) | -| 20 | PB1 ( SCK/PCINT1 ) | Digital pin 52 (SCK) | -| 21 | PB2 ( MOSI/PCINT2 ) | Digital pin 51 (MOSI) | -| 22 | PB3 ( MISO/PCINT3 ) | Digital pin 50 (MISO) | -| 23 | PB4 ( OC2A/PCINT4 ) | Digital pin 10 (PWM) | -| 24 | PB5 ( OC1A/PCINT5 ) | Digital pin 11 (PWM) | -| 25 | PB6 ( OC1B/PCINT6 ) | Digital pin 12 (PWM) | -| 26 | PB7 ( OC0A/OC1C/PCINT7 ) | Digital pin 13 (PWM) | -| 27 | PH7 ( T4 ) | | -| 28 | PG3 ( TOSC2 ) | | -| 29 | PG4 ( TOSC1 ) | | -| 30 | RESET | RESET | -| 31 | VCC | VCC | -| 32 | GND | GND | -| 33 | XTAL2 | XTAL2 | -| 34 | XTAL1 | XTAL1 | -| 35 | PL0 ( ICP4 ) | Digital pin 49 | -| 36 | PL1 ( ICP5 ) | Digital pin 48 | -| 37 | PL2 ( T5 ) | Digital pin 47 | -| 38 | PL3 ( OC5A ) | Digital pin 46 (PWM) | -| 39 | PL4 ( OC5B ) | Digital pin 45 (PWM) | -| 40 | PL5 ( OC5C ) | Digital pin 44 (PWM) | -| 41 | PL6 | Digital pin 43 | -| 42 | PL7 | Digital pin 42 | -| 43 | PD0 ( SCL/INT0 ) | Digital pin 21 (SCL) | -| 44 | PD1 ( SDA/INT1 ) | Digital pin 20 (SDA) | -| 45 | PD2 ( RXDI/INT2 ) | Digital pin 19 (RX1) | -| 46 | PD3 ( TXD1/INT3 ) | Digital pin 18 (TX1) | -| 47 | PD4 ( ICP1 ) | | -| 48 | PD5 ( XCK1 ) | | -| 49 | PD6 ( T1 ) | | -| 50 | PD7 ( T0 ) | Digital pin 38 | -| 51 | PG0 ( WR ) | Digital pin 41 | -| 52 | PG1 ( RD ) | Digital pin 40 | -| 53 | PC0 ( A8 ) | Digital pin 37 | -| 54 | PC1 ( A9 ) | Digital pin 36 | -| 55 | PC2 ( A10 ) | Digital pin 35 | -| 56 | PC3 ( A11 ) | Digital pin 34 | -| 57 | PC4 ( A12 ) | Digital pin 33 | -| 58 | PC5 ( A13 ) | Digital pin 32 | -| 59 | PC6 ( A14 ) | Digital pin 31 | -| 60 | PC7 ( A15 ) | Digital pin 30 | -| 61 | VCC | VCC | -| 62 | GND | GND | -| 63 | PJ0 ( RXD3/PCINT9 ) | Digital pin 15 (RX3) | -| 64 | PJ1 ( TXD3/PCINT10 ) | Digital pin 14 (TX3) | -| 65 | PJ2 ( XCK3/PCINT11 ) | | -| 66 | PJ3 ( PCINT12 ) | | -| 67 | PJ4 ( PCINT13 ) | | -| 68 | PJ5 ( PCINT14 ) | | -| 69 | PJ6 ( PCINT 15 ) | | -| 70 | PG2 ( ALE ) | Digital pin 39 | -| 71 | PA7 ( AD7 ) | Digital pin 29 | -| 72 | PA6 ( AD6 ) | Digital pin 28 | -| 73 | PA5 ( AD5 ) | Digital pin 27 | -| 74 | PA4 ( AD4 ) | Digital pin 26 | -| 75 | PA3 ( AD3 ) | Digital pin 25 | -| 76 | PA2 ( AD2 ) | Digital pin 24 | -| 77 | PA1 ( AD1 ) | Digital pin 23 | -| 78 | PA0 ( AD0 ) | Digital pin 22 | -| 79 | PJ7 | | -| 80 | VCC | VCC | -| 81 | GND | GND | -| 82 | PK7 ( ADC15/PCINT23 ) | Analog pin 15 | -| 83 | PK6 ( ADC14/PCINT22 ) | Analog pin 14 | -| 84 | PK5 ( ADC13/PCINT21 ) | Analog pin 13 | -| 85 | PK4 ( ADC12/PCINT20 ) | Analog pin 12 | -| 86 | PK3 ( ADC11/PCINT19 ) | Analog pin 11 | -| 87 | PK2 ( ADC10/PCINT18 ) | Analog pin 10 | -| 88 | PK1 ( ADC9/PCINT17 ) | Analog pin 9 | -| 89 | PK0 ( ADC8/PCINT16 ) | Analog pin 8 | -| 90 | PF7 ( ADC7/TDI ) | Analog pin 7 | -| 91 | PF6 ( ADC6/TDO ) | Analog pin 6 | -| 92 | PF5 ( ADC5/TMS ) | Analog pin 5 | -| 93 | PF4 ( ADC4/TCK ) | Analog pin 4 | -| 94 | PF3 ( ADC3 ) | Analog pin 3 | -| 95 | PF2 ( ADC2 ) | Analog pin 2 | -| 96 | PF1 ( ADC1 ) | Analog pin 1 | -| 97 | PF0 ( ADC0 ) | Analog pin 0 | -| 98 | AREF | Analog Reference | -| 99 | GND | GND | -| 100 | AVCC | VCC | +--- +title: 'ATmega2560-Arduino Pin Mapping' +description: 'A diagram showing the correspondence between the pins on an Arduino board and those of the ATmega2560 microcontroller.' +tags: + - ATmega2560 +--- + +Below is the pin mapping for the Atmega2560. The chip used in Arduino 2560. There are pin mappings to [Atmega8](/hacking/hardware/PinMapping) and [Atmega 168/328](/hacking/hardware/PinMapping168) as well. + +![Arduino Mega 2560 PIN diagram.](./assets/PinMap2560big_Rev2.png) + +**Arduino Mega 2560 PIN mapping table** + +| Pin Number | Pin Name | Mapped Pin Name | +| ---------- | ------------------------ | --------------------- | +| 1 | PG5 ( OC0B ) | Digital pin 4 (PWM) | +| 2 | PE0 ( RXD0/PCINT8 ) | Digital pin 0 (RX0) | +| 3 | PE1 ( TXD0 ) | Digital pin 1 (TX0) | +| 4 | PE2 ( XCK0/AIN0 ) | | +| 5 | PE3 ( OC3A/AIN1 ) | Digital pin 5 (PWM) | +| 6 | PE4 ( OC3B/INT4 ) | Digital pin 2 (PWM) | +| 7 | PE5 ( OC3C/INT5 ) | Digital pin 3 (PWM) | +| 8 | PE6 ( T3/INT6 ) | | +| 9 | PE7 ( CLKO/ICP3/INT7 ) | +| 10 | VCC | VCC | +| 11 | GND | GND | +| 12 | PH0 ( RXD2 ) | Digital pin 17 (RX2) | +| 13 | PH1 ( TXD2 ) | Digital pin 16 (TX2) | +| 14 | PH2 ( XCK2 ) | | +| 15 | PH3 ( OC4A ) | Digital pin 6 (PWM) | +| 16 | PH4 ( OC4B ) | Digital pin 7 (PWM) | +| 17 | PH5 ( OC4C ) | Digital pin 8 (PWM) | +| 18 | PH6 ( OC2B ) | Digital pin 9 (PWM) | +| 19 | PB0 ( SS/PCINT0 ) | Digital pin 53 (SS) | +| 20 | PB1 ( SCK/PCINT1 ) | Digital pin 52 (SCK) | +| 21 | PB2 ( MOSI/PCINT2 ) | Digital pin 51 (MOSI) | +| 22 | PB3 ( MISO/PCINT3 ) | Digital pin 50 (MISO) | +| 23 | PB4 ( OC2A/PCINT4 ) | Digital pin 10 (PWM) | +| 24 | PB5 ( OC1A/PCINT5 ) | Digital pin 11 (PWM) | +| 25 | PB6 ( OC1B/PCINT6 ) | Digital pin 12 (PWM) | +| 26 | PB7 ( OC0A/OC1C/PCINT7 ) | Digital pin 13 (PWM) | +| 27 | PH7 ( T4 ) | | +| 28 | PG3 ( TOSC2 ) | | +| 29 | PG4 ( TOSC1 ) | | +| 30 | RESET | RESET | +| 31 | VCC | VCC | +| 32 | GND | GND | +| 33 | XTAL2 | XTAL2 | +| 34 | XTAL1 | XTAL1 | +| 35 | PL0 ( ICP4 ) | Digital pin 49 | +| 36 | PL1 ( ICP5 ) | Digital pin 48 | +| 37 | PL2 ( T5 ) | Digital pin 47 | +| 38 | PL3 ( OC5A ) | Digital pin 46 (PWM) | +| 39 | PL4 ( OC5B ) | Digital pin 45 (PWM) | +| 40 | PL5 ( OC5C ) | Digital pin 44 (PWM) | +| 41 | PL6 | Digital pin 43 | +| 42 | PL7 | Digital pin 42 | +| 43 | PD0 ( SCL/INT0 ) | Digital pin 21 (SCL) | +| 44 | PD1 ( SDA/INT1 ) | Digital pin 20 (SDA) | +| 45 | PD2 ( RXDI/INT2 ) | Digital pin 19 (RX1) | +| 46 | PD3 ( TXD1/INT3 ) | Digital pin 18 (TX1) | +| 47 | PD4 ( ICP1 ) | | +| 48 | PD5 ( XCK1 ) | | +| 49 | PD6 ( T1 ) | | +| 50 | PD7 ( T0 ) | Digital pin 38 | +| 51 | PG0 ( WR ) | Digital pin 41 | +| 52 | PG1 ( RD ) | Digital pin 40 | +| 53 | PC0 ( A8 ) | Digital pin 37 | +| 54 | PC1 ( A9 ) | Digital pin 36 | +| 55 | PC2 ( A10 ) | Digital pin 35 | +| 56 | PC3 ( A11 ) | Digital pin 34 | +| 57 | PC4 ( A12 ) | Digital pin 33 | +| 58 | PC5 ( A13 ) | Digital pin 32 | +| 59 | PC6 ( A14 ) | Digital pin 31 | +| 60 | PC7 ( A15 ) | Digital pin 30 | +| 61 | VCC | VCC | +| 62 | GND | GND | +| 63 | PJ0 ( RXD3/PCINT9 ) | Digital pin 15 (RX3) | +| 64 | PJ1 ( TXD3/PCINT10 ) | Digital pin 14 (TX3) | +| 65 | PJ2 ( XCK3/PCINT11 ) | | +| 66 | PJ3 ( PCINT12 ) | | +| 67 | PJ4 ( PCINT13 ) | | +| 68 | PJ5 ( PCINT14 ) | | +| 69 | PJ6 ( PCINT 15 ) | | +| 70 | PG2 ( ALE ) | Digital pin 39 | +| 71 | PA7 ( AD7 ) | Digital pin 29 | +| 72 | PA6 ( AD6 ) | Digital pin 28 | +| 73 | PA5 ( AD5 ) | Digital pin 27 | +| 74 | PA4 ( AD4 ) | Digital pin 26 | +| 75 | PA3 ( AD3 ) | Digital pin 25 | +| 76 | PA2 ( AD2 ) | Digital pin 24 | +| 77 | PA1 ( AD1 ) | Digital pin 23 | +| 78 | PA0 ( AD0 ) | Digital pin 22 | +| 79 | PJ7 | | +| 80 | VCC | VCC | +| 81 | GND | GND | +| 82 | PK7 ( ADC15/PCINT23 ) | Analog pin 15 | +| 83 | PK6 ( ADC14/PCINT22 ) | Analog pin 14 | +| 84 | PK5 ( ADC13/PCINT21 ) | Analog pin 13 | +| 85 | PK4 ( ADC12/PCINT20 ) | Analog pin 12 | +| 86 | PK3 ( ADC11/PCINT19 ) | Analog pin 11 | +| 87 | PK2 ( ADC10/PCINT18 ) | Analog pin 10 | +| 88 | PK1 ( ADC9/PCINT17 ) | Analog pin 9 | +| 89 | PK0 ( ADC8/PCINT16 ) | Analog pin 8 | +| 90 | PF7 ( ADC7/TDI ) | Analog pin 7 | +| 91 | PF6 ( ADC6/TDO ) | Analog pin 6 | +| 92 | PF5 ( ADC5/TMS ) | Analog pin 5 | +| 93 | PF4 ( ADC4/TCK ) | Analog pin 4 | +| 94 | PF3 ( ADC3 ) | Analog pin 3 | +| 95 | PF2 ( ADC2 ) | Analog pin 2 | +| 96 | PF1 ( ADC1 ) | Analog pin 1 | +| 97 | PF0 ( ADC0 ) | Analog pin 0 | +| 98 | AREF | Analog Reference | +| 99 | GND | GND | +| 100 | AVCC | VCC | diff --git a/content/hacking/02.hardware/PinMapping2560/assets/PinMap2560big_Rev2.png b/content/retired/08.hacking/02.hardware/PinMapping2560/assets/PinMap2560big_Rev2.png similarity index 100% rename from content/hacking/02.hardware/PinMapping2560/assets/PinMap2560big_Rev2.png rename to content/retired/08.hacking/02.hardware/PinMapping2560/assets/PinMap2560big_Rev2.png diff --git a/content/hacking/02.hardware/PinMapping32u4/PinMapping32u4.md b/content/retired/08.hacking/02.hardware/PinMapping32u4/PinMapping32u4.md similarity index 100% rename from content/hacking/02.hardware/PinMapping32u4/PinMapping32u4.md rename to content/retired/08.hacking/02.hardware/PinMapping32u4/PinMapping32u4.md diff --git a/content/hacking/02.hardware/PinMapping32u4/assets/32U4PinMapping.png b/content/retired/08.hacking/02.hardware/PinMapping32u4/assets/32U4PinMapping.png similarity index 100% rename from content/hacking/02.hardware/PinMapping32u4/assets/32U4PinMapping.png rename to content/retired/08.hacking/02.hardware/PinMapping32u4/assets/32U4PinMapping.png diff --git a/content/hacking/02.hardware/PinMappingSAM3X/PinMappingSAM3X.md b/content/retired/08.hacking/02.hardware/PinMappingSAM3X/PinMappingSAM3X.md similarity index 100% rename from content/hacking/02.hardware/PinMappingSAM3X/PinMappingSAM3X.md rename to content/retired/08.hacking/02.hardware/PinMappingSAM3X/PinMappingSAM3X.md diff --git a/content/hacking/02.hardware/StandaloneAssembly/StandaloneAssembly.md b/content/retired/08.hacking/02.hardware/StandaloneAssembly/StandaloneAssembly.md similarity index 100% rename from content/hacking/02.hardware/StandaloneAssembly/StandaloneAssembly.md rename to content/retired/08.hacking/02.hardware/StandaloneAssembly/StandaloneAssembly.md diff --git a/content/hacking/02.hardware/StandaloneAssembly/assets/programmer-cable.jpg b/content/retired/08.hacking/02.hardware/StandaloneAssembly/assets/programmer-cable.jpg similarity index 100% rename from content/hacking/02.hardware/StandaloneAssembly/assets/programmer-cable.jpg rename to content/retired/08.hacking/02.hardware/StandaloneAssembly/assets/programmer-cable.jpg diff --git a/content/hacking/02.hardware/StandaloneAssembly/assets/programmer-header.jpg b/content/retired/08.hacking/02.hardware/StandaloneAssembly/assets/programmer-header.jpg similarity index 100% rename from content/hacking/02.hardware/StandaloneAssembly/assets/programmer-header.jpg rename to content/retired/08.hacking/02.hardware/StandaloneAssembly/assets/programmer-header.jpg diff --git a/content/hacking/02.hardware/StandaloneAssembly/assets/ser-connector-back.jpg b/content/retired/08.hacking/02.hardware/StandaloneAssembly/assets/ser-connector-back.jpg similarity index 100% rename from content/hacking/02.hardware/StandaloneAssembly/assets/ser-connector-back.jpg rename to content/retired/08.hacking/02.hardware/StandaloneAssembly/assets/ser-connector-back.jpg diff --git a/content/hacking/02.hardware/StandaloneAssembly/assets/standalone-header-space.jpg b/content/retired/08.hacking/02.hardware/StandaloneAssembly/assets/standalone-header-space.jpg similarity index 100% rename from content/hacking/02.hardware/StandaloneAssembly/assets/standalone-header-space.jpg rename to content/retired/08.hacking/02.hardware/StandaloneAssembly/assets/standalone-header-space.jpg diff --git a/content/hacking/02.hardware/StandaloneAssembly/assets/standalone-no-serial.jpg b/content/retired/08.hacking/02.hardware/StandaloneAssembly/assets/standalone-no-serial.jpg similarity index 100% rename from content/hacking/02.hardware/StandaloneAssembly/assets/standalone-no-serial.jpg rename to content/retired/08.hacking/02.hardware/StandaloneAssembly/assets/standalone-no-serial.jpg diff --git a/content/hacking/02.hardware/StandaloneAssembly/assets/standalone-schematic.jpg b/content/retired/08.hacking/02.hardware/StandaloneAssembly/assets/standalone-schematic.jpg similarity index 100% rename from content/hacking/02.hardware/StandaloneAssembly/assets/standalone-schematic.jpg rename to content/retired/08.hacking/02.hardware/StandaloneAssembly/assets/standalone-schematic.jpg diff --git a/content/hacking/02.hardware/StandaloneAssembly/assets/standalone-w-serial.jpg b/content/retired/08.hacking/02.hardware/StandaloneAssembly/assets/standalone-w-serial.jpg similarity index 100% rename from content/hacking/02.hardware/StandaloneAssembly/assets/standalone-w-serial.jpg rename to content/retired/08.hacking/02.hardware/StandaloneAssembly/assets/standalone-w-serial.jpg diff --git a/content/hacking/02.hardware/building-an-arduino-on-a-breadboard/assets/6pinAVRprogcable.jpg b/content/retired/08.hacking/02.hardware/building-an-arduino-on-a-breadboard/assets/6pinAVRprogcable.jpg similarity index 100% rename from content/hacking/02.hardware/building-an-arduino-on-a-breadboard/assets/6pinAVRprogcable.jpg rename to content/retired/08.hacking/02.hardware/building-an-arduino-on-a-breadboard/assets/6pinAVRprogcable.jpg diff --git a/content/hacking/02.hardware/building-an-arduino-on-a-breadboard/assets/6pinAVRproghead.jpg b/content/retired/08.hacking/02.hardware/building-an-arduino-on-a-breadboard/assets/6pinAVRproghead.jpg similarity index 100% rename from content/hacking/02.hardware/building-an-arduino-on-a-breadboard/assets/6pinAVRproghead.jpg rename to content/retired/08.hacking/02.hardware/building-an-arduino-on-a-breadboard/assets/6pinAVRproghead.jpg diff --git a/content/hacking/02.hardware/building-an-arduino-on-a-breadboard/assets/ArduinoISP_Front2.jpg b/content/retired/08.hacking/02.hardware/building-an-arduino-on-a-breadboard/assets/ArduinoISP_Front2.jpg similarity index 100% rename from content/hacking/02.hardware/building-an-arduino-on-a-breadboard/assets/ArduinoISP_Front2.jpg rename to content/retired/08.hacking/02.hardware/building-an-arduino-on-a-breadboard/assets/ArduinoISP_Front2.jpg diff --git a/content/hacking/02.hardware/building-an-arduino-on-a-breadboard/assets/Atmega168PinMap2.png b/content/retired/08.hacking/02.hardware/building-an-arduino-on-a-breadboard/assets/Atmega168PinMap2.png similarity index 100% rename from content/hacking/02.hardware/building-an-arduino-on-a-breadboard/assets/Atmega168PinMap2.png rename to content/retired/08.hacking/02.hardware/building-an-arduino-on-a-breadboard/assets/Atmega168PinMap2.png diff --git a/content/hacking/02.hardware/building-an-arduino-on-a-breadboard/assets/arduinobb_02.jpg b/content/retired/08.hacking/02.hardware/building-an-arduino-on-a-breadboard/assets/arduinobb_02.jpg similarity index 100% rename from content/hacking/02.hardware/building-an-arduino-on-a-breadboard/assets/arduinobb_02.jpg rename to content/retired/08.hacking/02.hardware/building-an-arduino-on-a-breadboard/assets/arduinobb_02.jpg diff --git a/content/hacking/02.hardware/building-an-arduino-on-a-breadboard/assets/arduinobb_03.jpg b/content/retired/08.hacking/02.hardware/building-an-arduino-on-a-breadboard/assets/arduinobb_03.jpg similarity index 100% rename from content/hacking/02.hardware/building-an-arduino-on-a-breadboard/assets/arduinobb_03.jpg rename to content/retired/08.hacking/02.hardware/building-an-arduino-on-a-breadboard/assets/arduinobb_03.jpg diff --git a/content/hacking/02.hardware/building-an-arduino-on-a-breadboard/assets/arduinobb_04.jpg b/content/retired/08.hacking/02.hardware/building-an-arduino-on-a-breadboard/assets/arduinobb_04.jpg similarity index 100% rename from content/hacking/02.hardware/building-an-arduino-on-a-breadboard/assets/arduinobb_04.jpg rename to content/retired/08.hacking/02.hardware/building-an-arduino-on-a-breadboard/assets/arduinobb_04.jpg diff --git a/content/hacking/02.hardware/building-an-arduino-on-a-breadboard/assets/arduinobb_05.jpg b/content/retired/08.hacking/02.hardware/building-an-arduino-on-a-breadboard/assets/arduinobb_05.jpg similarity index 100% rename from content/hacking/02.hardware/building-an-arduino-on-a-breadboard/assets/arduinobb_05.jpg rename to content/retired/08.hacking/02.hardware/building-an-arduino-on-a-breadboard/assets/arduinobb_05.jpg diff --git a/content/hacking/02.hardware/building-an-arduino-on-a-breadboard/assets/arduinobb_05_supply.jpg b/content/retired/08.hacking/02.hardware/building-an-arduino-on-a-breadboard/assets/arduinobb_05_supply.jpg similarity index 100% rename from content/hacking/02.hardware/building-an-arduino-on-a-breadboard/assets/arduinobb_05_supply.jpg rename to content/retired/08.hacking/02.hardware/building-an-arduino-on-a-breadboard/assets/arduinobb_05_supply.jpg diff --git a/content/hacking/02.hardware/building-an-arduino-on-a-breadboard/assets/arduinobb_06.jpg b/content/retired/08.hacking/02.hardware/building-an-arduino-on-a-breadboard/assets/arduinobb_06.jpg similarity index 100% rename from content/hacking/02.hardware/building-an-arduino-on-a-breadboard/assets/arduinobb_06.jpg rename to content/retired/08.hacking/02.hardware/building-an-arduino-on-a-breadboard/assets/arduinobb_06.jpg diff --git a/content/hacking/02.hardware/building-an-arduino-on-a-breadboard/assets/arduinobb_07.jpg b/content/retired/08.hacking/02.hardware/building-an-arduino-on-a-breadboard/assets/arduinobb_07.jpg similarity index 100% rename from content/hacking/02.hardware/building-an-arduino-on-a-breadboard/assets/arduinobb_07.jpg rename to content/retired/08.hacking/02.hardware/building-an-arduino-on-a-breadboard/assets/arduinobb_07.jpg diff --git a/content/hacking/02.hardware/building-an-arduino-on-a-breadboard/assets/arduinobb_08.jpg b/content/retired/08.hacking/02.hardware/building-an-arduino-on-a-breadboard/assets/arduinobb_08.jpg similarity index 100% rename from content/hacking/02.hardware/building-an-arduino-on-a-breadboard/assets/arduinobb_08.jpg rename to content/retired/08.hacking/02.hardware/building-an-arduino-on-a-breadboard/assets/arduinobb_08.jpg diff --git a/content/hacking/02.hardware/building-an-arduino-on-a-breadboard/assets/arduinobb_09.jpg b/content/retired/08.hacking/02.hardware/building-an-arduino-on-a-breadboard/assets/arduinobb_09.jpg similarity index 100% rename from content/hacking/02.hardware/building-an-arduino-on-a-breadboard/assets/arduinobb_09.jpg rename to content/retired/08.hacking/02.hardware/building-an-arduino-on-a-breadboard/assets/arduinobb_09.jpg diff --git a/content/hacking/02.hardware/building-an-arduino-on-a-breadboard/assets/arduinobb_10.jpg b/content/retired/08.hacking/02.hardware/building-an-arduino-on-a-breadboard/assets/arduinobb_10.jpg similarity index 100% rename from content/hacking/02.hardware/building-an-arduino-on-a-breadboard/assets/arduinobb_10.jpg rename to content/retired/08.hacking/02.hardware/building-an-arduino-on-a-breadboard/assets/arduinobb_10.jpg diff --git a/content/hacking/02.hardware/building-an-arduino-on-a-breadboard/assets/arduinobb_11.jpg b/content/retired/08.hacking/02.hardware/building-an-arduino-on-a-breadboard/assets/arduinobb_11.jpg similarity index 100% rename from content/hacking/02.hardware/building-an-arduino-on-a-breadboard/assets/arduinobb_11.jpg rename to content/retired/08.hacking/02.hardware/building-an-arduino-on-a-breadboard/assets/arduinobb_11.jpg diff --git a/content/hacking/02.hardware/building-an-arduino-on-a-breadboard/assets/arduinobb_12.jpg b/content/retired/08.hacking/02.hardware/building-an-arduino-on-a-breadboard/assets/arduinobb_12.jpg similarity index 100% rename from content/hacking/02.hardware/building-an-arduino-on-a-breadboard/assets/arduinobb_12.jpg rename to content/retired/08.hacking/02.hardware/building-an-arduino-on-a-breadboard/assets/arduinobb_12.jpg diff --git a/content/hacking/02.hardware/building-an-arduino-on-a-breadboard/assets/arduinobb_13.jpg b/content/retired/08.hacking/02.hardware/building-an-arduino-on-a-breadboard/assets/arduinobb_13.jpg similarity index 100% rename from content/hacking/02.hardware/building-an-arduino-on-a-breadboard/assets/arduinobb_13.jpg rename to content/retired/08.hacking/02.hardware/building-an-arduino-on-a-breadboard/assets/arduinobb_13.jpg diff --git a/content/hacking/02.hardware/building-an-arduino-on-a-breadboard/assets/arduinobb_14.jpg b/content/retired/08.hacking/02.hardware/building-an-arduino-on-a-breadboard/assets/arduinobb_14.jpg similarity index 100% rename from content/hacking/02.hardware/building-an-arduino-on-a-breadboard/assets/arduinobb_14.jpg rename to content/retired/08.hacking/02.hardware/building-an-arduino-on-a-breadboard/assets/arduinobb_14.jpg diff --git a/content/hacking/02.hardware/building-an-arduino-on-a-breadboard/assets/arduinobb_avradapter.jpg b/content/retired/08.hacking/02.hardware/building-an-arduino-on-a-breadboard/assets/arduinobb_avradapter.jpg similarity index 100% rename from content/hacking/02.hardware/building-an-arduino-on-a-breadboard/assets/arduinobb_avradapter.jpg rename to content/retired/08.hacking/02.hardware/building-an-arduino-on-a-breadboard/assets/arduinobb_avradapter.jpg diff --git a/content/hacking/02.hardware/building-an-arduino-on-a-breadboard/assets/arduinobb_bootload1.jpg b/content/retired/08.hacking/02.hardware/building-an-arduino-on-a-breadboard/assets/arduinobb_bootload1.jpg similarity index 100% rename from content/hacking/02.hardware/building-an-arduino-on-a-breadboard/assets/arduinobb_bootload1.jpg rename to content/retired/08.hacking/02.hardware/building-an-arduino-on-a-breadboard/assets/arduinobb_bootload1.jpg diff --git a/content/hacking/02.hardware/building-an-arduino-on-a-breadboard/assets/arduinobb_mk2.jpg b/content/retired/08.hacking/02.hardware/building-an-arduino-on-a-breadboard/assets/arduinobb_mk2.jpg similarity index 100% rename from content/hacking/02.hardware/building-an-arduino-on-a-breadboard/assets/arduinobb_mk2.jpg rename to content/retired/08.hacking/02.hardware/building-an-arduino-on-a-breadboard/assets/arduinobb_mk2.jpg diff --git a/content/hacking/02.hardware/building-an-arduino-on-a-breadboard/assets/arduinobb_parts.jpg b/content/retired/08.hacking/02.hardware/building-an-arduino-on-a-breadboard/assets/arduinobb_parts.jpg similarity index 100% rename from content/hacking/02.hardware/building-an-arduino-on-a-breadboard/assets/arduinobb_parts.jpg rename to content/retired/08.hacking/02.hardware/building-an-arduino-on-a-breadboard/assets/arduinobb_parts.jpg diff --git a/content/hacking/02.hardware/building-an-arduino-on-a-breadboard/assets/arduinobb_tiny.jpg b/content/retired/08.hacking/02.hardware/building-an-arduino-on-a-breadboard/assets/arduinobb_tiny.jpg similarity index 100% rename from content/hacking/02.hardware/building-an-arduino-on-a-breadboard/assets/arduinobb_tiny.jpg rename to content/retired/08.hacking/02.hardware/building-an-arduino-on-a-breadboard/assets/arduinobb_tiny.jpg diff --git a/content/hacking/02.hardware/building-an-arduino-on-a-breadboard/assets/arduinobb_usbback.jpg b/content/retired/08.hacking/02.hardware/building-an-arduino-on-a-breadboard/assets/arduinobb_usbback.jpg similarity index 100% rename from content/hacking/02.hardware/building-an-arduino-on-a-breadboard/assets/arduinobb_usbback.jpg rename to content/retired/08.hacking/02.hardware/building-an-arduino-on-a-breadboard/assets/arduinobb_usbback.jpg diff --git a/content/hacking/02.hardware/building-an-arduino-on-a-breadboard/assets/arduinobload_burn.png b/content/retired/08.hacking/02.hardware/building-an-arduino-on-a-breadboard/assets/arduinobload_burn.png similarity index 100% rename from content/hacking/02.hardware/building-an-arduino-on-a-breadboard/assets/arduinobload_burn.png rename to content/retired/08.hacking/02.hardware/building-an-arduino-on-a-breadboard/assets/arduinobload_burn.png diff --git a/content/hacking/02.hardware/building-an-arduino-on-a-breadboard/assets/arduinobload_burndone.png b/content/retired/08.hacking/02.hardware/building-an-arduino-on-a-breadboard/assets/arduinobload_burndone.png similarity index 100% rename from content/hacking/02.hardware/building-an-arduino-on-a-breadboard/assets/arduinobload_burndone.png rename to content/retired/08.hacking/02.hardware/building-an-arduino-on-a-breadboard/assets/arduinobload_burndone.png diff --git a/content/hacking/02.hardware/building-an-arduino-on-a-breadboard/assets/arduinobload_burning.png b/content/retired/08.hacking/02.hardware/building-an-arduino-on-a-breadboard/assets/arduinobload_burning.png similarity index 100% rename from content/hacking/02.hardware/building-an-arduino-on-a-breadboard/assets/arduinobload_burning.png rename to content/retired/08.hacking/02.hardware/building-an-arduino-on-a-breadboard/assets/arduinobload_burning.png diff --git a/content/hacking/02.hardware/building-an-arduino-on-a-breadboard/assets/arduinobload_pickboard.png b/content/retired/08.hacking/02.hardware/building-an-arduino-on-a-breadboard/assets/arduinobload_pickboard.png similarity index 100% rename from content/hacking/02.hardware/building-an-arduino-on-a-breadboard/assets/arduinobload_pickboard.png rename to content/retired/08.hacking/02.hardware/building-an-arduino-on-a-breadboard/assets/arduinobload_pickboard.png diff --git a/content/hacking/02.hardware/building-an-arduino-on-a-breadboard/assets/arduinobload_plugadapter.jpg b/content/retired/08.hacking/02.hardware/building-an-arduino-on-a-breadboard/assets/arduinobload_plugadapter.jpg similarity index 100% rename from content/hacking/02.hardware/building-an-arduino-on-a-breadboard/assets/arduinobload_plugadapter.jpg rename to content/retired/08.hacking/02.hardware/building-an-arduino-on-a-breadboard/assets/arduinobload_plugadapter.jpg diff --git a/content/hacking/02.hardware/building-an-arduino-on-a-breadboard/assets/arduinobload_plugin.jpg b/content/retired/08.hacking/02.hardware/building-an-arduino-on-a-breadboard/assets/arduinobload_plugin.jpg similarity index 100% rename from content/hacking/02.hardware/building-an-arduino-on-a-breadboard/assets/arduinobload_plugin.jpg rename to content/retired/08.hacking/02.hardware/building-an-arduino-on-a-breadboard/assets/arduinobload_plugin.jpg diff --git a/content/hacking/02.hardware/building-an-arduino-on-a-breadboard/assets/arduinobload_pwrgnd.jpg b/content/retired/08.hacking/02.hardware/building-an-arduino-on-a-breadboard/assets/arduinobload_pwrgnd.jpg similarity index 100% rename from content/hacking/02.hardware/building-an-arduino-on-a-breadboard/assets/arduinobload_pwrgnd.jpg rename to content/retired/08.hacking/02.hardware/building-an-arduino-on-a-breadboard/assets/arduinobload_pwrgnd.jpg diff --git a/content/hacking/02.hardware/building-an-arduino-on-a-breadboard/assets/arduinobload_wires.jpg b/content/retired/08.hacking/02.hardware/building-an-arduino-on-a-breadboard/assets/arduinobload_wires.jpg similarity index 100% rename from content/hacking/02.hardware/building-an-arduino-on-a-breadboard/assets/arduinobload_wires.jpg rename to content/retired/08.hacking/02.hardware/building-an-arduino-on-a-breadboard/assets/arduinobload_wires.jpg diff --git a/content/hacking/02.hardware/building-an-arduino-on-a-breadboard/building-an-arduino-on-a-breadboard.md b/content/retired/08.hacking/02.hardware/building-an-arduino-on-a-breadboard/building-an-arduino-on-a-breadboard.md similarity index 100% rename from content/hacking/02.hardware/building-an-arduino-on-a-breadboard/building-an-arduino-on-a-breadboard.md rename to content/retired/08.hacking/02.hardware/building-an-arduino-on-a-breadboard/building-an-arduino-on-a-breadboard.md diff --git a/content/hacking/02.hardware/hardware.md b/content/retired/08.hacking/02.hardware/hardware.md similarity index 100% rename from content/hacking/02.hardware/hardware.md rename to content/retired/08.hacking/02.hardware/hardware.md diff --git a/content/hacking/hacking.md b/content/retired/08.hacking/hacking.md similarity index 100% rename from content/hacking/hacking.md rename to content/retired/08.hacking/hacking.md diff --git a/content/hacking/header.png b/content/retired/08.hacking/header.png similarity index 100% rename from content/hacking/header.png rename to content/retired/08.hacking/header.png diff --git a/content/software/plc-ide/tutorials/plc-ide-cloud-support/content.md b/content/software/plc-ide/tutorials/plc-ide-cloud-support/content.md index 5de3a9463f..60d0845370 100644 --- a/content/software/plc-ide/tutorials/plc-ide-cloud-support/content.md +++ b/content/software/plc-ide/tutorials/plc-ide-cloud-support/content.md @@ -405,7 +405,7 @@ The PLC program will do the following processes: The following code delivers the previous tasks: -``` +```cpp cnt := cnt + 1; out_counter := cnt; diff --git a/content/software/plc-ide/tutorials/plc-ide-pin-mapping/content.md b/content/software/plc-ide/tutorials/plc-ide-pin-mapping/content.md index 31d2f37036..9076b88738 100644 --- a/content/software/plc-ide/tutorials/plc-ide-pin-mapping/content.md +++ b/content/software/plc-ide/tutorials/plc-ide-pin-mapping/content.md @@ -79,7 +79,7 @@ We will assign to the **Digital Output pin 2** the name **`digitalOut01`** To interact with the digital output pin you can use this code: -``` +```cpp // Set the Digital Output 01 to HIGH digitalOut01 := 1; @@ -102,7 +102,7 @@ Now on the popup menu, you can set the name of the variable, then select the typ As it is an array you will be able to access its pin in a **For loop** like the following: -``` +```cpp // Set all the Digital Outputs to HIGH FOR pinNumber := 0 TO 7 DO diff --git a/content/software/plc-ide/tutorials/plc-programming-introduction/content.md b/content/software/plc-ide/tutorials/plc-programming-introduction/content.md index 6fbcb0a144..2dfa2f3399 100644 --- a/content/software/plc-ide/tutorials/plc-programming-introduction/content.md +++ b/content/software/plc-ide/tutorials/plc-programming-introduction/content.md @@ -159,7 +159,8 @@ There are 5 languages available: ### Structured Text This language is similar to C, the code to assign a value to a variable is the following: -``` + +```cpp count := count + addition; ``` @@ -170,7 +171,8 @@ count := count + addition; This programming language is similar to Assembly programming. The code for a counter script is: -``` + +```cpp LD count ADD addition ST count