0

XD1035 connection to arduino for serial communication

All of the articles on arduino to brightsign communication are several years old now.

I'm starting a new project wherein I'd like to have an arduino send serial command to a brightsign XD1035 to trigger video playback. 

The information I'm trying to find is about physical connections. The XD1035 has USB-A and C, 3.5mm, and GPIO. My arduino is micro USB. what's the simplest physical connection between the two for serial communication?

Thank you!

10 comments

  • 0
    Avatar
    Mwszalek

    Anyone? any clues?

  • 1
    Avatar
    Ken Campbell

    You should be able to establish a bidirectional, full duplex serial connection between the Brightsign and the Arduino using any of the three physical connections you mentioned; USB, the 3.5mm serial (not headphone) jack and via the GPIO port. The steps necessary to configure the connections, and the specifics around voltages and level-shifting, are different though.

    For virtual serial ports over a USB connection, I would start by reading this:

    roSerialPort - Documentation - BrightSign Documentation (atlassian.net)

    Something like FTDI's USB to 5V TTL cable might be worth looking into. I have not tested this one, but plan to shortly:

    TTL-232R-5V - FTDI (ftdichip.com)

     

    For the Brightsign's 3.5mm RS232 serial port, start here:

    https://docs.brightsign.biz/space/DOC/1391067186/XD5+Hardware+Interfaces#3.5mm-Serial

    You would need a bidirectional line driver/receiver such as the MAX232 or MAX3232 between the Brightsign and the Arduino's serial port pins (pins 0 and 1 on most Arduinos) to convert between RS232 voltage levels and TTL voltage levels.

     

    For serial over GPIO; most Series 3 and Series 4 devices (I have not had the opportunity to test Series 5) have "alternative functions" that can be configured on the GPIO port, which include one or two serial ports depending on the model. Since the GPIO port is at TTL voltage levels, you'd need a couple of level shifters (I think even a couple of resistors would work) to translate between the Brightsign's 3.3V and the Arduino's 5V levels. If you have a 3.3V Arduino (such as the Pro Mini 3.3v) level shifting is not required.

    https://brightsign.atlassian.net/wiki/spaces/DOC/pages/370673264/roControlPort#EnableAlternateFunction(button-As-Integer%2C-pin_function-As-String)-As-Boolean

    With the serial1 port enabled on GPIO, you can connect the Arduino pin 0 (Serial RX) to Brightsign GPIO pin 11 (Serial 1 TX), Arduino pin 1 (Serial1 TX) to Brightsign GPIO pin 0 (Serial1 RX), and a connection between Arduino GND and Brightsign GPIO GND. 

     

    Hope this helps!

    Ken

     

  • 0
    Avatar
    Mwszalek

    I appreciate the info and the time. For a USB connection and the cable, are you saying that I can't connect directly from the USB on an arduino to the USB on the brightsign?

    That's the big question I have ultimately. I'm just trying to figure out a physical connection that will work so that when I spend several hours troubleshooting why it doesn't work it doesn't turn out to be that the connection will never work.

     

  • 1
    Avatar
    Ken Campbell

    Just to clarify, for scenario a) I was suggesting a virtual serial port over the USB connection on the Brightsign which is protocol and level converted by the FTDI chip inside the cable, to a TTL-level UART connection (via pins 0 and 1) on the Arduino shield header.

    I've never tried serial over a direct USB connection between a Brightsign and Arduino. Never had a need to do it that way, as I preferred to keep the USB connection available for programming and debugging. But now I'm curious. It should work, but I'm happy to try it out and let know you.

    Ken

     

  • 0
    Avatar
    Mwszalek

    wow, yeah that would be incredible. I'm trying to test myself, but this is my first time doing serial on Brightsign so I'm just struggling to figure out the proper setup before I can even start troubleshooting the project.

  • 1
    Avatar
    Ken Campbell

    I tested serial communication between a Brightsign XD1033 and an Arduino UNO using just a USB cable and it worked. I repeated the tests with an Arduino Mega 2550 and it worked too. In both cases I used the USB-A port on the Brightsign, connected to the USB-B port on each Arduino.

    Both of those boards use a separate IC to bridge the USB-to-Serial connection. I don't have any Arduinos on hand where the uC has native USB support, but as long as they enumerate as the correct USB classs (CDC?), they should work just as well. 

    If you want to really understand how to use the serial connection, you'll want to dive into the roSerialPort developer documentation link I included in my first reply. Since you're familiar with coding for Arduino, I'd suggest you do the Brightsign side of things with native Brightscript. You'll have a lot more control. Start with an echo test, where one device sends a string to the other device, which then gets modified and sent back to the first device. Then move onto parsing and playing different files with the roVideoPlayer object.

    It's been a while since I've touched Arduinos, so I had forgotten that the serial lines between the bridge and the uC are physically connected to pins 0 and 1. So, my original suggestion a) of using an FTDI cable with an embedded bridge IC connected to the Arduino header pins 0 and 1, while technically accurate and functional, is completely unnecessary. I'll leave my previous comments in this thread, just in case someone else finds the information useful.

     Best of luck!

    Ken

  • 1
    Avatar
    Ken Campbell

    Here's a simple demo to get you going. Load the Arduino code into your IDE, compile and upload to the board. Put the autorun.brs on your Brightsign card, connect the two devices with your USB cable, power up the Brightsign. The Arduino starts counting up from 0, once a second, and transmits the value to the Brightsign, which shows it on your display device.

    There are many, many ways to build serial links, and what I'm doing here is not representative of a typical robust protocol, it's just a basic sandbox to play with.

    autorun.brs

    Sub Main()

    BAUD_RATE = 115200

    messagePort = CreateObject("roMessagePort")

    deviceInfo = CreateObject("roDeviceInfo")
    endpoints = deviceInfo.GetUSBTopology({array: true})
    USBSerialPortName = "USB:" + endpoints[0].fid

    serialPort = CreateObject("roSerialPort", USBSerialPortName, BAUD_RATE )
    serialPort.SetLineEventPort(messagePort)

    videoMode = CreateObject("roVideoMode")
    screenWidth = videoMode.GetResX()
    screenHeight = videoMode.GetResY()

    OSDrectangle = CreateObject("roRectangle", 0, screenHeight / 2 - screenHeight / 64, screenWidth, screenHeight / 32)

    OSDparams = CreateObject("roAssociativeArray")
    OSDparams.LineCount = 1
    OSDparams.TextMode = 2
    OSDparams.Rotation = 0
    OSDparams.Alignment = 1

    OSD = CreateObject("roTextWidget", OSDrectangle, 1, 2, OSDparams)
    OSD.Show()

    while true

    event = wait(0, messagePort)

    if type(event) = "roStreamLineEvent" then

    OSD.PushString(event)

    end if

    end while

    End Sub

     

    Arduino sketch:

    #define BAUD_RATE 115200
    int count = 0;

    void setup()
    {
    Serial.begin(BAUD_RATE);
    }

    void loop()
    {
    Serial.print(count++, DEC);
    Serial.print('\r');
    delay(1000);
    }

     

    Ken

     

  • 0
    Avatar
    Mwszalek

    Thank you again for all the info! 

  • 0
    Avatar
    Ken Campbell

    You’re welcome. Best of luck with your project!

    Ken

  • 0
    Avatar
    Ken Campbell

    There does not appear to be a USB "hot plug" event exposed via Brightscript, despite there being one available for the Javascript API.  

    This means that if your Arduino device is disconnected and reconnected, your Brightsign script will stop working. You will need to restart the script or reboot the player.

    One possible workaround is to have a system timer that checks the state of the connected device (using deviceInfo.GetUSBTopology() ) but it may not catch a fast disconnect / reconnect event.

    If I come across a better solution, I'll post it here.

    Ken

Please sign in to leave a comment.