Message thread on Webots Real Robots

Unable to communicate with ePuck via bluetoothby Andrew Valancius (Webots EDU - 3) 2018-09-17 03:46:56
HI, I'm running Webots EDU R2018b on Ubuntu 18.04.1

I believe I have set up my Bluetooth connection properly. I followed the steps outlined in the bluetooth setup guide here: https://www.cyberbotics.com/doc/guide/epuck#bluetooth-setup

I start Webots, I find the com port listed in the robot window. I successfully select the com port, but when I press play I get this error in the webots console:
INFO: beginner_e-puck_dance: Starting: ""/usr/local/webots/resources/projects/controllers/void/void""
[beginner_e-puck_dance] Bluetooth connection failed with this error
[beginner_e-puck_dance] Serial error on port "���" : File "���" does not exists. No such file or directory
[beginner_e-puck_dance] 
[beginner_e-puck_dance] Please check:
[beginner_e-puck_dance] - your Bluetooth interface is setup properly on your computer
[beginner_e-puck_dance] - the ID of the robot corresponds to the bluetooth connection
[beginner_e-puck_dance] - the robot runs the latest version of the sercom program
[beginner_e-puck_dance] - the robot is not too far away from the Bluetooth antenna of the computer
[beginner_e-puck_dance] - the robot is switched on (the green led should be on)
[beginner_e-puck_dance] - the battery of the robot is fully charged (the red led should off)
[beginner_e-puck_dance] - the robot reset button was pressed
[beginner_e-puck_dance] Error: Starting the remote control library (wbr_start) failed
Here is another run from the Webots console
[beginner_e-puck_dance] Bluetooth connection failed with this error
[beginner_e-puck_dance] Serial error on port "`V��" : File "`V��" does not exists. No such file or directory
[beginner_e-puck_dance] 
[beginner_e-puck_dance] Please check:
[beginner_e-puck_dance] - your Bluetooth interface is setup properly on your computer
[beginner_e-puck_dance] - the ID of the robot corresponds to the bluetooth connection
[beginner_e-puck_dance] - the robot runs the latest version of the sercom program
[beginner_e-puck_dance] - the robot is not too far away from the Bluetooth antenna of the computer
[beginner_e-puck_dance] - the robot is switched on (the green led should be on)
[beginner_e-puck_dance] - the battery of the robot is fully charged (the red led should off)
[beginner_e-puck_dance] - the robot reset button was pressed
[beginner_e-puck_dance] Error: Starting the remote control library (wbr_start) failed


I then reproduced this but sent the output to the linux terminal and I got this similarly confusing error:
INFO: beginner_e-puck_dance: Starting: ""/usr/local/webots/resources/projects/controllers/void/void""
[beginner_e-puck_dance] Bluetooth connection failed with this error
[beginner_e-puck_dance] Serial error on port "" : File "" does not exists. No such file or directory
[beginner_e-puck_dance] 
[beginner_e-puck_dance] Please check:
[beginner_e-puck_dance] - your Bluetooth interface is setup properly on your computer
[beginner_e-puck_dance] - the ID of the robot corresponds to the bluetooth connection
[beginner_e-puck_dance] - the robot runs the latest version of the sercom program
[beginner_e-puck_dance] - the robot is not too far away from the Bluetooth antenna of the computer
[beginner_e-puck_dance] - the robot is switched on (the green led should be on)
[beginner_e-puck_dance] - the battery of the robot is fully charged (the red led should off)
[beginner_e-puck_dance] - the robot reset button was pressed
[beginner_e-puck_dance] Error: Starting the remote control library (wbr_start) failed
And here's another run in terminal
INFO: beginner_e-puck_dance: Starting: ""/usr/local/webots/resources/projects/controllers/void/void""
[beginner_e-puck_dance] Bluetooth connection failed with this error
[beginner_e-puck_dance] Serial error on port "`���" : File "`���" does not exists. No such file or directory
[beginner_e-puck_dance] 
[beginner_e-puck_dance] Please check:
[beginner_e-puck_dance] - your Bluetooth interface is setup properly on your computer
[beginner_e-puck_dance] - the ID of the robot corresponds to the bluetooth connection
[beginner_e-puck_dance] - the robot runs the latest version of the sercom program
[beginner_e-puck_dance] - the robot is not too far away from the Bluetooth antenna of the computer
[beginner_e-puck_dance] - the robot is switched on (the green led should be on)
[beginner_e-puck_dance] - the battery of the robot is fully charged (the red led should off)
[beginner_e-puck_dance] - the robot reset button was pressed
[beginner_e-puck_dance] Error: Starting the remote control library (wbr_start) failed



