Casparcg-connection (NPM - NODE package)

Hi,

im using the casparcg server 2.0.7 in a stable build.

I wanted to build a new web UI with node.js and start installing the casparcg-connection package and recognizing that I got an 400 error from the server what means “command not found”

-------REASON------
InfoCommand {
  context: undefined,
  response: AMCPResponse { raw: '400 ERROR', code: 400 },
  responseProtocol:
   ResponseSignature {
     code: 200,
     validator: [Function: ListValidator],
     parser: [Function: ChannelParser] },
  _payload: {},
  _status: 5,
  _stringParamsArray: [],
  _objectParams: { channel: undefined, layer: undefined },
  _token: 'vejpuh3',
  resolve: [Function],
  reject: [Function] }

So I looked up an older project with same server version and I found out that the casparcg-connect version 3.0.1 seems to work so i switch in the newer project and it works. So from version 3.0.1 to 4.0.2 was something changed that caspar don’t accept the commands.

My test code simply looks like this in node:

const { CasparCG } = require("casparcg-connection");
const connection = new CasparCG();

const getInfos = () => {
  connection.info().then(function(fulfilled){
    console.log('RESPONSE!');
    console.log(fulfilled.response.data);
  },function(reason){
    console.log("-------REASON------");
    console.log(reason);
  });
};

Im dump and should read the Notes…

Note: starting with version 4.0.0 the default queue mode is now SALVO. You can optionally set the queue mode back to sequential if you need compatibility with CasparCG 2.0.7 or earlier. Note that the implementation of scheduled commands requires asynchronous behaviour and therefore only works in salvo mode.

THX CLOSE pls >.<

Greetings
Dan

Yes, the 4.x version is made to be work with CasparCG 2.1 NRK, which handles asynchronous commands much better.