Announcement

Collapse
No announcement yet.

Window script doen't run under Jessie

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

    Window script doen't run under Jessie

    I am slowing converting my HS3 over to raspberry pi - Jessie. I have a script that runs under windows just fine, but I get the following error when I run it under Jessie.

    Running script /usr/local/HomeSeer/scripts/Lightsonv2.vb :Exception has been thrown by the target of an invocation.Invalid IL code in scriptcode3.VBWrapper:Main (object): IL_01d2: nop

    I have no idea what this means. Any help would be greatly appreciated.

    There is the script. I did not write it, but I copied it from somewhere. So I have limited understanding of how it works.

    Sub Main(Parm As Object)

    'Script to display Light Status

    Dim Status
    Dim DeviceVal

    Dim Offf'0
    Dim OnOn'1
    Dim Lightson as Integer





    OnOn = ""
    Offf = ""
    Lightson=0
    Dim col As New Collections.Generic.List(Of Scheduler.Classes.DeviceClass)
    Dim dv As Scheduler.Classes.DeviceClass

    Dim EN As Scheduler.Classes.clsDeviceEnumeration
    EN = hs.GetDeviceEnumerator
    Do
    dv = EN.GetNext
    If dv Is Nothing Then Continue Do
    col.Add(dv)
    Loop Until EN.Finished

    If col IsNot Nothing AndAlso col.Count > 0 Then
    For Each dv In col
    If dv Is Nothing Then Continue For

    If dv.Location2(Nothing)= "Lights" then
    DeviceVal= hs.DeviceValue(dv.Ref(Nothing))

    If DeviceVal = 0 then
    Offf = Offf & dv.Name(Nothing) & ", " & "<Br>"
    Else
    OnOn = OnOn & dv.Name(Nothing) & ", " & "<Br>"
    Lightson=Lightson+1
    End If

    'hs.writelog ("OK", OnOn)
    'hs.WriteLog("Ref: " & dv.Ref(Nothing), dv.Name(Nothing) & " " & DeviceVal & " " & Status) 'Update HS Log
    'hs.WriteLog("Ref: " & dv.Ref(Nothing), dv.Name(Nothing) & " " & dv.Location(Nothing) & " " & dv.Location2(Nothing))

    End If
    Next
    End If


    If OnOn = "" then OnOn = "All Lights are Off"
    hs.SetDeviceString(14, Trim(OnOn), True)
    hs.SetDeviceValueByRef(14, Lightson, True)


    End Sub

    #2
    Is Jessie Linux? Not all vb.net is supported under linux.

    I would be suspicious of: Collections.Generic.List(Of Scheduler.Classes.DeviceClass)


    tenholde
    tenholde

    Comment


      #3
      You could try completing the variable declarations for a few variables.
      Change:
      Dim Status
      Dim DeviceVal

      Dim Offf'0
      Dim OnOn'1
      Dim Lightson as Integer
      to:
      Dim Status as String
      Dim DeviceVal as Integer

      Dim Offf as String '0
      Dim OnOn as String '1
      Dim Lightson as Integer
      Mike____________________________________________________________ __________________
      HS3 Pro Edition 3.0.0.548, NUC i3

      HW: Stargate | NX8e | CAV6.6 | Squeezebox | PCS | WGL 800RF | RFXCOM | Vantage Pro | Green-Eye | Edgeport/8 | Way2Call | Ecobee3 | EtherRain | Ubiquiti

      Comment


        #4
        Yes. It is Jessie Linux. I assume it was a problem with vb running on Linux. I guest I will just have to stick with my Windows system for now. Thanks
        John

        Comment

        Working...
        X