04-28-2022, 10:15 AM
(This post was last modified: 04-28-2022, 10:23 AM by moarZs.)
RE: Added a new pulse oximeter importer...
Hiya folks, I'm sorry to be "that guy" but I'm having difficulty getting (shadowmoon.waltz's fork) o2ring.py to work. I'm sure this is just user error but can somebody give me a nudge in the right direction please? If I jiggle the o2ring so it wakes up and I run:
Quote:python3 o2ring.py -v --csv
it sits for about a 20 second timeout with:
Quote:Namespace(brightness=None, csv=True, ext='vld', hr_alert_high=None, hr_alert_low=None, keep_going=False, multi=False, o2_alert=None, prefix=None, scan=30, screen=None, verbose=1, vibrate=None) Connecting...
and then spits out:
Quote:No devices found!
disconnecting all
I would be happy if I could just download the bin and/or csv file. I'm on a debian based distro, got bleak installed, and I'm afraid the readme isn't enough for me. (am I dense?)
Should I try the original version? Am I using wrong CLI options? Are my expectations of how it should work wrong? Can I do this through the proprietary USB cable?
RE: Added a new pulse oximeter importer...
Do you have an iPhone or Android phone? If so, you can use the Viatom/Wellue app and then download the data file from it.
RE: Added a new pulse oximeter importer...
Do any of the sample bleak scripts work? i.e. can you see your ring/sleepu using discover.py. You might need to wake up the ring/sleepu by plugging/unplugging charger/sensor
05-01-2022, 04:12 AM
(This post was last modified: 05-01-2022, 04:15 AM by moarZs.)
RE: Added a new pulse oximeter importer...
@Crimson Nape: That works but I do not want to have a dedicated offline android device, virtual or otherwise just to accommodate this oximeter. (Using a M$ VM also works)
@kappa: Sorry, I can't find these bleak sample scripts including discovery.py. However, it is no longer giving me the error I first posted. (even after reboots..?)
Now it says:
Quote:python3 o2ring.py -v --csv
Namespace(brightness=None, csv=True, ext='vld', hr_alert_high=None, hr_alert_low=None, keep_going=False, multi=False, o2_alert=None, prefix=None, scan=30, screen=None, verbose=1, vibrate=None)
Connecting...
Traceback (most recent call last):
File "o2ring.py", line 168, in <module>
loop.run_until_complete(task)
File "/usr/lib/python3.8/asyncio/base_events.py", line 616, in run_until_complete
return future.result()
File "o2ring.py", line 65, in main
await manager.start_discovery()
File "/home/moarZs/Desktop/oximeter.backup/o2r/o2r-master/o2r/o2bt.py", line 142, in start_discovery
await self.scanner.start()
File "/home/moarZs/.local/lib/python3.8/site-packages/bleak/backends/bluezdbus/scanner.py", line 166, in start
assert_reply(reply)
File "/home/moarZs/.local/lib/python3.8/site-packages/bleak/backends/bluezdbus/utils.py", line 23, in assert_reply
raise BleakDBusError(reply.error_name, reply.body)
bleak.exc.BleakDBusError: [org.bluez.Error.InProgress] Operation already in progress
RE: Added a new pulse oximeter importer...
I know I'm asking a stupid question, but are you sure that your computer has Bluetooth capability, and it is operational?
- Red
RE: Added a new pulse oximeter importer...
I guess I was going down the same path of questioning presence of Bluetooth Low Energy support (not all host BT hardware supports BTLE). You can get discover.py from the bleak examples: https://github.com/hbldh/bleak/tree/develop/examples
05-03-2022, 05:30 AM
(This post was last modified: 05-03-2022, 05:31 AM by moarZs.)
RE: Added a new pulse oximeter importer...
OK, thanks. I didn't realize bluetooth version 4+ was needed. I'll try it on one of my newer laptops or buy the latest BT dongle.
Is there a way to do this via the USB cable?
For the possible benefit of other forum readers, here is one way to determine your bluetooth version: "hciconfig -a |grep LMP"
You're looking for LMP 6.x or higher...
LMP 11 - Bluetooth Core Specification 5.2
LMP 10 - Bluetooth Core Specification 5.1
LMP 9.x – Bluetooth 5.0
LMP 8.x – Bluetooth 4.2
LMP 7.x – Bluetooth 4.1
LMP 6.x – Bluetooth 4.0
LMP 5.x – Bluetooth 3.0 + HS
LMP 4.x – Bluetooth 2.1 + EDR
LMP 3.x – Bluetooth 2.0 + EDR
LMP 2.x – Bluetooth 1.2
LMP 1.x – Bluetooth 1.1
LMP 0.x – Bluetooth 1.0b
RE: Added a new pulse oximeter importer...
I have more questions, sorry:
1) I was thinking of sniffing the USB interaction between the device and O2 Insight Pro in windows and replaying it in nix. My concern before I try this is that I might be able to trigger the initiation of the upload of the binary files (using "usbrply" for example) but how would you tell linux to receive the file? Anybody know how to go about this?
2) Do the original/older/unforked @shadowmoon.waltz / @MyNameWasTaken o2ring.py scripts also required bluetooth 4+ / BLE?
RE: Added a new pulse oximeter importer...
Keep in mind that the oximeter uses a USB/HID cable and not a standard USB/USB one.
RE: Added a new pulse oximeter importer...
I've captured the USB traffic. It's essentially the same commands and data format as is used on the BLE communication path, but with USB HID as the transport. The HID data contains the data length as the first octet and then the data for that packet, padded out to 32 bytes total. It should be relatively straightforward to adapt the o2ring bleak script to use pyusb or similar.
|