
今回はLet's notのCF-SZ5内蔵のbluetoothを使って、
スマホとペアリングして
「Serverless Bluetooth Keyboard & Mouse for PC/Phone」で
スマホをbluetooth keyboardとMouseとして使おう
というネタです。簡単でした。
bluetoothネタはあまりやっていませんでした。反省。
●Bluetoothctlで接続
Let's noteにはbluetoothが内蔵して標準で使えますが、
今まであまりつかっていませんでした。もったいない。
というのも、何か掴みが悪かったからという印象でした。
ので使ってみようと思いました。
・LubuntuでBluetooth機器を扱う時は`bluetoothctl`を使う
https://arimasou16.com/blog/2021/04/10/00385/
・bluetoothctl のコマンド一覧と使い方をまとめてみた
https://qiita.com/noraworld/items/55c0cb1eb52cf8dccc12
・Bluetooth
https://wiki.archlinux.jp/index.php/Bluetooth#Obex_.E3.82.92.E4.BD.BF.E3.81.A3.E3.81.A6.E3.83.95.E3.82.A1.E3.82.A4.E3.83.AB.E3.81.AE.E9.80.81.E5.8F.97.E4.BF.A1.E3.82.92.E8.A1.8C.E3.81.86
・BluetoothでUbuntu〜Androidスマートフォン間ファイル転送
https://applecom.blog.jp/archives/30999162.html
・遂にGeminiPDAを外付けBluetoothキーボードにする方法が見つかりました。
https://sinmoble.com/2020/05/14/post-5019/
ググると色々なサイトが出てくる。
やってみようと思いました。
●dmseg
まずドライバちゃんと動いているかな?
という事でdmesg
sudo dmesg | tee dmesg.txt
みたいな感じでdmesgをtxtで保存してエディタでbluetoothを検索。
適当にチェックして流し読みしてドライバあるねえ。という所まで。
ならば常駐して動いているなとわかった。
[ 7.005316] Bluetooth: Core ver 2.22
[ 7.005362] NET: Registered protocol family 31
[ 7.005365] Bluetooth: HCI device and connection manager initialized
[ 7.005371] Bluetooth: HCI socket layer initialized
[ 7.005375] Bluetooth: L2CAP socket layer initialized
[ 7.005383] Bluetooth: SCO socket layer initialized
[ 7.167859] Bluetooth: hci0: Bootloader revision 0.0 build 2 week 52 2014
[ 7.174071] Bluetooth: hci0: Device revision is 5
[ 7.174075] Bluetooth: hci0: Secure boot is enabled
[ 7.174077] Bluetooth: hci0: OTP lock is enabled
[ 7.174078] Bluetooth: hci0: API lock is enabled
[ 7.174080] Bluetooth: hci0: Debug lock is disabled
[ 7.174081] Bluetooth: hci0: Minimum firmware build 1 week 10 2014
[ 7.177479] Bluetooth: hci0: Found device firmware: intel/ibt-11-5.sfi
●bluetoothctl
でCUIでBluetoothとスマホをペアリング
sudo apt install bluez
多分最初から入っていると思うので、実行
参考サイトを見て設定方法は
scan on
trust [MAC Address]
pair [MAC Address]
connect
でペアリング出来る。
Mac Addressとは
Device 00:12:34:56:78:90 myPhone
の英数字部分である。コマンドで実行してみると
sudo bluetoothctl
scan on
とすると周囲のBluetoothデバイスがざっくり表示されるので、
自分のスマホの表示名をチェックして
trust 00:12:34:56:78:90
pair 00:12:34:56:78:90
スマホ側に「ペアリングしますか?」と出てきたらOKで接続
connect 00:12:34:56:78:90
これで接続完了である。
実に簡単でした・・・
で接続状況を確認
sudo hciconfig -a
hci0: Type: Primary Bus: USB
BD Address: 00:00:00:00:00:00 ACL MTU: 1021:4 SCO MTU: 96:6
UP RUNNING
RX bytes:123234 acl:894 sco:0 events:5640 errors:0
TX bytes:633979 acl:888 sco:0 commands:2868 errors:0
Features: 0xbf 0xfe 0x0f 0xfe 0xdb 0xff 0x7b 0x87
Packet type: DM1 DM3 DM5 DH1 DH3 DH5 HV1 HV2 HV3
Link policy: RSWITCH SNIFF
Link mode: SLAVE ACCEPT
Name: 'cfsz52'
Class: 0x3c010c
Service Classes: Rendering, Capturing, Object Transfer, Audio
Device Class: Computer, Laptop
HCI Version: 4.2 (0x8) Revision: 0x100
LMP Version: 4.2 (0x8) Subversion: 0x100
Manufacturer: Intel Corp. (2)
ちゃんとUP RUNNINGになって接続出来ています。
●Serverless Bluetooth Keyboard & Mouse for PC/Phone
https://play.google.com/store/apps/details?id=io.appground.blek
スマホ側にアプリをインストールして起動。
スマホ側の「ADD DEVICE」をクリックしてCF-SZ5をクリック
で後は自動でつながるはず・・・
中々繋がりません。何故でしょうか?
何回かやっていると繋がりました。ちょっと思い出せませんが、
・Lubuntuとスーパーユーザー権限でConnectされている
・Bluetooth通しがつながっている
・ソフトでPCを接続している
みたいな条件が重なると使えるらしいです。
コレ凄い高性能ですが、残念ながら日本語入力が使えません。
惜しいです。
しかしLubuntu側のFcitx-Mozcで日本語変換出来るのでよしとしましょうw
●まとめ
キーボード、マウスが死んでもBluetoothとスマホがあれば
なんとか操作できそうです。
タブレットなんかも良さそうです。
しかしこんなに簡単に出来るなんてw
しかしこのアプリ、母艦OS側のOS環境に依存しません。
WinでもLinuxでもMacでも。
モバイル環境では便利かと。
また故障したPCのリサイクルなど。
Android 要件5.0 以上なので古いAndroidでもKeyboard、Mouseになれます。
個人的にお気に入りになりました。
【Ubuntuの最新記事】
- Ubuntu改造日記 20.04〜 ラン..
- Ubuntu改造日記 節電設定 TLPの..
- Ubuntu改造日記 省メモリ Fire..
- Ubuntu改造日記 22.04〜 Gr..
- Ubuntu改造日記 メモリ+スワップ満..
- Ubuntu改造日記 Swap圧縮 zw..
- Ubuntu改造日記 wubi for ..
- Ubuntu改造日記 コマンドラインでS..
- Ubuntu改造日記 省メモリ キャッシ..
- Ubuntu改造日記 3,000円ジャン..
- Ubuntu改造日記 簡易ファイルサーバ..
- Ubuntu改造日記 16bit x86..
- Ubuntu改造日記 OpenMSX+M..
- Ubuntu改造日記 OpenMSX-c..
- Ubuntu改造日記 キーボード故障対策..
- Ubuntu改造日記 最近のSteam+..
- Ubuntu改造日記 USBメモリ、SS..
- Ubuntu改造日記 USBメモリ、SS..
- Ubuntu改造日記 オープンソース初代..
- Ubuntu改造日記 Onenote &..