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 script to bind rfcomm device to remote Bluetooth device #1401

Merged
merged 6 commits into from
Jul 1, 2022

Conversation

708yamaguchi
Copy link
Member

cherry-picked from knorth55#146

I add script to bind rfcomm device to remote bluetooth device.

By binding rfcomm device, we can connect bluetooth device via rosserial.
https://github.com/sktometometo/M5Stack_Bluetooth_rosserial_example

Usage

Save the bluetooth device MAC address to file like (/var/lib/robot/rfcomm_devices.yaml)

- name: device1
  address: XX:XX:XX:XX:XX:XX
- name: device2
  address: YY:YY:YY:YY:YY:YY

Then, run this program.
If you use PR2,

roslaunch jsk_pr2_startup pr2_rfcomm_bind.launch machine:=c2  # bluetooth dongle is now in c2

management

Currently, I automatically start the above launch file by upstart in PR2.

The config file is in /etc/upstart/jsk-rfcomm-bind.conf in pr2.

To check how many devices are bound to rfcomm, use rfcomm command.

ssh pr2
ssh c2
rfcomm

@708yamaguchi 708yamaguchi added hacktoberfest-accepted https://hacktoberfest.digitalocean.com/hacktoberfest-update PR1040 labels Oct 11, 2021
@knorth55 knorth55 mentioned this pull request Nov 11, 2021
50 tasks
Copy link
Member

@k-okada k-okada left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@708yamaguchi
Copy link
Member Author

708yamaguchi commented Nov 19, 2021

Thank you very much for your advice.

I add usage and management information to README.md.

@708yamaguchi
Copy link
Member Author

With this commit, existing rfcomm devices is cleared when rfcomm_bind.py is executed.

If we continue to call rfcomm_bind.py without clearing rfcomm devices, the number of rfcomm devices will continue to increase, making it difficult to manage.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hacktoberfest-accepted https://hacktoberfest.digitalocean.com/hacktoberfest-update PR1040
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants