WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: pi zero W, piCore 13, bluetooth terminal  (Read 1707 times)

Offline creitzel

  • Newbie
  • *
  • Posts: 36
pi zero W, piCore 13, bluetooth terminal
« on: October 07, 2022, 09:04:10 PM »
Hi everyone.   :)

I'm trying to get a bluetooth serial terminal set up on my pi zero w, running piCore 13.1.  Paul gave me a hand in another thread (http://forum.tinycorelinux.net/index.php/topic,24427.0.html), getting bluetooth up and running, but I'm not quite sure how to go about having the pi listen for a serial connection, and provide a login/tty to the serial port.

In the other thread, patrikg posted a link that is supposed to show steps to accomplish this, but after trying that method, it has become clear to me that a few of the commands that they want you to use aren't available on piCore.  For instance, it is trying to use a program/script called "Bluetooth-agent", which I can't find anywhere on my system.  It also references "agetty", which isn't present either.  I think I can replace agetty with getty, but I'm not sure what to do with bluetooth-agent.

Can anyone provide a set of steps for getting the pi setup to provide a serial port, listen on that port, and start a login/tty when someone connects to it?

Any help you all could give me would be greatly appreciated.

Thanks,

Chris

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11178
Re: pi zero W, piCore 13, bluetooth terminal
« Reply #1 on: October 07, 2022, 09:28:18 PM »

Offline creitzel

  • Newbie
  • *
  • Posts: 36
Re: pi zero W, piCore 13, bluetooth terminal
« Reply #2 on: October 09, 2022, 11:55:15 AM »
Thanks Rich.  bt-agent does appear to work like the "bluetooth-agent" mentioned in that other post.

That said, I've not had much success using it.  That post that I was trying makes it sound simple:
Code: [Select]

Now append the following to /etc/inittab (using nano - and substituting for your own):

#Bluetooth Channel 22
PA22:23:respawn:/usr/bin/bluetooth-agent <passkey>
BS22:23:once:/usr/bin/sdptool add --channel=22 SP
BT22:23:once:/usr/bin/rfcomm -r watch 0 22 /sbin/agetty -L rfcomm0 115200

Now reboot. Your other device should be able to discover and pair for a serial device. Connect to that serial at 115200, and you will have a login shell!

I've tried to emulate this on picore by adding the following to bootlocal.sh:
Code: [Select]
bt-agent --compatibility=NoInputNoOutput -d # start the agent with no passcode, as a daemon.
sdptool add --channel=22 SP
rfcomm -r watch 0 22 /sbin/getty -L rfcomm0 115200

That appears to mostly work, in that it brings the pi up and I can connect/pair with it, but I can't seem to get a serial port/login prompt on it.  I think the problem may be in the command I'm handing to rfcomm.  I'm not sure if I should be using rfcomm0 as the port for the getty command, but I also don't know what if anything to replace it with.

Do you happen to know how I can see which port is being mapped via bluetooth?


Offline creitzel

  • Newbie
  • *
  • Posts: 36
Re: pi zero W, piCore 13, bluetooth terminal
« Reply #4 on: October 10, 2022, 04:29:43 PM »
I searched at the web and found...

Thanks for the links, patrikg.  Unfortunately, they don't really cover anything that I didn't already find out.  I still can't get it working.  I guess I'll just have to stick with what I've already got working, wifi, and hdmi/keyboard when I need to maintain it etc.

Offline patrikg

  • Wiki Author
  • Hero Member
  • *****
  • Posts: 662
Re: pi zero W, piCore 13, bluetooth terminal
« Reply #5 on: October 11, 2022, 07:06:55 AM »
Have you tried to use the original newest os like Raspberry Pi OS Lite (previously called Raspbian).
To see if you can get it to work there ?
And then transfer your knowledge to the no bloated os like PiCore.
Like how we solved the problem with alsa and hdmi sound in picore.

64bit

32bit
« Last Edit: October 11, 2022, 07:18:29 AM by patrikg »