Websockets passing all msg properties as payload instead of discrete

Good morning!

Edited for less words...

I have two RPi's.
Flow set up on Site A, then copied to Site B, with some unique params changed (site ID, temp sensors serial's).

Both send data via websockets to a master NodeRed system that sorts and processes the data for a dashboard.

Site A sends msg.topic and master site receives it exactly as sent.
Site B sends msg.topic, and master receives it with msg.topic property buried in the payload.

Somewhere between the websocket input at site B and websocket output at Master site, all msg.properties are encapsulated into the payload. So msg.topic doesn't exist when received by Master site websocket.

A debug node on Site B shows all message properties reaching the outbound websocket as expected.
A debug node on the master site receiuve websocket shows all properties bundled into payload.

Better screenshot, my highlighter obscured the colors of the original:
Bottom debug is the working unit, showing "topic" in blue as a property.
Top debug is the not working unit, showing "topic" as payload data.

Both units send uptime the same (Site A sends as a topic, site B sends as payload), I just couldn't find debug nodes of those next to each other for a better screenshot.

image

Looks like a JSON string, and sounds like you want it to be converted to an object.

You can use the built in JSON node.

I'm not sure that's the issue. Wouldn't that be required on both units then?
It works fine from one, but not the other.

Both separate sites use the same copied flow to generate the message and send over websockets. One produces expected results, the other does not.

Post both full flows here, then I can compare them.

Will do... These are 2014 Pi's and unbelievably slow to get into the interfaces.

Didn't realize there was a bunch of sensitive data in the flows, doing find/replace in notepad now.

I can't fit the code, keeps saying I'm exceeding the character limit. Using code tags.

Well, it's solved, but I'm not really sure how.

No change:

  • reinstalled NR a dozen times, and made sure versions matched on the working unit and the non-working unit.
  • rebuilt the flow from the ground up
  • reloaded the OS, restored the flow from backup
  • replaced the Pi with a Pi 3, made sure OS and NR versions matched between working and non-working units

Change (solved):

  • created a new websocket channel on each end and replaced the old one.

I thought I had done this when rebuilding the flow, but I likely didn't actually delete the websocket, and it seems the websocket itself was somehow corrupt, not the nodes or flow. "Entire message" was selected in the websocket config. The new and old websockets appear to be identical, but one works corectly and the other doesn't.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.