Upload Sketch for BiBoard

This chapter is for Advanced users with programming experience.

1. Read the Quick Start Guide

For the specific parameters of each functional module of BiBoard, please refer to:

2. Set up BiBoard

2.1 Prepare the ESP32 development environment

Note:

  • Arduino IDE 2.*.* cannot add the large_spiffs_16MB (4.5MB APP with OTA/6.93MB SPIFFS) configuration option currently.

  • The SPIFFS file upload plugin in Arduino IDE 1.8.* is written in Java. And Arduino IDE 2.0 is written in a different language (TypeScript + Golang), so the previous upload plugin cannot be used in Arduino IDE 2.*.* There is no support for the Arduino IDE 2.0 SPIFFS file upload plugin currently.

If you need to use more SPIFFS functions, it is recommended to install and use the Arduino IDE 1.8 temporarily; we strongly recommend the legacy version 1.8.19. Otherwise, the latest version 2.*.* is OK.

Open Preferences in Arduino, add the ESP32 development board URL:

https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json

Click OK button to save it.

Open Boards Manager... and wait for updates from external board support links. Search “esp32” and install the support package.

After showing INSTALLED, the BiBoard board support package is finished.

2.2 Modify the code file in the package

  • sdkconfig.h

  • For Windows: C:\Users\{username}\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.*\tools\sdk\esp32\qio_qspi\include\sdkconfig.h

  • For Mac: /Users/{username}/Library/Arduino15/packages/esp32/hardware/esp32/2.0.*/tools/sdk/esp32/qio_qspi/include/sdkconfig.h

  • For Ubuntu: Arduino root directory/.arduino15 (hidden file)/packages/esp32/hardware/esp32/2.0.12/tools/sdk/esp32/qio_qspi/include/sdkconfig.h

Append a line of code at the end of the file:

2.3 Setup the options

Please review the option list to configure the board's (ESP32 Dev Module) upload speed, CPU frequency, and other settings.

There is a setting for the Flash Size and Partition Scheme among the options. For more information, refer to the next section.

2.4 Choose hardware partition

The BiBoard V0 uses an ESP32 with a 16M flash. To simplify, you can use the Minimal SPIFFS (1.9MB APP with OTA/190KB SPIFFS) partition map without a problem. There's plenty of programming space for the standard OpenCatEsp32 firmware.

The BiBoard V1 uses an ESP32 with a 4M flash.

4 MB partition

You can use the Minimal SPIFFS (1.9MB APP with OTA/190KB SPIFFS).

16 MB partition

Suppose you want to fully utilize the 16 MB flash of BiBoard V0 (it's unnecessary and takes a longer uploading time). You can read the user manual for the Add hardware partition configuration option in Arduino IDE.

2.5 Download the source code & install the library

We keep updating the codes as an open-source project. You can star-mark and follow our GitHub repository to get the newest features and bug fixes. You can also share your codes with worldwide OpenCatEsp32 users.

Download the ​OpenCatEsp32-Quadruped-Robot source code

The GitHub repository is : https://github.com/PetoiCamp/OpenCatEsp32-Quadruped-Robot We suggest you utilize GitHub’s version control feature. Otherwise, make sure you download the WHOLE OpenCatEsp32 FOLDER every time. All the codes have to be the same version to work together.

If you download the Zip file of the codes, you will get an OpenCatEsp32-main folder after unzipping. Please rename it to OpenCatEsp32 before opening the OpenCatEsp32.ino so that the two names match.

  • There are several test***.ino codes in the ModuleTests folder. You can upload them separately to test specific modules (I recommend using testBuzzer.ino as your first test sketch).

Install the libraries

  • Download and install the MU Vision Sensor library into the Arduino IDE.

  • Install ArduinoJson in the Library Manager.

  • Install WebSockets in the Library Manager.

2.6 Connect to BiBoard via USB type-C data cable

Set the serial port in the Arduino IDE:

If you cannot find the serial port after connecting to your computer:

2.7 Compile and upload the sketch

Modify the device type macro definition in OpenCatEsp32.ino according to the device type.

Modify the motherboard model macro definition in OpenCatEsp32.ino according to the mainboard (BiBoard) version.

if the robot(Bittle X+Arm) with the robotic arm, you should also activate the macro definition as follows:

Otherwise, please comment out this line code.

After the modification is completed, you can click the Upload button (as below) to upload the sketch OpenCatEsp32.ino, and the changes in the code file will be automatically saved.

2.8 Program Initialization

If the version date of the currently uploaded sketch is newer than the version date of the mainboard firmware, it will automatically enter the initialization startup mode after the sketch upload is completed.

  • You can check the version date of the currently uploaded sketch in the source code file (OpenCatEsp32/src/OpenCat.h): #define DATE "250218" // YYMMDD

  • You can send the serial command "?" in the serial monitor to check the version date of the mainboard firmware:

When the mainboard is powered on, open the serial monitor and you will see the startup information:

If you do not see the startup information after opening the serial monitor, please short press the Reset button on the mainboard.

Next you will see the following prompt questions:

  • Send 'Y' to the question, which means resetting all servo corrections to zero.

  • Send "n" to skip this step.

If you want to keep the previous joint calibration data, please send 'n'.

  • Send 'Y' to the question, which means calibrating the IMU, i.e. the gyro/accelerometer sensor.

  • Send "n" to skip this step.

If you want to keep the previous IMU calibration data, please send 'n'.

Input 'n' and press Enter to continue. Or you can do nothing, it will Auto skip in 5 seconds.

The details of serial port printing information are as follows:

When the string "Ready!" is output in the serial monitor, the program will enter the regular startup mode.

Every time the mainboard is powered on, it compares the BIRTHMARK in the EEPROM to determine whether the program has been initialized. If the program has already been initialized, it will not enter the initialization startup mode again.

Note: When the mainboard is powered on, the music melodies played in the regular startup mode and the initialization startup mode are completely different. This is convenient for users (no need to open the serial monitor) and can also identify the startup mode.

If you need to clear the calibration parameters of the servo and recalibrate the joint servo, or recalibrate the IMU, you can send the serial command "!" in the serial monitor, and the program will re-enter the initialization startup mode.

2.9 Swith working mode via the serial commands (Optional)

The default code runs the Standard mode (including the Voice command function). If you want to switch modes, Please open the serial monitor and send the following serial commands:

Serial command
Function

XA

Voice. For BiBoard V0, the switch on the extension hat should be dialed to the Voice command side (default mode

XU

Ultrasonic. For BiBoard V0, the switch on the extension hat should be dialed to the Uart2 side; voice control will not work.

XC

Camera

XL

Light

XT

Touch

XI

PIR

XG

Gesture

XD

IR distance

XQ

Quick demo

XS

Enable the Serial 2(Tx2, Rx2). For BiBoard V0, the switch on the extension hat should be dialed to the Uart2 side; voice control will not work.

XB

Enable the back touch funtion.

X

Disable all the module functions above.

z

RandomMind (On/Off)

The behavior of the official modules is defined in separate header files in OpenCat/src/. You can find them in OpenCat/src/io.h -> readSignal(). The behavior of Quick demo mode is defined in OpenCat/OpenCat.ino -> quickDemo(). You can study the example code to write your functions.

You can learn about the function of each module through the EXTENSIBLE MODULES.

2.10 Power on

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

3. Configuration with App

The BiBoard has built-in Bluetooth, and you can connect it with the mobile app to do joint calibration and remote control.

You can check the update history information in the ChangeLog.md.

Last updated

Was this helpful?