Skip to content

Jgd postlaunch updates #1954

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -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 <device port>
```

Windows
```
> install.bat -p <device port>
```


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 `<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:
![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 <device port> <path-to-your-firmware>
```

Windows
```
> flash_firmware.bat -p <device port> <path-to-your-firmware>
```
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

Expand Down Expand Up @@ -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.

<!--
## Julian Proposal

## What is Alvik

![This is an image](assets/alvik-classroom.jpg)

Arduino® Alvik is a powerful and versatile robot specifically designed for programming and STEAM education. Powered by the Arduino® Nano ESP32, Alvik offers diverse learning paths through different programming languages including MicroPython, Arduino C, and block-based coding; enabling different possibilities to explore Robotics, IoT and Artificial Intelligence.



### What is included

![Unboxing Alvik](assets/unboxing.jpg)

Inside Alvik's packaging you will find the following items:
* Alvik (x1)
* Cable USB-C® to USB-C® (x1)
* 18650 Battery (already inside the robot) (x1)


***The product is sensible to electrostatic discharge, observe ESD-safe handling procedures when working with it***


### The Brain

Alvik have two controllers

### The Body

#### Controller

#### Power

- How to charge Alvik
- Replacing the battery

#### Sensors
- Touch Buttons
- Distance Sensor
- Line Follower Sensors
- Color Sensor
- IMU

#### Actuators
- Motors and Encoders

## Move Alvik!

### Basic Touch Programming

### Following Objects

### Line Follower


## Alvik First Use

### Update Alvik's body

### Update Alvik's brain
- Update ESP32 Micropython Firmware
- Update Alvik's Library
### Hello Alvik! Your first program!


## Program Alvik!

### Controlling the motors

### Reading buttons

### Detecting obstacles

### Following a line

### Sensing colors

### Detecting Crashes and Fallings

### LEDs

## Expanding the Robot

### Additional Connectors
- Qwiic Connectors
- Grove Connectors
- Servomotors Connectors

### Lego Technic Compatibility

### Custom parts

## Want more?

## Need Help?
-->
Loading