Windows command line control

  • May 27, 2013 at 16:23 #6771
    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
      <a href="http://nmap.org/ncat" rel="nofollow">http://nmap.org/ncat</a>
    * 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.
    May 27, 2013 at 16:35 #6773
    jamieburchell
    Participant

    Small bug fix version 1.1 attached.

    Attachments:
    You must be logged in to view attached files.
    May 27, 2013 at 18:07 #6778
    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.
    May 27, 2013 at 18:13 #6780
    jamieburchell
    Participant

    Updated comments

    Attachments:
    You must be logged in to view attached files.
    May 27, 2013 at 20:33 #6784
    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

    May 27, 2013 at 22:31 #6785
    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.
    May 27, 2013 at 22:33 #6787
    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”.

    May 28, 2013 at 12:03 #6798
    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?

    May 28, 2013 at 13:07 #6801
    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.

    May 28, 2013 at 19:04 #6805
    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.

    May 28, 2013 at 19:35 #6806
    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 ๐Ÿ™‚

    May 28, 2013 at 21:47 #6809
    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.
    February 14, 2014 at 10:53 #12544
    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

    February 14, 2014 at 17:59 #12550
    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

    February 14, 2014 at 18:26 #12551
    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

You must be logged in to reply to this topic.