I was hoping that there was some weird issue with my fonts in Webots so I tried the linux terminal, but the blank file path left me just as confused. I don't know what type of file it's looking for, nor where it is looking, so I don't know how to continue here. I have tried this with the mode selector switch in position 3 and 11 with the same results.

Before submitting this post I also tried multiple ways of making sure that the epuck was paired and trusted. for example, after binding the ePuck to rfcomm0, using rfcomm would output
rfcomm0: 10:00:E8:AD:5B:42 channel 1 config [tty-attached]
I also tried using bluetoothctl to set up the connection and I was able to successfully pair and trust the ePuck, but no matter how I set up the connection, when I select the appropriate COM port in the RobotWindow in Webots, I would always get an error like above. Please let me know if there is any other pertinent information you might need to help me.
Re: Unable to communicate with ePuck via bluetoothby Fabien Rohrer (Webots PRO - 1317) 2018-09-17 09:11:52
Hi,

It looks like the port string is somehow corrupted. I never saw this before.
This string should be given to the e-puck bluetooth library through the environment variable called "WEBOTS_COM[1-9]"

The font and the switch position should not be related with the issue.

1. Could you check how you defined the "WEBOTS_COM1" environment variable (as described in the doc)?
Sharing the terminal commands (and their output) you wrote before calling webots would be helpful.
2. Did you uninstalled the "modemmanager" package as suggested in the documentation?
3. On the first connection, the Ubuntu Bluetooth applet should ask you to enter the e-puck PIN. If you failed this step, it may cause similar issues. I expect that removing the e-puck from the Bluetooth applet and retry to pair it could help.
4. You should try to use the "e-puck monitor". http://www.gctronic.com/doc/index.php/E-Puck#PC_interface
(i.e. to try to dialog with the e-puck without Webots.) This would help us to understand what's going on.

Sincerely,
Fabien Rohrer
Re: Unable to communicate with ePuck via bluetoothby Andrew Valancius (Webots EDU - 3) 2018-09-18 00:00:19
Hi,
Thank you so much for the reply.
So I uninstalled modemmanager and retried everything with similar results.
Here is what I did:
andrew@Theodin-Ubuntu18:~$ hcitool scan
Scanning ...
	10:00:E8:AD:5B:42	e-puck_2703
andrew@Theodin-Ubuntu18:~$ cd /
andrew@Theodin-Ubuntu18:/$ sudo rfcomm bind /dev/rfcomm1 10:00:E8:AD:5B:42
andrew@Theodin-Ubuntu18:/$ sudo chmod 666 /dev/rfcomm1
andrew@Theodin-Ubuntu18:/$ ls /dev/ | grep rf
btrfs-control
rfcomm1
rfkill
andrew@Theodin-Ubuntu18:/$ export WEBOTS_COM1=/dev/rfcomm1
andrew@Theodin-Ubuntu18:/$ export | grep WE
declare -x WEBOTS_COM1="/dev/rfcomm1"
andrew@Theodin-Ubuntu18:/$ webots --stdout --stderr
INFO: beginner_e-puck_dance: Starting: ""/usr/local/webots/resources/projects/controllers/void/void""
[beginner_e-puck_dance] Bluetooth connection failed with this error
[beginner_e-puck_dance] Serial error on port "�n]��" : File "�n]��" does not exists. No such file or directory
[beginner_e-puck_dance] 
[beginner_e-puck_dance] Please check:
[beginner_e-puck_dance] - your Bluetooth interface is setup properly on your computer
[beginner_e-puck_dance] - the ID of the robot corresponds to the bluetooth connection
[beginner_e-puck_dance] - the robot runs the latest version of the sercom program
[beginner_e-puck_dance] - the robot is not too far away from the Bluetooth antenna of the computer
[beginner_e-puck_dance] - the robot is switched on (the green led should be on)
[beginner_e-puck_dance] - the battery of the robot is fully charged (the red led should off)
[beginner_e-puck_dance] - the robot reset button was pressed
[beginner_e-puck_dance] Error: Starting the remote control library (wbr_start) failed
INFO: beginner_e-puck_dance: Terminating.
andrew@Theodin-Ubuntu18:/$ 

