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

Error creating Gateway #13

Open
harryhcs opened this issue Jun 30, 2021 · 2 comments
Open

Error creating Gateway #13

harryhcs opened this issue Jun 30, 2021 · 2 comments

Comments

@harryhcs
Copy link

harryhcs commented Jun 30, 2021

Hi there, I'm using your nodes and trying to create a Gateway. Not clear what it expects but looking at the src it expects a payload with the following keys:

  • location
  • name
  • id
  • etc

I have node-red function that sets the payload:

msg.payload = { 
    "description": "MikroTik LtAP LR8",
    "discoveryEnabled": true,
    "gatewayProfileId": "1",
    "id": "3133303718004e00",
    "location": {
      "accuracy": 0,
      "altitude": 0,
      "latitude": 0,
      "longitude": 0,
      "source": "UNKNOWN"
    },
    "metadata": {},
    "boards": [
      {
        "fineTimestampKey": "string",
        "fpgaID": "string"
      }
    ],
    "name": "MikroTik-Roaming",
    "networkServerId": "1",
    "organizationId": "1",
    "tags": {}
}
        	
return msg;

It only returns this Error:

""TypeError: c.toArray is not a function""

@harryhcs
Copy link
Author

harryhcs commented Jul 1, 2021

Is it not something here, I dont think your passing it all these values:


proto.api.Gateway.toObject = function(includeInstance, msg) {
  var f, obj = {
    id: msg.getId(),
    name: msg.getName(),
    description: msg.getDescription(),
    location: (f = msg.getLocation()) && common_common_pb.Location.toObject(includeInstance, f),
    organizationId: msg.getOrganizationId(),
    discoveryEnabled: msg.getDiscoveryEnabled(),
    networkServerId: msg.getNetworkServerId(),
    gatewayProfileId: msg.getGatewayProfileId(),
    boardsList: jspb.Message.toObjectList(msg.getBoardsList(),
    proto.api.GatewayBoard.toObject, includeInstance),
    tagsMap: (f = msg.getTagsMap(true)) ? f.toArray() : [],
    metadataMap: (f = msg.getMetadataMap(true)) ? f.toArray() : [],
    serviceProfileId: msg.getServiceProfileId()
  };

  if (includeInstance) {
    obj.$jspbMessageInstance = msg;
  }
  return obj;
};
}

@adminfriso
Copy link
Collaborator

Correct, at the time of writing the extra parameters were not present in chirpstack already. Also we have not actively used this part of the functionality so it has not been thouroghly tested like other parts of the package.

If i am correct you are looking for this part of the package

If you require more properties, please create a pull request for adding those

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