Skip to content

Commit 82ab248

Browse files
committed
adding flashing documentation
1 parent 6bb6382 commit 82ab248

File tree

9 files changed

+43
-85
lines changed

9 files changed

+43
-85
lines changed

content/hardware/08.edu/solution-and-kits/alvik/tutorials/01.getting-started/getting-started.md

+43-85
Original file line numberDiff line numberDiff line change
@@ -143,118 +143,76 @@ The connectors are placed in the back of the robot, the pinout is shown in the f
143143

144144
![Connectors Pinout](assets/datasheet_connectors.png)
145145

146-
## Coding Alvik
146+
## Updating Alvik (Alvik First Use)
147147

148-
![Alvik USB Connection](assets/connecting-final.gif)
148+
### Updating Alvik's Brain (Nano ESP32)
149149

150-
In order for Alvik to work properly three things have to be set correctly:
150+
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:
151151

152-
1. The Nano ESP32 needs the [MicroPython firmware](https://labs.arduino.cc/en/labs/micropython) on it.
153-
2. The [latest libraries](https://github.com/arduino/arduino-alvik-mpy/releases) have to be placed in the Nano ESP32.
154-
3. The [latest firmware](https://github.com/arduino-libraries/Arduino_AlvikCarrier/releases) has to be uploaded to the STM32 microcontroller.
152+
1. Install the micropython bootloader on it following [this guide](https://docs.arduino.cc/micropython/basics/board-installation/).
155153

156-
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.
154+
2. Download the Alvik micropyton libraries
157155

158-
### MicroPython Firmware on the Nano ESP32
156+
1. Alvik micropython libraries from the [Alvik repository](https://github.com/arduino/arduino-alvik-mpy/tree/main)
157+
2. ucPack libraries from the [ucPack repository](https://github.com/arduino/ucPack-mpy/tree/main)
159158

160-
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.
159+
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
161160

162-
![Connection Succeeded](assets/connection_succeeded.png)
161+
![Setting the FW path on the Labs for micropython](assets/fw_path.png)
163162

164-
If something goes wrong it means you need to upload the MicroPython firmware on the Nano ESP32.
163+
165164

166-
Follow [this guide](https://docs.arduino.cc/micropython/basics/board-installation/).
165+
4. Make sure your Alvik is OFF, connect it to your computer and then, turn it ON
167166

168-
### How to Upload Libraries
167+
![Alvik USB Connection](assets/connecting-final.gif)
169168

170-
You will find the latest instructions directly in the [repository](https://github.com/arduino/arduino-alvik-mpy/releases). Here are the main steps:
169+
171170

172-
1. Prepare file
171+
5. Connect your Alvik to the Arduino Labs for micropython and open the "lib"
172+
![Setting the FW path on the Labs for micropython](assets/lib_folder.png)
173173

174-
Download the repository and extract all the files in a specific folder that will become the main Alvik folder.
174+
6. Select the "Arduino-alvik" and move it to the "lib" folder in your Alvik.
175+
![Setting the FW path on the Labs for micropython](assets/moving_alvik_folder.png)
175176

176-
2. Remove old files
177+
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.
178+
![Setting the FW path on the Labs for micropython](assets/moving_ucPack.png)
177179

178-
Open **Arduino Lab for MicroPython** and **connect** Alvik. Then:
180+
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.
179181

180-
- Click on the `files` icon
182+
1. demo.py
183+
2. hand_follower.py
184+
3. line_follower.py
185+
4. main.py
186+
5. touch_move.py
181187

182-
- Click on a `files name` in the bottom left explorer windows.
188+
![Setting the FW path on the Labs for micropython](assets/moving_examples.png)
183189

184-
- Click on the `bin` icon to delete it
190+
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.
185191

186-
- Repeat for all the files, from all folders
192+
### Updating Alvik's Body (STM32)
187193

188-
![Delete all files](assets/delete_files.png)
194+
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)
189195

190-
3. Install mpremote
196+
This step will download a "firmware_x_x_x.bin" file, save it in your Alvik folder
191197

192-
[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!
193-
194-
```
195-
(venv)$ pip install mpremote
196-
```
197-
198-
or
199-
200-
```
201-
(venv)$ python3 -m pip install mpremote
202-
```
203-
204-
Depending on how you configure Python on your machine.
205-
206-
4. Install library
207-
208-
Run the following line to upload all files and download the dependencies needed to run the Arduino Alvik MicroPython library.
209-
210-
Linux
211-
```
212-
$ ./install.sh -p <device port>
213-
```
214-
215-
Windows
216-
```
217-
> install.bat -p <device port>
218-
```
219-
220-
The `install.*` script will copy all the needed files into your Alvik.
221-
222-
The `<device port>` 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:
223-
224-
- 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)
225-
- You can check it by using the Arduino Lab for MicroPython by clicking `Connect` after connecting Alvik with the USB cable.
226-
- You can check the list of the USB devices attached to your PC.
227-
228-
### How to Upload Firmware
229-
230-
1. Download the latest [pre-compiled firmware](https://github.com/arduino-libraries/Arduino_AlvikCarrier/releases/latest) and place it inside Alvik's project folder
231-
232-
2. Go into `utilities` folder and run the `flash_firmware` script:
233-
234-
235-
Linux
236-
```
237-
$ ./flash_firmware.sh -p <device port> <path-to-your-firmware>
238-
```
239-
240-
Windows
241-
```
242-
> flash_firmware.bat -p <device port> <path-to-your-firmware>
243-
```
244-
Answer `y` to flash firmware.
198+
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"
199+
![Setting the FW path on the Labs for micropython](assets/firmware.png)
245200

246-
### Test
201+
3. Let's move now the "firmware_x_x_x.bin" to the main root.
202+
![Setting the FW path on the Labs for micropython](assets/moving_fw_bin.png)
247203

248-
There are several examples to test all the features of your Alvik placed inside the `examples` folder.
204+
249205

250-
Open **Arduino Lab for MicroPython** and **connect** Alvik. Then:
206+
4. Turn ON your alvik, go to the Editor tab and tun the following commands by typing them and clicking on the "Play" button
207+
```shell
208+
from arduino_alvik import update_firmware
209+
210+
update_firmware('./firmware_1_0_0.bin')
211+
```
251212

252-
1. Click on the `files` icon
253-
2. Click on the `path string` in the bottom right explorer windows.
254-
3. Click on the `file name` of the example you choose
255-
4. Click on the `play button`
213+
![Setting the FW path on the Labs for micropython](assets/flashing_fw.png)
256214

257-
![Test examples files](assets/test_files.png)
215+
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.
258216

259217
## Maintenance
260218

0 commit comments

Comments
 (0)