Roku Developer Program

Join our online forum to talk to Roku developers and fellow channel creators. Ask questions, share tips with the community, and find helpful resources.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
nithyaak
Visitor

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.
0 Kudos
6 REPLIES 6
nithyaak
Visitor

Re: Cannot have 2 roku running my app at same time in my hou

any one have any idea? thanks
0 Kudos
belltown
Roku Guru

Re: Cannot have 2 roku running my app at same time in my hou

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.
0 Kudos
nithyaak
Visitor

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

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.
0 Kudos
EnTerr
Roku Guru

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

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?
0 Kudos
nithyaak
Visitor

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

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 😞
0 Kudos

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

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....
0 Kudos
Need Assistance?
Welcome to the Roku Community! Feel free to search our Community for answers or post your question to get help.

Become a Roku Streaming Expert!

Share your expertise, help fellow streamers, and unlock exclusive rewards as part of the Roku Community. Learn more.