Windows command line control

LightwaveRF Community: Welcome Forums LightwaveRF Hackers Windows command line control

This topic contains 122 replies, has 12 voices, and was last updated by  jamieburchell 4 months ago.

Viewing 15 posts - 1 through 15 (of 123 total)
  • Author
    Posts
  • #6771
     jamieburchell says:

    jamieburchell
    Participant

    Hi

    I’ve created a Windows command line tool for controlling the WifiLink and thought I’d share it here.

    LightwaveRF Command Line Control v1.0 by Jamie Burchell

    Usage:
    lwrf room-name device-name on|off|lock|unlock|dim 1-100
    lwrf room-name off
    lwrf room-name mood 1-4

    Examples:
    lwrf lounge lights on
    lwrf lounge lights dim 50
    lwrf "spare bedroom" lights lock
    lwrf "sitting room" "porch light" on
    lwrf front-room mood 2
    lwrf kitchen off

    Requirements:
    * The ncat utility to send network messages, download the Windows binary from
    http://nmap.org/ncat
    * The device running this script must be registered with your WifiLink
    (The WifiLink will prompt for registration when the first command is sent)
    * You must edit the configuration inside this script

    Don’t forget to put it (and the required ncat utility) somewhere Windows will find it (e.g. system32)

    You’ll also need to rename the attachment lwrf.bat

    Enjoy!

    Attachments:
    You must be logged in to view attached files.
    #6773
     jamieburchell says:

    jamieburchell
    Participant

    Small bug fix version 1.1 attached.

    Attachments:
    You must be logged in to view attached files.
    #6778
     jamieburchell says:

    jamieburchell
    Participant

    Oops, spotted a flaw in the last 2 scripts that meant they wouldn’t have worked.

    New version attached.

    Chris, any chance we can edit these posts?

    Thanks

    Jamie

    Attachments:
    You must be logged in to view attached files.
    #6780
     jamieburchell says:

    jamieburchell
    Participant

    Updated comments

    Attachments:
    You must be logged in to view attached files.
    #6784
     h3mp says:

    h3mp
    Participant

    Sounds cool – how come you have to use nmap – is there nothing native in WinAPI that can send the right packets?
    It’s something I’d like to look at myself at some point, possibly from windows or from a netduino :)

    Mark

    #6785
     jamieburchell says:

    jamieburchell
    Participant

    New version: 2.0

    - Added support for feedback from the “Wifi Link”
    - Misc code improvements
    - Added some more comments

    Chris: Is there a way this version could be made the only one available?

    Cheers

    Jamie

    Attachments:
    You must be logged in to view attached files.
    #6787
     jamieburchell says:

    jamieburchell
    Participant

    Sounds cool – how come you have to use nmap – is there nothing native in WinAPI that can send the right packets?
    It’s something I’d like to look at myself at some point, possibly from windows or from a netduino

    Mark

    I couldn’t find a way of sending a UDP packet from a batch file without an external program. I’m using ncat to send and listen for the response from the “Wifi Link”.

    #6798
     h3mp says:

    h3mp
    Participant

    I should have looked at your batch file before asking the question sorry! – It’s very cool.

    Are “sequences” stored within the Wifi-link itself? if so, could the batch file be adapted to trigger them?

    #6801
     skiv71 says:

    skiv71
    Participant

    i’ve used batch files in conjuction with the lightwaverf api (which has a command line).

    but i’ve since moved onto php… simple php script and you can talk directly to the wifi link.

    my system uses php scripts for reading, writing and setting of points.

    i was using the wifi link, but once you get a busy network, it seems to cause random triggers,

    so i use rfxtrx433 exclusively now,

    and i have many devices :)

    developer of BMS Link (http://linode.bmslink.co.uk). A cloud based Home Automation platform for LightwaveRF, Z-Wave, RFXCOM.
    #6805
     jamieburchell says:

    jamieburchell
    Participant

    Are “sequences” stored within the Wifi-link itself? if so, could the batch file be adapted to trigger them?

    Yes, sequences and timers are stored in the Wifi-link once they’ve been setup. Probably wouldn’t be too hard to add them to the batch file.

    Could have used php, it would certainly have been easier (I’m a PHP developer) but this way works and at least it doesn’t require a PHP install :)

    The Wifi-link suffers from issues turning the wrong devices on and off – I don’t know if it’s just my unit or a common firmware bug but I’m in contact with JSJS about it.

    #6806
     h3mp says:

    h3mp
    Participant

    Thanks Jamie..
    I’m also a PHP (and C#) Developer.. want to do a bit of lightwaveRF customization but currently trying to choose between going down the PC route using batch files like yours with my wifi-link, or using a rfxtrx433.. or maybe doing custom hardware based on a netduino and 433 transceiver.. suspect i might end up doing a mix of all 3 :-)

    #6809
     jamieburchell says:

    jamieburchell
    Participant

    Hey

    V3 attached with support for triggering sequences (and cancelling them all)

    I’ve also had success controlling the WifiLink with iOS (iPod/iPad/iPhone) using an app by CommandFusion called iViewer Next. With the free Windows guiDesigner software you can create a remote control with feedback, sliders etc. I’m happy to share them on here if anyone’s interested.

    Cheers,

    Jamie

    Attachments:
    You must be logged in to view attached files.
    #12544
     alonmalka1 says:

    alonmalka1
    Participant

    Hi,

    I use your program all the time through an iphone app I created. I would like to be able to send the wifi-link a command to clear all events.
    Can you guide me what to do?
    I don’t know how to listen to a port. If someone can guide me on this subject I may be able to do it myself.

    Thanks,
    Alon

    #12550
     jamieburchell says:

    jamieburchell
    Participant

    Hey

    I’ll gladly help if I can. I’m not sure what you mean about using my app with an iPhone though?

    Do you need to know the string to send the WifiLink to cancel all timers?

    Cheers

    #12551
     alonmalka1 says:

    alonmalka1
    Participant

    Yes I would like to know the string for canceling all events.
    I would also like to know if it isnot too much trouble how to read the data that wifi link recieves.
    Thanks,
    Alon

Viewing 15 posts - 1 through 15 (of 123 total)

You must be logged in to reply to this topic.