Corona

Description

All about Corona development and Lua coding

Forums

I've made even more changes to try an streamline this library and with that I've checked this into the HAH google code project.

I'll slowly check in examples to demonstrate various facets of using Corona, and if people ask questions about something it may spawn a new "demo sample" to show how solve this particular problem.

The wiki page only has a reference to the SVN repo location but overtime I'll flesh this out with a "how to get going" walkthrough for new comers.  If you are familiar with SVN you can sync this up on your windows box to make sure you always have the latest of everything.

I use tortoise SVN on windows and it works just fine.

http://www.dbzoo.com/livebox/corona

Brett

Forums

 

I am not sure if anyone looks at the forum anymore as there have not been any new post for over a year.

 

During the lock down I decided to alter my HAH android app.

Corona SDK has now been rebranded to Solar2D.

Now when I try and run my app I get a storyboard error.

Any help would be very much appreciated.

 

kema

Forums

I have been struggling for a while to get the updated corona, suite of apps working.

Every time I compile on my computer’s I get the following/similar error.

Windows simulator build date: Aug 28 2013 @ 17:45:55

Copyright (C) 2009-2013  C o r o n a   L a b s   I n c .

        Version: 2.0.0

        Build: 2013.1202

Run

 time error

error loading module 'hahlib.interface.bsc' from file 'C:\Users\kema01\AppData\R

oaming\Corona Labs\Corona Simulator\Plugins\hahlib\interface\bsc.lua':

        ...ta\Roaming\Corona Labs\Corona Simulator\Plugins\hahlib\interface\bsc.

lua:1: unexpected

Please see attached jpg for further details.

I have downloaded all corona files to my computer using  SVN

I have the early version of the android app working with out issue.

If you require any further details please let me know.

Many thanks kema...

Forums

Hi troops...

Just had to recover my HAHbox after anaborted update - back working again now (thanks for the help and pointers)...had to make changes to some lua scripts to refelct the upgrade and now want to update my android to point at the new xAP addresses...tried moding the old file, got to the compile option in Corona - it balked and said I needed the latest version, so I download and installed version 3.0.0 build 2014.2393 - I had to change the build settings to the latest on the HAH site...all fine!...no!  I can get the Corona simultaor to work perfectly and I get an APK that goes onto the android but when I try to install the APK it comes up with Parse error - problem parsing the package!!!!  I notice that the new APK doesn't have the Corona icon but I can't give any more details...

I've attached the Corona folder for you to peruse....(remove the __.txt and it becomes a RAR!)

Any pointers?

Elliot

Forums

Hi

We now have a number of devices, running the HAH Android app, modified to suit our requirements.

I have a problem as follows:-

If you do not (wife) shut the Android app down after completing your task, but leave it running and the phone goes in to screen lock. After a while (not sure how long) it freezes up the app and also flash will not respond. Sometimes you can just take the phone/table out of stand bye if you know which device was last used and it will respond, after it completes updating all the changes since it was previously used. Other times I have to reboot the HAH.

Hope the above makes.

Would it be possible to have the app shut down after a set time, say 2 minutes after non-use.

 

kema

Forums

Since I've added my WH1080 node to the HAH I seem to be getting plugboard crashes due to receiving data from the wrong serial ports.

Sometimes plugboard just stops, other times I do actually get an error like this...

lua: /usr/share/lua/5.1/xap/init.lua:395:

/usr/share/lua/5.1/xap/jeenode.lua:51:

invalid value (nil) at index 3 in table for 'concat' xAP Message being processed.

xap-header { uid=FF00D500 source=dbzoo.livebox.Serial hop=1 class=Serial.Comms v=12 }

serial.received { data=OK 2 41 0 19WH1080:2619:2 0 port=/dev/ttyUSB0 }

stack traceback:

[C]: in function 'error'

/usr/share/lua/5.1/xap/init.lua:395: in function 'dispatch'

/usr/share/lua/5.1/xap/init.lua:97: in function 'fun'

/usr/share/lua/5.1/pl/List.lua:444: in function 'foreach'

/usr/share/lua/5.1/xap/init.lua:96: in function 'callback'

/usr/share/lua/5.1/xap/init.lua:203: in function 'dispatch'

/usr/share/lua/5.1/xap/init.lua:117: in function 'process'

/etc_ro_fs/plugboard/plugboard.lua:77: in main chunk

[C]: ?

I thought it could be a power issue so I have now added a powered USB hub rather than stressing the HAH any more but that doesn't seem to have helped

Forums

Hi Brett

 

Im trying to implement a slider for dimmer control using Garrys Dimmable endpoint lua -/content/he107-switch#comment-2936

I've created a slider listener event as below, can i specify the xapSource this way? - Im not seeing any BSC levels in XFX Viewer

-- Slider listener
local function sliderListener( event )
    local slider = event.target
    local value = event.value
    xapSource="dbzoo.livebox.Plugboard:LoungeLights." .. value
    print( "Slider at " .. value .. "%" )
end

local slider = widget.newSlider
{
    top = 200,
    left = 50,
     width = 200,
    listener = sliderListener

}

 

Forums

All,

I have spent the last few days putting together this proof of concept, hope its of use.

Its very rough and needs tidying but seems to work. Its labelled scene4.lua so can be included easily in Brett's multiscene demo.

Just amend the feed ID and labels in the code to suit.

NOTE: It uses the label index number in the pickerwheel to load the correct graph so its important the labels are entered in order numerically within the labels table, i.e. entry 1 relates to xively datastream 0, etc.

v02 will include a second column in the picker wheen to select chart time span.

Cheers,

Garry.

EDIT: v02 including chart time span added.

Forums

I've put together a little multi-scene demo and included a few other trinkets to get your excited about you can do.  This demo connects to my house which is exposed on the internet so it should work for you guys too.

Enjoy,

Update: I installed this on my android and noticed 1 bug, the bar at the bottom of the screen is OFF the screen. (you see it in the emulator but not on a real device).

I've uploaded new source - or you can manually amend the offending code in main.lua

local segmentedControl = widget.newSegmentedControl
{
   left = 0,
   top = _H-30, -- bottom of screen minus the size of the default height for the segment.
   segments = labels,
   segmentWidth = _W/#labels, -- Size the number of labels to fill the screen width.
   defaultSegment = 1,
   onPress = onControlPress
}

Update: 13-Sep

In order for socket.tcp() to work correctly the APP is required to be granted internet access permission.  Included an additional file build.settings to sort this out, I also fix a few other bugs whilst I was at it.

Replaced demo attachment

Update: 24-Sep

Added handling for ApplicationResume/Suspend restructure main.lua, made changes to xap.lua to prevent xap events from being sent when suspended.

Update 26-Sep

Handle Sleep/Resume events - required a bit of a rework.
Put in error handler scene to display stack traces on the screen.

Forums

Hello all,

I'm trying to keep this corona thread going and trying to hack my way through creating a corona app to work with the HAH.

I have an app with a main and 2 'views' 

This is probably going to be answered by Brett :) 

I have a floorplan image on view 1.

That clears when I move to view2 and the buttons appear with the current RF status and the temps etc. but when I move back to view1 the buttons are still there. I have tried storyboard.removeScene("view2") and various other options but the buttons are still visible