13

I have a bluetooth remote shutter paired to my Android phone. The remote shutter acts like a bluetooth keyboard.

My app happily processes the keyboard events created by the remote shutter, but the remote shutter goes to sleep after 90 seconds, and requires one key press to wake it up before it sends the next key press.

I need a mechanism for keeping the remote shutter awake so that I don't lose that first key press. (Yes I understand the sleep mode is to conserve energy, but I need the low latency).

I have tried connecting to the device as both client and server, with the hope that I could send something on the OutputStream to the device. But I wasn't able to create a connection.

Is there anyway way to programmatically keep the remote shutter awake?

Based on the following answers I suspect not

Just for completeness the details of the paired device are:

  • name=AB Shutter3
  • MAC=Some_MAC_ADDRESS
  • btClass=2540
  • btType=1
  • UUIDs=[00001124-0000-1000-8000-00805f9b34fb, 00000000-0000-1000-8000-00805f9b34fb]
William
  • 20,150
  • 8
  • 49
  • 91
  • What is the name of the shutter? – Murat Karagöz Oct 04 '17 at 12:46
  • It is called "AB Shutter3" – William Oct 04 '17 at 20:45
  • Thanks to all 3 responders. While I have come to the conclusion that there is no way to keep the device active that fits within our requirements, Mohamed's answer got me furthest down a path for an acceptable solution. For those that are interested I opted to listen to the ACL_CONNECTED BroadcastIntent to determine that the BT device had woken up and use that along with application state to determine appropriate action. – William Oct 07 '17 at 07:49

3 Answers3

5

Seems it totally depends on remote shutter firmware: if it goes to sleep after 90 sec after last key press - there is no way to wake it up programmatically (unless change its firmware). Easiest solution is to use remote shutter without sleep mode (or DIY bt/ble button). And anyway you can use external circuit (for example 555 timer based) powered from shutter battery and parallel connected with one of shutter buttons, which generates pulse every 90.1 sec to simulate first key press and wake up shutter.

Andrii Omelchenko
  • 13,183
  • 12
  • 43
  • 79
2

There is no programmatic way to get this done but you have 3 possible solution for your issue:

  1. Get a shutter that does not sleep
  2. Make your own shutter using Arduino or Raspberry Pi
  3. Modify the AB shutter by adding an additional circuit that enables your device every time it shuts down. For this purpose, you may take advantage from those links to know more about the circuit and how can you modify it: http://www.the-bridge.cc/ct137s15/?p=2647 and https://shkspr.mobi/blog/2016/02/cheap-bluetooth-buttons-and-linux/
Mohamed Chaawa
  • 918
  • 1
  • 9
  • 23
0

Yes, it is possible to keep the other end of the connection awake as long as it accepts the input signals.

As you mentioned,

I have tried connecting to the device as both client and server, with the hope that I could send something on the OutputStream to the device. But I wasn't able to create a connection.

This is the best way to keep the bluetooth device awake. This is the device that I used to send signals to my Nexus Player's remote programmatically[Linux Platform]. Initially, I used HIDD and RFCOMM commands on Linux terminal and then started implementing the connection in C.

Other way is to modify the firmware of the device as per your requirements(If possible).

Exception : If the firmware of the BT device has been designed in such a way that only pressing the button will keep it awake and no other input signal can reset it's timer or counter then there is nothing that can be done from outside world of that device. And Reading Here gives an hint that AB Shutter is one of them(Still not sure though).

Manoj
  • 853
  • 1
  • 7
  • 28