nrkno / sofie-mos-connection

Sofie MOS Connection: A Part of the Sofie TV Studio Automation System
https://github.com/nrkno/Sofie-TV-automation/
MIT License
22 stars 14 forks source link

Other: Error in response: Unsupported function: "roStorySend". NCS and Client switch places #104

Open Inaztm opened 3 weeks ago

Inaztm commented 3 weeks ago

About me

This issue was posted by a dev from a small startup for Ukrainian media.

Issue

Hello. Version 4.1.1. I am calling await mosDevice.sendRunningOrderStory(story), but for some reason, the NCS and client switch places, resulting in the client sending the story to the NCS.

Here's what appears in the debug log:

exec command ROStory {
   port: "upper",
   strict: true,
   mosID: undefined,
   ncsID: undefined,
   _messageID: 0,
   mosTypes: {
     strict: true,
     mosString128: {
       create: [Function: create],
       validate: [Function: validate],
       stringify: [Function: stringify],
       valueOf: [Function: valueOf],
       is: [Function: is],
       fallback: [Function: fallback],
     },
     mosDuration: {
       create: [Function: create],
       validate: [Function: validate],
       stringify: [Function: stringify],
       valueOf: [Function: valueOf],
       is: [Function: is],
       fallback: [Function: fallback],
     },
     mosTime: {
       create: [Function: create],
       validate: [Function: validate],
       stringify: [Function: stringify],
       valueOf: [Function: valueOf],
       is: [Function: is],
       fallback: [Function: fallback],
     },
   },
   fullStory: {
     ID: {
       _mosString128: "696e697469616c426c6f636b4964",
     },
     Slug: {
       _mosString128: "Story",
     },
     Items: [],
     RunningOrderId: {
       _mosString128: "66a89f31f50ae688ba269e3e",
     },
     Body: [
       {
         Type: "p",
         Content: "Test story sub content",
       }
     ],
   },
   messageXMLBlocks: [Getter],
   prepare: [Function: prepare],
   messageID: [Getter],
   toString: [Function: toString],
 }

 Socket got data (4, ::ffff:10.37.129.2, upper): "<mos>
   <ncsID>VSPrompter.VSGP.mos</ncsID>
   <mosID>Companion.ncs</mosID>
   <messageID>6</messageID>
   <roStorySend>
     <storyID>696e697469616c426c6f636b4964</storyID>
     <storySlug>Story</storySlug>
     <roID>66a89f31f50ae688ba269e3e</roID>
     <storyBody>
       <p>Test story sub content</p>
     </storyBody>
   </roStorySend>
 </mos>"

 parsedData {
   ncsID: "VSPrompter.VSGP.mos",
   mosID: "Companion.ncs",
   messageID: 6,
   roStorySend: {
     storyID: "696e697469616c426c6f636b4964",
     storySlug: "Story",
     roID: "66a89f31f50ae688ba269e3e",
     storyBody: {
       p: "Test story sub content",
     },
   },
 }

 Socket got data (upper): "<mos>
<ncsID>VSPrompter.VSGP.mos</ncsID>
<mosID>Companion.ncs</mosID>
<messageID>6</messageID>
<mosAck>
  <objID>0</objID>
  <objRev>0</objRev>
  <status>NACK</status>
  <statusDescription>Unsupported function: "roStorySend"</statusDescription>
</mosAck>
</mos>"

errored error: Error in response: Unsupported function: "roStorySend"
    at _ensureReply (/$bunfs/root/integrations-sidecar-aarch64-apple-darwin:10390:15)
    at /$bunfs/root/integrations-sidecar-aarch64-apple-darwin:10308:35
nytamin commented 3 weeks ago

Hi! Could you clarify, are you implementing an NCS using mos-connection? If yes, is the receiver (mos client) also a mos-connection client, or something else?

Inaztm commented 3 weeks ago

Hi! Could you clarify, are you implementing an NCS using mos-connection? If yes, is the receiver (mos client) also a mos-connection client, or something else?

Yes, NCS implementing using mos-connection. The Receiver (mos client) is a teleprompter (a Windows application) that has the capability to connect to an NCS and supports MOS protocol v2.8.4.

Inaztm commented 3 weeks ago

Also my createMosServer function

createMosServer

```typescript import { ConnectionConfig, IConnectionConfig, MosConnection, MosDevice, } from "@mos-connection/connector"; export type MosServerProps = {} & Partial; export function createMosServer(props: MosServerProps) { let mos = new MosConnection( new ConnectionConfig({ mosID: "Companion.ncs", isNCS: true, strict: true, debug: true, acceptsConnections: true, openRelay: true, ...props, profiles: { "0": true, "1": true, "2": true, "3": true, "4": true, "5": false, "6": false, "7": false, }, }), ); const onConnection = async (mosDevice: MosDevice) => { const mosTypes = mosDevice.mosTypes; // Could also be retrieved with getMosTypes(strict) const deviceMosId = mosDevice.primaryId; console.log("[SERVER] A new Mosdevice connected", deviceMosId); mosDevice.onRequestMachineInfo(async () => { return { manufacturer: mosTypes.mosString128.create("mommy"), model: mosTypes.mosString128.create("model!"), hwRev: mosTypes.mosString128.create("0.1"), swRev: mosTypes.mosString128.create("1.0"), DOM: mosTypes.mosString128.create("1989-07-01"), SN: mosTypes.mosString128.create("1234"), ID: mosTypes.mosString128.create(props.mosID), time: mosTypes.mosTime.create(Date.now()), // opTime?: mosTypes.mosTime.create(), mosRev: mosTypes.mosString128.create("A"), supportedProfiles: { deviceType: "NCS", profile0: true, profile1: true, profile2: true, profile3: true, profile4: true, profile5: false, profile6: false, profile7: false, }, }; }); }; return { mos, onConnection, }; } ```

nytamin commented 3 weeks ago

Are you perhaps running both the mos-server and the teleprompter on the same machine? Due to how the MOS TCP ports connections work, you will run into these issues if you run them on the same.