[PLUG] Connect BT keyboard to headless Raspberry
Eric House
eehouse at eehouse.org
Thu Jan 20 22:36:30 UTC 2022
> Your idea should work. I sort of tested it with the equipment at hand. I
> > first configured the Pi to boot to console using raspi-config. I added a
> > line to the .profile on the Pi to start screen
> > screen -S raScreen
> >
> > then in the .screenrc I have
> > multiuser on
> >
> > This "multiuser on" is not necessary if you are going to ssh into the
> same
> user account as screen. I was contemplating a simpler setup of using ssh
> to log into a secondary user account so that the .profile in that account
> would share the screen with the primary user account. that way you would
> not have to use the "bash -- noprofile" in the ssh. The other nice feature
> to have would be an autologin by the Pi so that you would not have to
> blindly enter the username and password, but this is trickier to setup and
> leaves a bit of a security vulnerability.
>
Ha, it's mostly working! Ok, first I gave up on screen (after 20+ years)
and switched to tmux, mostly because its name makes help so much easier to
search for. But I've configured .bashrc so that all interactive logins get
attached to the same tmux session. And made console logins automatic (after
modifying sudo to require a password. You need physical access to my Pi (4)
or a paired bluetooth keyboard, but still better to limit the damage.)
So now I connect the iPad via ssh and the bluetooth keyboard directly and
its typing shows up on the iPad's screen. Two remaining problems -- that
might be related, or might be a result of my being a tmux noob.
* Each time I use the keyboard the tmux session shrinks to 80x30, the size
of /dev/tty1 that the keyboard's talking to. That's maybe 1/3 of the iPad's
screen.
* tmux stuff that involves a command buffer, e.g. 'ctrl-b :' doesn't work
from the keyboard: the buffer doesn't show up, and apparently isn't just
offscreen because typing something plus return doesn't do anything.
I'm hoping somehow getting /dev/tty1 to report itself as larger lets me
work around the first problem, and that perhaps I'll find a way to get tmux
to be the size I tell it to. It's pretty unusual to want the size of the
session providing keyboard input to be ignored!
(I may try to do this with screen now that I know it's possible. Does
anybody know if it's better about letting you specify tty dimensions?)
Thanks!
--Eric
More information about the PLUG
mailing list