Results 1 to 8 of 8

Thread: Linux, QT and qml! You have my attention! ...and I have a transport tcp problem

  1. #1

    Post Linux, QT and qml! You have my attention! ...and I have a transport tcp problem

    I have long been looking for a home automation package that would run on a Linux server. I even played with the idea of learning QT so that I could write my own software for this. Now that I have found your Girder 6 software and read the manual I realize that this is what I need!

    Will you be preparing packages for Debian wheezy (64 bit)?

    Will there be a Netremote app for Blackberry 10, Ubuntu phone and sailfish (Jolla) as these are all QT and qml platforms (not sure what phone I’ll be getting next)?

    I hope the whole home pro (WHP) licenses will allow cross platform usage (eg. Windows and Linux).

    And now to the problem I have.

    I am interested in writing a Lua-driver (RS-232 and raw tcp/ip) for my Sharp tv (LC-46LE831S) and I have been doing some test but I can't get Girder to send a text string using your "simpleSendAndReceive.lua" example (C:\Program Files\Promixis\Girder 6\lua\examples).

    I have copied "simpleSendAndReceive.lua" to C:\Program Files\Promixis\Girder 6\lua\sharp

    I have a scripting action triggered by Girders event "GirderStarted" (I also tried LuaStarted). This script runs without any errors and my debug message is printed (I can also see that address and port '127.0.0.1', 1002 shows up in Girders variable inspector).
    --
    SimpleSendAndReceive = require('sharp.simpleSendAndReceive')
    simpleSendAndReceive = SimpleSendAndReceive.new('127.0.0.1', 1002)
    print("scripting action triggered by GirderStarted event") -- debug
    --

    Next I trigger a Girder scripting action (from a key down event) to send a string but this doesn’t work. Although my debug message is printed to the Lua Console .
    --
    simpleSendAndReceive:send("POWR 1\r")
    print("Power on") -- debug
    --

    I have open my firewall for Girder 6 and even tried to turn it off but I can’t seem to get a message go through, what could I be doing wrong?

    If I create a Lua script (and place it in a Girder scripting action triggered by a key down event) I can connect to a server (I use Hercules setup utility from hw-group as a test tool) on 127.0.0.1 (localhost) port 1002 and send string "POWR 1\r”.
    --
    local host, port = "127.0.0.1", 1002
    local socket = require("socket")
    local tcp = assert(socket.tcp())
    tcp:connect(host, port);
    print("Conected") -- debug
    tcp:send("POWR 1\r")
    tcp:close()
    --

    I also tried entering my Yahoo SMTP setting in Girder (my yahoo SMTP settings works from within mozilla Thunderbird on Ubuntu 14.04 same hardware, network etc.) but I get "Could not connect to host" error. What could be the reson for this?

    Any pointers would be appreciated!


    Joachim

    I am Running Windows 8.1 64 bit and Girder 6.0.0.55 x64
    Attached Files Attached Files
    Last edited by Yoggi; April 20th, 2014 at 05:21 AM.

  2. #2
    Join Date
    Jan 1998
    Location
    Jupiter, FL
    Posts
    13,541

    Default

    Sorry about the delay I'll try to look at this tomorrow.
    Ron
    No support through PM

  3. #3

    Default

    Is there anybody who have tried the "simpleSendAndReceive.lua" example and succeeded that could give me some pointers?

    Your help would be much appreciated!

    Joachim

  4. #4
    Join Date
    Jan 1998
    Location
    Jupiter, FL
    Posts
    13,541

    Default

    Sorry I missed this. I'll try to get to this tomorrow.
    Ron
    No support through PM

  5. #5

    Default

    Hi Ron,

    I hope you can find the time to answer my previews questions

    In the meantime I have made some progress with the "simpleSendAndReceive.lua" example. It appears that I needed to add a :connect() call to my code.

    Maybe your example code should have the line "simpleSendAndReceive:connect()" added (see below).

    --[[

    To use this code you can use the following lua code. Simply enter it into a
    script action and fire it on LuaStarted

    SimpleSendAndReceive = require('examples.simpleSendAndReceive')
    simpleSendAndReceive = SimpleSendAndReceive.new('192.168.1.1', 5000)
    simpleSendAndReceive:connect()

    to send something simply do:
    simpleSendAndReceive:send("hello\n")

    --]]

    So using the "simpleSendAndReceive.lua" example with the parser "\r" I can now send and recive commands (to and from my Sharp TV over TCP). If I e.g. send the string "POWR? \r" to the TV it replies/returns "1\r" for on and "0\r" for off (in the Girder Lua Console I see the message "Received: 1" or "Recived: 0").

    So now I need figure out how to turn this into a driver that can handle on, off, channel up, channel down etc. commands.

    As usual pointers would be appreciated!

    Joachim

    Command examples and replies:

    On Off? "POWR? \r" returns "1\r" for on "0\r" for off (all other commands returns ERR if TV is off)
    On: "POWR1 \r" returns "OK\r"
    Off: "POWR0 \r" returns "OK\r"
    Volume? "VOLM0? \r" returns a value between 0 - 60 (ERR if TV is off) e.g. "11\r"
    Set volume to 7: "VOLM7 \r" returns "OK\r"
    Channel up: "CHUP \r" returns "OK\r"
    Last edited by Yoggi; April 20th, 2014 at 05:35 PM.

  6. #6
    Join Date
    Jan 1998
    Location
    Jupiter, FL
    Posts
    13,541

    Default

    You'll want to get started with transactions. If you open the file lua\pio1\init.lua around lines 124 you'll find one such thing.

    It's sends "getrelay #\n" and then hangs around until 5000 milliseconds pass by (thus timing out) or something comes in that matches the regular express ^getrelay (%d),(%d)" for example ( "getrelay 1,0") the terminator is setup on line 403
    Ron
    No support through PM

  7. #7

    Default

    Thanks, I'll read up on transactions!

    When you have the time, could you pleas answer my platforms questions!?

    Will you be preparing packages for Debian wheezy (Linux 64 bit)?

    Will there be a Netremote app for Blackberry 10, Ubuntu phone and sailfish (Jolla) as these are all QT and qml platforms (not sure what phone I’ll be getting next)?

    Will the whole home pro (WHP) licenses allow for cross platform usage (eg. front end on Windows and back end on Linux)?

    Thanks,

    Joachim

  8. #8
    Join Date
    Jan 1998
    Location
    Jupiter, FL
    Posts
    13,541

    Default

    We'll be providing Girder builds for Linux 64 bit yes. We still have to figure out how to package so that it will run on multiple distributions instead of having to compile for each.

    NR for BB, Ubuntu phone, sailfish,... we do not own any of those but if there is enough demand we'll provide builds for those as well yes.

    WHP allows cross platform usage yes!
    Ron
    No support through PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •