0

CSV issues. Please Help.



Hey guys, I need some help. Attached to this post is my autoplay.csv file and my autorun.bas file, currently running on my Roku HD600 v. 1.1.28.

I am having a few problems that I'm not sure how to resolve, so I'll start by describing what we are trying to achieve.

We have a computer running a user interface on an elo touch screen. There are three menus. The computer is sending serial commands to the roku based on what the user chooses. All elements of the UI are kept on the pc, only video elements are on the roku. We chose this method b/c we want the video to display on one screen, and the UI to display on another.

The first menu ask the user to choose between Menu_A and Menu_B. While the UI is on the First Menu, the roku is playing an attract loop.

If the User clicks on Menu_A, the roku begins playing Menu_A's attract loop. The UI then gives the user 8 options to view different video clips. When they choose a clip, the Roku then begins playing that video.

Here's the first issue. Currently, after the video finishes, the roku stop playing anything. It is supposed to jump back to the the Attract Loop it was playing, in this instance Menu_A's attract. I used the videoend function of the .CSV to achieve this, but it is not working.

The Second issue is this:
We want Menu_A and Menu_B to timeout. IF their individual attract loops have been running for more than 60 seconds, we want the roku to jump back to the First Menu's Attract loop. Currently, the roku plays through the chosen menu's attract loop and stops. It doesn't timeout back to the main loop, nor does it continue playing the current one.


Also, the roku keeps defaulting to VGA mode even though the .bas and .csv files both say to do 1280x720x60p. Can't figure out why.

I hope all this makes sense and someone can help me.

For those of you who look at the CSV file, the Main Menu attract is called NIK_a.mpg; the Menu_A attract is RW_A.mpg; and the Menu_B attract is GR_A.mpg.

Thanks in Advance.
RC Maples

autoplay.csv


VIDEOMODE,1280x720x60p,, IMAGEMODE,0,, EVENTS,,timeout:60,videoend STATE,NIK_a.mpg,,NIK_a.mpg STATE,GR_1.mpg,,GR_A.mpg STATE,GR_2.mpg,,GR_A.mpg STATE,GR_3.mpg,,GR_A.mpg STATE,GR_4.mpg,,GR_A.mpg STATE,GR_5.mpg,,GR_A.mpg STATE,GR_6.mpg,,GR_A.mpg STATE,GR_7.mpg,,GR_A.mpg STATE,GR_8.mpg,,GR_A.mpg STATE,RW_1.mpg,,RW_A.mpg STATE,RW_2.mpg,,RW_A.mpg STATE,RW_3.mpg,,RW_A.mpg STATE,RW_4.mpg,,RW_A.mpg STATE,RW_5.mpg,,RW_A.mpg STATE,RW_6.mpg,,RW_A.mpg STATE,GR_A.mpg,NIK_a.mpg, STATE,RW_A.mpg,NIK_a.mpg, autorun.bas videomode=CreateObject("roVideoMode") videomode.SetMode ("1280x720x60p") video=CreateObject("roVideoPlayer") video.SetLoopMode(true) REM okay=video.PlayFile(root+"NIK_a.mpg") REM if okay=0 then REM print "Error finding /NIK_a.mpg" REM stop REM endif file=ReadAsciiFile("autoplay.csv") if file<>"" then play_csv goto play_vid

