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

iotile-gateway throwing away scan packet fields? #944

Open
mattrunchey opened this issue Feb 7, 2020 · 2 comments
Open

iotile-gateway throwing away scan packet fields? #944

mattrunchey opened this issue Feb 7, 2020 · 2 comments
Assignees

Comments

@mattrunchey
Copy link
Contributor

Somewhere in iotile-gateway, scan packets are being modified before it ends up at a consumer (via hw.scan(), for example).

We discovered this because some of our systems rely on finding the signal_strength field in a packet to collect diagnostics.

I am looking for where in coretools this is happening and will update if I find it (opening a ticket now in case anyone finds it faster!)

@mattrunchey
Copy link
Contributor Author

Testing to discover this

You can run two programs side by side to see the difference in packet outputs.

from iotile.core.hw.hwmanager import HardwareManager
with HardwareManager(port='{ws:localhost}|{bled112}') as hw:
  results = hw.scan()
  for dev in list(results):
    print(dev)

Compare the dev print between the two port settings above.
A packet from the gateway's port looks like

{'uuid': 42, 'connection_string': 'device/2a', 'expiration_time': 8200.031356979, 'slug': 'd--0000-0000-0000-002a'}

A packet from the bled112 port looks like

{
    "advertising_version": 1,
    "connection_string": "88:6B:0F:B2:74:29",
    "expiration_time": 8912.371642329,
    "low_voltage": false,
    "pending_data": false,
    "signal_strength": -39,
    "slug": "d--0000-0000-0000-002a",
    "user_connected": false,
    "uuid": 42,
    "validity_period": 60
}

@mattrunchey
Copy link
Contributor Author

@timothyfroehlich for investigation so far.

iotile-gateway puts the signal_strength field in here and it's possible that somewhere in the transport_plugin we're using that the field isn't sent along

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