PASCOscientific / pasco_python

Other
16 stars 4 forks source link

Web Bluetooth #1

Open murkle opened 1 year ago

murkle commented 1 year ago

Do you have any examples using Web Bluetooth in Chrome? Thanks! 🙏

vegardlr commented 1 year ago

Please send instructions as to how to perform such a test, and will try

murkle commented 1 year ago

That would be great, thank you!

Here's a couple of minimal examples of web Bluetooth https://github.com/murkle/utils/blob/master/webhid/godirect_bluetooth.html

https://github.com/murkle/utils/blob/master/webbluetooth/GoDice.html

The actual Bluetooth connection is pretty straightforward I hope 😁

jonathanhanna commented 1 year ago

Hi @murkle! I'm a Product Manager at PASCO and I'd like to learn more about what you're trying to accomplish. Could you please reach out to me at jhanna@pasco.com? Thanks!

Jonathan

vegardlr commented 1 year ago

@murkle I did not understand from the files in your github, what you wanted me to try out. Please write abit more what you are trying to accomplish and how you wanted me to take part in this

murkle commented 1 year ago

I've got the device and I've made some good progress, see https://murkle.github.io/utils/webbluetooth/pasco_codeNode.html

I'm having trouble with reading eg the temperature sensor though - maybe you can help a bit?

I'm successfully connecting with this service: UUID 4a5c0000-0000-0000-0000-5c1e741f1c00

and I can send commands to change the LEDs etc to this Characteristic: UUID 4a5c0000-0002-0000-0000-5c1e741f1c00

So it looks like I need to send this command: one_shot_cmd = [ self.GCMD_READ_ONE_SAMPLE, packet_size ]

and according to these bits of code: service_id = sensor_id + 1 uuid = "4a5c000" + str(service_id) + "-000" + str(characteristic_id) + "-0000-0000-5c1e741f1c00" uuid = self._set_uuid(service_id, self.SEND_CMD_CHAR_ID)

it looks like I should send it to UUID 4a5c000X-0002-0000-0000-5c1e741f1c00 where X relates to the sensor_id but that Characteristic doesn't exist unless X = 0

So I'm a bit stuck on (a) where to send GCMD_READ_ONE_SAMPLE and (b) how to get the data back once I've sent it.

vegardlr commented 1 year ago

Hi again,

i see. This is already at a technical level in which I have no insight. So unfortunatly, I can not help. Vennlig hilsen Vegard

On juli 20 2023, at 11:41 am, Michael Borcherds @.***> wrote:

I've got the device and I've made some good progress, see https://murkle.github.io/utils/webbluetooth/pasco_codeNode.html @.***/0?redirect=https%3A%2F%2Fmurkle.github.io%2Futils%2Fwebbluetooth%2Fpasco_codeNode.html&recipient=cmVwbHkrQURUVURFUFZHT0lWWU1BNlhWTU82Uk9DWVlaM1JFVkJOSEhHU01TQVVRQHJlcGx5LmdpdGh1Yi5jb20%3D) I'm having trouble with reading eg the temperature sensor though - maybe you can help a bit? I'm successfully connecting with this service: UUID 4a5c0000-0000-0000-0000-5c1e741f1c00

and I can send commands to change the LEDs etc to this Characteristic: UUID 4a5c0000-0002-0000-0000-5c1e741f1c00

So it looks like I need to send this command: one_shot_cmd = [ self.GCMD_READ_ONE_SAMPLE, packet_size ]

and according to these bits of code: service_id = sensor_id + 1 uuid = "4a5c000" + str(service_id) + "-000" + str(characteristic_id) + "-0000-0000-5c1e741f1c00" uuid = self._set_uuid(service_id, self.SEND_CMD_CHAR_ID)

it looks like I should send it to UUID 4a5c000X-0002-0000-0000-5c1e741f1c00 where X relates to the sensor_id but that Characteristic doesn't exist unless X = 0

So I'm a bit stuck on (a) where to send GCMD_READ_ONE_SAMPLE and (b) how to get the data back once I've sent it. — Reply to this email directly, view it on GitHub @./1?redirect=https%3A%2F%2Fgithub.com%2FPASCOscientific%2Fpasco_python%2Fissues%2F1%23issuecomment-1643605609&recipient=cmVwbHkrQURUVURFUFZHT0lWWU1BNlhWTU82Uk9DWVlaM1JFVkJOSEhHU01TQVVRQHJlcGx5LmdpdGh1Yi5jb20%3D), or unsubscribe @./2?redirect=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FADTUDEK6PK7T42D6XKYX5X3XRD4LRANCNFSM6AAAAAAZM5BQPY&recipient=cmVwbHkrQURUVURFUFZHT0lWWU1BNlhWTU82Uk9DWVlaM1JFVkJOSEhHU01TQVVRQHJlcGx5LmdpdGh1Yi5jb20%3D). You are receiving this because you commented.Hi