2

TCP commands

Could you please add an easy way to add TCP commands. Now it's very difficult due scripting. only UDP is to less.

I need an easyway to give ip adress and message. it is so simple to write it in your software. One way is enough, so no receiving. Receiving would be nice but not needed very often.

 

40 comments

  • 3
    Avatar
    Lyndon

     

    WE have a feature request  logged to add tcp support to brightauthor. We do have a plugin you can test. You add the plugin to your project, and then send a plugin command with the ip address youw ant to set to, port, and the command/message.

     

    https://www.brightsignnetwork.com/download/Scripts/tcp-plugin.brs

    You can set the ip address and port you want to send to using a plugin message with the following text:

    tcp!set!192.168.1.20!10055

     

    Then, to send a command, you send another message:

    tcp!messagehere

  • 0
    Avatar
    RDJ sound and light

    Thanks for your explanation!
    I already tested this script, but I didn't understand how to use. Now I understand the way to do it.

    I was not able to open the sample program to look in it. This was written in an old version. Maybe you could update it or add a last version of Brightauthor file for other users?

  • 0
    Avatar
    Lyndon

    can you send me the project file you're referring to?

  • 0
    Avatar
    RDJ sound and light

    Here i found the sample file. But this is written in an old brightauthor.

    https://drive.google.com/a/rdjsound.nl/folderview?id=0B4AICAjLEWKyazBVSmQzbWlnQUE&usp=drive_web

  • 0
    Avatar
    Jeff Slack

    Hello,

       Any progress on that native TCP support?  I've tried this to some success - however when I try to communicate to a Display (to turn off) it doesn't handle messages coming back in very well and the Brightsign player reboots.  It seems to happen with the Display sends a CR  ("\x0D") back on the TCP port to the player.  Or, for that matter, if I send that from a PC it reboots just as well.  What would I need to do to the .brs file to ignore this kind of response?  And, what language is the .brs file written in?

  • 0
    Avatar
    Bright Scripters

    Hi Jeff,

     

    Plugins are written in the BrightScript language. You can learn all about it here:

    http://docs.brightsign.biz/display/DOC/BrightScript

    You could get some insight, about the condition that causes the player to reboot, if you put the player in debug mode.

    Which player model are you testing with? Does it have a serial port?

  • 0
    Avatar
    Lyndon

     

    You can also log into the player's ip at this address:

    http://yourplayeriphere/lastkmsg.html

     

    This will tell you the cause of the last reboot. IT will include the line # of the failure.

  • 0
    Avatar
    ^UD\_$

    That's a keeper :)
    Where can we find documentation of such goodies?

  • 0
    Avatar
    Lyndon

    Doesn't look like there's a public list of the hidden pages...I'll get a list of the ones that would be useful..

     

    edid.html is one, gives feedback on what the display is reporting to the player as supported. Looks partly like this..

  • 0
    Avatar
    Jeff Slack

    Thanks for posting those hidden resources.  I'll mess around with the code a bit.  I'm using a XD1033.  If the network commands don't work, I might have to go to a serial port option.  It's tripping me up a bit because the display wants to authenticate prior to taking network commands with properly terminated commands.  It looks like there are some Hex conversion resources in the BrightScript guide that may help solve that issue.  Thanks!

  • 0
    Avatar
    Sebastian Gartz

    Hello!

    I still have problems using the plugin :(

    I just want to connect my player (ex XT1143) to Barco PDS 902 and change for example the input.

    Here ist the Maual - the command for change an input is - as descibed on page 139 - isel -i1

    http://www.cplav.com/media/Barco-PDS-902-User-Guide.pdf

    But i doenst work...

    can you help me?

     

     

     

     

  • 0
    Avatar
    Lyndon

    Sebastian, are you able to send commands from another tool or program from your pc. Is there any terminating character that needs to be added to the command.  What did you edit in the plugin to set the port and address for device you're trying to connect to?

    Please send a screenshot of the file menu, properties, autorun tab so I can see how the plugin's listed. Is the plugin actually running?

     

    If you log into the player ip address, and go to the log tab, you can see right after boot if the plugin says an error loading if you see output saying the plugin is invalid in the system log. Sometimes, that can happen. If the plugin doesn't load, then nothing else works that's tied to the plugin. 

  • 0
    Avatar
    Sebastian Gartz

    Hey Lyndon!

    Like in the manual (Barco PDS 902) described i can send the commands with Windows telnet. that works fine.

    In the Barco Manaual it means

    The PDS’s command protocol is compatible with GNU getopt parsing. Every parameter of the command has an option character associated with it. A <CR>carriage return (ASCII 13) terminates the command.

    But it has no effect :(

     

    In the plugin itself, i didn't wrote anything - or do i have to?

     

    At first i sent a touchevent like this (just for testing):

    The next touchevent is this:

    Here ist a link to the project and the logfile of the player:

    https://we.tl/G60plEpAK1

     

     

  • 0
    Avatar
    Lyndon

     

    Ok, but that's a telnet connection. What the brightsign is trying to do is not telnet to the device? Does the device only support telnet connections?

     

     

  • 0
    Avatar
    Bright Scripters

    Not sure if this plugin is the right tool, but regardless, it seems like the presentation is missing the login part.

    Even when using port 3000, you would need to send "user" and a CR.

    Seems like you would need some sort of handshaking mechanism, in the sense that you would send something to the Barco, and wait for it to respond, before you can send the next part. You could also try use the pause command, to allow the Barco to respond, without knowing what the response is.

    From the manual:

    To login via Ethernet without requiring a user name or password, telnet to port 3000.

    Example: > telnet 192.168.0.10 3000 4. After you “Telnet” into the PDS, you are presented with the login prompt: Welcome to PDS. Login as “user”. Press for password. a. Type “user” and press ENTER to login. b. When prompted for a password, press ENTER. Once you have successfully logged in, the following message appears, along with the command prompt (>): ShellApp waiting for input >

  • 0
    Avatar
    William P

    First off, thanks for the plugin!  With my Epson projectors, it's rock solid but my TV is having issues.  Pardon my ignorance of BrightScript I've got a few issues going on.  I have a TV (TCP only, no UDP) with a pretty ridiculous command language and my power off command is POWR0   \r.  Testing it with Packet sender I get an OK\r response (and the TV turns off) as long as that is identical.  When translating to HEX I get an ERR\r, without the 3 blanks I get an ERR\r and when I send lower case I return ERR\r.  I thumbed through the script in Notepad and saw that the plugin does at least 2 of those things and it eludes to HEX.  Is there a 1:1 ASCII plugin available that I can handle syntax in the tcp!message? 

     

    Thanks!

  • 0
    Avatar
    RDJ sound and light

    Have you fill in 20h for the spaces? And 0D to close the command?

  • 0
    Avatar
    William P

    Hi RDJ, thanks for the response.  Unfortunately, hex isn't an option.  For reasons that are beyond me, the syntax on TV has to be ASCII so I can't use 20 20 20 0d.  I tried sending it as POWR0   \r but the TCP plugin automatically adds another carriage return.  And possibly translates to hex but I can't confirm that.

  • 0
    Avatar
    RDJ sound and light

    You Could test it with Hercules From HW-group. Usefull tool!

  • 0
    Avatar
    Mike Ross

    Hi all, i'm trying to send this command  {"jsonrpc":"2.0","method":"Player.Stop"}  to an audio player, i can send it from PacketSender just fine but when i set up this TCP plugin with the commands up above nothing happens

  • 0
    Avatar
    Janosch Wenger

    Hi all,

    I have the same issue than Jeff Slack. The player i use is an HD1022. I also use packet sender for testing the answers from the player.

    First i tested the tcp- plugin without editing it. Nothing happened. Then i set the destination adress and port manually in the script.

    Now the player sends me my test-message, but after that he reboots. My packet sender doesn't send any answer back (tested with another computer and another packetsender).

    According to the log from the player, the reason for the reboot is a script runtime error:

    Can someone please help me? It's urgent..

  • 0
    Avatar
    Lyndon

     

    Please submit a ticket to support with the plugin attached, and the project file you're publishing it with. 

  • 0
    Avatar
    Lyndon

    I posted an updated version of the plugin. There was an event check in the plugin where the plugin tried to accept an incoming connection even though the event type wasn't correct. 

  • 0
    Avatar
    Bas van Tuijl

    Hi There,

    Is there a way to allow a Brightsign player to receive TCP commands or HTTP requests?

     

    We're looking to roll out XT1143s to 50 sites and we need to find a way to start / stop / switch presentations and move through presentations  via our custom iPad app (which can only send TCP commands or HTTP Requests).

     


    Thanks,

     

    Bas

  • 0
    Avatar
    Bright Scripters

    Absolutely!

     

    If the player is the initiating http request, then you could implement that via brightscript, in an autorun.brs file, or a BrightAuthor plugin.

    Thinking about it, you could potentially deliver variables over a live data feed, that would be used to activate content conditionally.

    There are several options, and the best to pick would depend on other aspects of the project. 

  • 0
    Avatar
    Bas van Tuijl

    Ok great :)

     

    The idea is that were would be a holding loop (just a series of videos) running normally. Our iPad would then trigger a move over to a specific video via the TCP / HTTP command.

    At the moment, our iPad doesn't need to update any variables, though this concept is something which would be great for something else i'm working on.

     

    How could I use a live data feed to implement this?

     

     

    Thanks,

     

    Bas

  • 0
    Avatar
    Shaun

    I saw this as an email thread this morning. Assuming the plugin doesn't have any errors - I don't have a player to test against.

    Add the plugin to your presentation with the name "REST"

    Send a get request to IP:9000/rest/control with a parameter cmd="YourCommand"

    Your parameter will be sent as a zone msg to your presentation so use that as your event.

    And because I can't seem to attach things find it here: https://github.com/shaunmw/PublicBS

  • 0
    Avatar
    Bas van Tuijl

    You sir, are a legend!

     

     

    Let me try this and i'll come back to you with the results.

     

     

    Thanks,

     

    Bas

  • 0
    Avatar
    Shaun

    Not a problem, I already had the code. I missed out a section though. I've added lines 67 and 68.

    event.SetResponseBodyString("CMD_Received: "+event.GetRequestParam("cmd"))
    event.SendResponse(200)

    You'll get a string as the response and code 200.

  • 0
    Avatar
    David Gaither

    Shaun,

    This is great!  Thank you!  This should be helpful in future projects.

     

    Otherwise, I'm still trying to find a way to implement 2-way TCP string communication, the post provided tcp-plugin.brs crashes when sending messages.

    Debugger Info: Runtime error: Type Mismatch. (runtime error &h18) in SD:/autorun.brs(13158), 

    Lines in question: 

    13157: ' Bose port?
    13158: port$ = event.GetUserData()
    13159:
    13160: m.bsp.diagnostics.PrintDebug("roStreamEndEvent received on port " + port$)
    13161: m.bsp.logging.WriteEventLogEntry(m.stateMachine, m.id$, "streamEnd", port$, "0")
    13162: m.bsp.logging.WriteDiagnosticLogEntry(m.bsp.diagnosticCodes.EVENT_STREAM_END, port$)

     

    This is on an XT1143, Firmware: 7.0.60

Please sign in to leave a comment.