The good news however, is that I was able to connect using the ePuckMonitor utility.
Here is what I did with bluetoothctl
andrew@Theodin-Ubuntu18:/$ bluetoothctl
[NEW] Controller 5C:F3:70:84:B7:9C Theodin-Ubuntu18 [default]
[NEW] Device 10:00:E8:AD:5B:42 e-puck_2703
Agent registered
[bluetooth]# pair 10:00:E8:AD:5B:42
Attempting to pair with 10:00:E8:AD:5B:42
Failed to pair: org.bluez.Error.AlreadyExists
[bluetooth]# info 10:00:E8:AD:5B:42
Device 10:00:E8:AD:5B:42 (public)
	Name: e-puck_2703
	Alias: e-puck_2703
	Paired: yes
	Trusted: yes
	Blocked: no
	Connected: no
	LegacyPairing: no
	UUID: Serial Port               (00001101-0000-1000-8000-00805f9b34fb)
[bluetooth]# remove 10:00:E8:AD:5B:42
[DEL] Device 10:00:E8:AD:5B:42 e-puck_2703
Device has been removed
[bluetooth]# scan on
Discovery started
[CHG] Controller 5C:F3:70:84:B7:9C Discovering: yes
[NEW] Device 10:00:E8:AD:5B:42 e-puck_2703
[bluetooth]# pair 10:00:E8:AD:5B:42
Attempting to pair with 10:00:E8:AD:5B:42
[CHG] Device 10:00:E8:AD:5B:42 Connected: yes
Request PIN code
[e-pu1m[agent] Enter PIN code: 2703
[CHG] Device 10:00:E8:AD:5B:42 UUIDs: 00001101-0000-1000-8000-00805f9b34fb
[CHG] Device 10:00:E8:AD:5B:42 ServicesResolved: yes
[CHG] Device 10:00:E8:AD:5B:42 Paired: yes
Pairing successful
[CHG] Device 10:00:E8:AD:5B:42 ServicesResolved: no
[CHG] Device 10:00:E8:AD:5B:42 Connected: no
[bluetooth]# trust 10:00:E8:AD:5B:42
[CHG] Device 10:00:E8:AD:5B:42 Trusted: yes
Changing 10:00:E8:AD:5B:42 trust succeeded
[bluetooth]# info 10:00:E8:AD:5B:42
Device 10:00:E8:AD:5B:42 (public)
	Name: e-puck_2703
	Alias: e-puck_2703
	Paired: yes
	Trusted: yes
	Blocked: no
	Connected: no
	LegacyPairing: yes
	UUID: Serial Port               (00001101-0000-1000-8000-00805f9b34fb)
	RSSI: -69
[CHG] Device 10:00:E8:AD:5B:42 RSSI: -78
[bluetooth]# info 10:00:E8:AD:5B:42
Device 10:00:E8:AD:5B:42 (public)
	Name: e-puck_2703
	Alias: e-puck_2703
	Paired: yes
	Trusted: yes
	Blocked: no
	Connected: no
	LegacyPairing: yes
	UUID: Serial Port               (00001101-0000-1000-8000-00805f9b34fb)
	RSSI: -78
[CHG] Device 10:00:E8:AD:5B:42 RSSI: -67
[CHG] Device 10:00:E8:AD:5B:42 Connected: yes
[CHG] Device 10:00:E8:AD:5B:42 Connected: no
[bluetooth]# 

As you can see, I was able to succesfully pair with the ePuck.
At the end of the output you'll see the connected status go from no to yes when I connected to the ePuck with ePuckMonitor.
This did not happen when I attempted to connect to the ePuck in Webots. Webots just spit out that same file does not exist error.
I entered /dev/rfcomm1 in ePuckMonitor and it worked. I'm fairly confident that WEBOTS_COM1 is set correctly because /dev/rfcomm1 shows up in the RobotWindow dropdown menu.
Re: Unable to communicate with ePuck via bluetoothby Fabien Rohrer (Webots PRO - 1317) 2018-09-18 14:08:29
It's quite clear now that it comes from a memory corruption in libe-puck_bluetooth.so. By luck you have access to the code source of this library.

I contact you in a private e-mail right now to give you instructions.

Sincerely,
Fabien Rohrer
You need to log in to be able to reply, subscribe or unsubscribe to this thread

LIVE CHAT (beta)

How can I help you?

Support team
Chat with us ×