Announcement

Collapse
No announcement yet.

Script help for Raspberry Pi please

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Script help for Raspberry Pi please

    Hi, I'm trying to use HomeSeer for the first time, it's a test system on a Raspberry Pi 3. I have a USB serial adapter on ttyUSB0 which I'd like to use to control a projector lift via RS232 to see if HomeSeer will be suitable for my requirements. According to the manual I need to do the following:

    1. Com setting 8 data bits, 1 start bit, 1 stop bit, 2400 baud
    2. Directive for extending (I'm starting with only this command for now): 0xFF 0xEE 0xEE 0xEE 0xE9, send continually two times each time interval 200ms

    I'm not familiar with scripting in VB.net at all, I've tried the following which doesn't work so am hoping someone can help me please!

    Sub Main(parm as object)
    Dim PortNumber
    PortNumber=ttyusb0
    hs.OpenComPort PortNumber,"2400,N,8,1",1,"",""
    hs.SendToComPort PortNumber, chr(&HFF) & chr(&HEE) & chr(&HEE) & chr(&HEE) & chr(&HE9)
    hs.waitsecs 0.2
    hs.SendToComPort PortNumber, chr(&HFF) & chr(&HEE) & chr(&HEE) & chr(&HEE) & chr(&HE9)
    hs.closeComPort(PortNumber)
    End Sub

    Can anyone assist with the correct Linux / RPi3 scripting so I can test this unit?

  • #2
    Looks like a lot of your syntax is VBScript, not VB.net. Note that a lot of the examples in the help file are in VBScript syntax. Having said that, I have no idea if the com port scripting command work with the port numbers used in linux. I would email support@homeseer.com and ask them to confirm the correct syntax for those commands in linux, unless someone else here has experience wit those commands under linux. The help file indicates that the port number should be an integer (corresponding to the COM port number under Windows). Passing a string to it likely won't work.
    HS 3.0.0.548: 1990 Devices 1172 Events
    Z-Wave 3.0.1.262: 126 Nodes on one Z-Net

    Comment


    • #3
      Hi,
      have you discovered how to work with serial ports on Linux?
      I am experiencing the same difficulty and can't find how...

      Thanks.

      Comment


      • #4
        Please note a couple more things I've tried:

        1) Booted up in Safe mode (shorting GPIO 5/6) which brings up a command line prompt (Busybox kernel) and allows me to access the Linux directory structure. However, for some reason, I can't see anything under the /etc/init.d/ directory even though that is where I put my script.

        2) Entered Recovery Mode at startup (held Shift key down) which brings up the NOOBS menu. It shows that Rasbian is installed, but won't let me enter the config file. It only gave me the option to install other OS's, or to reinstall Rasbian.

        3) While in Safe mode I also tried creating a config.txt and cmdline.txt files but wasn't sure where to place them since there was no /boot directory visible.

        The next thing I plan to try is to install a Linux OS on a USB drive for my Windows PC to boot from. Hopefully, then I can use my PC to access the /etc/init.d/superscript file to delete it.

        Comment

        Working...
        X