5 Replies Latest reply on Sep 25, 2015 2:29 PM by PabloM_Intel

    Serial login over bluetooth has issues with ioctl

    @hippiehacker

      This is part of the github.com/ii/iikeyboard/wiki

       

      login over bluetooth serial port protocol · ii/iikeyboard Wiki · GitHub

       

      When using rfcomm to connect to programs via bluetooth, I'm not sure all the appropriate ioctls work.

       

       

      SPP is a limited serial implementation and I've found some issues with it that in my cobbling doesn't run bash with job control or emacs:

      On the edison:

      Add a /etc/systemd/system/bttty.service

      [Unit] Description=Bluetooth Serial [Service] ExecStart=/usr/bin/rfcomm -r watch rfcomm0 1 /sbin/agetty --autologin root --login-pause --noreset --noclear rfcomm0 115200 linux [Install] WantedBy=multi-user.target 

      You can optionally advertise the service via SDP via /etc/systemd/system/btsdp.service:

      [Unit] Description=let folks know we run an bluetooth SP on port 1 After=bluetooth.service [Service] Type=oneshot ExecStart=-/usr/bin/sdptool add --channel=1 SP [Install] WantedBy=multi-user.target 

      Then start:

      systemctl start bttty

      and enable it for next boot.

      systemctl enable btty

      Add this to /etc/bluetooth/rfcomm.conf or run sudo rfcomm -r bind 1 98:4F:EE:XX:YY:ZZ:

      rfcomm1 { bind no; device 98:4F:EE:XX:YY:ZZ; channel 1; comment "Serial Port"; } 

      https://github.com/ii/iikeyboard/wiki/login-over-bluetooth-serial-port-protocol#loginlogin!

      Once rfcomm is has bound that port, you can just run sudo screen /dev/rfcomm1 115200and it will drop you to a bash prompt...

      Poky (Yocto Project Reference Distro) 1.6.1 eddiebetter rfcomm0 [press ENTER to login] eddiebetter login: root (automatic login) -bash: cannot set terminal process group (184): Inappropriate ioctl for device -bash: no job control in this shell root@eddiebetter:~# id uid=0(root) gid=0(root) groups=0(root),29(audio) 

      Bash is complaining about ioctl, and job control an emacs won't run... probably something similar.

      Emacs is looking for a /dev/tty

      root@eddiebetter:~# emacs -nw emacs: Could not open file: /dev/tty