Skip to content
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

noble not returning correct data #329

Open
mteichtahl opened this issue Feb 21, 2024 · 6 comments
Open

noble not returning correct data #329

mteichtahl opened this issue Feb 21, 2024 · 6 comments

Comments

@mteichtahl
Copy link

mteichtahl commented Feb 21, 2024

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;
        }
      }
    })
@rzr
Copy link

rzr commented Feb 22, 2024

Is this reproductible with other devices ?

@mteichtahl
Copy link
Author

mteichtahl commented Feb 22, 2024 via email

@rzr
Copy link

rzr commented Feb 23, 2024

Does this relate to other problem observed elsewhere:

abandonware/bleno#23

@mteichtahl
Copy link
Author

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

@mteichtahl
Copy link
Author

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

@rzr
Copy link

rzr commented Mar 8, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants