Announcement

Collapse
No announcement yet.

Help. With aspx on Home Troller Raspberry PI

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

    Help. With aspx on Home Troller Raspberry PI

    I am trying to run aspx on homeseer . I have read some of the forum posts on this issue but a litlle confused with RP Linux. I have the following version of Mono installed:

    4.5.1. My current version of homeseer is : HS3 ZEE S2 Edition 3.0.0.548

    I tried to locate VBNC and its not installed. I tried installing it but it failed due to broken components. I tried updating mono it also falied. Could someone point me in the right direction?

    Thanks

    Will
    Last edited by wkrasner; September 22, 2019, 02:43 PM. Reason: Mono

    #2
    Try https://helpdesk.homeseer.com/articl...date-to-mono-5

    If that doesn't work, yell...

    Comment


      #3
      Thank you . I have installed the updated version of Mono. I get the following error when executing:

      Code:
      <%@ LANGUAGE="VBSCRIPT"%>
      <html>
      <head>
      <title>Hello World</title> </head>
      
      <body bgcolor="White">
      <div align="center"><h1>Hello World</h1></div>
      <br><p><hr><p>
      <%Response.Write("Hello World!")%>
      
      </body>
      </html>
      System.SystemException

      Error running vbnc: Cannot find the specified file

      Description: HTTP 500.Error processing request.

      Details: Non-web exception. Exception origin (name of application or object): System.
      Exception stack trace:
      at Microsoft.VisualBasic.VBCodeGenerator.FromFileBatch (System.CodeDom.Compiler.CompilerParameters options, System.String[] fileNames) [0x000eb] in <f74b9f2fea8d47a7922726600e468191>:0 at System.CodeDom.Compiler.CodeCompiler.System.CodeDom.Compiler .ICodeCompiler.CompileAssemblyFromFileBatch (System.CodeDom.Compiler.CompilerParameters options, System.String[] fileNames) [0x0003a] in <f74b9f2fea8d47a7922726600e468191>:0 at System.CodeDom.Compiler.CodeDomProvider.CompileAssemblyFromF ile (System.CodeDom.Compiler.CompilerParameters options, System.String[] fileNames) [0x00006] in <f74b9f2fea8d47a7922726600e468191>:0 at System.Web.Compilation.AssemblyBuilder.BuildAssembly (System.Web.VirtualPath virtualPath, System.CodeDom.Compiler.CompilerParameters options) [0x0029f] in <51af09eb4cc84340898f1133a5df1f38>:0 at System.Web.Compilation.AssemblyBuilder.BuildAssembly (System.Web.VirtualPath virtualPath) [0x00008] in <51af09eb4cc84340898f1133a5df1f38>:0 at System.Web.Compilation.BuildManager.GenerateAssembly (System.Web.Compilation.AssemblyBuilder abuilder, System.Web.Compilation.BuildProviderGroup group, System.Web.VirtualPath vp, System.Boolean debug) [0x00202] in <51af09eb4cc84340898f1133a5df1f38>:0 at System.Web.Compilation.BuildManager.BuildInner (System.Web.VirtualPath vp, System.Boolean debug) [0x00106] in <51af09eb4cc84340898f1133a5df1f38>:0 at System.Web.Compilation.BuildManager.Build (System.Web.VirtualPath vp) [0x00058] in <51af09eb4cc84340898f1133a5df1f38>:0 at System.Web.Compilation.BuildManager.GetCompiledType (System.Web.VirtualPath virtualPath) [0x00037] in <51af09eb4cc84340898f1133a5df1f38>:0 at System.Web.Compilation.BuildManager.GetCompiledType (System.String virtualPath) [0x00006] in <51af09eb4cc84340898f1133a5df1f38>:0 at System.Web.HttpApplicationFactory.InitType (System.Web.HttpContext context) [0x0020f] in <51af09eb4cc84340898f1133a5df1f38>:0 at System.Web.HttpApplicationFactory.GetApplication (System.Web.HttpContext context) [0x00018] in <51af09eb4cc84340898f1133a5df1f38>:0 at System.Web.HttpRuntime.Process (System.Web.HttpWorkerRequest req) [0x00052] in <51af09eb4cc84340898f1133a5df1f38>:0

      Comment


        #4
        My impression is that vbscript isn't supported on Linux.

        Do you have a file named test.aspx in /usr/local/HomeSeer/html/ ? This is included in fresh installs, but it doesn't appear to be included in the incremental archive used when updating.

        If its there, open http://<hs3 ip address>/test.aspx in your browser.

        For this to work, you'll need to add the "aspx workaround" discovered by an enterprising forum member, bsobel. We'll get to that presently; in the meantime, run these commands at the Linux command line and post the output.

        Code:
        dpkg -V mono-vbnc
        
        type vbnc
        
        file /usr/bin/vbnc
        If there's no output from the 1st one - that's good.

        The 2nd one should output "vbnc is /usr/bin/vbnc"

        If the 2nd is correct, the 3rd one will output either "/usr/bin/vbnc: Bourne-Again shell script, ASCII text executable" or "/usr/bin/vbnc: POSIX shell script, ASCII text executable" depending on whether or not you have the above mentioned workaround in place.

        Comment


          #5
          Thanks again for the quick reply.

          Click image for larger version

Name:	cbnc.JPG
Views:	99
Size:	31.5 KB
ID:	1328325

          Comment


            #6
            I went ahead and installed vbnc

            result is as you expected
            Click image for larger version

Name:	Annotation 2019-09-23 024058.jpg
Views:	91
Size:	59.5 KB
ID:	1328327


            Now error has changed

            Click image for larger version

