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

Mesh network database import fails #250

Closed
codezork opened this issue Oct 7, 2022 · 9 comments · Fixed by #252
Closed

Mesh network database import fails #250

codezork opened this issue Oct 7, 2022 · 9 comments · Fixed by #252
Assignees
Labels
android bug Something isn't working

Comments

@codezork
Copy link

codezork commented Oct 7, 2022

A json file exported from https://github.com/NordicSemiconductor/Android-nRF-Mesh-Library cannot be imported. Crashes with: ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: MeshNetworkEventError(error: Invalid Mesh Provisioning/Configuration Database JSON file, unsupported ID).
The original app by Nordic Semi can import its own export.

@ghost
Copy link

ghost commented Oct 7, 2022

Hello @codezork,
Thanks for the report !

Nordic's app may have a newer SDK version than this plugin. See #246.

Unfortunately at the moment I can't debug it but I suspect this is the reason why your export cannot be imported : they may have change something since our latest upgrade. Could you check this idea ?

@ghost
Copy link

ghost commented Oct 7, 2022

Also, if my above comment doesn't help it would be much appreciated if you could upload here a json file that makes the plugin throwing this error 🙏

@codezork
Copy link
Author

codezork commented Oct 9, 2022

This is the JSON from Nordic. Could you add a JSON to the repo that works with your version of the app?

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "id": "https://www.bluetooth.com/specifications/specs/mesh-cdb-1-0-1-schema.json#",
  "version": "1.0.1",
  "meshUUID": "F79807A0-8A75-4540-8EB1-C957BE7197FE",
  "meshName": "nRF Mesh Network",
  "timestamp": "2022-10-07T16:09:32+02:00",
  "partial": false,
  "netKeys": [
    {
      "name": "Network Key 1",
      "index": 0,
      "key": "F15A4E1ED751A36AE197A60983AFDE58",
      "phase": 0,
      "minSecurity": "insecure",
      "timestamp": "2022-10-07T15:59:29+02:00"
    }
  ],
  "appKeys": [
    {
      "name": "Application Key 1",
      "index": 0,
      "boundNetKey": 0,
      "key": "266A731589FEB4B887D102B40147C02F"
    },
    {
      "name": "Application Key 2",
      "index": 1,
      "boundNetKey": 0,
      "key": "94C72F2478C5E058019FCA3A6AA0EF1C"
    },
    {
      "name": "Application Key 3",
      "index": 2,
      "boundNetKey": 0,
      "key": "701F857321F9E9F3F4ABE7A8BFA9F435"
    }
  ],
  "provisioners": [
    {
      "provisionerName": "nRF Mesh Provisioner",
      "UUID": "B3E36C78-E7B3-41A8-B579-AE34C6170B3E",
      "allocatedUnicastRange": [
        {
          "lowAddress": "0001",
          "highAddress": "199A"
        }
      ],
      "allocatedGroupRange": [
        {
          "lowAddress": "C000",
          "highAddress": "CC9A"
        }
      ],
      "allocatedSceneRange": [
        {
          "firstScene": "0001",
          "lastScene": "3333"
        }
      ]
    }
  ],
  "nodes": [
    {
      "UUID": "B3E36C78-E7B3-41A8-B579-AE34C6170B3E",
      "name": "nRF Mesh Provisioner",
      "deviceKey": "C39E0EA225DA665FEC90AC04C9DDA112",
      "unicastAddress": "0001",
      "security": "insecure",
      "configComplete": false,
      "features": {
        "friend": 2,
        "lowPower": 2,
        "proxy": 2,
        "relay": 2
      },
      "defaultTTL": 5,
      "netKeys": [
        {
          "index": 0,
          "updated": false
        }
      ],
      "appKeys": [
        {
          "index": 0,
          "updated": false
        },
        {
          "index": 1,
          "updated": false
        },
        {
          "index": 2,
          "updated": false
        }
      ],
      "elements": [
        {
          "name": "Element: 0x0001",
          "index": 0,
          "location": "0000",
          "models": [
            {
              "modelId": "0001",
              "bind": [],
              "subscribe": []
            }
          ]
        }
      ],
      "excluded": false
    }
  ],
  "groups": [],
  "scenes": [],
  "networkExclusions": [
    {
      "ivIndex": 0,
      "addresses": [
        "0002"
      ]
    }
  ]
}

@codezork
Copy link
Author

codezork commented Oct 9, 2022

The readme.mo from nordic says: "The mesh network configuration (JSON schema) is compatible with
Mesh Configuration Database Profile 1.0". So nothing should have been changed.
Are you completely in nordic's code while importing?

@ghost
Copy link

ghost commented Oct 9, 2022

You are right there should not be any changes because of the spec.
Yes this plugin is only a wrapper on the Nordic SDK 👍 so the json is not altered before "entering" their code.

Thanks for the json, I will try to find time to debug this this week as I understand this is a blocker for you.

@codezork
Copy link
Author

codezork commented Oct 9, 2022

Excellent! Thank you

@Nanodash
Copy link
Collaborator

Nanodash commented Oct 13, 2022

Hello @codezork,
I began to update the plugin, I will do some non-regression tests and will then look at your issue. Sorry for the delay !

@Nanodash Nanodash self-assigned this Oct 13, 2022
@Nanodash Nanodash added bug Something isn't working android labels Oct 13, 2022
@Nanodash
Copy link
Collaborator

Hi @codezork , I've found the issue. It's indeed a version issue. It's seems that schema id has changed from http://www.bluetooth.com/specifications/assigned-numbers/mesh-profile/cdb-schema.json# to yours : "https://www.bluetooth.com/specifications/specs/mesh-cdb-1-0-1-schema.json#", and our version of Nordic SDK is throwing for this

@Nanodash
Copy link
Collaborator

the fix is pretty straight forward : update Nordic dependencies

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
android bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants