nionata / grapevine

Anonymous proximity-based gossip messaging mobile application
1 stars 0 forks source link

Bluetooth errors #36

Closed nionata closed 2 years ago

nionata commented 2 years ago

Transmission was successful with up to 4 devices! That being said, issues arose. As more devices started interacting, there were more and more issues.

Originally posted by @nionata in https://github.com/nionata/grapevine/issues/35#issuecomment-974889167

nionata commented 2 years ago

DF36610E-7858-436A-9B2B-BDBF633F656B_1_102_o

5B334F34-D600-483E-B62B-0C864598D3B2_1_102_o

nionata commented 2 years ago

I am going to first try and relax the task runner interval. If that doesn't work, I have a feeling the move to transmitting a user id instead of messages directly will resolve some of these issues

Update I tried removing the tickler and it resulted in a single transmission. My hunch is that advertising resumes after a transmission. However, after a connection via the central module, device scanning stops.

nionata commented 2 years ago

Re: write error

After adding a try catch in the peripheral handlers, the write request from the central's POV no longer errors out. Instead, the peripheral now logs this error:

ERROR  [Error: invalid wire type 4 at offset 113]
nionata commented 2 years ago

maximum length is limited to 512 bytes by the specification

The size of the value of any GATT attribute is fixed. By adding additional message meta, I must have exceeded this limit causing the over-wire base64 string to be corrupted. This is the end of the road for bluetooth message transmission. Goodbye v0, hello v1.