Name:	vbnc.JPG
Views:	85
Size:	30.8 KB
ID:	1328328
            also I dont have the test.aspx that came with fresh install, anywhere to download it? Thanks

            Will

            Comment


              #7
              OK, now you have the "expected" error!!

              What you need to do is to replace the contents of /usr/bin/vbnc with the following:

              Code:
              #!/bin/bash
              # mono vbnc invocation script patched for HS3 aspx compatability
              for x
              do
                  if [[ $x =~ ^/tmp/ && -e $x ]]
                  then
                      sed -i '1{/#External/d}' $x
                  fi
              done
              exec /usr/bin/mono --debug $MONO_OPTIONS /usr/lib/mono/4.5/vbnc.exe "$@"
              test.aspx is included in the "full" installer, found at https://homeseer.com/updates3/hs3pi3_070319.tar.gz I doubt that anyone will kill me for posting it here...

              Code:
              <%@ Page Language="VB" %>
              <script runat="server">
              
                  ' Insert page code here
                  '
                  Dim hs As Scheduler.hsapplication
                  Dim plugin As HomeSeerAPI.PluginAccess
              
                  Sub Page_Load(Sender As Object, E As EventArgs)
                      ' for use with the HS web server
                      hs = Context.Items("Content")
              
                      ' get a reference to the Z-Wave plugin
                      plugin = New HomeSeerAPI.PluginAccess(hs, "Z-Wave", "")
                      If plugin.Connected Then
                          Label2.Text = "Connected to Z-Wave plugin, name=" & plugin.Name
                      End If
                      label1.text = "HomeSeer Ver: " & hs.version
              
                              Dim EN As Scheduler.Classes.clsDeviceEnumeration
                              Dim dv As Scheduler.Classes.DeviceClass
                      EN = hs.GetDeviceEnumerator
                              Do
                          dv = EN.GetNext
                          If dv Is Nothing Then Continue Do
                      Loop Until EN.Finished
                  end sub
              
                  Sub ButSpeak_Click(sender As Object, e As EventArgs)
                      hs.speak(txtspeak.text,false,"")
                              Dim EN As Scheduler.Classes.clsDeviceEnumeration
                              Dim dv As Scheduler.Classes.DeviceClass
                      EN = hs.GetDeviceEnumerator
                              Do
                          dv = EN.GetNext
                          If dv Is Nothing Then Continue Do
                              '       hs.WriteLog("SAMPLE", "Found device from aspx: " & dv.Name(Nothing))
                      '    If dv.Interface(Nothing) IsNot Nothing Then
                       '       If dv.Interface(Nothing).Trim = "Sample Plugin" Then
                       '           hs.WriteLog("SAMPLE", "Found device from aspx: " & dv.Name(Nothing))
                      '        End If
                      '    End If
                      Loop Until EN.Finished
                  End Sub
              
                  Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs)
                      'hs.ExecX10("q7", "on")
                  End Sub
              
                  Protected Sub Button2_Click(ByVal sender As Object, ByVal e As System.EventArgs)
                      'hs.ExecX10("q7", "off")
                  End Sub
              
                      Private Function GetHeadContent() As String
                      Try
                          Return hs.GetPageHeader("", "Test Page", "", "", False, False, True, False, False)
                      Catch ex As Exception
                      End Try
                      Return ""
                  End Function
              
                      Private Function GetBodyContent() As String
                      Try
                          Return hs.GetPageHeader("", "Test Page", "", "", False, True, False, True, False)
                      Catch ex As Exception
                      End Try
                      Return ""
                  End Function
              
              </script>
              <html>
              <head runat="server">
              <%response.write(GetHeadContent())%>
              </head>
              <body>
              <% response.write(GetBodyContent()) %>
                  <form runat="server">
                      <p>
                          <asp:Label id="Label1" runat="server" width="210px">Label</asp:Label>
                      </p>
                      <p>
                          <asp:Label id="Label2" runat="server" width="400px">Label</asp:Label>
                      </p>
                      <p>
                      </p>
                      <p>
                          <asp:Button id="ButSpeak" onclick="ButSpeak_Click" runat="server" Text="Speak"></asp:Button>
                          <asp:TextBox id="TxtSpeak" runat="server"></asp:TextBox>
                      </p>
                      <p>
                          <asp:Button ID="Button1" runat="server" OnClick="Button1_Click" Text="Light On" />
                      </p>
                      <p>
                          <asp:Button ID="Button2" runat="server" OnClick="Button2_Click" Text="Light Off" />&nbsp;</p>
              
                      <!-- Insert content here -->
                  </form>
              </body>
              </html>

              Comment


                #8
                Thank you.

                Ok I tried replacing the file vbnc through winscp , but file permissions are denied. I suspect I have to do this as root, but I dont have the password. Any thoughts

                I also tried nano , permisison also denied

                Comment


                  #9
                  Both homeseer and pi should be set up as sudo users. To use that, preface the command with sudo, i.e.

                  Code:
                  sudo nano /usr/bin/vbnc

                  Comment


                    #10
                    Thanks agian. I was able to edit the file. Now getting following error on execution of test.aspx:
                    Click image for larger version

Name:	last error.JPG
Views:	92
Size:	84.5 KB
ID:	1328499


                    I am open to learning a new language. What do most people use with the RP Deployment?

                    Thanks

                    Will

                    Comment


                      #11
                      To use VB.NET, use this instead:

                      Code:
                      <%@ Page Language="VB" %>
                      HS 3.0.0.548: 1990 Devices 1172 Events
                      Z-Wave 3.0.1.262: 126 Nodes on one Z-Net

                      Comment


                        #12
                        my bad I executed the wrong file. Dah! Thanks

                        Comment


                          #13
                          Thank you all . I am up and running with aspx and vb script

                          Comment

                          Working...
                          X