0

Using the GPIO ports on both the expander and main board

I have tried all the scripts that have been posted on here about using both sets of GPIO ports.

I use HD810's and EM100's for alot of what I do. I would like to be able the respond to an input or set an output high for feedback on either unit. This comes in handy for being able to have several options for the client.

Everytime I load one of the examples, I always get a dot operator error. For example I loaded the following which was posted here:

debug=true

'****** CREATE MESSAGE PORTS ******
p = CreateObject("roMessagePort")
tmr = CreateObject("roMessagePort")
sp = CreateObject("roMessagePort")

'****** CREATE SERIAL PORT ******
serial = CreateObject("roSerialPort",0,115200)
serial.SetLineEventPort(p)
serial.SetEOL(chr(10))


gpioEx = CreateObject("roControlPort", "Expander-GPIO")
gpioOnBoard = CreateObject("roControlPort", "Brightsign")
iplayer = CreateObject("roImagePlayer")
vplayer = CreateObject("roVideoPlayer")
vplayer.SetPort(p)
gpioEx.SetPort(p)
gpioOnBoard.SetPort(p)

REM Constants / Settings / Variables
iplayer.PreloadFile("menu.jpg")

gpioEx.EnableInput(0)
gpioEx.EnableInput(1)
gpioOnBoard.EnableInput(0)
gpioOnBoard.EnableInput(1)


'Video Database
DIM vlist[12]
vlist[1]="TRADE SCENE.mpeg"
vlist[2]="FOUS-TV-171 Fort Union Trading Post_transport.ts"
vlist[3]="GUN EVOLUTION.Copy_NEW.mpeg"
vlist[4]="FORT MUSIC.mpeg"


Start: 
iplayer.DisplayPreload()


loop:
msg = wait(0,p)

if type(msg) = "roControlDown" then
button_pressed = msg.GetInt()

if button_pressed = 0 then
vplayer.PlayFile(vlist[1])

elseif button_pressed = 1 then 
vplayer.PlayFile(vlist[2])

elseif button_pressed = 2 then 
vplayer.PlayFile(vlist[3])

elseif button_pressed = 3 then 
vplayer.PlayFile(vlist[4])

endif

else if type(msg) = "roVideoEvent" then
if msg.GetInt() = 8 goto start
endif

goto loop


and when it loads I get this error:

Line 19 error code &hec: 'Dot' Operator attempted with invalid BrightScript Com.

019: gpioEx.SetPort(p)


Can someone help with this?

Thanks

5 comments

  • 0
    Avatar
    RokuLyndon


    What firmware are you running? If you have old enough firmware, it's not available. Please test under the latest firmware. I assume you have an expander plugged in. Do you have a second unit you can test with? This can happen if the expander is not seen.
  • 0
    Avatar
    Lovell, Willard


    Lyndon

    Thanks for the response

    Now that makes alot of sense.  I can understand if its programmed and not seen there could be issues for sure.  I am using Firmware 3.3.78 in the HD810.  I have been seeing something in the boot that shows this:

    [    3.868} usb 1-1.2.1.6: device descriptor read/64, error -32

    [    4.328] usb 1-1.2.1.6: device descriptor read/64, error -32

    [    5.108] usb 1-1.2.1.6: device not accepting address 12, error -32

    [    5.608] usb 1-1.2.1.6: device not accepting address 13, error -32


    if the expander is bad how else can I test it to be sure?

    Will
  • 0
    Avatar
    Lovell, Willard


    Lyndon

    I have my gpio ports working on both the expander and main unit.  Now I am trying to differentiate (sp) between the two ports.  When I use the GetSourceIdentity  the number of the port seems to change with every reboot of the device.
    Is there a better way to know which GPIO port it is comming from?

    Will
  • 0
    Avatar
    RokuLyndon


    Well that's definitely looks like there's a problem reading the expander. It could be the expander or the usb port. I'm assuming you don't have a second unit to test with or another expander. Please send an email to <!-- e --><a href="mailto:support@brightsign.biz">support@brightsign.biz</a><!-- e --> and I"ll setup a replacement.
  • 0
    Avatar
    Lovell, Willard


    Lyndon

    Thanks for the help.  I am able to use all ports on both units and I know which one is sending the commands.

    Again thanks

    Will
Please sign in to leave a comment.