USB controller

Since 2020, the esieabot is provided with a wireless USB controller. It is a gamepad with 2 joysticks, 10 buttons, and a D-pad. It is connected to the Raspberry Pi through a USB dongle. The wireless communication is achieved through the 2.4 GHz frequency with a proprietary protocol.

../../_images/controller1.png

Note

The wireless controller can be cumbersome to use in an environment with many esieabots. In that case, you can use the virtual controller.

Power the controller

The controller is powered by two AAA batteries. To replace them, open the battery compartment on the back of the controller. To turn it on, set the ON/OFF switch to the ON position. It is located on the front of the controller, between the two joysticks. The controller will be automatically set in sleep mode after few minutes of inactivity. To turn it back on, press the “mode” button.

Pair the controller

The controller is in pairing mode when it is turned on. While in pairing mode, the green and red LEDs on the top of the controller will blink. To pair the controller with the USB dongle, plug the dongle into the Raspberry Pi’s left USB port. The controller will automatically pair with the dongle. The green LED will stop blinking and the red LED will stay on.

Warning

The controller is not hard binded to the dongle. It will try to pair to any free dongle in range. If you are running multiple esieabots in the same room, try to leave the room while pairing the controller to avoid pairing it to the wrong dongle. If it is paired to the wrong dongle, you can unpair it switching the controller off and on again.

Test the controller

To test the controller, you can use the command jstest. This command is part of the package joystick. If it is not installed on your esieabot, you can install it with the following command:

sudo apt install joystick

Then, you can test the controller with the following command:

jstest /dev/input/js0

This program will show you every axis and buttons of your controller. Try to use them all to see if there are correctly recognized. If nothing is shown on screen, check if your controller is binding to your dongle and not any other one. You can exit the test by pressing Ctrl+C.

Note

As usual, these commands must be run in a terminal on the esieabot.

Control your esieabot with the controller

There are built-in programs installed on the esieabot to control it with the controller. There are located in the folder /esieabot/available/official. The program esieabot-demo-v4 is a basic demo program that uses the controller to control the esieabot. The program esieabot-pwm is a more advanced program that uses the controller to control the esieabot with PWM signals which allows a more precise control.