Navigation

    • Register
    • Login
    • OpenHardware.io
    • Categories
    • Recent
    • Tags
    • Popular
    1. Home
    2. FlipFlap3
    • Profile
    • Following
    • Followers
    • Topics
    • Posts
    • Best
    • Groups

    FlipFlap3

    @FlipFlap3

    7
    Reputation
    14
    Posts
    477
    Profile views
    1
    Followers
    0
    Following
    Joined Last Online

    FlipFlap3 Follow

    Best posts made by FlipFlap3

    • OpenHAB 2.5 MySensors Serial Gateway - How to install

      [update 2018-03-03 for version 2.2]
      [update 2019-01-05 for version 2.4]
      [updates 2019-04 add esh-io-transport-mqtt (needed even for serial gateway) and stop debug mysensors]
      [updates 2020-02-25 update for zulu openjdk implementation and other minor adjustments]

      Preparing your raspberry with clean install:
      Download RASPBIAN STRETCH LITE from https://www.raspberrypi.org/downloads/raspbian/
      Flash to SD-Card with etcher (https://etcher.io/) or any other flash tool you like
      create empty "ssh" file in root on SD-Card
      Insert SD-Card into raspberry PI, connect with UTP cable to your router and power on.
      Go get some coffee
      Get IP address by pinging raspberrypi.local from commandprompt on your pc
      Start SSH session with putty to the raspberry pi
      Login as "pi" with password "raspberry"

      Initial configuration:
      sudo raspi-config
      Change your password
      Network options\Hostname Change hostname to "openhabpi" or what you want
      [optional: add wifi settings]
      Interfacing Options\SPI enable
      Advanced options\Expand the file system
      Advanced options\Memory split change the memory split for the GPU from "64" to “16”
      Finish + reboot
      sudo apt-get update
      sudo apt-get upgrade
      sudo apt-get install screen mc vim git htop

      Java installation: (updated 2020-02-25)
      echo "deb http://ppa.launchpad.net/webupd8team/java/ubuntu xenial main" | sudo tee /etc/apt/sources.list.d/webupd8team-java.list
      echo "deb-src http://ppa.launchpad.net/webupd8team/java/ubuntu xenial main" | sudo tee -a /etc/apt/sources.list.d/webupd8team-java.list
      sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys EEA14886
      sudo apt-get update
      sudo apt-get install oracle-java8-installer
      sudo apt-get install oracle-java8-set-default

      wget -q -O - http://repos.azulsystems.com/RPM-GPG-KEY-azulsystems | sudo tee /etc/apt/trusted.gpg.d/zulu.asc
      sudo echo 'deb http://repos.azulsystems.com/debian stable main' | sudo tee /etc/apt/sources.list.d/zulu.list
      sudo apt-get update
      sudo apt-get install zulu-embedded-8

      MySensors:
      git clone https://github.com/mysensors/MySensors.git --branch master
      cd MySensors

      [edit update 2019-01-05]
      sudo nano /home/pi/MySensors/examples_linux/mysgw.cpp

      Uncomment the where needed to make it look like this:

      // Config file
      #define MY_LINUX_CONFIG_FILE "/etc/mysensors.conf"
      
      // How many clients should be able to connect to this gateway (default 1)
      #define MY_GATEWAY_MAX_CLIENTS 10
      
      // Serial config
      // Enable this if you are using an Arduino connected to the USB
      #define MY_LINUX_SERIAL_PORT "/dev/ttyUSB0"
      // Enable this if you need to connect to a controller running on the same device
      // You also need to define MY_LINUX_SERIAL_PORT above with the symlink name for the PTY device
      #define MY_LINUX_SERIAL_IS_PTY
      // Grant access to the specified system group for the serial device
      #define MY_LINUX_SERIAL_GROUPNAME "tty"
      

      Save & close mysgw.cpp

      note: I have chosen channel 69 for the rf24 network. You can choose your own, but remember to use the same channel in your arduino sketches as you do here.

      ./configure --my-gateway=serial --my-serial-is-pty --my-rf24-channel=69 --my-transport=rf24 --my-serial-groupname=tty
      make
      sudo ./bin/mysgw --config-file /etc/mysensors.dat --daemon
      sudo make install
      sudo systemctl daemon-reload
      sudo systemctl enable mysgw.service
      sudo systemctl start mysgw.service

      OpenHAB2:
      wget -qO - 'https://bintray.com/user/downloadSubjectPublicKey?username=openhab' | sudo apt-key add -
      echo 'deb http://dl.bintray.com/openhab/apt-repo2 stable main' | sudo tee /etc/apt/sources.list.d/openhab2.list
      sudo apt-get update
      sudo apt-get install openhab2
      sudo apt-get install openhab2-addons
      sudo systemctl start openhab2.service
      sudo systemctl status openhab2.service
      sudo systemctl daemon-reload
      sudo systemctl enable openhab2.service

      Time for coffee again.......

      open web page select expert....

      sudo usermod -a -G dialout openhab
      sudo usermod -a -G tty openhab

      cd /usr/share/openhab2/addons/
      sudo wget http://www.oberfoell.com/openhab2/org.openhab.binding.mysensors-2.5.0-SNAPSHOT.jar
      sudo chown openhab:openhab org.openhab.binding.mysensors-2.5.0-SNAPSHOT.jar
      ssh -p 8101 openhab@localhost (used to fail the first time, but works now at the first attempt)
      pw:habopen
      feature:install openhab-transport-serial
      feature:install openhab-core-io-transport-mqtt
      log:set DEBUG org.openhab.binding.mysensors
      log:tail

      sudo reboot

      Finally:
      web-> paperui/things add MySensors Serial Gateway
      settings:
      Serial Port: /dev/ttyUSB0
      Send Delay: 200
      Baudrate: 115200
      Skip startup connection check: true

      All done. Good luck!

      When all is working well, you can stop debugging mysensors this will help to reduce the log files.
      //start karaf
      ssh -p 8101 openhab@localhost
      //enter password
      habopen
      // stop debugging mysensors and switch to only registring events
      log:set INFO org.openhab.binding.mysensors
      // close karaf
      <ctrl>D

      For further reducing logs you can add them to logrotate

      posted in OpenHAB
      FlipFlap3
      FlipFlap3
    • RE: OpenHAB 2.5 MySensors Serial Gateway - How to install

      @nizoo91 Just found out myself as well that this was missing. Thanks!

      posted in OpenHAB
      FlipFlap3
      FlipFlap3
    • RE: OpenHAB 2.5 MySensors Serial Gateway - How to install

      solved it

      Inside "/home/pi/MySensors/example_linux/mysgw.cpp" or where you downloaded the "git clone https://github.com/mysensors/MySensors.git --branch master" there is this option:

      // Grant access to the specified system group for the serial device
      //#define MY_LINUX_SERIAL_GROUPNAME "tty"

      uncomment to
      // Grant access to the specified system group for the serial device
      #define MY_LINUX_SERIAL_GROUPNAME "tty"

      save file

      stop mysgw with "sudo systemctl stop mysgw.service"
      remove mysgw from auto start with "sudo systemctl disable mysgw.service"
      uninstall with "sudo make uninstall"
      installed again

      I added openhab to the tty group using "sudo usermod -a -G tty openhab"

      full reboot

      and it works!

      posted in OpenHAB
      FlipFlap3
      FlipFlap3
    • RE: OpenHAB 2.5 MySensors Serial Gateway - How to install

      @jic Nope sry, BUT.. I am going to do a fresh install again today. Will check if I can get it to work and make updates to this howto where needed.

      posted in OpenHAB
      FlipFlap3
      FlipFlap3

    Latest posts made by FlipFlap3

    • RE: OpenHAB 2.5 MySensors Serial Gateway - How to install

      Updated to OpenHAB 2.5 with step-by-step instructions
      switched to Zulu Java

      posted in OpenHAB
      FlipFlap3
      FlipFlap3
    • RE: OpenHAB 2.5 MySensors Serial Gateway - How to install

      @nizoo91 Just found out myself as well that this was missing. Thanks!

      posted in OpenHAB
      FlipFlap3
      FlipFlap3
    • RE: OpenHAB 2.5 MySensors Serial Gateway - How to install

      @joaoabs

      I had to re-install myself and found my how to wasn't 100% correct for OpenHAB 2.4 so I updated it.

      Works with OpenHAB 2.4 and @TimO 's 2.4 jar. Kudos to him for this!

      posted in OpenHAB
      FlipFlap3
      FlipFlap3
    • RE: Beginner totally lost during installation of serial gateway

      https://forum.mysensors.org/topic/6694/openhab-2-2-mysensors-serial-gateway-how-to-install

      No need to have a 2nd arduino connected through usb. Just attach a nrf chip directly to your pi

      posted in OpenHAB
      FlipFlap3
      FlipFlap3
    • RE: OpenHAB 2.5 MySensors Serial Gateway - How to install

      @greymarvel said in OpenHAB 2.2 MySensors Serial Gateway - How to install:

      @FlipFlap3
      Firstly well done for the brilliant instructions . I too have been attempting to use Openhab with my sensors over the last year and to be honest although I've had relative success, because of the limited amount of, up to date and accurate tutorials its been a steep slope to climb. Currently I have Openhabian installed on a Raspberry pi with a Gateway connected to the I/O pins of the Pi and a couple of temp sensors connected ( all be it with difficulty ). It's setup as an Ethernet Gateway but I did try once to setup it up as a serial gateway, unsuccessfully I might add. Out of interest if I did re- install using your setup instructions, Is a serial Gateway better or easier in any way ? it does seem like the most supported option of the 3 for most people on the forum .

      Thanks

      Sorry for late response (busy with anual reporting lately).

      I have tried MTTQ first myself, but I didn't get things working smoothly. 2nd attempt was with serial gateway. Even though I had some problems at first, I did manage to get it working. I had a hard time finding a good tutorial though, so I wrote down the steps I took carefully. Reason for me to put it here was to have a personal backup for my notes and if it would be helpful for anyone else that would be an awesome bonus 😉

      I didn't try ethernet gateway yet cause I am happy with the current setup.

      posted in OpenHAB
      FlipFlap3
      FlipFlap3
    • RE: OpenHAB 2.5 MySensors Serial Gateway - How to install

      @frozenyack Sorry, I can't remember seeing an error like that before.

      posted in OpenHAB
      FlipFlap3
      FlipFlap3
    • RE: What does a newbie need to integrate sensors with OpenHab?

      A year ago I tried to get some sensors going for the first time. Tried mqtt 1st, but failed. 2nd was serial. That worked. In the end it doesnt matter. When it works, you don't have to look at it anymore. You can just power up new sensors and they will pop up in OpenHAB.

      posted in OpenHAB
      FlipFlap3
      FlipFlap3
    • RE: What does a newbie need to integrate sensors with OpenHab?

      Since you attached a nrf24 directly to your pi, I presume you have all your sensors connected eith nrf24 as well.
      You could use a serial gateway. I updated my documentation yesterday on how I do it. You can find it on the same sub forum you posted this.

      posted in OpenHAB
      FlipFlap3
      FlipFlap3
    • RE: OpenHAB 2.5 MySensors Serial Gateway - How to install

      2.3 snapshot doesn't work. 2.2 does

      Updated opening post for step by step instruction on installing openhab2.2 with mysensors 2.2 serial gateway binding. If you have any questions, just post them here.

      posted in OpenHAB
      FlipFlap3
      FlipFlap3
    • RE: OpenHAB 2.5 MySensors Serial Gateway - How to install

      @jic Nope sry, BUT.. I am going to do a fresh install again today. Will check if I can get it to work and make updates to this howto where needed.

      posted in OpenHAB
      FlipFlap3
      FlipFlap3