-
-
Notifications
You must be signed in to change notification settings - Fork 101
Open
Labels
topic: codeRelated to content of the project itselfRelated to content of the project itselftype: imperfectionPerceived defect in any part of projectPerceived defect in any part of project
Description
I have an application that uses Open Sound Control (UDP) Unicast packets from Node.js to the Arduino.
After updating the platform to version 1.5.1, my packets now have a delay of over three seconds in the loop that processes them and are of low reliability (dropped). Node will send a message and then there is a delay of 2-3 seconds (sometimes more).
The fault does not occur not when using version 1.4.1 of the platform. This is nearly instantaneous when using that version.
The version of the firmware on the "bridge" module of my UNO R4 WiFi board is 0.6.0.
An outgoing UDP packet from node:
Javascript
This is a dead simple SLIP encoded UDP packet
import { Client } from 'node-osc'
const sendOsc = (message, value, threshold = 0) => {
//Arduino
var osc3 = new Client(ARDUINO_IP, OSC_PORT)
osc3.send(message, value, threshold, () =>{
osc3.close()
})
oscLog(`${message} | ${value} | ${threshold}`, 'send')
}I'm using the latest version of the node-osc package.
Arduino sketch
WiFiUDP Udp;
setup() {
//WIFI SETUP CODE OMMITED
int status = Udp.begin(RECEIVE_PORT);
Serial.println(status);
Serial.println("\nUDP Listening");
}
loop() {
//30Hz delay omitted, I read at 30 Hz
readUdp();
}
void readUdp() {
int len = Udp.parsePacket();
if (len > 0) {
OSCMessage msg;
Udp.readBytes(OSC_BUFFER, len);
Serial.println("Packet Received");
msg.fill(OSC_BUFFER, len);
if (msg.hasError()) {
Serial.println("Misformated message");
return; //Exit
}Metadata
Metadata
Assignees
Labels
topic: codeRelated to content of the project itselfRelated to content of the project itselftype: imperfectionPerceived defect in any part of projectPerceived defect in any part of project