View Single Post
Old 02-22-2025, 01:46 PM   #1477
vahtos
Junior Member
vahtos began at the beginning.
 
Posts: 2
Karma: 10
Join Date: Feb 2025
Device: Kobo Sage
Bluetooth Controller Fast Connect & Fast Efficient Sleep

A few people have asked about quickly connecting a bluetooth controller (8bitdo in my case) using NickelMenu. I had this question too, and I did some tinkering with this and figured out a nice solution. I am not going to go into detail on how to do some of the steps (enable developer mode, force wifi on, and telnet), these are covered well elsewhere and are generally searchable.

Before starting
1. Make sure to enable telnet on your reader. You will need this to get the MAC address of your Bluetooth controller. I did this manually before installing NickelMenu, but according to the NickelMenu docs, this should work:

Code:
menu_item :main    :Telnet             :cmd_spawn          :quiet:/bin/mount -t devpts | /bin/grep -q /dev/pts || { /bin/mkdir -p /dev/pts && /bin/mount -t devpts devpts /dev/pts; }
     chain_success                        :cmd_spawn          :quiet:/usr/bin/pkill -f "^/usr/bin/tcpsvd -E 0.0.0.0 1023" || true && exec /usr/bin/tcpsvd -E 0.0.0.0 1023 /usr/sbin/telnetd -i -l /bin/login
     chain_success                        :dbg_toast          :Started Telnet server on port 1023.
2. Enable developer mode
2a. Enable "Force Wifi ON"

Get your controller's MAC address
1. Turn on Bluetooth on your device.
2. Turn on telnet on your reader, then using your computer's terminal (if you're using Windows, you might need to open "Turn Windows features on or off" and enable "Telnet Client"), connect to your device using it's IP address
Code:
telnet 192.168.0.110
3. Turn on your controller and start pairing mode on it
4. Run this in your telnet session:
Code:
bluetoothctl scan on
5. In the resulting messages, you should see a line similar to
Code:
[NEW] Device E4:17:D8:6E:87:61 8BitDo Micro gamepad
5a. Note down the MAC address, the part between "Device" and "8BitDo", in this case
Code:
E4:17:D8:6E:87:61
6. Close your telnet session, connect your ereader to your PC, and edit your NickelMenu configuration. My full configuration is below, make sure to replace the MAC address to your devices MAC address from the previous step!
Code:
#--------------------------------------------------------------------------------------------
menu_item :main     :Connect Controller           :nickel_bluetooth   :enable
  chain_success                                   :cmd_spawn          :quiet:bluetoothctl scan on
  chain_success                                   :cmd_spawn          :quiet:bluetoothctl pair E4:17:D8:6E:87:61
  chain_success                                   :cmd_spawn          :quiet:bluetoothctl connect E4:17:D8:6E:87:61
  chain_success                                   :dbg_toast          :Controller Connection Steps Complete
menu_item :main     :Energy Efficient Sleep       :nickel_bluetooth   :disable
  chain_success                                   :nickel_wifi        :disable
  chain_success                                   :power              :sleep
menu_item :main     :Bluetooth OFF                :nickel_bluetooth   :disable
menu_item :main     :Wifi OFF                     :nickel_wifi        :disable
menu_item :main     :Sleep                        :power              :sleep

#--------------------------------------------------------------------------------------------
menu_item :reader   :Connect Controller           :nickel_bluetooth   :enable
  chain_success                                   :cmd_spawn          :quiet:bluetoothctl scan on
  chain_success                                   :cmd_spawn          :quiet:bluetoothctl pair E4:17:D8:6E:87:61
  chain_success                                   :cmd_spawn          :quiet:bluetoothctl connect E4:17:D8:6E:87:61
  chain_success                                   :dbg_toast          :Controller Connection Steps Complete
menu_item :reader   :Energy Efficient Sleep       :nickel_bluetooth   :disable
  chain_success                                   :nickel_wifi        :disable
  chain_success                                   :power              :sleep
menu_item :reader   :Bluetooth OFF                :nickel_bluetooth   :disable
menu_item :reader   :Wifi OFF                     :nickel_wifi        :disable
menu_item :reader   :Sleep                        :power              :sleep
Notes
- When you connect the controller for the first time, you may need to press "Connect Controller" twice.
- Connecting the controller this way, instead of using the Kobo UI, seems to work better generally -- it actually saves the controller as a saved device and will auto-reconnect if you just turn on Bluetooth and turn on the controller. So you may consider adding another NickelMenu entry that just enables Bluetooth, though it is safe to just keep using the "Connect Controller" entry as-is.
- I also included an "Energy Efficient Sleep" entry which shuts off wifi, shuts off bluetooth, and sleeps the ereader
- The individual OFF entries are for if you want to stop using your controller, but keep using the ereader without wasting battery power on bluetooth/wifi.
vahtos is offline   Reply With Quote