Comments (3)
What is the BLE rate limiter and in which cases it has to be adapted?
from flipmouse.
In general, there is a maximum sending frequency, because of the underlying protocol limitations.
In case of the FLipmouse, there are 2 limits, depending on the used HID interface (Bluetooth or USB):
USB:
USB-HID data is transferred by an endpoint in interrupt transfer mode.
This results in repeating polling by the host, in an interval which is defined in the USB descriptor.
The minimum interval is 1ms, so max. 1000 HID reports each second.
The limit is handled by the USB hardware integrated in the Teensy uC, so each time we call Mouse.move()
we trust on the Mouse library to handle any buffering and data transfer. So no rate limit there, except a general "tick time" for the main loop.
Bluetooth:
Bluetooth data is sent a little more complicated:
- Serial interface to any BT board (the first attempt was an EZ-Key HID module on a breadboard, currently we use a
custom ESP32 PCB with our firmware) in 9600Baud. So we need to consider this interface in any timing and buffering. - ESP32 handles via GAP & GATT events the connection to any paired device.
(there is another issue there on how pairing is handled for the user). - ESP32 buffers the HID data and sends it via a GATT notification to the BT host (central device)
We experienced problems with some devices, which could not handle a high data rate very well (BT).
The mouse moved with a noticeable delay in the movements (~500-1000ms), which renders the FM nearly unusable.
To overcome this issue, we limited the BT sending in the FM by a timestamp based limitation and we discard any packages which are sent more often.
For a rate limit which is a long time (e.g. 50-200ms) we loose many fine steps of mouse movement.
A short time between HID data transmission might result in delays on some BT devices, but gives a precise mouse control and most of the devices.
So: we need a good default value and the possibility to adapt this value if necessary π
Because the BT rate limiting (and an additional buffering specialized on mouse data) is implemented in the ESP32,
we could introduce a general AT command which can send data to the BT addon.
There are a few more use cases for this:
- Enable/disable pairing mode in BT
- Enable/disable the WebGUI on the FLipMouse
- Fetch all paired devices
- Delete on existing pairing
(and maybe more)
from flipmouse.
Thanks for the detailed explanation! π
This results in repeating polling by the host, in an interval which is defined in the USB descriptor.
Crazy, normally one would think a mouse would be the perfect device to trigger events if something happens and not using polling by the host.
So: we need a good default value and the possibility to adapt this value if necessary π
OK, makes sense!
Do you know how other Bluetooth mouses deal with this problem? Do they simply have a good default value?!
from flipmouse.
Related Issues (20)
- HW - evaluate best USB plug positioning
- Couple of unclear instructions in Construction Guide HOT 1
- Unclear calibration on slot-switch if gain!=50 HOT 4
- FlipMouse C# GUI - Problem if ID string is assigned as keyboard write HOT 1
- FlipMouse C# GUI - List of slots is not set correctly, if settings are not loaded from mouse HOT 1
- Wrong component labelling for BT add-on module HOT 1
- Inconsistent EEPROM state HOT 3
- Keycode lookup if esp32_mouse_keyboard aka ESP32miniBT module is connected. HOT 1
- Media keys
- FLipMouse GUI - Managing Bluetooth devices HOT 4
- Automatic Firmware Update HOT 3
- `AT SR`: add button states HOT 3
- Saving config: performance and usability HOT 5
- openinput support HOT 3
- Macros: AT MA KW \;;CR; writing "ΓΆ" instead of ";" HOT 2
- Add AT command for renaming slots
- Add AT command to switch on/off certain buzzer beeps
- 3d-printed case: improvements
- Sip&Puff sensor spurious failing HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from flipmouse.