Get Started: Create Your First Block Program

Uploading the Firmware

If you haven't set up the BiBoard and uploaded the firmware to the robot yet, please refer to the section Detailed Tutorial on BiBoard Setup.

Powering On the Robot

  • Long-press the battery button and boot up the robot with one side up. It will enter the calibration state automatically in the regular startup mode. The picture below shows the head, the upper and lower legs installed after the robot enters the calibration state.

Please refer to Chapter 5 🔌 Connect Wires and Chapter 6 📐 Calibration for the complete calibration process.

  • If you power on the robot and it is upright (with its back upward), the robot will start from the "rest" posture (fold the legs and unlock the servos) in the regular startup mode.

Open the Petoi Web Coding Blocks

Navigate to OpenCatEsp32 > PetoiWebCodingBlocks > main.html to start programming with Petoi Web Coding Blocks on web.

Connecting the Robot via Serial Port

Connect the robot’s mainboard to your computer via USB cable.

Please ensure the battery is connected to the robot, then long-press the battery switch to power on the robot. (If the battery is not used, connecting the robot to the web page or WiFi may fail next.)

Establishing the Serial Connection

Click the button in the on the webpage to establish a serial connection with the robot. Depending on your operating system, you may see the following connection pop-up windows:

  • Mac

  • Windows

  • Chromebook

Select the corresponding serial port as shown in the images above (you can unplug and replug the data cable connected to the robot to determine which serial port belongs to the robot). Click the "Connect" button and wait for the connection to be established.

Once the connection is successful, you will see the serial monitor open automatically. If the connection fails, please try refreshing the webpage and repeating the steps.

If your robot restarts automatically after connecting to the serial port, please wait for the restart process to complete.

At this point, you can now use the Petoi Web Coding Blocks to program the robot, with all commands being transmitted to the robot via the serial port. If you wish to start programming directly now, please skip ahead to section Create Your First Block-Based Programming Program.

If you wish to control the robot wirelessly (via WiFi), please continue reading this document.

Connecting the Robot via WiFi

When the robot does not have your WiFi credentials stored, a serial connection is required to establish a WiFi connection. Please confirm that you have connected the robot to your computer according to the previous section "Connecting the Robot via Serial Port".

Once your robot completes the initial WiFi setup, it will save the WiFi information internally, allowing you to connect the webpage to the robot via WiFi in the future.

To set up the WiFi connection for the robot for the first time, you need to perform the following steps:

Splitting Your WiFi Bands

For first-time use, you need to establish a connection between your robot and computer. Both must be on the same WiFi network, and the robot can only connect to 2.4GHz WiFi networks. Therefore, you need to split your WiFi SSID into two frequency bands.

Follow these steps to split your WiFi bands:

  1. Access your router’s Wireless Settings page (access method typically found on the router’s label).

  2. In the 2.4GHz settings, change the WiFi name (SSID) to xxx-2.4G and save.

  3. In the 5GHz settings, change the SSID to xxx-5G and save.

  4. After renaming, both xxx-2.4G and xxx-5G will appear in your device’s WiFi list.

Note: Since the WiFi names have changed, all devices connected to this router need to reconnect. If you didn’t change the password, it remains the original password.

First-Time WiFi Connection

Please confirm that your computer has connected to the 5G WiFi network specified in the previous section.

Click the button in the upper right corner, and a WiFi configuration window will pop up.

Enter the name and password of your 2.4GHz WiFi network, paying attention to capitalization, and click to wait for the connection.

Once the WiFi connection is successful, the robot will automatically restart to ensure the connection is available. You will see the IP address in the block in the workspace automatically updated.

Now you can start using the webpage programming blocks to write programs for the robot!

Subsequent WiFi Connections

Once your robot has stored your WiFi credentials, subsequent WiFi connections only require you to open the webpage, power on the robot, and click the button on the webpage. You will see the IP address in the block in the workspace automatically updated.

Due to potential changes in the router's IP address, the webpage may sometimes fail to connect to the robot via WiFi without a cable. Simply connect the robot to your computer with the cable and click to connect, and the new IP address will be automatically updated and saved.

Additionally, you can still use a cable for a wired connection. Petoi Web Coding Blocks will prioritize serial communication for optimal performance.

Create Your First Block-Based Programming Program

Now the robot can receive instructions from the computer program! Let’s officially write your first block-based program and make it work.

Drag the Blocks

Click on the option in the toolbox on the left, find the second block , and drag it under the default code block in the workspace. This is the starting point of the program.

Click on to expand the dropdown menu and select the posture . Click on and enter a number such as 3. This will make Bittle greet and then wait for 3 seconds.

Click on the option in the toolbox on the left, find the first block labeled and drag it below the block you just added.

Then, click on the option, find the first block (empty text block), and drag it to the right of the block you just added, like this: This will allow the program to output any text content to the console. Let’s click on the added text block and enter: Hello world!

Run the Program

Click in the upper left corner, and you will see the program we just wrote in action: the robot greets, and after 3 seconds, the console on the right side of the webpage displays the output message "Hello World!"

Congratulations on completing your first block-based programming program! For a detailed introduction to using the Petoi Web Coding Blocks, please refer to Detailed Interface Introduction.

Chromebook Connection Guide

For Chromebook users, you may need to ensure the following 3 settings are correct to successfully connect to the serial port and WiFi.

1 System Settings for Serial Port Connection

This section applies whenever you accidentally click the "Connect to Linux" button in the image shown below.

When you plug in the USB cable to connect the robot to your computer, a pop-up window will appear in the lower right corner of the screen, as shown in the image. Please do not click the "Connect to Linux" button in the pop-up window, simply close the window directly.

If you did not click this button in the pop-up window, you can skip this section and proceed directly to the next two sections.

If you accidentally click the button in the pop-up window, please follow the steps below.

  1. Open your computer settings, scroll to the bottom of the left settings column, find "About ChromeOS" and click on it.

  2. Then, scroll to the bottom of the right settings content, locate the "Linux development environment" tab, and click to enter.

  1. Locate the "Manage USB devices" tab and click to enter.

  1. Find your robot's serial port option, like the "USB Single Serial" option shown in the image below. You will notice that the toggle switch for this option is in the ON position.

If there are multiple serial port options listed here, you can identify the robot's serial port by unplugging and replugging the cable connected to the robot and observing which serial port option disappears or appears.

Click it to turn it off.

2 WiFi Connection Setup

  1. Click to open WiFi settings.

  1. Please confirm that you have selected the 5G WiFi network to be used for connecting to the robot, such as the WiFi set here is CAT-5G. Then, scroll to the bottom, click on the "Proxy" tab, and switch the "Connection type" to "Direct Internet Connection".

3 Browser Settings for Serial Port Connection

  1. Open your Google Chrome browser, click the menu button in the upper-right corner, scroll to the bottom of the pop-up menu, and find and click the "Settings" option to open the browser settings page. In the settings page, locate and click to open the "Privacy and security" tab.

  1. Scroll down and locate the "Additional permissions" tab, then click to expand it.

  1. Locate the "Serial ports" tab and click to open it.

  1. Click to select the option "Sites can ask to connect to serial ports" to allow your browser to connect to serial ports.

Last updated