Announcement

Collapse
No announcement yet.

My HomeSeer Based Smart Home

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

  • mwolter
    replied
    My HS3 install using the scripts and steps in the original post had been running well for for almost three years. Decided to update to HS4 recently and the Systemd scripts still work well.

    Had to update Mono to version 6.10.0.104 using the commands below.
    Code:
    sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF
    sudo apt install apt-transport-https ca-certificates
    echo "deb http://download.mono-project.com/repo/ubuntu xenial/snapshots/6.10.0.104 main" | sudo tee /etc/apt/sources.list.d/mono-official-stable.list
    sudo apt update
    Was also able to make ASPX pages (@jon00 's plugins) work by editing /usr/bin/vbnc and replacing
    Code:
    #!/bin/sh
    exec /usr/bin/mono --debug $MONO_OPTIONS /usr/lib/mono/4.5/vbnc.exe "$@"
    with
    Code:
    #!/bin/bash
    exec /usr/bin/mono --gc-params=nursery-size=64m $MONO_OPTIONS /usr/lib/mono/4.5/vbc.exe "$@"

    Leave a comment:


  • MattL0
    replied
    Hi Pete,

    Thank you for your message.

    Yesterday, (with the half-awareness of knowing i was delaying my school thèsis again..lol), I wrote on Mono’s Github aboute the aspx issue. I Wrote to HST and I navigated the web about this issue as well.

    The issues seems to not be related to homeseer at all. Just wondering what changed from 5.0.1.1 to post 5.0.1.1...

    I think the mono-xbnc package is diferent now 4.7 vs 4.6)..but it can be a lot of things(depndencies, library) related (more or less) to that.

    Finally , i also tried the mono 5.14 preview relaese in the hope something was different. But got the same aspx page issue. Same with nightly 5.17 ( and 30% of my plugin didnt load and was not able to install them)

    Someone needs to investigate what did brake after 5.0.1.1...


    So From the official stable 5.12 ..I switched to 5.0.1.1 5 days ago. I think it uses more cpu and ram and has more cpu peaks, but not sure about this.
    I run this on a debian 9.5 x64 system, headless.
    I really wanted to use the grouping utility of Jon00 to clean my devices page. After this is done, i will maybe revert to the stable mono release.
    And i discovered you can output a txt file from the device and event viewer of Jon00 without having to show the .aspx page..
    So there is little use, in my case , of the 5.0.1.1 package.

    Last edited by MattL0; August 4, 2018, 09:39 PM.

    Leave a comment:


  • Pete
    replied
    Here using updated HS3 Lite (ARM) and HS3 Pro (Intel) on Ubuntu 18.04 and latest release of Mono Homeseer aspx pages do not load.

    Since day one of using RPi or Linux with Homeseer have kept the base OS updated. (RPi Raspberian, Linux 14.04, 16.04 and 18.04).

    I have not and will not be freezing a build of Mono to run aspx in Homeseer.

    Onus should be on Microsoft Mono to fix this as it is working with a previous version of Mono (there are many bug #'s posted relating to this issue on the Mono forums).

    Pine64:/HomeSeer/html# lsb_release -a
    LSB Version: core-9.20170808ubuntu1-noarch:security-9.20170808ubuntu1-noarch
    Distributor ID: Ubuntu
    Description: Ubuntu 18.04.1 LTS
    Release: 18.04
    Codename: bionic

    Pine64:/HomeSeer/html# mono -V
    Mono JIT compiler version 5.12.0.301 (tarball Wed Jul 25 16:41:47 UTC 2018)
    SIGSEGV: normal
    Notifications: epoll
    Architecture: arm64
    Disabled: none
    Misc: softdebug
    Interpreter: yes
    LLVM: supported, not enabled.
    GC: sgen (concurrent by default)

    Test aspx shows:
    System.Web.Compilation.CompilationException
    Error VBNC30248: CHANGEME

    Description: Error compiling a resource required to service this request. Review your source file and modify it to fix this error.
    Details: error VBNC30248: CHANGEME
    Error origin: Compiler
    Error source file: ~/Global.asax
    Exception stack trace:
    Version Information: 5.12.0.301 (tarball Wed Jul 25 16:57:14 UTC 2018); ASP.NET Version: 4.0.30319.42000

    Last edited by Pete; August 4, 2018, 06:52 PM.

    Leave a comment:


  • MattL0
    replied
    Originally posted by mwolter View Post
    Upgrading SEL to Ubuntu 16.04 and Mono 5.0.1.1

    First up is upgrading your HomeTroller SEL from Libuntu 14.04 with Mono 3.2.8 to Ubuntu Server 64 bit with Mono 5.0.1.1. This was no easy task but with my notes, it should be much easier for you! These steps should work with the standard Linux version and possibly the Pi version as well.

    I have been playing around with scripting on HomeSeer and using TenScripting but noticed that Mono 3.2.8 uses an older version of VB .Net. After helping my Mother install her SEL I noticed that HS is now shipping it with Mono v5. So I decided to update the OS and Mono at the same time and did a complete rebuild of the system.

    I was able to save my devices, zwave info, most of the events and now my system appears to be faster as well. All functionality has been maintained. Linux Tools, updating HS through the web interface, plugin installation, lighthttpd (for disaster recovery) and also added support for proper HS shutdown from Linux. For Linux, I decided to go with a server version of Ubuntu and use Webmin for administration. If you have a Linux based HS system, I highly recommend Webmin. It's a very easy to use web-based administration for GUI file access and exiting, Linux logs, user administration and a whole lot more. Far better than VNC or any other remote access system IMO. I've used it on other work-related projects in the past and it was perfect for this.

    HS process startup was moved to a system service and can be properly started and stopped from within systemd. I used the screen method from one of Pete's scripts, modified and split in two. One for start-up and another for shutdown. Made a simple systemd script and it appears to be working perfectly. Through monitoring of systemd and HS logs everything is started and shutdown properly and the HS web-based startup and shutdown work as well. Events and device operation appear to be faster than before (if that's even possible).

    Be very careful which version of Mono you install. As I am aware, the only Mono versions 100% compatible with HS are 3.2.8 and 5.0.1.1.

    Systemd Scripts

    HomeSeer.service
    Code:
    [Unit]
    Description=HomeSeer Home Automation
    After=network.target
    
    [Service]
    Restart=on-failure
    RestartSec=30
    TimeoutStartSec=60
    Type=forking
    ExecStart=/usr/local/HomeSeer/HomeSeer_start.sh
    PIDFile=/usr/local/HomeSeer/HomeSeerScreen.pid
    ExecStop=/usr/local/HomeSeer/HomeSeer_stop.sh
    
    [Install]
    WantedBy=multi-user.target
    HomeSeer_start.sh
    Code:
    #!/bin/bash
    DIR='/usr/local/HomeSeer' # HomeSeer Directory
    NAME='HomeSeer' # Server handle for the screen session
    HSPID="$DIR/HomeSeer.pid" # HomeSeer Process ID
    PID="$DIR/HomeSeerScreen.pid" # Screen Process ID
    if [ "$(pgrep -cf "mono.+HSConsole")" -ge 1 ]; then # Test if HS is running
    echo -e "$NAME is already running."
    else # If not running start HS
    if [ "$(pgrep -cf "[S]CREEN.+${NAME}")" -ge 1 ]; then pkill -cf "[S]CREEN.+${NAME}"; fi # Stop screen if running
    /usr/bin/screen -dm -S $NAME # Start detached screen
    sleep 2
    /usr/bin/screen -S $NAME -X stuff "export LANG=en_US.UTF-8; echo 0403 c07f > /sys/bus/usb-
    serial/drivers/ftdi_sio/new_id; cd $DIR; mono $DIR/HSConsole.exe --log; exit^M" # Start HomeSeer
    sleep 2
    pgrep -f "mono.+HSConsole" > $HSPID # Obtain HomeSeer Process ID
    pgrep -f "[S]CREEN.+${NAME}" > $PID # Obtain screen Process ID
    [ -s $HSPID ] && echo "$NAME started." # If HSPID exists and the size is greater than zero, echo
    fi
    HomeSeer_stop.sh
    Code:
     #!/bin/bash
    HSPID='/usr/local/HomeSeer/HomeSeer.pid'
    PID='/usr/local/HomeSeer/HomeSeerScreen.pid'
    NAME='HomeSeer'
    if [ -f $HSPID ]; then # Test if PID file exists
    if [ -s $HSPID ]; then # Test if PID is not empty
    if [ "$(pgrep -cf "mono.+HSConsole")" -ge 1 ]; then # If HS is running
    for char in $(printf "\\r s h u t d o w n \\r") ; do #invoke shutdown command to homeseer screen instance...
    /usr/bin/screen -p 0 -S $NAME -X stuff "$char"
    sleep 0.1
    done
    fi
    for number in {1..4} ; do # Allow time for HS and plugins to gracefully shutdown
    sleep 10
    if [ "$(pgrep -cf "mono.+HSConsole")" -lt 1 ]; then break; fi # If HS has closed, stop waiting
    done
    if [ "$(pgrep -cf "mono.+HSConsole")" -ge 1 ]; then # Kill HS if it was not stopped gracefully
    echo -e "$NAME did not stop gacefully. Killing it"
    kill "$(cat $HSPID)"
    else
    echo -e "$NAME was stopped."
    fi
    if [ "$(pgrep -cf "[S]CREEN.+${NAME}")" -ge 1 ]; then /usr/bin/screen -S $NAME -X stuff "exit^M"; fi # Gracefully close screen if running
    fi
    rm -f $HSPID; rm -f $PID # Remove PID files
    else
    echo -e "$NAME is not running."
    fi
    So here you go, my notes in PDF. Please take a look and let me know if you find anything that needs correction.

    Change Log:
    180104: Updated PDF with auto reboot and importing events
    180107: Found aspx pages were not loading properly. Spent quite a bit of time on this. Tried going to a 32 bit version of linux. Tried installing other Mono related packages. In the end had to revert to Mono 5.0.1.1. Updated the PDF with several new steps regarding this.
    180203: Removed unnecessary lines and made systemd scripts available directly in the post to avoid formatting issues.
    I Think later build of mono are x64. Do you think the change from 32 to 64 bit mono is causing the issue with .aspx page? I dont really understand the .aspx bug on resent mono stable release.. but maybe trying to use the --arch=32 option to load aspx page would be an option..? or try forcing the --arch=32 option with hs3 entirely..somehow...on stable mono release?

    https://www.mono-project.com/docs/ab...eleases/5.2.0/

    Leave a comment:


  • mwolter
    replied

    Leave a comment:


  • Winnah9000
    replied
    Originally posted by mwolter View Post
    First up is upgrading your HomeTroller SEL from Libuntu 14.04 with Mono 3.2.8 to Ubuntu Server 64 bit with Mono 5.0.1.1. This was no easy task but with my notes, it should be much easier for you! These steps should work with the standard Linux version and possibly the Pi version as well.

    I have been playing around with scripting on HomeSeer and using TenScripting but noticed that Mono 3.2.8 uses an older version of VB .Net. After helping my Mother install her SEL I noticed that HS is now shipping it with Mono v5. So I decided to update the OS and Mono at the same time and did a complete rebuild of the system.

    I was able to save my devices, zwave info, most of the events and now my system appears to be faster as well. All functionality has been maintained. Linux Tools, updating HS through the web interface, plugin installation, lighthttpd (for disaster recovery) and also added support for proper HS shutdown from Linux. For Linux, I decided to go with a server version of Ubuntu and use Webmin for administration. If you have a Linux based HS system, I highly recommend Webmin. It's a very easy to use web-based administration for GUI file access and exiting, Linux logs, user administration and a whole lot more. Far better than VNC or any other remote access system IMO. I've used it on other work-related projects in the past and it was perfect for this.

    HS process startup was moved to a system service and can be properly started and stopped from within systemd. I used the screen method from one of Pete's scripts, modified and split in two. One for start-up and another for shutdown. Made a simple systemd script and it appears to be working perfectly. Through monitoring of systemd and HS logs everything is started and shutdown properly and the HS web-based startup and shutdown work as well. Events and device operation appear to be faster than before (if that's even possible).


    So here you go, my notes in PDF. Please take a look and let me know if you find anything that needs correction.

    Change Log:
    180104: Updated PDF with auto reboot and importing events
    180107: Found aspx pages were not loading properly. Spent quite a bit of time on this. Tried going to a 32 bit version of linux. Tried installing other Mono related packages. In the end had to revert to Mono 5.0.1.1. Updated the PDF with several new steps regarding this.
    180203: Removed unnecessary lines and made systemd scripts available directly in the post to avoid formatting issues.
    Your PDF has been extremely helpful for updating my Ubuntu 14 and Mono 3.2.8 to 16.04.4 and Mono 5.0.1.1. However, I'm running into an issue with the images not appearing in the web interface for HomeSeer.

    "Warning File does not exist: /usr/local/HomeSeer/html/images/HomeSeer/ui/settings.png"

    On just about every image in the web interface.

    Leave a comment:


  • Krumpy
    replied
    The HS Z2 image has speaker.exe started. So, it is possible and will research how they start it. No biggie.

    Yes, in reply to the previous person posting about serial ports changing their assignment in Linux. It appears to be a common issue with Linux. Research and you will find several posts about it. Kinda sad if you ask me. There is a work around that seems to be recommended. I played around with this years ago and will need to research again as I will be in the same boat with an installation that I am working on. Oh yeah, this happens with USB based serial ports. Apparently does not happen with regular serial ports.

    Leave a comment:


  • ptran0
    replied
    I'm running HS3 in Mint18.2.
    Annoy issue I have is USB Com port assignment inconsistent.
    example. Zwave stick is on dev/tty/USB0
    RFXcom dev/tty/USB1
    when restart the computer , USB port may or may not stay in the same port assign.

    Leave a comment:


  • mwolter
    replied
    Originally posted by Krumpy View Post
    Do you guys have any thoughts about running the speaker.exe under Linux? I guess my question is about how to spawn or launch the speaker.exe within the HomeSeer_start.sh file, etc.



    I probably could engineer something myself, but thought to ask for consistency..



    Thanks!!

    Leave a comment:


  • Krumpy
    replied
    Do you guys have any thoughts about running the speaker.exe under Linux? I guess my question is about how to spawn or launch the speaker.exe within the HomeSeer_start.sh file, etc.

    I probably could engineer something myself, but thought to ask for consistency..

    Thanks!!

    Leave a comment:


  • randman
    replied

    Leave a comment:


  • mwolter
    replied

    Leave a comment:


  • randman
    replied
    I was able to configure the homeseer user to start HomeSeer without having to do sudo. In addition to doing chown homeseer:root on all the HomeSeer files, I had to change the port in Settings.ini to use a higher port greater than 1024 (default is to use 80). If you don’t change the port setting, a web browser wouldn’t be able to connect to HomeSeer if it was started as a non-privileged user (like homeeeer).

    I think I prefer to run HomeSeer as a non-privileged user, especially on a machine that is reachable over the Internet.

    Leave a comment:


  • randman
    replied
    The document says to do chown homeseer:root, but it looks like the start script starts HomeSeer as root? If so, what would be the point of doing the chown?

    I figure there’s 2 ways to run HomeSeer:

    1. Do the chown homeseer:root on the HomeSeer directory and files/directories and then run HomeSeer as the homeseer user without doing sudo.

    OR

    2. Keep he HomeSeer fields/directories as owned by root and start HomeSeer as root.

    Option 1 is ideal, but not sure if there might in the future be some HomeSeer or plug-in functionality that assumes it has root privileges.

    Option 2 I know will work, but it’s generally best to not run software as root if possible.

    What do folks do?

    Leave a comment:


  • mwolter
    replied
    I just tried installing the latest version of Mono (5.8.0.108) and added the mono-xsp4 package and ASPX pages did not load.

    The error I received is below. This is the exact same error received from prior mono versions. So I'm not sure why this would be different for you. Are you using Ubuntu 16.04.3 x64 Server or a different distro?

    Code:
    System.Web.Compilation.CompilationException
    error VBNC30248: CHANGEME
    
    Description: Error compiling a resource required to service this request. Review your source file and modify it to fix this error.
    Details: error VBNC30248: CHANGEME
    Error origin: Compiler
    Error source file: ~/Global.asax
    Exception stack trace:
      at System.Web.Compilation.AssemblyBuilder.BuildAssembly (System.Web.VirtualPath virtualPath, System.CodeDom.Compiler.CompilerParameters options) [0x00312] in <52b8d38f1da445f7ad770be558c9fed4>:0 
      at System.Web.Compilation.AssemblyBuilder.BuildAssembly (System.Web.VirtualPath virtualPath) [0x00008] in <52b8d38f1da445f7ad770be558c9fed4>: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 <52b8d38f1da445f7ad770be558c9fed4>:0 
      at System.Web.Compilation.BuildManager.BuildInner (System.Web.VirtualPath vp, System.Boolean debug) [0x00106] in <52b8d38f1da445f7ad770be558c9fed4>:0 
    Version Information: 5.8.0.108 (tarball Fri Jan 19 18:15:21 UTC 2018); ASP.NET Version: 4.0.30319.42000
    Originally posted by Krumpy View Post
    Was the following package installed when you tried ASPX pages with mono? I followed the installation instructions from the mono web site and could not run ASPX pages even though I followed your process with 5.0.1.1. I then installed the following and ASPX pages worked. I would really encourage folks to test their mono installation before installing HomeSeer which can be done by following the examples on http://www.mono-project.com/docs/get...d/mono-basics/ web site.



    I do appreciate the document that you put together as it gave me a reference guide even though I did not follow it verbatim. The good thing here is that I learned a lot about Linux and getting around pretty well.

    Thank you also for updating the original post and adding the ability to copy/paste the HomeSeer_start.sh and HomeSeer_stop.sh scripts as it will help folks.

    Leave a comment:

Working...
X