sensboston / bleconsole Goto Github PK
View Code? Open in Web Editor NEWBluetooth Low Energy device console app
Home Page: https://sensboston.github.io/BLEConsole
License: MIT License
Bluetooth Low Energy device console app
Home Page: https://sensboston.github.io/BLEConsole
License: MIT License
When trying to access Install via ClickOnce The webpage blocks access.
Please help me with the installation.
Hello and thank you for this tool!
I am able to pull data from the console from a Nordic Thingy52 without problem e.g.
open Thingy
fmt dec
subs #4/#5
how can I run this from a script and let another application use the output?
hi! thanks for this console it is brilliant! I just have a question, how can I append a \r ? like "hello\r"
I know I can switch at the end to hex, but then I see the notifications in hex too :/
Hi,
I have a lot of ble devices with the same advertising name.
It would be cool if there was a way of connecting to them using the 6-byte bluetooth address. At the moment I don't really have a way of differentiating between the devices using just the name.
Other than that its a really helpful application for testing various communication protocls during development.
Thanks for your effort!
I am new to this app and am trying to figure out all commands but still getting errors I don't understand.
Can you give me some examples of how to write to my device?
Example: how would I write a Bluetooth name?
Write %name ?
Hello everyone,
I could able to send some string data to BLE device, which is already paired.
Now I want to send a text file which is already saved in my local drive. But i could not load file from my Local drive. Can anyone suggest me how to send local file data to ble device?
Hello,
I've been experimenting with a BLE TinyShield paired with a TinyZero from TinyCircuits. Successfully, I managed to establish a connection and issue commands to the Arduino by writing them into the characteristic "Custom Characteristic: 6e400002-b5a3-f393-e0a9-e50e24dcca9e W" (details below). Despite thorough testing of all available characteristics and services, I can't seem to read the data written by the Arduino into the UART characteristic.
Any insights on this? I must admit, I'm quite new to coding.
Thank You!
What I tried using the BLEConsole:
BLE: ls
#Address Name
#00: 49:d7:0d:da:c2:22 no_advertising_name
#1: e1:81:69:a0:a8:53 BlueNRG
#2: c4:07:1f:9f:b2:0b Forerunner 935
BLE: open #1
Device BlueNRG is disconnected.
Connecting to BlueNRG.
Found 3 services:
#00: GenericAttribute
#1: GenericAccess
#2: Custom Service: 6e400001-b5a3-f393-e0a9-e50e24dcca9e
BLE: set #0
Selected service GenericAttribute.
#00: ServiceChanged I
BLE: set #0
Selected service GenericAttribute.
#00: ServiceChanged I
BLE: read #0
Read failed: ProtocolError 0x02: Read Not Permitted
BLE: set #1
Selected service GenericAccess.
#00: DeviceName RW
#1: Appearance RW
#2: PeripheralPreferredConnectionParameters R
BLE: read #0
Read 7 bytes.
utf8: BlueNRG
hex: 42 6C 75 65 4E 52 47
BLE: read #1
Read 2 bytes.
utf8:
hex: 00 00
BLE: read #2
Read 8 bytes.
utf8: ???? ??
hex: FF FF FF FF 00 00 FF FF
BLE: set #2
Selected service Custom Service: 6e400001-b5a3-f393-e0a9-e50e24dcca9e.
#00: Custom Characteristic: 6e400002-b5a3-f393-e0a9-e50e24dcca9e W ---> characteristic I use to write
#1: Custom Characteristic: 6e400003-b5a3-f393-e0a9-e50e24dcca9e N
BLE: read #0
Read failed: ProtocolError 0x02: Read Not Permitted
BLE: read #1
Read failed: ProtocolError 0x02: Read Not Permitted
How the BLE shield writes data inside the characteristic:
uint8_t lib_aci_send_data(uint8_t ignore, uint8_t* sendBuffer, uint8_t sendLength) {
return !Write_UART_TX((char*)sendBuffer, sendLength);
}
uint8_t Write_UART_TX(char* TXdata, uint8_t datasize)
{
tBleStatus ret;
ret = aci_gatt_update_char_value(UARTServHandle, UARTRXCharHandle, 0, datasize, (uint8_t *)TXdata);
if (ret != BLE_STATUS_SUCCESS) {
PRINTF("Error while updating UART characteristic.\n") ;
return BLE_STATUS_ERROR ;
}
return BLE_STATUS_SUCCESS;
}
AND
if (!lib_aci_send_data(PIPE_UART_OVER_BTLE_UART_TX_TX, (uint8_t*)sendBuffer, sendLength))
{
SerialMonitorInterface.println(F("TX dropped!"));
}
I am trying to read the hart rate or (if possible) the raw pulse from a Mi Band 4.
BLE: st
Device Mi Smart Band 4 is connected.
Available services:
#00: GenericAccess
#1: GenericAttribute
#2: DeviceInformation
#3: Custom Service: 00001530-0000-3512-2118-0009af100700
#4: AlertNotification
#5: ImmediateAlert
#6: HeartRate
#7: 65248
#8: 65249
#9: 14338
Selected service: HeartRate
Available characteristics:
#00: HeartRateMeasurement N
#1: HeartRateControlPoint RW
if I do r #1 I get protocol error.
device information works.
any idea?
After subscribing to characterisitc which is set to the indication property the application does not seem to receive the event on value change.
The application works very well when the characteristic is set to the notification propery.
I connected to a ble device(#3), it has a service (#2) i want to use a characteristic (#00 or #1) to send a char ("?"), if i send this char the bluetooth device will send me a string.
BLE: stat
Device Control_Unit is connected.
Available services:
#00: GenericAccess
#1: GenericAttribute
#2: Custom Service: 39df7777-b1b4-b90b-57f1-7144ae4e4a6a
Selected service: Custom Service: 39df7777-b1b4-b90b-57f1-7144ae4e4a6a
Available characteristics:
#00: Custom Characteristic: 39df9999-b1b4-b90b-57f1-7144ae4e4a6a N
#1: Custom Characteristic: 39df8888-b1b4-b90b-57f1-7144ae4e4a6a W
BLE:
i have already set format to ASCII
how can i get this work? Here is what i send:
Current display format: ASCII
BLE: read #2/#1 ?
Invalid device number 01 ?
Invalid characteristic #1 ?
BLE:
Thank you for an amazing application!
I am interacting with a GoPro. I encountered 2 problems:
First problem
In "Bluetooth LE Explorer" I can see the service 61590 and it's characteristics:
When I try to access the same service (65190) through BLEConsole, it returns "Error accessing service."
Second problem
I would like to write directly to characteristic b5f90072-aa8d-11e3-9046-0002a5d5c51b (which is inside the service 6190). I tried following your naming rules, but it didn't work:
It would be easier if I could write to b5f90072-aa8d-11e3-9046-0002a5d5c51b directly (without the "Custom characteristic" or service part).
I see in the README that there is a possibility that the device that ls fetches may not currently exist, but I don't understand why ls would fetch a device that is not present in the current period, is it because ls isn't really scanning for surrounding devices? If so, is it possible for BLEConsole to actively scan for surrounding devices?
Also, I noticed that BLEConsole supports using the arrow keys to fetch the input history, but why is it that a BLEConsole that is closed and then restarted can also fetch the previous input history?
By the way, I've never written C#, so I don't know much about any of this, and would appreciate a explanation, thanks!
Note: This is a new feature idea, I don't know if I will find the time to implement this, anyone is welcome to do so
Rationale
When getting a new/unknown BLE device it always a discovery which services/characteristics are implemented/supported.
Especially in reverse-engineering of a undocumented product.
Description
Currently it is technically possible to do this by hand, but I think it would be a good feature to have a "device info dump" command.
Listing all the available services and their characteristics with their values/options in one big list.
Implementation
There is a bit of a challenge implementing this in the current codebase.
Only the BluetoothLEAttributeDisplay
is stored in the global _services and _characteristics lists. Also the _characteristics is switches based on the selected service.
We could either:
_selectedService
and _selectedCharacteristic
would point to objects within that list.Hi,
I wanted to use BLEConsole in order to activate the wifi on a GoPro Hero 8.
In order to do this I need to send a value to a characteristic. The value is 03170101. This value should be converted in byte array and send to the device.
When I do it i do not get any error message but nothing happens on the camera.
For confirmation I tried another similar solution on Debian and it works...
I just wanted to be sure of how the write command should be written. As of know I use : Write #06/#00 03170101
Thnaks,
Dear Community,
I came across this application and found it quite good. So i started testing this to see if it would be suitable for me to use in my project. I found one issue that i am not sure of and need some help.
After disconnecting from a device, reconnecting to the device again will invariable report a device unreachable error or a crash just after subscribing to the notify service. Log file attached.
Any help or pointers would be greatly appreciated. Since i can just reopen the app and connect i dont believe its an issue on the peripheral side. Also i have used outer android based ble apps to connect and disconnect multiple time siwthout any issues.
Thanks.
BLEConsoleLog.txt
Abel.
BLE: w #02 test
Write failed: ProtocolError 0x05: Insufficient Authentication
See https://medium.com/rtone-iot-security/deep-dive-into-bluetooth-le-security-d2301d640bfc
With friendly name can we get device info which is already connected BT.
Like I assume i have mouse logitech mouse mx master, keyboard EGRO860 and Mi phone connected to that.
With this tool last connected is active we are fetching that device info.
is it possible to fetch the device info with friendly name MX master.
I was planning on using the BLE Console for some simple device interaction.
But I'm not sure where I can find the latest build.
The releases page (and click once) all refer to 1.5.6. But according to the releases page, this is from Mar 17, 2018.
The source-code seems to have advanced a lot beyond this point.
Can someone be so kind to create a release/build?
I've tried compiling the sources, but as the compile_hints.txt states I got down the rabbit hole of Windows SDK Kit versions and I'm afraid I'm going to introduce more issues rather than fix them.
Note: This is a new feature idea, I don't know if I will find the time to implement this, anyone is welcome to do so
Rationale
More and more (low-power) devices publish their information in a advertisement message instead or in addition to the GATT.
Connecting to such a (battery powered) device will get you the info but will drain the battery of the device.
Description
It would be a good feature to be able to receive/collect these advertisement messages and provide them as output.
Implementation
.NET has the BluetoothLEAdvertisementWatcher class for this purpose.
Basically creating start trigger and displaying the output from the receive event would implement this feature.
Hello everyone,
I want to send a basic ASCII instruction to a bluetooth device and I can't find how to do that with BLEConsole...
Could you help me please ?
Thank you for your help ! ๐
Using the "unsub all" command does not actually work!
In the file "Program.cs", it appears that line 1322 never returns to complete the unsubscribe operation.
I found the following changes allow the unsubscribe to work:
Line 1303:
was: static async void Unsubscribe(string param)
change to: static async Task Unsubscribe(string param)
Line 793:
was: if (_subscribers.Count > 0) Unsubscribe("all");
change to: if (_subscribers.Count > 0) await Unsubscribe("all");
Line 790:
was: static void CloseDevice()
change to: static async Task CloseDevice()
Line 742:
was: CloseDevice();
change to: await CloseDevice();
Line 380:
was: Unsubscribe(parameters);
change to: await Unsubscribe(parameters);
Line 334:
was: CloseDevice();
change to: await CloseDevice();
Line 286:
insert: if (_selectedDevice != null) { await CloseDevice(); }
how to direct use BLEConsole.exe in cmd,do not in BLEConsole.exe . like C:\BLEConsole.exe list,then output ble device list
It's only finding specific devices. It can't find my Xbox controller or Nintendo Switch Joy-cons. It can find it just find in the settings app for Windows 10, but it can't find it in this app.
In my tests on Windows 10 the command to unsubscribe from e.g. a notification does not work (also affects indications):
await sub.WriteClientCharacteristicConfigurationDescriptorAsync(GattClientCharacteristicConfigurationDescriptorValue.None);
https://github.com/sensboston/BLEConsole/blob/master/BLEConsole/Program.cs#L1200
Once you execute the command above the control flow stops and exit Unsubscribe
, so it seems to trigger some internal Exception but I wasn't able to catch an Exception.
The command itself seems to be correct just Windows acts totally unexpected. For this reason the unsubs all
command does not work at least on the computers I had tested it on.
My guess is that this is some sort of Windows/.net bug.
Can you tell me an example to find a specific device and automaticly connecting to it in a foreach loop ?
THX for your great work.
Thanks for this tool! It's very helpful for automating control of my RGB strips.
Sometimes my devices respond with:
Device <Device> is unreachable.
Is there a good way to detect that this happened, and retry? Maybe with exit codes or just using if/else and repeating the code a few times?
Perhaps increasing the timeout that might help?
I am attempting to leverage BLEConsole in a scripted method. Issue I am having is that when leveraging the open command against the name of the devices the application presents the services as it should but any time I attempt to write to those characteristics or set the service I get an error. When specifying the device by number I am able to connect without issue. This is an issue as if the system device order changes the script will break.
A successful write...
BLE: ls
#00: bhyve_20B160
#01: Living Room TV
#02: MX Master 2S
#03: NEEWER-RGB660 PRO
BLE: open #3
Connecting to NEEWER-RGB660 PRO.
Found 4 services:
#00: GenericAccess
#01: GenericAttribute
#02: Custom Service: 69400001-b5a3-f393-e0a9-e50e24dcca99
#03: Custom Service: 7f510004-b5a3-f393-e0a9-e50e24dcca9e
BLE: set #2
Selected service Custom Service: 69400001-b5a3-f393-e0a9-e50e24dcca99.
#00: Custom Characteristic: 69400003-b5a3-f393-e0a9-e50e24dcca99 N
#01: Custom Characteristic: 69400002-b5a3-f393-e0a9-e50e24dcca99 W
BLE: format HEX
Current display format: Hex
BLE: w #02/#01 78 86 04 58 01 18 64 D7
An example of write failure... showing the error "Error accessing service." & "Please specify characteristic name or # for writing."
BLE: ls
#00: bhyve_20B160
#01: Living Room TV
#02: MX Master 2S
#03: NEEWER-RGB660 PRO
BLE: open NEEWER-RGB660
Device NEEWER-RGB660 PRO is disconnected.
Connecting to NEEWER-RGB660 PRO.
Found 4 services:
#00: GenericAccess
#01: GenericAttribute
#02: Custom Service: 69400001-b5a3-f393-e0a9-e50e24dcca99
#03: Custom Service: 7f510004-b5a3-f393-e0a9-e50e24dcca9e
BLE: set #2
Error accessing service.
BLE: format HEX
Current display format: Hex
BLE: w #02/#01 78 86 04 58 01 18 64 D7
Please specify characteristic name or # for writing.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.