@sdetweil @Sean
Hello Guys Thank you for your vallueed help!
I found out that the spawn function is called every time. so in a couple of minuts the spawn function has called 100 python projects. and this is blocking the raspberry
I changed is to this: and now im going to Import the project of sdetweil in the software. But it is no more blocking.
thank you guys
/// node_helper.js
const spawn = require("child_process").spawn
var NodeHelper = require("node_helper")
var process = spawn("python", ["/home/pi/src/P2000.py"])
module.exports = NodeHelper.create({
socketNotificationReceived: function(notification, payload) {
switch(notification) {
case "GIVE_ME_DATA":
this.job()
break
}
},
job: function() {
process.stdout.on("data", (data)=>{
console.log(data)
var result = String.fromCharCode.apply(null, new Uint16Array((data)))
this.sendSocketNotification("HERE_IS_DATA", result)
})
}
})