Hi all,
I want test something with node red and one raspberry pi.
I use HC SR04 (ultra sonic sensor). If my SR04 is under 10 i want play a video.
Si for this i use the node RPI-SRF and i made a little function.
if(msg.payload < 10){
msg.payload = "PLAYVIDEO"
}
return msg;
after this node I put an exec mode with this command "mpg123 /home/pi/Desktop/flip2.mov"
But in debug node i've this msg.payload "".
So question, How to play a vidéo in fullscreen when the SR04 is under 10cm ?
[
{
"id": "e63e6f037fea2e7f",
"type": "rpi-srf",
"z": "0a43e3503ec04468",
"name": "Capteur de proximité",
"topic": "SRF",
"pulse": "0.5",
"pins": "35,37",
"precision": "0",
"x": 2990,
"y": 1280,
"wires": [
[
"72c228dd03b00f70"
]
]
},
{
"id": "72c228dd03b00f70",
"type": "function",
"z": "0a43e3503ec04468",
"name": "Sensibilité capteur",
"func": "if(msg.payload < 10){\n msg.payload = \"PLAYVIDEO\"\n}\nreturn msg;",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 3300,
"y": 1300,
"wires": [
[
"f865e04384c37cf0",
"579d56c98f95ef55"
]
]
},
{
"id": "f865e04384c37cf0",
"type": "exec",
"z": "0a43e3503ec04468",
"command": "mpg123 /home/pi/Desktop/flip2.mov",
"addpay": "payload",
"append": "VIDEO",
"useSpawn": "false",
"timer": "0",
"winHide": false,
"oldrc": false,
"name": "",
"x": 3670,
"y": 1320,
"wires": [
[
"05d9470753db434d"
],
[],
[
"7a66713f34f14a28"
]
]
},
{
"id": "05d9470753db434d",
"type": "debug",
"z": "0a43e3503ec04468",
"name": "",
"active": false,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "false",
"statusVal": "",
"statusType": "auto",
"x": 4140,
"y": 1280,
"wires": []
},
{
"id": "7a66713f34f14a28",
"type": "debug",
"z": "0a43e3503ec04468",
"name": "",
"active": false,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "false",
"statusVal": "",
"statusType": "auto",
"x": 4070,
"y": 1400,
"wires": []
},
{
"id": "579d56c98f95ef55",
"type": "debug",
"z": "0a43e3503ec04468",
"name": "",
"active": false,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "false",
"statusVal": "",
"statusType": "auto",
"x": 3540,
"y": 1100,
"wires": []
}
]
thanks in advance