I use the serialport package in my app (https://github.com/voodootikigod/node-serialport). This code is just working fine on the server :
Meteor.startup(function () {
SerialPort = Meteor.npmRequire('serialport');
});
Meteor.methods({
serialPortsRefresh: function () {
SerialPort.list(function (err, ports) {
ports.forEach(function(port) {
console.log(port.comName);
});
// Config.insert(ports);
return ports;
});
}
});
Now i want to save this list in a collection to expose it to the client. What is the best solution ?
When i uncomment Config.insert(ports); i've the error :
throw new Error("Meteor code must always run within a Fiber. " +
Thanks in advance !