How can I recover a json message from a distant server?

image

And how have you configured the remote server? Is there a screenshot or similar you can show?

Try changing your port from 9000 to 1880

1 Like

doesn't work

image

The configuration of the remote server you shared showed you still have it configured to connect to port 9000. That is wrong - it should be set to whatever port node-red is listening on - which is 1880 by default.

So when you say "doesn't work" without any further information about what you actually did, it is really hard to help. What did you change exactly to get that error? We are telling you to change the configuration of the remote server - so why that would cause an error in the local node-red debug window is very unclear.

ok .... I change the port of my remote server to 1880....
and there is no message in the debug node :
image

to go further I would like to use the node switch to send the message in a direction according to the value of sensorInstallId
is it a good idea ?
I've read Switch node - jsonata - magic?
but I don't understand if the "Key is" exist or not ?

for the moment I've made this

but the property 1 doesn't match .... it's the otherwise property(6) which send a debug message
What's wrong in my reflexion ?

Thanks

In the switch node use "contains" or "==" instead of Jsonata. Search for values without quotes.

1 Like

So it's now working? If so what change did you make between your two posts?

the solution by bakman2 works because I make a simulation of a message .... I will like to test the switch node and the differents rules.
thanks bakman2 :grinning:
thanks cymplecy for the simulation of message :grinning:

the part with node "HTTP IN" doesn't works ....

Try putting your original TCP node instead of the simulated inject node (remember to change back to using port 9000)

1 Like

yes I've tested your solution in real usage cymplecy
and it's work fine....
and now I can steer my sensor data stream where I want :grinning:
by cons I still do not understand why "http in" does not work