PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0
Showing posts with label node-red. Show all posts
Showing posts with label node-red. Show all posts

Tuesday, July 12, 2022

[FIXED] How can i seperate/split part of string messege in node red

 July 12, 2022     json, message, node-red, string     No comments   

Issue

I received this message:

 "data: "{"cmd":"gw","seqno":515816,"EUI":"000DB53113683569","ts":1510584501221,"fcnt":1,"port":2,"freq":868100000,"toa":1482,"dr":"SF12 BW125 4/5","ack":false,"gws":[{"rssi":-71,"snr":9.5,"ts":1510584501221,"time":"2017-11-13T14:48:21.218869Z","gweui":"B827EBFFFF6A14DD","lat":50.0751806,"lon":14.4022641}],"bat":255,"data":"0002560000000000000000"}"" 

I need to put away the "data: " and on the end the "

I need just the JSON message if I use JSON node it just writes me an error because of the "data: "


Solution

You can use a function node to chop the string up. Something like this:

msg.payload = msg.payload.substring(7,msg.payload.length - 1);
return msg;

And then wire this to a JSON node.



Answered By - hardillb
Answer Checked By - Robin (PHPFixing Admin)
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg

Tuesday, January 4, 2022

[FIXED] Node red with lamp stack?

 January 04, 2022     lamp, node-red     No comments   

Issue

i've installed a xamp stack onto a raspberry pi and it is collecting data from 5 arduino sensors. My question is can i also install node-red into my raspberry pi to help me with creating the IoT dashboard for the client side?

Will there be any collision or interference between my lamp stack and nodered?

I am using raspbian buster lite


Solution

There should be no interaction between the a LAMP stack and Node-RED out of the box.



Answered By - hardillb
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Older Posts Home
View mobile version

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
All Comments
Atom
All Comments

Copyright © PHPFixing