Open alexmc1510 opened 1 year ago
Hey! So, you said you get an error on this over here https://github.com/st-one-io/node-open-protocol/issues/40
Can you do what you're trying and share a debug log? To enable it, set the environment variable NODE_DEBUG=open-protocol
Hello, thank you very much for your support.
Here is the code I am executing, trying to get the traces with MID0900:
const openProtocol = require('node-open-protocol');
let op = openProtocol.createClient(4545, "192.168.0.199", () => {
console.log("Connected!");
let opts = {
mid: 8,
revision: 1,
payload: "09000013500000000000000000000000000000001001"
}
op.on("data", (data) => {
console.log("Data received", data);
});
op.sendMid(8, opts, (err) => {
if (err) {
console.log("Error", err);
return;
}
});
});
And here you are the log:
node C:\Users\alex\node_modules\node-open-protocol\test\alex.js
OPEN-PROTOCOL 7564: new SessionControlClient
OPEN-PROTOCOL 7564: new LinkLayer {
stream: <ref *1> Socket {
connecting: true,
_hadError: false,
_parent: null,
_host: null,
_closeAfterHandlingError: false,
_readableState: ReadableState {
objectMode: false,
highWaterMark: 16384,
buffer: BufferList { head: null, tail: null, length: 0 },
length: 0,
pipes: [],
flowing: null,
ended: false,
endEmitted: false,
reading: false,
constructed: true,
sync: true,
needReadable: false,
emittedReadable: false,
readableListening: false,
resumeScheduled: false,
errorEmitted: false,
emitClose: false,
autoDestroy: true,
destroyed: false,
errored: null,
closed: false,
closeEmitted: false,
defaultEncoding: 'utf8',
awaitDrainWriters: null,
multiAwaitDrain: false,
readingMore: false,
dataEmitted: false,
decoder: null,
encoding: null,
[Symbol(kPaused)]: null
},
_events: [Object: null prototype] {
end: [Function: onReadableStreamEnd],
connect: [Function],
timeout: [Function]
},
_eventsCount: 3,
_maxListeners: undefined,
_writableState: WritableState {
objectMode: false,
highWaterMark: 16384,
finalCalled: false,
needDrain: false,
ending: false,
ended: false,
finished: false,
destroyed: false,
decodeStrings: false,
defaultEncoding: 'utf8',
length: 0,
writing: false,
corked: 0,
sync: true,
bufferProcessing: false,
onwrite: [Function: bound onwrite],
writecb: null,
writelen: 0,
afterWriteTickInfo: null,
buffered: [],
bufferedIndex: 0,
allBuffers: true,
allNoop: true,
pendingcb: 0,
constructed: true,
prefinished: false,
errorEmitted: false,
emitClose: false,
autoDestroy: true,
errored: null,
closed: false,
closeEmitted: false,
[Symbol(kOnFinished)]: []
},
allowHalfOpen: false,
_sockname: null,
_pendingData: null,
_pendingEncoding: '',
server: null,
_server: null,
timeout: 20000,
[Symbol(async_id_symbol)]: 2,
[Symbol(kHandle)]: TCP {
reading: false,
onconnection: null,
[Symbol(owner_symbol)]: [Circular *1]
},
[Symbol(lastWriteQueueSize)]: 0,
[Symbol(timeout)]: Timeout {
_idleTimeout: 20000,
_idlePrev: [TimersList],
_idleNext: [TimersList],
_idleStart: 123,
_onTimeout: [Function: bound ],
_timerArgs: undefined,
_repeat: null,
_destroyed: false,
[Symbol(refed)]: false,
[Symbol(kHasPrimitive)]: false,
[Symbol(asyncId)]: 4,
[Symbol(triggerId)]: 1
},
[Symbol(kBuffer)]: null,
[Symbol(kBufferCb)]: null,
[Symbol(kBufferGen)]: null,
[Symbol(kCapture)]: false,
[Symbol(kSetNoDelay)]: false,
[Symbol(kSetKeepAlive)]: false,
[Symbol(kSetKeepAliveInitialDelay)]: 0,
[Symbol(kBytesRead)]: 0,
[Symbol(kBytesWritten)]: 0
},
timeOut: undefined,
retryTimes: undefined,
rawData: undefined,
disableMidParsing: undefined
}
OPEN-PROTOCOL 7564: new OpenProtocolParser
OPEN-PROTOCOL 7564: new openProtocolSerializer
OPEN-PROTOCOL 7564: new MIDParser
OPEN-PROTOCOL 7564: new MIDSerializer
OPEN-PROTOCOL 7564: SessionControlClient connect
OPEN-PROTOCOL 7564: SessionControlClient sendMidOne
OPEN-PROTOCOL 7564: LinkLayer _write { mid: 1, revision: 6 }
OPEN-PROTOCOL 7564: MIDSerializer _transform { mid: 1, revision: 6 }
OPEN-PROTOCOL 7564: LinkLayer _onDataMidSerializer { mid: 1, revision: 6, payload: <Buffer > }
OPEN-PROTOCOL 7564: openProtocolSerializer _transform { mid: 1, revision: 6, payload: <Buffer > }
OPEN-PROTOCOL 7564: openProtocolSerializer _transform publish <Buffer 30 30 32 30 30 30 30 31 30 30 36 30 30 31 30 31 30 30 30 30 00>
OPEN-PROTOCOL 7564: LinkLayer _onDataOpSerializer <Buffer 30 30 32 30 30 30 30 31 30 30 36 30 30 31 30 31 30 30 30 30 00>
OPEN-PROTOCOL 7564: LinkLayer _read 16
OPEN-PROTOCOL 7564: LinkLayer _onDataStream <Buffer 30 32 32 31 30 30 30 32 30 30 36 20 30 31 30 31 20 20 20 20 30 31 30 30 30 30 30 32 30 30 30 33 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 ... 172 more bytes>
OPEN-PROTOCOL 7564: OpenProtocolParser _transform <Buffer 30 32 32 31 30 30 30 32 30 30 36 20 30 31 30 31 20 20 20 20 30 31 30 30 30 30 30 32 30 30 30 33 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 ... 172 more bytes>
OPEN-PROTOCOL 7564: LinkLayer _onDataOpParser {
mid: 2,
revision: 6,
noAck: false,
stationID: 1,
spindleID: 1,
sequenceNumber: 0,
messageParts: 0,
messageNumber: 0,
payload: <Buffer 30 31 30 30 30 30 30 32 30 30 30 33 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 30 34 41 43 54 30 35 76 32 2e 30 20 20 ... 151 more bytes>
}
OPEN-PROTOCOL 7564: new MIDParser _transform {
mid: 2,
revision: 6,
noAck: false,
stationID: 1,
spindleID: 1,
sequenceNumber: 0,
messageParts: 0,
messageNumber: 0,
payload: <Buffer 30 31 30 30 30 30 30 32 30 30 30 33 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 30 34 41 43 54 30 35 76 32 2e 30 20 20 ... 151 more bytes>
}
OPEN-PROTOCOL 7564: LinkLayer _onDataMidParser {
mid: 2,
revision: 6,
noAck: false,
stationID: 1,
spindleID: 1,
sequenceNumber: 0,
messageParts: 0,
messageNumber: 0,
payload: {
cellID: 0,
channelID: 0,
controllerName: '',
supplierCode: 'ACT',
openProtocolVersion: 'v2.0',
controllerSoftwareVersion: 'IXB_R_3.6.13.10880_',
toolSoftwareVersion: '3.6.13',
rbuType: 'None',
controllerSerialNumber: 'A3500191',
systemType: 3,
systemSubtype: 1,
sequenceNumberSupport: 0,
linkingHandlingSupport: 0
}
}
OPEN-PROTOCOL 7564: SessionControlClient receivedReply {
mid: 2,
revision: 6,
noAck: false,
stationID: 1,
spindleID: 1,
sequenceNumber: 0,
messageParts: 0,
messageNumber: 0,
payload: {
cellID: 0,
channelID: 0,
controllerName: '',
supplierCode: 'ACT',
openProtocolVersion: 'v2.0',
controllerSoftwareVersion: 'IXB_R_3.6.13.10880_',
toolSoftwareVersion: '3.6.13',
rbuType: 'None',
controllerSerialNumber: 'A3500191',
systemType: 3,
systemSubtype: 1,
sequenceNumberSupport: 0,
linkingHandlingSupport: 0
}
}
OPEN-PROTOCOL 7564: LinkLayer finishCycle undefined
OPEN-PROTOCOL 7564: LinkLayer deactivateLinkLayer
OPEN-PROTOCOL 7564: SessionControlClient _sendingProcess
Connected!
OPEN-PROTOCOL 7564: SessionControlClient _sendMid 8 {
mid: 8,
revision: 1,
payload: '09000013500000000000000000000000000000001001'
}
OPEN-PROTOCOL 7564: SessionControlClient new Message
OPEN-PROTOCOL 7564: SessionControlClient _sendingProcess
OPEN-PROTOCOL 7564: SessionControlClient _transmitMid Message {
_mid: {
mid: 8,
revision: 1,
payload: '09000013500000000000000000000000000000001001'
},
_callback: [Function (anonymous)],
_type: 'manual',
_group: undefined,
_baseMid: {
mid: 8,
revision: 1,
payload: '09000013500000000000000000000000000000001001'
}
}
OPEN-PROTOCOL 7564: SessionControlClient _calcRevision undefined undefined undefined undefined
OPEN-PROTOCOL 7564: LinkLayer _write {
mid: 8,
revision: 1,
payload: '09000013500000000000000000000000000000001001'
}
OPEN-PROTOCOL 7564: MIDSerializer _transform {
mid: 8,
revision: 1,
payload: '09000013500000000000000000000000000000001001'
}
node:buffer:410
throw new ERR_INVALID_ARG_VALUE.RangeError('size', size);
^
RangeError [ERR_INVALID_ARG_VALUE]: The argument 'size' is invalid. Received NaN
at Function.alloc (node:buffer:419:3)
at Object.serializer (C:\Users\alex\node_modules\node-open-protocol\src\mid\0008.js:61:26)
at MIDSerializer._transform (C:\Users\alex\node_modules\node-open-protocol\src\MIDSerializer.js:39:29)
at Transform._write (node:internal/streams/transform:175:8)
at writeOrBuffer (node:internal/streams/writable:392:12)
at _write (node:internal/streams/writable:333:10)
at Writable.write (node:internal/streams/writable:337:10)
at LinkLayer._write (C:\Users\alex\node_modules\node-open-protocol\src\linkLayer.js:344:28)
at writeOrBuffer (node:internal/streams/writable:392:12)
at _write (node:internal/streams/writable:333:10) {
code: 'ERR_INVALID_ARG_VALUE'
}
Node.js v18.16.0
If I use the Open Protocol Interface Tester, here you are part of the result because MID0900 also contains binary data in the last part of the telegram (I captured it with Wireshark):
2023-4-5:19:43:8:768 Generic Data Subscribe
To PF 30 30 36 34 30 30 30 38 30 30 31 30 20 20 20 20 00640008 0010
Tö PF 30 30 20 20 30 39 30 30 30 30 31 33 35 30 30 30 00 0900 00135000
Tö PF 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 00000000 00000000
Tö PF 30 30 30 30 30 30 30 30 30 30 30 30 31 30 30 31 00000000 00001001
Tö PF 00
2023-4-5:19:43:8:782 Command Accepted
From PF 30 30 32 34 30 30 30 35 30 30 31 20 30 30 30 30 00240005 001 0000
Fröm PF 20 20 20 20 30 30 30 38 00 0008 .
2023-4-5:19:46:28:949 Trace curve
From PF 31 33 32 35 30 39 30 30 30 30 31 20 30 30 30 30 13250900 001 0000
Fröm PF 20 20 20 20 30 30 30 30 30 30 30 31 30 34 32 30 0000 00010420
Fröm PF 32 33 2d 30 34 2d 30 35 3a 31 39 3a 34 35 3a 31 23-04-05 :19:45:1
Fröm PF 33 30 30 30 30 31 30 31 30 35 30 30 30 36 30 31 30000101 05000601
Fröm PF 30 30 30 30 30 31 30 31 30 30 30 30 30 30 30 31 00000101 00000001
Fröm PF 30 30 30 31 30 30 30 30 30 34 30 30 30 30 30 30 00010000 04000000
Fröm PF 30 30 31 32 30 32 30 30 38 30 34 30 30 30 30 30 00120200 80400000
Fröm PF 30 30 41 33 34 33 32 38 36 37 30 30 30 35 31 30 00A34328 67000510
Fröm PF 30 33 30 31 30 30 30 30 30 30 30 31 30 34 30 30 03010000 00010400
Fröm PF 30 35 33 30 31 30 30 31 30 30 30 30 30 30 30 31 05301001 00000001
Fröm PF 36 38 30 37 32 33 39 31 33 30 32 32 31 34 30 30 68072391 30221400
Fröm PF 38 30 33 30 30 30 30 30 30 30 30 2e 31 31 31 36 80300000 000.1116
Fröm PF 37 32 30 30 31 30 30 30 30 30 30 30 35 34 37 30 72001000 00005470
Fröm PF 30 38 30 33 32 30 32 32 2e 30 30 30 30 30 30 30 08032022 .0000000
Fröm PF 30 35 34 38 00 0548.
From your log, it looks like it breaks down when mid 8 is getting serialized into a buffer.
RangeError [ERR_INVALID_ARG_VALUE]: The argument 'size' is invalid. Received NaN
Is referencing this call: https://github.com/st-one-io/node-open-protocol/blob/f514d00d5ddc7b0d84f222c2e481e2a07cf16c91/src/mid/0008.js#L61
Which means that 9 + msg.payload.dataLength
evaluates to NaN
.
It looks like the object payload you're providing to sendMid
is incorrect. Try passing it an object that matches this
https://github.com/st-one-io/node-open-protocol/blob/f514d00d5ddc7b0d84f222c2e481e2a07cf16c91/src/mid/0008.js#L10-L14
More examples can be found in the unit tests for mid 8: https://github.com/st-one-io/node-open-protocol/blob/master/test/0008.spec.js
What is this Open Protocol Interface Tester? I haven't heard of this tool before but it sounds useful haha
Same error....
const openProtocol = require('node-open-protocol');
//* @param {object} MID0008
//* @param {number} MID0008.midNumber
//* @param {number} MID0008.revision
//* @param {number} MID0008.dataLength
//* @param {string} MID0008.extraData
let op = openProtocol.createClient(4545, "192.168.0.199", () => {
console.log("Connected!");
//To MIDs not implemented
let opts = {
midNumber: 900,
revision: 1,
dataLength: 35,
extraData: "00000000000000000000000000000001001"
}
op.on("data", (data) => {
console.log("Data received", data);
});
op.sendMid(8, opts, (err) => {
if (err) {
console.log("Error", err);
return;
}
});
});
node C:\Users\C41581\node_modules\node-open-protocol\test\alex.js
OPEN-PROTOCOL 7208: new SessionControlClient
OPEN-PROTOCOL 7208: new LinkLayer {
stream: <ref *1> Socket {
connecting: true,
_hadError: false,
_parent: null,
_host: null,
_closeAfterHandlingError: false,
_readableState: ReadableState {
objectMode: false,
highWaterMark: 16384,
buffer: BufferList { head: null, tail: null, length: 0 },
length: 0,
pipes: [],
flowing: null,
ended: false,
endEmitted: false,
reading: false,
constructed: true,
sync: true,
needReadable: false,
emittedReadable: false,
readableListening: false,
resumeScheduled: false,
errorEmitted: false,
emitClose: false,
autoDestroy: true,
destroyed: false,
errored: null,
closed: false,
closeEmitted: false,
defaultEncoding: 'utf8',
awaitDrainWriters: null,
multiAwaitDrain: false,
readingMore: false,
dataEmitted: false,
decoder: null,
encoding: null,
[Symbol(kPaused)]: null
},
_events: [Object: null prototype] {
end: [Function: onReadableStreamEnd],
connect: [Function],
timeout: [Function]
},
_eventsCount: 3,
_maxListeners: undefined,
_writableState: WritableState {
objectMode: false,
highWaterMark: 16384,
finalCalled: false,
needDrain: false,
ending: false,
ended: false,
finished: false,
destroyed: false,
decodeStrings: false,
defaultEncoding: 'utf8',
length: 0,
writing: false,
corked: 0,
sync: true,
bufferProcessing: false,
onwrite: [Function: bound onwrite],
writecb: null,
writelen: 0,
afterWriteTickInfo: null,
buffered: [],
bufferedIndex: 0,
allBuffers: true,
allNoop: true,
pendingcb: 0,
constructed: true,
prefinished: false,
errorEmitted: false,
emitClose: false,
autoDestroy: true,
errored: null,
closed: false,
closeEmitted: false,
[Symbol(kOnFinished)]: []
},
allowHalfOpen: false,
_sockname: null,
_pendingData: null,
_pendingEncoding: '',
server: null,
_server: null,
timeout: 20000,
[Symbol(async_id_symbol)]: 2,
[Symbol(kHandle)]: TCP {
reading: false,
onconnection: null,
[Symbol(owner_symbol)]: [Circular *1]
},
[Symbol(lastWriteQueueSize)]: 0,
[Symbol(timeout)]: Timeout {
_idleTimeout: 20000,
_idlePrev: [TimersList],
_idleNext: [TimersList],
_idleStart: 118,
_onTimeout: [Function: bound ],
_timerArgs: undefined,
_repeat: null,
_destroyed: false,
[Symbol(refed)]: false,
[Symbol(kHasPrimitive)]: false,
[Symbol(asyncId)]: 4,
[Symbol(triggerId)]: 1
},
[Symbol(kBuffer)]: null,
[Symbol(kBufferCb)]: null,
[Symbol(kBufferGen)]: null,
[Symbol(kCapture)]: false,
[Symbol(kSetNoDelay)]: false,
[Symbol(kSetKeepAlive)]: false,
[Symbol(kSetKeepAliveInitialDelay)]: 0,
[Symbol(kBytesRead)]: 0,
[Symbol(kBytesWritten)]: 0
},
timeOut: undefined,
retryTimes: undefined,
rawData: undefined,
disableMidParsing: undefined
}
OPEN-PROTOCOL 7208: new OpenProtocolParser
OPEN-PROTOCOL 7208: new openProtocolSerializer
OPEN-PROTOCOL 7208: new MIDParser
OPEN-PROTOCOL 7208: new MIDSerializer
OPEN-PROTOCOL 7208: SessionControlClient connect
OPEN-PROTOCOL 7208: SessionControlClient sendMidOne
OPEN-PROTOCOL 7208: LinkLayer _write { mid: 1, revision: 6 }
OPEN-PROTOCOL 7208: MIDSerializer _transform { mid: 1, revision: 6 }
OPEN-PROTOCOL 7208: LinkLayer _onDataMidSerializer { mid: 1, revision: 6, payload: <Buffer > }
OPEN-PROTOCOL 7208: openProtocolSerializer _transform { mid: 1, revision: 6, payload: <Buffer > }
OPEN-PROTOCOL 7208: openProtocolSerializer _transform publish <Buffer 30 30 32 30 30 30 30 31 30 30 36 30 30 31 30 31 30 30 30 30 00>
OPEN-PROTOCOL 7208: LinkLayer _onDataOpSerializer <Buffer 30 30 32 30 30 30 30 31 30 30 36 30 30 31 30 31 30 30 30 30 00>
OPEN-PROTOCOL 7208: LinkLayer _read 16
OPEN-PROTOCOL 7208: LinkLayer _onDataStream <Buffer 30 32 32 31 30 30 30 32 30 30 36 20 30 31 30 31 20 20 20 20 30 31 30 30 30 30 30 32 30 30 30 33 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 ... 172 more bytes>
OPEN-PROTOCOL 7208: OpenProtocolParser _transform <Buffer 30 32 32 31 30 30 30 32 30 30 36 20 30 31 30 31 20 20 20 20 30 31 30 30 30 30 30 32 30 30 30 33 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 ... 172 more bytes>
OPEN-PROTOCOL 7208: LinkLayer _onDataOpParser {
mid: 2,
revision: 6,
noAck: false,
stationID: 1,
spindleID: 1,
sequenceNumber: 0,
messageParts: 0,
messageNumber: 0,
payload: <Buffer 30 31 30 30 30 30 30 32 30 30 30 33 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 30 34 41 43 54 30 35 76 32 2e 30 20 20 ... 151 more bytes>
}
OPEN-PROTOCOL 7208: new MIDParser _transform {
mid: 2,
revision: 6,
noAck: false,
stationID: 1,
spindleID: 1,
sequenceNumber: 0,
messageParts: 0,
messageNumber: 0,
payload: <Buffer 30 31 30 30 30 30 30 32 30 30 30 33 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 30 34 41 43 54 30 35 76 32 2e 30 20 20 ... 151 more bytes>
}
OPEN-PROTOCOL 7208: LinkLayer _onDataMidParser {
mid: 2,
revision: 6,
noAck: false,
stationID: 1,
spindleID: 1,
sequenceNumber: 0,
messageParts: 0,
messageNumber: 0,
payload: {
cellID: 0,
channelID: 0,
controllerName: '',
supplierCode: 'ACT',
openProtocolVersion: 'v2.0',
controllerSoftwareVersion: 'IXB_R_3.6.13.10880_',
toolSoftwareVersion: '3.6.13',
rbuType: 'None',
controllerSerialNumber: 'A3500191',
systemType: 3,
systemSubtype: 1,
sequenceNumberSupport: 0,
linkingHandlingSupport: 0
}
}
OPEN-PROTOCOL 7208: SessionControlClient receivedReply {
mid: 2,
revision: 6,
noAck: false,
stationID: 1,
spindleID: 1,
sequenceNumber: 0,
messageParts: 0,
messageNumber: 0,
payload: {
cellID: 0,
channelID: 0,
controllerName: '',
supplierCode: 'ACT',
openProtocolVersion: 'v2.0',
controllerSoftwareVersion: 'IXB_R_3.6.13.10880_',
toolSoftwareVersion: '3.6.13',
rbuType: 'None',
controllerSerialNumber: 'A3500191',
systemType: 3,
systemSubtype: 1,
sequenceNumberSupport: 0,
linkingHandlingSupport: 0
}
}
OPEN-PROTOCOL 7208: LinkLayer finishCycle undefined
OPEN-PROTOCOL 7208: LinkLayer deactivateLinkLayer
OPEN-PROTOCOL 7208: SessionControlClient _sendingProcess
Connected!
OPEN-PROTOCOL 7208: SessionControlClient _sendMid 8 {
midNumber: 900,
revision: 1,
dataLength: 35,
extraData: '00000000000000000000000000000001001'
}
OPEN-PROTOCOL 7208: SessionControlClient new Message
OPEN-PROTOCOL 7208: SessionControlClient _sendingProcess
OPEN-PROTOCOL 7208: SessionControlClient _transmitMid Message {
_mid: {
midNumber: 900,
revision: 1,
dataLength: 35,
extraData: '00000000000000000000000000000001001',
payload: '',
mid: 8
},
_callback: [Function (anonymous)],
_type: 'manual',
_group: undefined,
_baseMid: {
midNumber: 900,
revision: 1,
dataLength: 35,
extraData: '00000000000000000000000000000001001',
payload: '',
mid: 8
}
}
OPEN-PROTOCOL 7208: SessionControlClient _calcRevision undefined undefined undefined undefined
OPEN-PROTOCOL 7208: LinkLayer _write {
midNumber: 900,
revision: 1,
dataLength: 35,
extraData: '00000000000000000000000000000001001',
payload: '',
mid: 8
}
OPEN-PROTOCOL 7208: MIDSerializer _transform {
midNumber: 900,
revision: 1,
dataLength: 35,
extraData: '00000000000000000000000000000001001',
payload: '',
mid: 8
}
node:buffer:410
throw new ERR_INVALID_ARG_VALUE.RangeError('size', size);
^
RangeError [ERR_INVALID_ARG_VALUE]: The argument 'size' is invalid. Received NaN
at Function.alloc (node:buffer:419:3)
at Object.serializer (C:\Users\C41581\node_modules\node-open-protocol\src\mid\0008.js:61:26)
at MIDSerializer._transform (C:\Users\C41581\node_modules\node-open-protocol\src\MIDSerializer.js:39:29)
at Transform._write (node:internal/streams/transform:175:8)
at writeOrBuffer (node:internal/streams/writable:392:12)
at _write (node:internal/streams/writable:333:10)
at Writable.write (node:internal/streams/writable:337:10)
at LinkLayer._write (C:\Users\C41581\node_modules\node-open-protocol\src\linkLayer.js:344:28)
at writeOrBuffer (node:internal/streams/writable:392:12)
at _write (node:internal/streams/writable:333:10) {
code: 'ERR_INVALID_ARG_VALUE'
}
Node.js v18.16.0
Let me know if you would like to test/debug in real time. I can always share the screen during a meeting. The error of the buffer is the one I detected but I don't know why...
quick tip, you can fold the log messages like this on github comments (or anywhere that supports markdown).
some text
<details>
<summary>logs</summary>
log content here
</details>
which gives the following:
some text
anyway, yeah I feel like some kind of coop debugging session is needed here. What is your timezone? Ideally we could connect on Discord, but I don't feel comfortable putting my info out here publicly. My email should be on my github profile.
I haven't used the sendMid
directly before, but I did a bit of poking around in sessionControlClient, and noticed something interesting in the _subscribe
call. It looks like it's building a mid 8: https://github.com/st-one-io/node-open-protocol/blob/master/src/sessionControlClient.js#L695-L712
which makes me think your opts
should look like this:
//To MIDs not implemented
let opts = {
payload: {
midNumber: 900,
revision: 1,
dataLength: 35,
extraData: "00000000000000000000000000000001001"
}
}
Hello,
I have tested the code you suggested in the following way. Marking genericMode as true and calling "suscribing" function instead of "sendmid".
With doing that, I manage to send the message as before, nevertheless, I receive the same error after the first trace reception. It seems that I am not answering the machine with the ack after reception that should be the following according Open Protocol Interface Tester:
Wireshark: But empty ack:
And log:
Hello,
I have a machine in my lab. If someone helps we can work on it. I have tried several combinations of MID0008 with MID0900 but does not work.
Regards,