-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Documentation #2
Comments
so the relevant UUIDs can be found here Lines 24 to 32 in 63fd491
As an overview for which UUID is used on what:
So far I know of the following byte sequences for the CommandChannel:
Generally all packets on the RX and TX channels, are always formatted like so:
The things you need to do to get the data are:
The thing you probably need to change to add support for you device is to just add a file in the device specific config folder and find out from which address the data is read on your device. But it would be helpfull to know which device you are trying to add support for. Best, |
Ok I have just seen that you are using omron 7361t The reason that this one is not supported yet is, that is has a different byte order in the records itself (hence the different import of bytearrayBitsToIntLittleEndian). If you can give me some time I can hopefully work it out. If you want to do some testing in the meantime you should be able to use:
as the device specific config file. Maybe you could give me one or two records bytesArrays to test on. |
Let me try, I will get back to you. |
'The reason that this one is not supported yet is, that is has a different byte order in the records itself' what records |
So each measurement you take is stored in the eeprom with the time of recording, the sys pressure, the dia pressure, and the heart rate and some other stuff. omblepy/deviceSpecific/hem-7322t-d.py Lines 17 to 27 in 63fd491
And in the code of UBMP this corresponds to: https://codeberg.org/LazyT/ubpm/src/commit/815a74dce1c41b16594e9e2d6208f96f3f2999a2/sources/plugins/vendor/omron/hem-7361t/DialogImport.cpp#L442-L448 And to complicate things further your device seems to use a different endianess. |
Can you share Omron's document if any? |
when switching to programming mode, and paring I am getting a response of b'\x82\x0f' + b'\x00'*18 |
Oh, so maybe the number of zeros can vary then. |
0x820F happens for me, if the device isn't paired in OS. |
When connecting to the device after paring, windows will give a prompt to pair. |
if i give I get a 0x8104 |
Does the initial pairing with -p work for you? Does the programm print something like "Paired device successfully with new key..."?
I also have this issue, sometimes removing the device from the windows bluetooth settings seems to be neccesary |
I can't say paring work, there is 0x01 and 0x02 available with program mode, if 0x02 get a response of 0x820F and for 0x01 0x8104 |
I think when you write to the unlock UUID the first byte indicates what to do. At least for my device it works like this:
If some bit in the second byte of the response is set, it seems to indicate some error. |
Also @LazyT has the same device and the initial pairing also didn't work. |
Tested with internal (intel) and external (csr) bluetooth adapter with original mac: doesn't work That was the reason, why ubpm only works with the faked mac... |
Does that mean you have tested with a Android Phone, that has bluetooth mac address that is different from the one that was originally paired with the omron device? In starting from Wednesday this week I should have access to a hem-7361t / m500 and can do some testing regarding the pairing process. |
Yes, paired on tablet and works on handy too. Tried also with cloned mac last byte +1: doesn't work on pc. So it's not vendor specific blacklist or something like this. |
@userx14 Tried to run your code but not pairing. Return code is '820f' |
I think @LazyT is right, and it seems to be OS dependent. I have connected a factory new HEM-7361T to an android device with the following steps: I always expected that there is a normal bluetooth connection mode, like there is with the hem-7322t, where you short press the blutooth button, and it goes into a mode where the little square directely appears and not the P. But the 7361 does not seem to have that. Instead I have to go into the P mode again, but it works the same from thereon. Send 0x01(16*bytes unlock key) and it changes to the square mode and accepts the commands and I'm able to access the eeprom (manually by with nRF Connect). I'm currently investigating why it is not working on windows. My programm does not seem to create a pair dialog with this devcies, even if I insert .pair(). Therefore I always get 0x820f, because the device is at this point in time not correctely paired. When I pair the device with the os first, there seems to be a different issue, where the tool does not have access to the gatt services anymore. |
It has something to do the encryption or the pairing procedure for ble devices. Encrypted services seem to be not supported at all by bleak, therefore it is most likeley unusable for this device. The response will therefore be always zero bytes when reading a characteristic and writes will not work at all. Since the device works with various Android phones and nRF-Connect I also tested with nRF-Connect and their nRF52840 chip using their Windows Desktop Application. There the device also returns 0x820f after connection. But when pairing the device without bonding the device suddenly works and I get the expected responses. So connecting then pairing is needed, which encrypts the btle connection and exchanges keys. After some experimenting I was able to reproduce the connection steps with bluetoothctl on linux by manually typing the commands and it works too. So here it my log of what I typed in the shell. Not every command might be neccesary, e.g. I suspect that the btmgmt commands are optional, but please try what is required on your devices to get it to work and report your findings. @LazyT would it be possible to "port" these commands to UBPM, since it uses the bluez stack directely? I'm currently looking for alternative python libraries which support encrypted bluetooth le services to get this code working with the hem-7362t, but that could mean that the support for windows 10 will no longer be present.
|
Which python library, I have tried Pyatt and it's good. But I am not getting exceptions and no response. while I get it on bleak. Hope it will work for you. Please keep updated. |
For over a year I made a bluetooth test tool and all the code was already there, with pairing. I don't know why it wasn't working, but it works now. I don't understand it. Didn't test reading records yet, but I guess this will work too. Holy shit, lol... |
I would guess that they changed something with later bluez versions, btle encryption support seems to be a recent development.
I have looked into pygatt, but unfortunatelly it seems to be a wrapper around gatttool which is deprecated. Also gatttool when used manually did not work for me when testing. For python it seems to work with python-bluezero with some trickery for pairing. |
Hi, https://github.com/userx14/omblepy/tree/bluezeroVersion When testing with the device I discovered it has some quirks in the protocol which differ from the hem7322t:
Additional observations:
|
I tried the new code. When I try that I am getting |
With which linux distro are you running your tests?
Testing on Ubuntu 22.04 did not work at all and gave the Ubuntu 20.04 worked but with the following limitations:
Best, |
I think the the authentification bug is now also fixed in the windows = crossplatform = bleak version. |
No, just use the bluetooth built into your phone. I was hoping the hardware in the phone supports the newer bluetooth standard, just to test if it makes a difference for the devices that do not workin with your stick. |
i dont get it , i mean, phone connects successfully with omron device with all three or its connect phone with bluetooh usb device? |
The idea was to use the Android Os Pairing dialog on a second phone which does not have the omron app installed and was not the last phone paired to the device. This would create a simmilar scenario to a pc trying to pair, just that most phones have hardware supporting more recent bluetooth versions. Anyway I think the most likeley cause is just the too low bluetooth version of your usb adapter. So if you can test on windows device with a chipset / usb dongle with more recent bluetooth version, just try if it works 😃 . |
i tried with a tablet that never connected and both devices connected on tablet but on omron devices keep blinking P |
Ok, so I would say it is most likely that the reason the pairing fails on windows is your usb dobgle's missing support for newer bluetooth features (4.2).
The continued blinking of the P on the screen is normal, one needs to write a pairing key to some bluetooth characteristics for it to stop, which is what omblepy would do after the pairing succeeded. |
ok what usb dongle you recommend? latest its one 5.0 or 5.1? that one works |
Dongles with 5.0 or 5.1 should both work. |
i guess i try get one on ebay , but i only see 5.0 so far. |
i get one from amazon 5.3 , it comes thursday , i update after i try |
im trying use tablet , but idk how do it i install it pydroid 3 , termius , i get omblepy file on the tablet but idk how run it. |
It is really complicated getting the bluetooth library I used to work on Android. It would involve building an app with python4android and Kivy. Better safe your time and wait for the usb dongle. |
i have high hopes on it hahah i get i tried like a hour, asked here to that , i let it, thanks man, i wait until dongle comes. |
if i do this working, all json files can be on same folder or i need different omblepy folders for each device? it can run on crontab or it needs do paring process every time, whatever its fine i mean one time in month or something. |
Currently it reads the records from the device and does these things:
The json file is intended to be directely imported into ubpm after each run and is not for permanent storage as it gets overwritten with every data readout. To be honest, I have not really thought about the use with multiple devices, it depends if you want to keep the results of the devices seperate or merge them into one file. The choise probably depends on if the devices are used by the same person or not. Depending on what you want to do here, you could modify the saveUBPMJson function to save to a different folder depending on the deviceName: |
i guess need use separate my step dad check continuosly and use this can be a good upgrade. i will check that |
i get a dongle 5.3 running 7530t i get this error, using 71xx one works connect with -p but get error with data. this one its the one with ekg. checking other one. the other its working i get data fine question , python3 ./omblepy.py -p -d HEM-7155t this need be used every time for connect then after python3 ./omblepy.py -d HEM-7155t idk too much running just this way works fine. and both press the P On device |
Nice, looks like the pairing is working now.
The -p option writes an unlock key into to omron device. If you only use omblepy you in theory only have to do this one single time. The error you see when trying to read out data is a programming made by me. I will try to fix it later this day. |
I hope it is fixed now, please try out the most recent version of: |
Thanks for the screenshots, that looks very promising. Here are the raw bytes of the records:
Since I now have the raw data of the measurements would it possible for you to tell me the data the omron displays for these nine measurments (year, month, sys pressure, dia pressure, ...) to find out which byte stores what data? I suspect I already see the year at the third byte, so if this is right the years for the first record should be |
i dont use this one too much , i checked on omron app and i get this july 11/22 124/91 ekg normal bpm 76 april 29/22 Ekg possible Atrial Flibrillation 110 bpm |
question ubpm can read ekg? im guessing not its other app for it, i feel this just very new on pc. i mean nature reverser thing. |
Hi, I think I got the blood pressure readings figured out.
If these are correct, the version in the testing branch should now also read the blood pressure records.
No, I don't think so. I'm unaware of any open source application that can read out that ekg curve. What is the status of the other devices currently?
|
its fine understand. yea those are successfully connected nice im going to try this update and let you know |
i little lost what need replace to save multiple ones devices readings? idk its useful i able to get other device BP786N i get really cheap by coincidence . |
I'm not sure if the code here works, since I currently have no device to test with. Please let me know if this is what you want. I think otherwise you can also do the thing you initially proposed and just create multiple folders with the respository and create the device separation that way.
BP786N / hem-7321 is very likely internally the same device as hem-7322, which is supported already. |
I will close this issue now. |
Can you tell me how you find which UUIDs for different functions and bytes code to write for a particular action?
The text was updated successfully, but these errors were encountered: