Hello everyone,
I am trying to send a TCP Message to the Mobotix Cam, but it doesn’t seem to work.
Here is what I configured:
And this is my script:
var net = require('net');
var HOST = '10.10.30.51';
var PORT = 8000;
var client = new net.Socket();
client.connect(PORT, HOST, function() {
console.log('CONNECTED TO: ' + HOST + ':' + PORT);
// Write a message to the socket as soon as the client is connected, the server will receive it as message from the client
client.write('arm');
console.log('Done');
});
// Add a 'data' event handler for the client socket
// data is what the server sent to this socket
client.on('data', function(data) {
console.log('DATA: ' + data);
// Close the client socket completely
client.destroy();
});
// Add a 'close' event handler for the client socket
client.on('close', function() {
console.log('Connection closed');
});
Log of the script just says it’s connected:
17:39:50.100 info javascript.0 (2920) Start javascript script.js.common.Tests.Skript_5
17:39:50.106 info javascript.0 (2920) script.js.common.Tests.Skript_5: registered 0 subscriptions and 0 schedules
17:39:50.108 info javascript.0 (2920) script.js.common.Tests.Skript_5: CONNECTED TO: 10.10.30.51:8000
17:39:50.109 info javascript.0 (2920) script.js.common.Tests.Skript_5: Done
17:39:52.828 info javascript.0 (2920) Stop script script.js.common.Tests.Skript_5
But the event isn’t triggered in the cam.
When I host a TCP server and send messages from the Cam to the server I get the message.
But I want to sent a TCP message to the cam.
Reason is, that I don’t want to use the HTTP API to trigger an event in the cam, since I need to write the admin password of the cam in the script.
So I wanted the cam to hear at messages and send just this message to the cam to trigger an event.
Any idea how to solve?
Thanks