---
title: Guide to using Gateway to experience Leanbot Digital Twin
description: "**Updated on October 16, 2023** To experience Leanbot Digital Twin, you need to grant Leanbot permission to connect to the Internet for transmitting and receiving data related to Leanbot's activities within the system. To achieve this, you can follow this…"
url: "https://pythaverse.space/docs/guide-to-using-gateway-to-experience-metaverse-with-leanbot/"
updated: "2023-10-16"
category: Leanbot Documentations / Guideline
tags:
  - DigitalTwin
  - Leanbot
  - Metaverse Demo
  - Pythaverse
  - User Guide
  - Window
---

# Guide to using Gateway to experience Leanbot Digital Twin

**Updated on October 16, 2023**

To experience Leanbot Digital Twin, you need to grant Leanbot permission to connect to the Internet for transmitting and receiving data related to Leanbot's activities within the system. To achieve this, you can follow this **Using PC Gateway** tutorial ***(DO NOT use Android Gateway app)*.**
**Here are detailed instructions on how to use Gateway PC:**
The steps include:

![](https://pythaverse.space/wp-content/uploads/2023/10/image-96.png)

### **I. Upload code to Leanbot**

#### Step 1. Visit the ******PGit******page to go to the DigitalTwin folder

- On PGit, click on [leanbot/Example/DigitalTwin](https://git.pythaverse.space/leanbot/Examples/tree/master/DigitalTwin) folder.
- Here, you will find program codes for experiencing Leanbot Digital Twin.

![](https://pythaverse.space/wp-content/uploads/2023/10/image-98.png)

#### Step 2. Double-click to open a mission file

For example, select the "Mission_1.1.ino" file

![](https://pythaverse.space/wp-content/uploads/2023/10/image-101.png)

#### Step 3. Copy all program code, click "******PCodeEditor********"**to redirect to PIDE page

- (1) Select all program code and press "Ctrl+C" key to copy
- (2) Click "PCodeEditor" to redirect to PIDE page

![](https://pythaverse.space/wp-content/uploads/2023/10/image-100.png)

#### Step 4. Create a new project on PIDE page

- (1) Click "**CREATE A NEW PROJECT**" button
- (2) Input your project
- (3) Click "**CREATE**" button

![](https://pythaverse.space/wp-content/uploads/2023/10/image-103-1024x691.png)

#### Step 5. Press "Ctrl+A" and "Ctrl+V" keys at 'area to paste the copied code'

![](https://pythaverse.space/wp-content/uploads/2023/10/image-104-1024x516.png)

### Step 6. Connect Leanbot to PC

Using a USB cable to connect Leanbot to PC.

***Note: It is recommended to turn Leanbot on before connecting to the computer.***

![](https://pythaverse.space/wp-content/uploads/2023/10/image-106.png)

### Step 7. Select the "****Compile & Upload****" icon

![](https://pythaverse.space/wp-content/uploads/2023/10/image-109.png)

### Step 8. Select USB Serial (COMx) on your PC, click "********Connect********" to upload code to Leanbot

![](https://pythaverse.space/wp-content/uploads/2023/10/image-108.png)

### Step 9. Successfully upload program code to Leanbot

- Icon (1) displays when Leanbot is successfully connected to the PC via USB cable.

- Receive a notification when the code upload is successfully completed, it will display "100% - Done!"(2).

![](https://pythaverse.space/wp-content/uploads/2023/10/image-110.png)

### **II. Connect Leanbot to PC via Bluetooth**

#### Step 1. Search for Bluetooth on your PC (personal computer)

- On your PC, Click on the *‘***Start***’ *menu-> Enter key ‘**Bluetooth**’ to search -> then select "**Bluetooth and other devices settings"***.*
- *For example, Bluetooth settings on Windows 10 Pro*.

![](https://pythaverse.space/wp-content/uploads/2023/10/image-71.png)

#### Step 2. Turn on the Leanbot robot

When the robot is turned on, you can see the Bluetooth light on the robot blinking.

![](https://pythaverse.space/wp-content/uploads/2023/10/image-57.png)

#### Step 3. Search Leanbot ID (without BLE) and click "**Pair**"

- Select**Leanbot ID**(without BLE) and click "**Pair**".
- *For example, select Bluetooth connection with '***Leanbot ID*****'** as **Leanbot 157163**. Do not select Leanbot 157163 BLE.*

![](https://pythaverse.space/wp-content/uploads/2023/10/image-17.png)

- Verify your Leanbot ID (as shown in the image below)

![](https://pythaverse.space/wp-content/uploads/2023/10/image-59.png)

- Each Leanbot is assigned a unique Leanbot ID.

#### Step 4. Enter the passcode as: "1234" and click*"*Next*"* button to connect.

![](https://pythaverse.space/wp-content/uploads/2023/10/image-14.png)

#### Step 5. Successfully connect Leanbot robot to PC via Bluetooth

When Leanbot robot is successfully connected to the computer via Bluetooth, and it will display *"**Connected**"*.

![](https://pythaverse.space/wp-content/uploads/2023/10/image-72.png)

#### Step 6. How to verify the **Port (COMx)** before connecting Leanbot to the PC Gateway

- Search for ***"Devices and Printers**"*
- *The example image is on the Windows 10 Pro operating system.*

![](https://pythaverse.space/wp-content/uploads/2023/10/image-86.png)

- Double click on the Leanbot ID icon.
- *For example, Leanbot has ID 157163.*

![](https://pythaverse.space/wp-content/uploads/2023/10/image-87.png)

- You will rely on the COM port found on your computer and use it to connect to PC Gateway.
- *For example, Leanbot uses Port (COMx) to connect to the Gateway, and in this case, it's Port (COM4).*

![](https://pythaverse.space/wp-content/uploads/2023/10/image-95.png)

### **III. Connect Leanbot to PC Gateway for data transmission**

#### Step 1. Access to the Gateway

There are 2 ways as follows:

- **Option 1**: Access [LEANBOT - DIGITAL TWIN DEMO](https://learn.pythaverse.space/course/view.php?id=382) course on PLearn page.
  Open the lesson to perform the mission on Leanbot Digital Twin, then click on "***Gateway***" button on the mission screen.
  - *For example, ms1 - The Leanbot moves forward, backward*.
    - *On the left menu, select a mission.*
    - *Left-click to open it.*
    - *Then, click the *****"*******Gateway*******"***** button.*
  - Other missions are also performed similarly to ms1.

![](https://pythaverse.space/wp-content/uploads/2023/10/image-118-1024x725.png)

![](https://pythaverse.space/wp-content/uploads/2023/10/image-115.png)

- ****Option 2****: Access to the [Gateway](https://meta.pythaverse.space/gateway?lang=en)

![](https://pythaverse.space/wp-content/uploads/2023/10/image-116.png)

#### Step 2. (Only if you experience Chrome crashing) Reset permission on Chrome browser

- Do not select Leanbot ID, because this will lead to Chrome crash
- In case Leanbot ID is selected by mistake (in step 4), please correct the mistake by following these ‘Reset permission’ steps:
  - Click on the "***Lock***" icon (1). *For example, Leanbot ID is Leanbot 157163*
  - Then click the "***Reset permission***" button (2)
  - Go to [**Step 3**](https://pythaverse.space/docs/guide-to-using-gateway-to-experience-metaverse-with-leanbot/#9-toc-title).

![](https://pythaverse.space/wp-content/uploads/2023/10/image-94.png)

#### Step 3. Click the***"Select Leanbot to connect"***

![](https://pythaverse.space/wp-content/uploads/2023/10/image-19.png)

#### Step 4. Select a connection Port (for robot connected on PC via Bluetooth)

- Select the correct ***Port (COMx)***. There are various COM ports available depending on your computer.
- Then click “***Connect***”.
- **DO NOT** select Leanbot ID. If you select it incorrectly, repeat [**Step 2**](https://pythaverse.space/docs/guide-to-using-gateway-to-experience-metaverse-with-leanbot/#9-toc-title).
- *Example 1: as shown in the picture, the Port (COMx) corresponds to **Port (COM4)**. This image is used on Chrome browser version 117.0.5938.134 or higher.*

![](https://pythaverse.space/wp-content/uploads/2023/10/image-85.png)

- *Example 2: the port (COMx) corresponds to **Port (COM6)**. This image is used on older versions of Chrome browser.*

![](https://pythaverse.space/wp-content/uploads/2023/10/image-45.png)

#### Step 5. Connect Leanbot to Gateway for successful data transfer

- The Bluetooth light stops blinking when the Gateway connection is successful

- During the experience, if the robot is disconnected, the Bluetooth light on Leanbot robot is blinking, you need to reload this page and repeat steps from [**Step 2**](https://pythaverse.space/docs/guide-to-using-gateway-to-experience-metaverse-with-leanbot/#9-toc-title) to Step 5.

![](https://pythaverse.space/wp-content/uploads/2023/10/image-12.png)

### **IV.ExperienceLeanbot Digital Twin**

#### Step 1. Prepare

To experience **Leanbot Digital Twin**, you must use the following codes to upload to Leanbot, then access [LEANBOT - DIGITAL TWIN DEMO](https://learn.pythaverse.space/course/view.php?id=382) course on PLearn.

#### Step 2. Click *"**Run"*** at the mission practice screen on PLearn page

##### *- Example 1 with mission ****"****ms1.1****"*****

![](https://pythaverse.space/wp-content/uploads/2023/10/image-47-1024x550.png)

##### *- With mission 'Leanbot movement on Mars Field Track*' as*********"******ms11.1", "ms11.2"** also does the same.*

![](https://pythaverse.space/wp-content/uploads/2023/10/image-6-1024x605.png)

#### Step 3. Wait for the system to check the connected devices

##### *- Example 1, mission **"ms1.1"***

![](https://pythaverse.space/wp-content/uploads/2023/10/image-48.png)

Click *****"Start now"***** button to begin.

![](https://pythaverse.space/wp-content/uploads/2023/10/image-50.png)

##### -*With respect to mission 'Leanbot movement on Mars Field Track' as **"ms11.1", "ms11.2"** performs the same action*.

#### Step 4. Robot runs mission on the Leanbot Digital Twin

##### -*With mission **"ms1.1"** move forward and backward*

- Place the robot on a flat table.
- Then, go to **[Step 5](https://pythaverse.space/docs/guide-to-using-gateway-to-experience-metaverse-with-leanbot/#24-toc-title)**

![](https://pythaverse.space/wp-content/uploads/2023/10/image-51-789x1024.png)

##### -*With missions Leanbot movement on Mars Field Track* as ***"ms11.1"** or **"ms11.2"** moving along the black line*

- The Leanbot robot must first learn to recognize black and white lines on the Mars fieldtrack.
- Next, go to **[Step 4](https://pythaverse.space/docs/guide-to-using-gateway-to-experience-metaverse-with-leanbot/#23-toc-title)**

![](https://pythaverse.space/wp-content/uploads/2023/10/image-26.png)

#### Step 5. Place the robot at starting point A and go to[Step 5](https://pythaverse.space/docs/guide-to-using-gateway-to-experience-metaverse-with-leanbot/#24-toc-title)

- All experience missions perform this step.
- Regarding the mission ms1, you can choose whether to use the Mars fieldtrack or just do it as [Step 4](https://pythaverse.space/docs/guide-to-using-gateway-to-experience-metaverse-with-leanbot/#31-toc-title). After that, continue to **Step 5,** and the robot will execute the mission.

![](https://pythaverse.space/wp-content/uploads/2023/10/image-28.png)

#### Step 6. Run Leanbot robot on Digital Twin

The Digital Twin screen displays the following information: **Status:**Ready**, Time:**0.000000 and **Score:**0, then click the *"**Start"***button to begin.

***Note***:To guarantee the robot transmits accurate data, only click the "***Start***" button when all the above information ***(Status, Time, Score) is displayed*****.**

##### -*Example 1 with mission **"ms1.1"***

![](https://pythaverse.space/wp-content/uploads/2023/10/image-53-1024x620.png)

##### - *With mission Leanbot movement on Mars Field Track **"ms11.1"****, "ms11.2"***

#### Step 7. Leanbot robot completes the mission

When Leanbot robot completes the mission, the updated status is ***Finish***.

##### - *Example 1 with mission **"ms1.1"***

![](https://pythaverse.space/wp-content/uploads/2023/10/image-55-1024x563.png)

##### - *Example 2 with mission **"ms11.2"***

![](https://pythaverse.space/wp-content/uploads/2023/10/image-30-683x1024.png)

#### The final step is confirming mission completion

- To confirm mission completion, click ***"Verify task completion"*** **(1)**, click *****"OK"***** (**2**) and close the tab **(3)** on the browser screen to conclude the mission.

![](https://pythaverse.space/wp-content/uploads/2023/10/image-67.png)

- At the mission screen on PLearn, search for robot activities by clicking the *****"Search"***** to find recently executed robot activities

![](https://pythaverse.space/wp-content/uploads/2023/10/image-32-1024x585.png)

***Note:***
*****- You need ***to follow the above steps correctly to join in the Leanbot Digital Twin experience.********

- ********DO NOT turn off the Leanbot robot.********

- If you wish to run a mission again, you can "************Reload this page************" after completing **[Step 7](https://pythaverse.space/docs/guide-to-using-gateway-to-experience-metaverse-with-leanbot/#29-toc-title),** then press the **"**********Reset**********"** button on the robot and follow the instructions in**[Step 6](https://pythaverse.space/docs/guide-to-using-gateway-to-experience-metaverse-with-leanbot/#26-toc-title)**

- Reload this page to run a mission again.

![](https://pythaverse.space/wp-content/uploads/2023/10/image-65.png)

- Reset Leanbot robot. DO NOT turn off the robot.

![](https://pythaverse.space/wp-content/uploads/2023/10/image-64.png)

Pythaverse Team.

[Back to Top](https://pythaverse.space/docs/guide-to-using-gateway-to-experience-metaverse-with-leanbot/#0-toc-title)