2 comments

  • 0
    Avatar
    RokuLyndon


    What modifications did you make to the autorun.bas script so it would accept serial commands? The default autorun script doesn't look for serial commands. It accepts input from buttons (using the GPIO port), or touchscreens, or a mouse. Any other form of input requires a custom script or a modification to the autorun. Or, do you have some adapter that plugs into the GPIO port that will simulate a button press?



    Since all you are doing is playing the video on the BrightSign, you could write a simple custom script to look for input on the serial port, and then play the appropriate files. In this scenario, you wouldn't use the autorun file or the csv file.



    We do provide custom scripting services. If you provide us with a detailed description of what you are trying to do, we can provide a quote. I will check and see if there's sufficient information here.



    I don't know if there's an extra space included in the text you pasted into your forum post. But, when I copied that text into a text file that I named autoplay.csv, there's an extra space in the file names under videoend. So, that extra space prevents attract loop from looping. "videoend" also has an extra space in its name in the csv file. Currently, your CSV file will play the attract loop, and once edited to remove the spaces, it will loop over and over again. But, there's no transition in your csv file that will allow any other file to play. What exactly is the computer sending to the brightsign over the serial port when the touchscreen screen is activated?



    You could also do this with two brightsigns that are connected to each other.



    For the video mode, you don't need to modify the autorun.bas if you are using a playlist or csv file. The video mode in the csv is enough. The only time you would set the videomode in the autorun file is if you were looping a single video by naming it "autoplay.mpg", for example, and you weren't using a playlist or csv file.
  • 0
    Avatar
    rcmaples


    After reading over some other posts, with people attempting to do things similiar to what I am trying to accomplish, I have an updated autorun.bas script that I'm trying to configure to fix our installment.



    I've created a script for my facilities installation. And it works, sort of. I have attached the script to this email for your perusal. I can send a text string to the roku, and most of the time it listens.



    The biggest issue is this:



    As it stands right now, only the three different attract loops will play on command. The commands I'm sending the roku to play them are:

    NIK_A   (to play the main attract)

    GR_A    (to play the Gray's Attract)

    RW_A   (to play the Right Attract)



    Each of the above commands successfully plays its respective video about 50% of the time. The times that the command fails, it plays the main attract loop instead.



    The other commands are used to play different videos, they are GR_1 - GR_ 8 and RW_1 - RW_6. None of these commands play their respective video. Instead, they play the NIK_A file.





    Any idea what might cuase this oddity looking over my script?




    debug=false

    REM ******************************************
    REM Initialize Objects
    REM Initialize Video
    REM ******************************************

    video=CreateObject("roVideoPlayer")
    mode=CreateObject("roVideoMode")
    serial=CreateObject("roSerialPort", 0, 9600)
    p=CreateObject("roMessagePort")
    video.SetPort(p)
    serial.SetLineEventPort(p)
    video.SetAudioMode(1)
    video.SetAudioOutput(2)
    videomode$="1280x720x60p"
    mode.SetMode(videomode$)

    REM *************************************
    REM File Names
    REM -------------------------------------
    REM attract$ / NIK_A.mpg is main attract loop
    REM grays$ is the GR Menu attract loop
    REM right$ is the RW Menu attract loop
    REM *************************************

    attract$="NIK_a.mpg"
    grays$="GR_A.mpg"
    right$="RW_A.mpg"
    gr_one$="GR_1.mpg"
    gr_two$="GR_2.mpg"
    gr_three$="GR_3.mpg"
    gr_four$="GR_4.mpg"
    gr_five$="GR_5.mpg"
    gr_six$="GR_6.mpg"
    gr_seven$="GR_7.mpg"
    gr_eight$="GR_8.mpg"
    rw_one$="RW_1.mpg"
    rw_two$="RW_2.mpg"
    rw_three$="RW_3.mpg"
    rw_four$="RW_4.mpg"
    rw_five$="RW_5.mpg"
    rw_six$="RW_6.mpg"

    video_to_play$=""
    video_playing=false

    REM *************************************
    REM File Names text
    REM -------------------------------------
    REM The strings herein will be used
    REM as the strings sent from the user-pc.
    REM NIK_A is the main attract Loop.
    REM RW_A is the attract loop for the RW Menu.
    REM GR_A is the attract loop for the GR Menu.
    REM For instance, if a user sends the command
    REM "gr_1" (by pressing the relevant button)
    REM this script recognizes that input and
    REM follows the designated path under wait_for_serial
    REM *************************************

    attract_l$="NIK_A"
    rw_a$="RW_A"
    gr_a$="GR_A"
    gr_1$="gr_1"
    gr_2$="gr_2"
    gr_3$="gr_3"
    gr_4$="gr_4"
    gr_5$="gr_5"
    gr_6$="gr_6"
    gr_7$="gr_7"
    gr_8$="gr_8"
    rw_1$="rw_1"
    rw_2$="rw_2"
    rw_3$="rw_3"
    rw_4$="rw_4"
    rw_5$="rw_5"
    rw_6$="rw_6"

    REM ***************************************
    REM Start Attract Loop
    REM Video plays first, and waits for input
    REM ***************************************

    attract:
    video.PlayFile(attract$)

    REM ***************************************
    REM Now we wait for a serial command
    REM ***************************************

    wait_for_serial:
    msg=wait(0, p)
    if (type(msg)<>"roStreamLineEvent") then goto wait_for_serial
    serial.SendLine (msg)

    if msg=attract_l$ then
    serial.SendLine (msg) 'Output command received to commandline
    goto intro                   'to see if command made it.

    else if msg=rw_a$ then
    video_to_play$=right$
    serial.SendLine (msg)
    goto Play_File

    else if msg=gr_a$ then
    video_to_play$=grays$
    serial.SendLine (msg)
    goto Play_File

    else if msg=gr_1$ then
    video_to_play=gr_one$
    serial.SendLine (msg)
    goto Play_File

    else if msg=gr_2$ then
    video_to_play=gr_two$
    serial.SendLine (msg)
    goto Play_File

    else if msg=gr_3$ then
    video_to_play=gr_three$
    serial.SendLine (msg)
    goto Play_File

    else if msg=gr_4$ then
    video_to_play=gr_four$
    serial.SendLine (msg)
    goto Play_File

    else if msg=gr_5$ then
    video_to_play=gr_five$
    serial.SendLine (msg)
    goto Play_File

    else if msg=gr_6$ then
    video_to_play=gr_six$
    serial.SendLine (msg)
    goto Play_File

    else if msg=gr_7$ then
    video_to_play=gr_seven$
    serial.SendLine (msg)
    goto Play_File

    else if msg=gr_8$ then
    video_to_play=gr_eight$
    serial.SendLine (msg)
    goto Play_File

    else if msg=rw_1$ then
    video_to_play=rw_one$
    serial.SendLine (msg)
    goto Play_File

    else if msg=rw_2$ then
    video_to_play=rw_two$
    serial.SendLine (msg)
    goto Play_File

    else if msg=rw_3$ then
    video_to_play=rw_three$
    serial.SendLine (msg)
    goto Play_File



    else if msg=rw_4$ then
    video_to_play=rw_four$
    serial.SendLine (msg)
    goto Play_File

    else if msg=rw_5$ then
    video_to_play=rw_five$
    serial.SendLine (msg)
    goto Play_File

    else if msg=rw_6$ then
    video_to_play=rw_six$
    serial.SendLine (msg)
    goto Play_File

    endif

    Play_File:
    video_playing=true
    video.PlayFile(video_to_play$)



    wait_for_video_end:
    msg=wait(0,p)

    if type(msg)="roVideoEvent" then
    status=msg.GetInt()
    if status <> vidend then goto wait_for_video_end
    video.StopClear()
    video_playing=false
    endif
    goto attract

Please sign in to leave a comment.