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.


Note:
You must open main.html using Google Chrome.
Ensure the browser is in direct connection mode.
It's best not to use a VPN, as it may slow down the response speed and impact the experience.

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.)
For Chromebook users, before proceeding with the next steps, you need to refer to the Chromebook Connection Guide chapter and complete the three settings mentioned in it.
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.
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".
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:
Access your router’s Wireless Settings page (access method typically found on the router’s label).
In the 2.4GHz settings, change the WiFi name (SSID) to
xxx-2.4Gand save.In the 5GHz settings, change the SSID to
xxx-5Gand save.After renaming, both
xxx-2.4Gandxxx-5Gwill appear in your device’s WiFi list.
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!
This entire process only needs to be set up once. The robot remembers your WiFi credentials.
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.
Note:
The connection relies on the local network environment. Please ensure your robot is always on the same WiFi network as your computer during every subsequent connection. Your network IP address may not always remain unchanged. If you entered the IP address directly in the workspace block but failed to connect, please consider possible IP address changes.
You may:
Connect the computer to the robot via the serial port. Send command w through the Petoi Web Coding Block's serial monitor, or simply click the
button to check and update the IP address.
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!"

Note: If you haven't set up WiFi for your robot and are using serial connection only, a WiFi configuration window will appear when you first click "Run Code". Simply close the pop-up and click
again to proceed.
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
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.
Open your computer settings, scroll to the bottom of the left settings column, find "About ChromeOS" and click on it.
Then, scroll to the bottom of the right settings content, locate the "Linux development environment" tab, and click to enter.

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

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.

Click it to turn it off.

2 WiFi Connection Setup
Click to open WiFi settings.


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
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.

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

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

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

Last updated