Forum Discussion

nithyaak's avatar
nithyaak
Visitor
10 years ago

Cannot have 2 roku running my app at same time in my house

Hi,
I have an app written and its communicating with a server hosted in godaddy . if I have only one roku player, it just works fine, however if I were to turn on my app from 2nd roku box from same network while 1st playing, 2nd one hangs. i was able to narrow down where is the trouble some point but dont know why its hanging here. any help would be much appreciated.

I have a very simple code like this to download an image ..

    print "1st check point.."
imageurl ="http://www.myserver.net/<someurl>/getimage.php?random="+rnd(20000).tostr()
print "imagurl=" + imageurl
xfer=createobject("roURLTransfer")
xfer.seturl(imageurl)
print "2nd check point.."
xfer.GetToFile("tmp:/livead.png")
print "3rd check point..".




it get hangs on xfer.GetToFile("tmp:/livead.png") . if I shutdown my 1st roku, then this one start to works. my getimage.php is very simple, its just outputting an jpeg image .
Note. if i were to access from my computer browser (another lan ip) while 1st roku playing, that works fine. its just the roku player not able to get it.

Does any one have any suggestion why its doing it and how can i get around this issue?
thanks for your time.

6 Replies

  • I see you're not doing any error-checking in your BrightScript code. If you check the Http response codes you might get more information. You can get even more information about what's going on if you use roSystemLog (handle the http.connect and http.error events). And check your server logs too.
  • Hi, I need some help with enabling system log to trace the issue.
    i tried doing this :
    "
    Function sendAsyncHttpCall(url as String) As String
            syslog = CreateObject("roSystemLog")
             print "sendAsyncHttpCall url=";url
             devicestatus=""
             
             devicecheckurlxfer=createobject("roURLTransfer")
             port=createobject("roMessagePort")
                  
             devicecheckurlxfer.EnableEncodings(true)
             devicecheckurlxfer.seturl(url)
             devicecheckurlxfer.SetMinimumTransferRate(1,2)
             devicecheckurlxfer.SetMessagePort(port)
             devicecheckurlxfer.asyncgettostring()
             
             syslog.SetMessagePort(port)
             syslog.EnableType("http.error")
             syslog.EnableType("http.connect")
             
                while true    
                msg=wait(100,port) '100 millisecond pause
                if type(msg)="roUrlEvent" then
            
                    if msg.getresponsecode()=200 then
                        devicestatus=msg.getstring()
                        headers=msg.getresponseheadersarray()
                        exit while
                    else
                        devicecheckurlxfer.asynccancel()
                       
                    end if
               else if type(msg) = "roSystemLogEvent" Then
                     print " >>> its a roSystemLogEvent detected"
                else
                    print "do something useful while we wait for data"   
                end if
                
                if timer.totalmilliseconds() > 3000 then
                    ?"timeout exceeded"
                              
                    exit while
                end if
            end while
             
                    
             print "status=" ; devicestatus 
             return devicestatus
    End Function

    "

    However, i can't access teh system.log. where and how can I access the system.log to see what is the issue i am having in the client side which is preventing if i have 2 roku box running at the same time.. I have checked my server side no errors. it appears the request is not going through the 2nd roku box if the 1st one is active and vice versa.
  • i suspect the issue is server side - e.g. being unable to server >1 connection at the same time. Have you tried to open that URL in 2 different browsers at the same time?
  • yes, i did. i can access the server side with multiple browser . I even tried writing a  java program to access (multiple threads) and that seems to be working fine. only roku is having issue 😞
  • are you doing any checks on the server side for the roku dev id? If you built your app on two different roku boxes, these would be different....