Firmware Uploader
This manual for Beginner. Makes it easier for you to get started with the robot(Nybble / Bittle ).
Last updated
This manual for Beginner. Makes it easier for you to get started with the robot(Nybble / Bittle ).
Last updated
After downloading the compressed file(.zip), please unzip it first.
Do NOT move the UI.exe to another location in Windows.
Petoi Desktop App works on both Nybble and Bittle controlled by NyBoard based on ATmega328P or Bittle X controlled by BiBoard based on ESP32. For NyBoard, more detailed documentation can be found at NyBoard V1_0, NyBoard V1_1, or NyBoard V1_2 (which is similar to NyBoard V1_1).
Use the USB uploader for NyBoard.
For more details, please refer to the Connect NyBoard section in the USB uploader module for specific steps.
You can find the board version number on the NyBoard.
Note:
For NyBoard V1_1, the board version number is here:
Dial the I2C switch(Sw2) to the "Arduino" side
The I2C switch changes the master of I2C devices (gyro/accelerometer, servo driver, external EEPROM). On default “Arduino”, NyBoard uses the onboard ATmega328P as the master chip; On “RPi”, NyBoard uses external chips connected through the I2C ports (SDA, SCL) as the master chip. Always select "Arduino" unless you can connect the I2C devices from the external chip.
Notes:
Sometimes, if you cannot go through the bootup stage, such as repetitively printing "IMU" and restarting, you may have accidentally dialed the switch to the "RPi" side.
Use the USB type-C data cable for BiBoard.
If you cannot find the serial port after connecting to your computer:
You may need to install the driver for the CP210x chip.
If the battery powers the BiBoard, please long-press the button on the battery >=3s to power off the mainboard so that the board is only powered through the USB cable and only the blue LED is lit up.
You can find the board version number on the BiBoard:
On the pre-assembled Bittle/Bittle X, you can check the version information of BiBoard like this by taking a picture and zooming in to see the version information:
There may be some OS platform compatibility issues with different computers.
You can still run the app directly from your terminal:
Go to OpenCat/pyUI/ in your terminal.
Install pyserial and pillow for your Python. You may get a clean Anaconda environment and pip3 install pyserial pillow
Run python3 UI.py
For NyBoard, the firmware uploader calls the application avrdude to upload firmware files to the mainboard.
Linux OS
For Linux system users, in addition to the above steps, you also need to perform the following steps:
1. Install avrdude
Fedora: dnf install avrdude
CentOS: yum install avrdude
Debian / Ubuntu: apt install avrdude
2. Modify the variable avrdudeconfPath in FirmwareUploader.py
Fedora / CentOS : avrdudeconfPath = '/etc/avrdude/'
Debian / Ubuntu : avrdudeconfPath = '/etc/'
For BiBoard, the firmware uploader calls the application esptool to upload firmware files to the mainboard.
After properly connecting the USB uploader, open the PetoiDesktopApp (for Windows: UI.exe / for Mac: Petoi Desktop App), and select your Model and Language.
The 1.0 software won't work properly with the Joint Calibrator, the Skill Composer, and other APIs. Only use it when you want to use CodeCraft (a graphical coding interface by our partner, TinkerGen).
Software version
1.0
2.0 (default)
The 1.0 version is obsolete.
Board version
NyBoard_V1_0 (default) NyBoard_V1_1 NyBoard_V1_2 BiBoard_V0_1 BiBoard_V0_2
BiBoard_V0_1 or BiBoard_V0_2 is for Bittle X only.
Product
Bittle (default) Nybble Bittle X
Mode
Standard (default) RandomMind Voice Mind+ Camera Ultrasonic RandomMind_Ultrasonic Light Touch PIR Gesture IR distance
For NyBoard, these 12 modes can be selected. All of these modes are applicable to both Bittle and Nybble.
For BiBoard, You only need to upload the Standard mode firmware, and you can switch between different modes via serial port commands. [1]
Serial port
Auto detection or by manual selection.
You can find the correct one through unplug and replug the USB socket on the computer side
You can use the following serial commands to switch modes for BiBoard:
XA
Voice. The switch on the extension hat should be dialed to the Voice command side
XU
Ultrasonic. The switch on the extension hat should be dialed to Uart2 side
XC
Camera
XL
Light
XT
Touch
XI
PIR
XG
Gesture
XD
IR distance
XQ
Quick demo
X
Standard
z
RandomMind (On/Off)
For BiBoard, Mind+ mode is supported by default and does not require a serial command to switch on.
For documentation on each sensor, please refer to the corresponding pages in the EXTENSIBLE MODULES section.
You can use the serial commands to switch modes for BiBoard: For BiBoard, Mind+ mode is supported by default, so it doesn't require a serial command to switch on. You can learn about the function of each module through the EXTENSIBLE MODULES.
There's no correlation between the board (hardware) version and the code (software) version.
Factory Reset Our factory uses it to improve efficiency. However, it automatically resets all the parameters, including the calibration parameters of the servos and the IMU, so it's not recommended for regular users.
Upgrade the Firmware It will upgrade both the parameters and the main function.
It is mandatory if you just downloaded a new version of this desktop app.
Update the Mode Only If you have upgraded the firmware at least once after downloading a new version of this desktop app, you can switch between the modes without refreshing the parameters. It's faster by skipping the firmware upgrade stage.
After clicking the Upgrade the Firmware button, the uploading process starts immediately. The status bar at the bottom shows the current progress in real-time and the results of key processes.
After the Parameters firmware has been successfully uploaded, the board runs the configuration program. Some message windows will pop up in sequence for you to confirm or cancel:
Reset joint offsets? (Y/N)
Select "Yes, " and the program will reset all servo calibration parameters to zero. The status bar will update the corresponding process and result in real time.
Select "No" to preserve the calibration value(so that you don't need to calibrate again if you have done so before).
If you select "Yes," the program will upload all skill configuration parameters, and the status bar will update the corresponding process and result in real-time.
Select "No," and the program will skip this step.
If you upload this version of the software for the first time, be sure to select "Yes"!
For software version 2.0, this choice is automatically processed as Y in the background.
Calibrate IMU? (Y/N)
Select "Yes, " and the program will calibrate the gyroscope (IMU) to balance the robot correctly. The status bar will update the corresponding process and result in real time.
Select "No," and the program will skip this step.
Note:
Ensure the mainboard is positioned horizontally before clicking the "Yes" button.
When uploading this firmware version for the first time, click the "Yes" button!
When all the steps are completed, a message window will appear showing "Parameter initialization complete!" You must confirm to proceed to the second round of uploading the main functional code.
When the above window pops up, there's an optional step to calibrate the servo driver before clicking OK. If later you find one of the servos stops working but can resume working after re-powering it, it's probably due to an inaccurate PWM driver signal. Please redo the previous uploading, and this step CANNOT be skipped.
This calibration makes the servo controller's (PCA9685 chip) angle signal more precise. A short jumper wire is used to connect the PWM pin 3 (the signal pin of one of the servo pins) and Grove pin A3, and the wire is steady. It doesn’t have to be a dedicated jumper wire. Any thin metal wire, such as a straightened paper clip, can work as long as it can connect the pins.
The program measures the pulse width of the signal and automatically calibrates the chip after successively getting three identical readings. It usually takes less than 2 seconds. The board will beep three times to indicate the calibration is done. The calibration offset will be saved to the board for the next bootup. The process should be done at least once, and we have calibrated every board after October 2022. But you can still do it by yourself, just in case.
After the upload, the status bar will update the corresponding result, such as the success or failure of firmware uploading. If the uploading is successful, a message window of "Firmware upload complete!" will pop up simultaneously.
Note:
When you open the software and upload the firmware for the first time, the program will first upload the "Parameters" firmware and then the "Main function" firmware. If you re-upload after a successful upload, the program will only upload the "Main function" firmware as long as you only modify the "Mode" option.
If the NyBoard is not connected to the battery and powered on, you will hear repetitive descending melodies, indicating that the battery is low or disconnected. You need to connect the battery and turn on its power.
If the uploading fails, the following message box will pop up:
The log file is located at:
For Windows: The log file is in the same directory as UI.exe
For macOS: You can check the log file as follows:
When you contact our support@petoi.com, please attach the log file to your email.
If you have Arduino IDE programming experience, you can see the same log message when uploading.
For NyBoard, you can refer to Upload Sketch For NyBoard.
For BiBoard, you can refer to Upload Sketch For BiBoard.
Before uploading the firmware, please ensure that no I2C device is connected to the I2C interface of the mainboard. Otherwise, the firmware upload will fail. The location of the I2C interface is as shown below (in the red box):
For software version 1.0, there is a warning message window of "Update Instincts? (Y/N)" will pop up as follows: