NubeIO / module-core-loraraw

0 stars 0 forks source link

[Feature] ZIP commissioning email #40

Open CanuckMarc opened 3 weeks ago

CanuckMarc commented 3 weeks ago

Previously the ZIP confirmation email was sent via old wires by disecting the raw lora payload. However with the new loraraw module, we do not have access to the raw lora payload. Therefore I think this functionality will need to be included in the loraraw module.

@Shiny380 if you have other ideas for how this can be accomplished, please advise.

These are the functions that were previously implemented in old wires to disect the raw lora payloads from ZIP boards.

SERIAL NUMBER:

if (!message) {
  return
}
if (message.length < 32) {
  return
}
if (message.substr(0, 4) != "00C0") {
  return
}
if (message.substr(14, 2) != "01") {
  return
}

str = ''
message = message.substr(26, 30)
for (var i = 0; i < message.length; i+=2) {
    var code = parseInt(message.substr(i, 2), 16)
    if (code < 48 || code > 122) {
      break
    }
    str += String.fromCharCode(code);
}
return str

MODBUS ADDRESS:

if (!message) {
  return
}
if (message.length < 32) {
  return
}
if (message.substr(0, 4) != "00C0") {
  return
}
if (message.substr(14, 2) != "01") {
  return
}
return parseInt(message.substr(4, 2), 16)
Shiny380 commented 3 weeks ago

the zip decoder needs to be finished to add device meta tags for the static payload with any string points. commented out here

no more logic will be added to this module, the reset has to be achieved in wires but this available data which might require more nodes in wires to get device tags unless it can be done with a http request node

CanuckMarc commented 3 weeks ago

@Shiny380 Please add this task to the development pipeline. We can discuss this further on our dev meeting today.

Shiny380 commented 3 weeks ago

@enjuthulung @RaiBnod can you please comment if we are able to get the meta-tags into wires currently somehow? i.e. a http node maybe?

CanuckMarc commented 3 weeks ago

my 2c is that we should have a specific node for getting tags and meta-tags from out ROS Points. These APIs won't be changing, so we could build a specific node.

Shiny380 commented 3 weeks ago

sure thing

Shiny380 commented 2 weeks ago

@enjuthulung any update on this?

RaiBnod commented 2 weeks ago

Hey @Shiny380,

We have introduced meta_tags only at the device level, but we are trying to find them at the point level. There could be two solutions for this:

Please share your thoughts on this.

Shiny380 commented 2 weeks ago

In this ticket: https://github.com/NubeIO/module-core-loraraw/issues/40, it appears that: We need to provide an option to select a point (similar to the rubix-point node, which we can refer to as rubix-point-http) [please correct me if I'm wrong].

It's the same meta-tags we added to the device level in the zip decoder. So In this ticket we just need those tags from the device, not points. So basically a rubix-device-http node, not point node

Shiny380 commented 2 weeks ago

On hold as this is only for 40 sites and not worth any development/automation. Support will simply assist for commissioning these sites