Corona remote 1.2: run time error

Hi,

I just upgraded to corona remote 1.2. I can connect (at least is says I am connected on the ipod!) to the simulator, but I get a run time error:

Runtime error
/Users/------/Desktop/Game/remote.lua:237: attempt to index global ‘network’ (a nil value)
stack traceback:
[C]: ?
/Users/------/Desktop/Game/remote.lua:237: in function ‘runTCPServer’
/Users/------/Desktop/Game/remote.lua:284: in function
?: in function <?:214>

This is my code (this is not the “main.lua”. This is were I use the remote):

module(..., package.seeall)  
  
function newlevel\_1 ()  
 local super = require("\_level\_1")  
 local this = super:newlevel\_1()  
  
--------------------Corona Remote--------------------  
  
-- Setup Corona Remote  
local remote = require("remote")  
remote.startServer( "8080" , "fast" )  
  
--------------------Physics--------------------  
  
-- Setup Physics  
local physics = require ("physics")  
physics.start()  
physics.setGravity (0,0)  
  
--------------------Ball--------------------  
  
-- Load Shadow  
local shadow = display.newCircle( 320 , 240 , 32 )  
shadow:setFillColor( 0 , 0 , 0 )  
shadow.alpha = 0.2  
shadow.yScale = 1.20  
  
-- Load Ball  
ball = display.newImageRect( "ball.png" , 60 , 60 )  
ball.x = 70  
ball.y = 890  
physics.addBody( ball , { density = 1.388997268825 , friction = 4, bounce = 0.1 , radius = 30 } )  
  
-- Apply Force To Ball  
function applyForceToBall( xForce , yForce )  
  
 -- Apply Force To Ball  
 ball:applyForce( xForce , yForce , ball.x , ball.y )  
  
 -- Move Ball To Front  
 ball:toFront()  
  
end  
  
-- Follow Ball  
local function followBall()  
  
 -- Move Shadow To Ball  
 shadow.x = ball.x  
 shadow.y = ball.y + 5  
  
end  
Runtime:addEventListener( "enterFrame" , followBall )  
  
--------------------Walls--------------------  
  
-- Top Wall  
local WoodBoardTop = display.newImage( "wall\_top.png" )  
WoodBoardTop.y = 12.5  
WoodBoardTop.x = 320  
physics.addBody(WoodBoardTop, "static", { bounce = 0.1, friction = 4} )  
  
-- Bottom Wall  
local WoodBoardBottom = display.newImage( "wall\_bottom.png" )  
WoodBoardBottom.y = 947.5  
WoodBoardBottom.x = 320  
physics.addBody(WoodBoardBottom, "static", { bounce = 0.1, friction = 4} )  
  
-- Left Wall  
local WoodBoardLeft = display.newImage( "wall\_left.png" )  
WoodBoardLeft.y = 480  
WoodBoardLeft.x = 12.5  
physics.addBody(WoodBoardLeft, "static", { bounce = 0.1, friction = 4} )  
  
-- Right Wall  
local WoodBoardRight = display.newImage( "wall\_right.png" )  
WoodBoardLeft.y = 480  
WoodBoardLeft.x = 627.5  
physics.addBody(WoodBoardRight, "static", { bounce = 0.1} )  
  
--------------------Game Walls--------------------  
  
-- Game wall 1  
local GameWall1 = display.newImage( "wall\_game1.png" )  
GameWall1.y = 320  
GameWall1.x = 415  
physics.addBody(GameWall1, "static", { bounce = 0.1, friction = 4} )  
  
-- Game wall 2  
local GameWall2 = display.newImage( "wall\_game2.png" )  
GameWall2.y = 640  
GameWall2.x = 225  
physics.addBody(GameWall2, "static", { bounce = 0.1, friction = 4} )  
 return this  
end  

Also, I am using SprintDeck so this is in the “level_1.lua” not “_level_1.lua”. Could this be the issue?

Thanks in advance

– [import]uid: 15281 topic_id: 6451 reply_id: 306451[/import]

Have you downloaded the latest remote.lua from the website. www.coronaremote.com

You also need the latest version of Corona for the new async api. [import]uid: 5354 topic_id: 6451 reply_id: 23624[/import]

Hey,

This “may” be the issue (not having the latest version of Corona).
Do I have to go to the website and download it (new Corona) or is there some way to just update it (from the application)?

Thanks
Ps I have version 2010.243 (2010.12.2) is this right? [import]uid: 15281 topic_id: 6451 reply_id: 23708[/import]

It needs 2011.268 or later.

https://developer.anscamobile.com/downloads/corona-sdk

And download the latest version of remote.lua from here www.coronaremote.com

Then it will all work and with the new network api ( what the error message meant ) you will get about 2x as much data in near real time. [import]uid: 5354 topic_id: 6451 reply_id: 23710[/import]

Yes! this was the issue. Thanks! [import]uid: 15281 topic_id: 6451 reply_id: 23714[/import]