HI all,
I’m sorry in advance for what will likely be a trivial answer. I’ve never used jscript before or coded in a very long time, so I’m trying to inhale as much as I can in a short while. I have people waiting on this so I can no longer research as I have been for the last couple of days to find a tutorial or answer. Even if there’s a resource that shows the process rather than the solution outright I’d be incredibly grateful!
I’m sending data via MQTT and it’s coming through fine. The existing decode script is pushing out the data simply as {parameter: measurement, parameter: measurement…} which is great, however I need to add the devEUI to this. I can add it to the existing structure no worries so it looks like this:
{devEUI: devEUI, parameter: measurement…}
but I need it to look like this:
{devEUI: devEUI{parameter: measurement,…}}
the decode is a very straightforward one, a function creating an array from the parameters and "return"ing it. I cannot for the life of me change this, I’ve tried another function to get the devEUI and return it before the measurements, I’ve tried nesting the decode function within the new function getting the devEUI; it always ends with an error or returns nothing at all.
I’ve tried constructing the extra text with console.log() which doesn’t show and I’m out of ideas.
It almost seems as if Chirpstack says I’m expecting this result in this structure and nothing else but I know that can’t be true.
If anyone, anyone can put me out of my misery or point me to a resource, I’d be forever grateful!