diff --git a/content/hardware/08.edu/solution-and-kits/alvik/tutorials/01.getting-started/assets/firmware.png b/content/hardware/08.edu/solution-and-kits/alvik/tutorials/01.getting-started/assets/firmware.png new file mode 100644 index 0000000000..ca2fefa27b Binary files /dev/null and b/content/hardware/08.edu/solution-and-kits/alvik/tutorials/01.getting-started/assets/firmware.png differ diff --git a/content/hardware/08.edu/solution-and-kits/alvik/tutorials/01.getting-started/assets/flashing_fw.png b/content/hardware/08.edu/solution-and-kits/alvik/tutorials/01.getting-started/assets/flashing_fw.png new file mode 100644 index 0000000000..919096f68b Binary files /dev/null and b/content/hardware/08.edu/solution-and-kits/alvik/tutorials/01.getting-started/assets/flashing_fw.png differ diff --git a/content/hardware/08.edu/solution-and-kits/alvik/tutorials/01.getting-started/assets/fw_path.png b/content/hardware/08.edu/solution-and-kits/alvik/tutorials/01.getting-started/assets/fw_path.png new file mode 100644 index 0000000000..7e51224f4b Binary files /dev/null and b/content/hardware/08.edu/solution-and-kits/alvik/tutorials/01.getting-started/assets/fw_path.png differ diff --git a/content/hardware/08.edu/solution-and-kits/alvik/tutorials/01.getting-started/assets/lib_folder.png b/content/hardware/08.edu/solution-and-kits/alvik/tutorials/01.getting-started/assets/lib_folder.png new file mode 100644 index 0000000000..aac0e41f9f Binary files /dev/null and b/content/hardware/08.edu/solution-and-kits/alvik/tutorials/01.getting-started/assets/lib_folder.png differ diff --git a/content/hardware/08.edu/solution-and-kits/alvik/tutorials/01.getting-started/assets/moving_alvik_folder.png b/content/hardware/08.edu/solution-and-kits/alvik/tutorials/01.getting-started/assets/moving_alvik_folder.png new file mode 100644 index 0000000000..3d448a3f63 Binary files /dev/null and b/content/hardware/08.edu/solution-and-kits/alvik/tutorials/01.getting-started/assets/moving_alvik_folder.png differ diff --git a/content/hardware/08.edu/solution-and-kits/alvik/tutorials/01.getting-started/assets/moving_examples.png b/content/hardware/08.edu/solution-and-kits/alvik/tutorials/01.getting-started/assets/moving_examples.png new file mode 100644 index 0000000000..2843ed2459 Binary files /dev/null and b/content/hardware/08.edu/solution-and-kits/alvik/tutorials/01.getting-started/assets/moving_examples.png differ diff --git a/content/hardware/08.edu/solution-and-kits/alvik/tutorials/01.getting-started/assets/moving_fw_bin.png b/content/hardware/08.edu/solution-and-kits/alvik/tutorials/01.getting-started/assets/moving_fw_bin.png new file mode 100644 index 0000000000..45be075b6e Binary files /dev/null and b/content/hardware/08.edu/solution-and-kits/alvik/tutorials/01.getting-started/assets/moving_fw_bin.png differ diff --git a/content/hardware/08.edu/solution-and-kits/alvik/tutorials/01.getting-started/assets/moving_ucPack.png b/content/hardware/08.edu/solution-and-kits/alvik/tutorials/01.getting-started/assets/moving_ucPack.png new file mode 100644 index 0000000000..72bea6d74f Binary files /dev/null and b/content/hardware/08.edu/solution-and-kits/alvik/tutorials/01.getting-started/assets/moving_ucPack.png differ diff --git a/content/hardware/08.edu/solution-and-kits/alvik/tutorials/01.getting-started/getting-started.md b/content/hardware/08.edu/solution-and-kits/alvik/tutorials/01.getting-started/getting-started.md index 1c2c802cb8..e1be52c70f 100644 --- a/content/hardware/08.edu/solution-and-kits/alvik/tutorials/01.getting-started/getting-started.md +++ b/content/hardware/08.edu/solution-and-kits/alvik/tutorials/01.getting-started/getting-started.md @@ -143,118 +143,76 @@ The connectors are placed in the back of the robot, the pinout is shown in the f ![Connectors Pinout](assets/datasheet_connectors.png) -## Coding Alvik +## Updating Alvik (Alvik First Use) -![Alvik USB Connection](assets/connecting-final.gif) +### Updating Alvik's Brain (Nano ESP32) -In order for Alvik to work properly three things have to be set correctly: +It may happen that you used your Nano ESP32 for other projects than Alvik, or you need to replace it. In order to make your Nano ESP32 work with Alvik, there are few steps needed: -1. The Nano ESP32 needs the [MicroPython firmware](https://labs.arduino.cc/en/labs/micropython) on it. -2. The [latest libraries](https://github.com/arduino/arduino-alvik-mpy/releases) have to be placed in the Nano ESP32. -3. The [latest firmware](https://github.com/arduino-libraries/Arduino_AlvikCarrier/releases) has to be uploaded to the STM32 microcontroller. +1. Install the micropython bootloader on it following [this guide](https://docs.arduino.cc/micropython/basics/board-installation/). -Alvik comes with a preinstalled version of libraries and firmware, but in case you want to upgrade it or if something happens and you mess things up, here is the guide to reinstall both libraries and firmware. +2. Download the Alvik micropyton libraries -### MicroPython Firmware on the Nano ESP32 + 1. Alvik micropython libraries from the [Alvik repository](https://github.com/arduino/arduino-alvik-mpy/tree/main) + 2. ucPack libraries from the [ucPack repository](https://github.com/arduino/ucPack-mpy/tree/main) -Download and install the [Arduino Lab for MicroPython](https://labs.arduino.cc/en/labs/micropython), if you are able to connect the Arduino Nano ESP32 it means that you're board is ready. You have to see the **CONNECTED** yellow label at the bottom. +3. Unzip both of the downloaded libraries in a single "Alvik" folder, open the Arduino Lab for MicroPython, go to the "files" tab and set the path to the unzipped folder on the Arduino Lab for Micropython -![Connection Succeeded](assets/connection_succeeded.png) + ![Setting the FW path on the Labs for micropython](assets/fw_path.png) -If something goes wrong it means you need to upload the MicroPython firmware on the Nano ESP32. + -Follow [this guide](https://docs.arduino.cc/micropython/basics/board-installation/). +4. Make sure your Alvik is OFF, connect it to your computer and then, turn it ON -### How to Upload Libraries + ![Alvik USB Connection](assets/connecting-final.gif) -You will find the latest instructions directly in the [repository](https://github.com/arduino/arduino-alvik-mpy/releases). Here are the main steps: + -1. Prepare file +5. Connect your Alvik to the Arduino Labs for micropython and open the "lib" + ![Setting the FW path on the Labs for micropython](assets/lib_folder.png) -Download the repository and extract all the files in a specific folder that will become the main Alvik folder. +6. Select the "Arduino-alvik" and move it to the "lib" folder in your Alvik. + ![Setting the FW path on the Labs for micropython](assets/moving_alvik_folder.png) -2. Remove old files +7. Go back to the main folder and select the "ucPack-mpy-main" folder and move it next ot the arduino_alvik inside the "lib" folder in your Nano ESP32. + ![Setting the FW path on the Labs for micropython](assets/moving_ucPack.png) -Open **Arduino Lab for MicroPython** and **connect** Alvik. Then: +8. Now go back to the main root of the files system on the Nano ESP32. Then in your local folder navigate to the examples folder once there, select the following files and move them to the main folder of the ESP32. -- Click on the `files` icon + 1. demo.py + 2. hand_follower.py + 3. line_follower.py + 4. main.py + 5. touch_move.py -- Click on a `files name` in the bottom left explorer windows. + ![Setting the FW path on the Labs for micropython](assets/moving_examples.png) -- Click on the `bin` icon to delete it +With this last step, your Nano ESP32 has been setted up with the Alvik out of the box experience and is ready to be used. -- Repeat for all the files, from all folders +### Updating Alvik's Body (STM32) -![Delete all files](assets/delete_files.png) +1. Download the [pre-compiled firmware](https://github.com/arduino-libraries/Arduino_AlvikCarrier/releases/latest) from the [Alvik Carrier GitHub reposiitory](https://github.com/arduino-libraries/Arduino_AlvikCarrier) -3. Install mpremote + This step will download a "firmware_x_x_x.bin" file, save it in your Alvik folder -[mpremote](https://docs.micropython.org/en/latest/reference/mpremote.html) is a Python module needed to upload files on the Nano ESP32. The minimum suggested mpremote release is 1.22.0. Be sure to have Python installed before proceeding! - -``` -(venv)$ pip install mpremote -``` - -or - -``` -(venv)$ python3 -m pip install mpremote -``` +2. Connect your Alvik to the Computer and to the Arduino Labs for Micropython. Then, go to the files tab and navigate to the folder where you stored the "firmware_x_x_x.bin" + ![Setting the FW path on the Labs for micropython](assets/firmware.png) -Depending on how you configure Python on your machine. - -4. Install library - -Run the following line to upload all files and download the dependencies needed to run the Arduino Alvik MicroPython library. +3. Let's move now the "firmware_x_x_x.bin" to the main root. + ![Setting the FW path on the Labs for micropython](assets/moving_fw_bin.png) -Linux -``` -$ ./install.sh -p -``` - -Windows -``` -> install.bat -p -``` + -The `install.*` script will copy all the needed files into your Alvik. +4. Turn ON your alvik, go to the Editor tab and tun the following commands by typing them and clicking on the "Play" button + ```shell + from arduino_alvik import update_firmware + + update_firmware('./firmware_1_0_0.bin') + ``` -The `` is the name of the USB port that your computer assigned to the Nano ESP32. There are several ways to find it, depending on your OS, for example: + ![Setting the FW path on the Labs for micropython](assets/flashing_fw.png) -- You can use the Arduino IDE to discover the port, [follow this guide to know more.](https://support.arduino.cc/hc/en-us/articles/4406856349970-Select-board-and-port-in-Arduino-IDE) -- You can check it by using the Arduino Lab for MicroPython by clicking `Connect` after connecting Alvik with the USB cable. -- You can check the list of the USB devices attached to your PC. - -### How to Upload Firmware - -1. Download the latest [pre-compiled firmware](https://github.com/arduino-libraries/Arduino_AlvikCarrier/releases/latest) and place it inside Alvik's project folder - -2. Go into `utilities` folder and run the `flash_firmware` script: - - -Linux -``` -$ ./flash_firmware.sh -p -``` - -Windows -``` -> flash_firmware.bat -p -``` -Answer `y` to flash firmware. - -### Test - -There are several examples to test all the features of your Alvik placed inside the `examples` folder. - -Open **Arduino Lab for MicroPython** and **connect** Alvik. Then: - -1. Click on the `files` icon -2. Click on the `path string` in the bottom right explorer windows. -3. Click on the `file name` of the example you choose -4. Click on the `play button` - -![Test examples files](assets/test_files.png) +After executing these commands, there will be updates of the process on the prompt, once the process finishes, the firmware of your alvik will be updated. ## Maintenance @@ -470,3 +428,101 @@ Now you can open the Arduino Lab for MicroPython, connect Alvik and open the exa 7. Test `bender.py` Open the example called `bender.py`, launch it and see on your display the image of Bender's robot. + + \ No newline at end of file