Skip to content

Commit 92ca8ff

Browse files
authored
Merge pull request #1 from lorumic/update-readme
Add more info to the README: compatible devices, bypass device scan
2 parents 62df838 + d9f145e commit 92ca8ff

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
# J7-C_UC96_BLE_Logger
2-
Bluetooth Low Energy Data logging for J7-C/UC96 USB Digital Power Testers
2+
Bluetooth Low Energy Data logging for J7-C/UC96 USB Digital Power Testers. It should work with all the digital testers sharing the atorch protocol - see [here](https://github.com/CursedHardware/atorch-console/blob/master/README.md#supported-meter) for a list of potentially supported devices. Tested on J7-C and UD18 meters.
33

44
## Installation
55

66
Requires [gattlib](https://github.com/labapart/gattlib).
77

88
### Warning
99

10-
Sadly there has been an API change with newer bluetooth adapters (HCI5) which [isn't supported by gattlib yet](https://github.com/oscaracena/pygattlib/issues/31). If you see a `Set scan parameters failed` error, your adapter may be using >=HCI5 and not be supported until the code has been ported to dbus/bluez or gattlib is updated.
10+
Sadly there has been an API change with newer bluetooth adapters (HCI5) which [isn't supported by gattlib yet](https://github.com/oscaracena/pygattlib/issues/31). If you see a `Set scan parameters failed` error, your adapter may be using >=HCI5 and not be supported until the code has been ported to dbus/bluez or gattlib is updated. You can still run the script, though, you just need to bypass the scan by passing the `--device` option (or its shorthand `-d`) when running it.
1111

1212
## Usage
1313

@@ -33,7 +33,7 @@ Device control:
3333
target device MAC address. If no address is given
3434
the first compatible device found will be used
3535
-w, --wait wait for device to appear
36-
-r, --reconnect wait and reconnect when loosing connection
36+
-r, --reconnect wait and reconnect after losing connection
3737
-H HCI, --hci HCI HCI used for communication. Defaults to hci0
3838
-T SCANTIME, --scantime SCANTIME
3939
Time in seconds to scan for devices. Defaults to 2

j7c.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
group_dev = parser.add_argument_group(title="Device control")
2626
group_dev.add_argument("-d", "--device", help="target device MAC address. If no address is given the first compatible device found will be used", default=False)
2727
group_dev.add_argument('-w', '--wait', help='wait for device to appear', action='store_true')
28-
group_dev.add_argument('-r', '--reconnect', help='wait and reconnect when loosing connection', action='store_true')
28+
group_dev.add_argument('-r', '--reconnect', help='wait and reconnect after losing connection', action='store_true')
2929
group_dev.add_argument("-H", "--hci", help="HCI used for communication. Defaults to hci0", default="hci0")
3030
group_dev.add_argument("-T", "--scantime", help="Time in seconds to scan for devices. Defaults to 2 Seconds", default=2, type=int)
3131

@@ -168,7 +168,7 @@ def __init__(self, address):
168168
self.requester = NotifyRequester(self.received, address, False)
169169

170170
def connect(self):
171-
debug(1, "Conneting to " + target)
171+
debug(1, "Connecting to " + target)
172172
sys.stdout.flush()
173173

174174
self.requester.connect(True)
@@ -210,7 +210,7 @@ def send_data(self):
210210
debug(3, "Found compatible device at address " + address)
211211
target = address
212212
except:
213-
debug(0, "Device discovery failed. Is bluetooth enabled? Are you root?")
213+
debug(0, "Device discovery failed. Is bluetooth enabled? Are you root? Try running the script with the --device option to bypass the scan - see https://github.com/adlerweb/J7-C_UC96_BLE_Logger/blob/main/README.md#warning")
214214

215215
if args.wait:
216216
doWait = True

0 commit comments

Comments
 (0)