sender script
JoachimAs opened this issue · 1 comments
Hello together,
your receiver is very beautiful and it works perfectly. Now I want to implement the sender and the priority is 0, with the tool sacnview for windows.
And the sender only once sent the information.
`const { Sender } = require('sacn');
const sACNServer = new Sender({
universe: 1,
// see table 3 below for all options
});
async function main() {
await sACNServer.send({
payload: { // required. object with the percentages for each DMX channel
1: 100,
2: 50,
3: 0,
},
sourceName: "My NodeJS app", // optional. LED lights will use this as the name of the source lighting console.
priority: 188, // optional. value between 0-200, in case there are other consoles broadcasting to the same universe
});
}
main(); // wrapped in a main() function so that we can await
the promise`
Hi @JoachimAs, the two problems you reported are related:
- the sender only sends the information once
- the priority is always 0
Unlike some sACN receivers, sACNViewer requires the sender to repeatedly send the data. sACN Viewer does not hold the last DMX data, so if you stop sending data it sets all channels and the priority value back to 0.
So, I've added a new option to the sender called minRefreshRate
which should solve both these issues:
const sACNServer = new Sender({
universe: 1,
minRefreshRate: 2, // 2Hz = every 0.5seconds
});
Let me know if you still have problems