noble icon indicating copy to clipboard operation
noble copied to clipboard

noble not returning correct data

Open mteichtahl opened this issue 1 year ago • 6 comments

Hi all

I have found an interesting issue. When I grab the manufacturerData from a peripheral, noble is giving me what appears to be incorrect data. Looking at the three samples, you will see the data from noble and bluetoothcli is different from the data returned from test_exec. I believe the data from test_exec to be correct. However, even if i hard code the key from test_exec into noble, the hearbeat fails to keep the session alive.

my environment is Linux jura 5.15.0-1046-raspi #49-Ubuntu SMP PREEMPT Thu Jan 18 12:45:41 UTC 2024 aarch64 aarch64 aarch64 GNU/Linux on Ubuntu 22.04.4 LTS

any guidance would be greatly appreciated

from noble

{
  localName: 'TT214H BlueFrog',
  txPowerLevel: undefined,
  manufacturerData: <Buffer ab 00 2a 05 08 03 31 3d e5 2e fa 00 46 43 83 42 01 c0 01 b6 28 00 00 00 00 00 00 00 00>,
  serviceData: [],
  serviceUuids: [ '1523', '1623' ],
  solicitationServiceUuids: [],
  serviceSolicitationUuids: []
}

from bluetoothcli

^Croot@jura:/home/amazon/btEngine# bluetoothctl info F8:FB:C3:2A:78:70
Device F8:FB:C3:2A:78:70 (random)
        Name: TT214H BlueFrog
        Alias: TT214H BlueFrog
        Paired: no
        Trusted: no
        Blocked: no
        Connected: no
        LegacyPairing: no
        UUID: Unknown                   (00001523-0000-1000-8000-00805f9b34fb)
        UUID: Unknown                   (00001623-0000-1000-8000-00805f9b34fb)
        ManufacturerData Key: 0x00ab
        ManufacturerData Value:
  2a 05 08 03 31 3d e5 2e fa 00 46 43 83 42 01 c0  *...1=....FC.B..
  01 b6 28 00 00 00 00 00 00 00 00                 ..(........   

From test_exec

[  info  ] [thread 55801]       Loading machines...
[  info  ] [thread 55801]       Loaded 543 machines.
[  info  ] [thread 55801]       Loading JOE from 'machinefiles/EF567_c.xml'...
[  info  ] [thread 55801]       JOE loaded.
[  info  ] [thread 55801]       Found machine 'GIGA X3c (INTB)' Version: 6 with 31 products.
[  info  ] [thread 55801]       Sending stay in BLE mode...
[  info  ] [thread 55801]       Key: 42. <---- - 0x2A
[  info  ] [thread 55801]       Wrote: 77656D
[  info  ] [thread 55801]       Connected.

the relevant code section is below

noble.on('discover', async (peripheral: Peripheral)=> {
      if (peripheral.address === CoffeeMachineUtils.toHexString(self.machineId)) {
        self.machine = peripheral;
        
        try {
          self.setState(MACHINE_STATE.CONNECTING)
          await peripheral.connectAsync();
          self.setState(MACHINE_STATE.CONNECTED)
          noble.stopScanning();
          console.log(peripheral.advertisement.manufacturerData)
        } catch (e) {
          self.setState(MACHINE_STATE.DISCONNECTED)
          throw e;
        }
      }
    })

mteichtahl avatar Feb 21 '24 00:02 mteichtahl

Is this reproductible with other devices ?

rzr avatar Feb 22 '24 20:02 rzr

It is. Yes. Both with other Bluetooth devices and central devices. We tested with both a pi and osx - same results Please note: My working hours may not be your working hours. Please do not feel obligated to reply outside of your normal work schedule!Sent on the go - please excuse mistakes On 23 Feb 2024, at 7:35 am, Philippe Coval @.***> wrote: Is this reproductible with other devices ?

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you authored the thread.Message ID: @.***>

mteichtahl avatar Feb 22 '24 20:02 mteichtahl

Does this relate to other problem observed elsewhere:

https://github.com/abandonware/bleno/issues/23

rzr avatar Feb 23 '24 16:02 rzr

Thanks for the tip. I’ll work through this and try swapping to raspbian

mteichtahl avatar Feb 23 '24 22:02 mteichtahl

We have now tried raspbian as well - it seems we are seeing the same behaviour

mteichtahl avatar Feb 26 '24 21:02 mteichtahl

Do you know if it's a regression ? I would compare to earlier versions ?

rzr avatar Mar 08 '24 08:03 rzr