Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ArduinoBluetoothHardware and example #569

Open
wants to merge 6 commits into
base: noetic-devel
Choose a base branch
from

Conversation

sktometometo
Copy link

@sktometometo sktometometo commented Sep 20, 2021

Add ArduinoBluetoothHardware.h and example for ESP32 Bluetooth Serial.

This PR enables rosserial connection over bluetooth of ESP32.
I don't know who originaly develop this usage, but already some uses this.

I thinks this will be useful for otherESP32 rosserial users.

I confirmed that example program works with boards below

  • ESP32-DevKitC-32E
  • M5Stack Core
  • M5Stack Core2
  • M5StickC

Usage

FIrst, burn the example sketch to your ESP32 board.
After that, connect your PC's bluetooth interface to esp32 board

bluetoothctl
scan on # check MAC address of your device
scan off
pair <MAC address of your device>
trust <MAC address of your device>
connect <MAC address of your device>
info <MAC address of your device> # check if your device is successfully connected

And bind bluetooth serial connection to /dev/rfcomm1

sudo rfcomm bind 1 <MAC address of your device>
sudo stty -F /dev/rfcomm1 57600 cs8

Now you can use rosserial over bluetooth

roscore
rosrun rosserial_python serial_node.py _port:=/dev/rfcomm1 _baud:=57600

@smiiisato
Copy link

I'm using devkit-v1 from esp32 and it didn't connect at all. But https://blog.51cto.com/u_12369060/5192168とhttps://askubuntu.com/questions/137794/why-is-my-bluetooth-connection-always-failing I did sudo apt install blueman and used blueman-manager to set up serial communication and it worked fine. Thank you very much.

@k-okada
Copy link

k-okada commented Jul 11, 2023

tips: to use this with latest noetic branch, we may need #448.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants