0

Store USB Input string in user variable

USB Input Event.

When string input from keyboard matches "Specify USB Input", a command is executed and state is transitioned.

 

Need to allow any string followed by CR to execute the command and transition state. Also the string input from keyboard should get stored in a user variable $$register$$ and to be sent via serial port to device attached to the serial.

Can this be done using BrightAuthor? Or a script is required? 

Any pointers will be helpful

10 comments

  • 0
    Avatar
    Bright Scripters

    Have you found the answer by now?

  • 0
    Avatar
    aionic

    Not yet. 
    Researcing on various forums as well as searching online.

  • 0
    Avatar
    Bright Scripters

    Which BrightAuthor are you using?

  • 0
    Avatar
    aionic

    BrightAuthor version="6" BrightAuthorVersion="5.0.1.4"

  • 0
    Avatar
    Bright Scripters

    Seems to be available only in BA Connected

    https://brightsign.atlassian.net/wiki/spaces/DOC/pages/1636434577/USB+Event

    Once you've captured the string in a variable, you can use the string to be sent out as {{register}}.

    (Different from how it's done in BA 5: $$register$$)

  • 0
    Avatar
    aionic

    Thanks. Got it working! Seems BrightAuthor is being legacy-ed

    On a not very crucial note, 
    I created BrightAuthor:connected project in Windows. But I cannot seem to load the project in BrightAuthor:connected running on MacOS. Is there some limitations? 

  • 0
    Avatar
    Bright Scripters

    Glad to see that you were able to make progress.

    There should not be an issue loading on Mac a project created on Windows. With that said, I've never attempted that and I could think of ways where file paths would not translate well between the two platform. Put differently; you should be able work cross-platform but I would not recommend it :)

    BrightAuthor "Classic" is not getting as much attention as Connected at this time, but there is still a significant user-base and companies which rely upon it so I'm not seeing going away any time soon. Both Classic and Connected have advantages and disadvantages so none is better than the other IMHO. It is important to pick the right tool for the job at hand.

  • 0
    Avatar
    aionic

    Although I got the original USB serial input into user variable working, while inputting a string, users make typing mistakes. However there is no way to know if the correct string has been input or not until enter is pressed and then the value inside the user variable can be displayed on the ticker. 

    Is there someway to "echo" the letters input through the USB Serial Event onto the ticker so that if the string entered is wrong the user can correct it before it is sent out on serial port?

    I did consider using a virtual keyboard but have not been able to successfully use it.

  • 0
    Avatar
    Bright Scripters

    Virtual keyboard makes sense.
    Enabling Backspace for correction makes things more complex which is where custom coding might be the right tool. With that said, it would be easier to assist with more details regarding your use case.
    What USB devise is used which sends string upon ENTER?
    What do user enter into a ticket?

  • 0
    Avatar
    aionic

    The USB device is a custom Edge AI Camera device (built by us). It takes an image and stores it using the string entered as the filename. This registers for example an image of a face using the users name sent to it as a string. Then when the owner of the face is once again in front of the AI camera, it does facial recognition using our USB device and outputs the name of the person to BrightSign which then in turn can play content targetted for that person.

    Currently there is no way of knowing if the string entered is correct, until enter is pressed and it can be displayed on the ticker. By then the wrong string is already sent to the USB device and face is registered under the wrong filename. 

    I could make it so that the string is sent after the user can see on the ticker that it is correct using one more command input. But it is a bit cumbersome. Also if the string is wrong, I need to reset the user variable and redo the registration.

    I tried using https://github.com/brightsign/html-virtual-keyboard virtual keyboard and was able to include the *.brs and keyboard.zip in presentation settings/support content in BrightSign:connected but this hangs the device after I publish it. Perhaps I am not doing it right.

Please sign in to leave a comment.