Splint
Posts: 31
Joined: Tue Jan 28, 2020 4:15 pm

Onboard bluetooth comms between RPi 3s

Thu Jun 17, 2021 7:42 am

I've been following this guide https://www.reddit.com/r/raspberry_pi/c ... th_serial/ but I got to step 4 and entered:

Code: Select all

sudo nano /etc/systemd/system/dbus-org.bluez.service
the response was

Code: Select all

Invalid command in menu main: sudo
I'm confident there are no errors in the command. Anyone know what's going on here?

Thanks

User avatar
rpdom
Posts: 18875
Joined: Sun May 06, 2012 5:17 am
Location: Chelmsford, Essex, UK

Re: Onboard bluetooth comms between RPi 3s

Thu Jun 17, 2021 7:58 am

You need to exit from the "[bluetooth]#" prompt before you can type that command. Just "exit" or "quit" or pressing Ctrl and D should do it.
Unreadable squiggle

Splint
Posts: 31
Joined: Tue Jan 28, 2020 4:15 pm

Re: Onboard bluetooth comms between RPi 3s

Thu Jun 17, 2021 8:05 am

Thank you :)

Splint
Posts: 31
Joined: Tue Jan 28, 2020 4:15 pm

Re: Onboard bluetooth comms between RPi 3s

Sat Jun 19, 2021 6:24 am

Things have gone pretty well up to the last step where the address is changed in the rfcomm-client.py file is changed.

The default code is:

Code: Select all

addr = None
which I changed to:

Code: Select all

addr = B8:27:EB:5E:18:0F
But when I try and run the code it returns a syntax error with the arrow pointing at the first colon. Any idea why this is the case and hoe to resolve it?

There is also mention in the reddit guide of "it's a string so use "ADDRESS"", I'm not clear on what this means.

Thanks.

RonR
Posts: 2282
Joined: Tue Apr 12, 2016 10:29 pm
Location: US

Re: Onboard bluetooth comms between RPi 3s

Sat Jun 19, 2021 7:04 am

Splint wrote:
Sat Jun 19, 2021 6:24 am
Things have gone pretty well up to the last step where the address is changed in the rfcomm-client.py file is changed.

The default code is:

Code: Select all

addr = None
which I changed to:

Code: Select all

addr = B8:27:EB:5E:18:0F
But when I try and run the code it returns a syntax error with the arrow pointing at the first colon. Any idea why this is the case and hoe to resolve it?

There is also mention in the reddit guide of "it's a string so use "ADDRESS"", I'm not clear on what this means.

Have you tried using "B8:27:EB:5E:18:0F" (with quotes) or "B827EB5E180F" (without colons and with/without quotes)?

User avatar
rpdom
Posts: 18875
Joined: Sun May 06, 2012 5:17 am
Location: Chelmsford, Essex, UK

Re: Onboard bluetooth comms between RPi 3s

Sat Jun 19, 2021 7:09 am

Splint wrote:
Sat Jun 19, 2021 6:24 am
Things have gone pretty well up to the last step where the address is changed in the rfcomm-client.py file is changed.

The default code is:

Code: Select all

addr = None
which I changed to:

Code: Select all

addr = B8:27:EB:5E:18:0F
But when I try and run the code it returns a syntax error with the arrow pointing at the first colon. Any idea why this is the case and hoe to resolve it?

There is also mention in the reddit guide of "it's a string so use "ADDRESS"", I'm not clear on what this means.

Thanks.
That line should be:

Code: Select all

addr = "B8:27:EB:5E:18:0F"
It's a string, so it needs to be in quotes.
Unreadable squiggle

Splint
Posts: 31
Joined: Tue Jan 28, 2020 4:15 pm

Re: Onboard bluetooth comms between RPi 3s

Sat Jun 19, 2021 1:35 pm

Thank you, that is now working.

One further question, what I would like to do is to use one RPi to monitor a micro switch which when triggered can message the other RPi wirelessly to start it's picamera to record video for a period of time.

For my limited experience I suspect the easiest way to do this would be to have the switch monitoring pi write a date/time stamp to a file a and have the camera pi syncing the file and looking for the date time as the trigger to record.

Any thoughts on how I would go about this or whether it's the best way of doing it?

Thanks again.

User avatar
B.Goode
Posts: 12299
Joined: Mon Sep 01, 2014 4:03 pm
Location: UK

Re: Onboard bluetooth comms between RPi 3s

Sat Jun 19, 2021 2:10 pm

Splint wrote:
Sat Jun 19, 2021 1:35 pm
Thank you, that is now working.

One further question, what I would like to do is to use one RPi to monitor a micro switch which when triggered can message the other RPi wirelessly to start it's picamera to record video for a period of time.

For my limited experience I suspect the easiest way to do this would be to have the switch monitoring pi write a date/time stamp to a file a and have the camera pi syncing the file and looking for the date time as the trigger to record.

Any thoughts on how I would go about this or whether it's the best way of doing it?

Thanks again.

gpiozero. Remote GPIO
https://gpiozero.readthedocs.io/en/stab ... _gpio.html
https://gpiozero.readthedocs.io/en/stab ... _gpio.html

That certainly works over a WiFI connection: I have no experience of using it via Bluetooth.

Splint
Posts: 31
Joined: Tue Jan 28, 2020 4:15 pm

Re: Onboard bluetooth comms between RPi 3s

Sat Jun 19, 2021 5:28 pm

Perfect. Thank you.

Return to “Troubleshooting”