Author Topic: Award a name or label to Node Id  (Read 199 times)

zzzap

  • Newbie
  • *
  • Posts: 8
Award a name or label to Node Id
« on: May 26, 2019, 01:56:40 PM »
Hello everybody ... we started  some day ago a  school project  and Felix help us with some info...Now we have a new problem..The project have 3 node with  a Gateway  and oled display. When a message is sent from Node 1 to gateway the display show the node ID number...(SENDER ID). Is possible to award a label or name (example DOOR 1 or WINDOW 2) to a node that will be display to oled gateway? For example at first message node ID is 1 and than we can choose  a name from a list .... so the next message display the selected name instead of  Node id number... Thank you all for any help :)

Felix

  • Administrator
  • Hero Member
  • *****
  • Posts: 5850
  • Country: us
    • LowPowerLab
Re: Award a name or label to Node Id
« Reply #1 on: May 27, 2019, 12:10:04 PM »
Is it possible? Definitely yes.

How you implement it .. that's a longer answer.

I would suggest this - instead of printing the [ID] message to the OLED right away on the gateway, you can simply pass the message on to the Gateway.js app. There, in the processSerialData() function you can then reformat the message to your liking (replacing/adding whatever information from the dbNode) and pass it back to the Gateway as a command, something like LCD:message where message is your reformatted string to display on the Gateway's LCD (if any). Then you can simply change any labels in the UI directly and they will instantly start changing on the OLED without additional coding anywhere.

That also gives you a chance to display DEBUG messages - for instance if no tokens were matched, or if anything else is wrong with the received message.

I might actually implement something like this myself since I wanted to add more control to the LCD/OLED display directly from the UI.

But for now I'm working on other features so this is low priority - your chance to learn/experiment/contribute!