Skip to content
  • MySensors
  • OpenHardware.io
  • Categories
  • Recent
  • Tags
  • Popular
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo
  1. Home
  2. Controllers
  3. OpenHAB
  4. Serial Gateway connection to Openhab

Serial Gateway connection to Openhab

Scheduled Pinned Locked Moved OpenHAB
development ope
86 Posts 16 Posters 81.1k Views 10 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • T TimO

    @CARSTEN I've compiled a modified version of the OpenHab Serial binding with a baud rate of 115200 as this is standard in mysensors.

    Download: org.openhab.binding.serial_1.6.0.201411271703.jar

    As @tboha suggested you currently have to manage all commands by yourself.

    I've attached my modified serial binding here. Please be aware, that all other configurations that depend on serial binding won't work with the modified version, because of the changed baud rate.

    I'm currently testing with this Serial Gateway:

    Serial Gateway

    Here is my OpenHab configuration for simple testing:

    demo.items: demo.items
    demo.rules: demo.rules
    demo.sitemap: demo.sitemap

    E Offline
    E Offline
    ewgor
    wrote on last edited by
    #52

    @TimO hi here too,

    cant test this version because i get this error regarding DHT:
    Arduino: 1.5.8 (Windows 7), Board: "Arduino Uno"

    RelayActuator.ino:21:5: error: no matching function for call to 'DHT::DHT()'
    RelayActuator.ino:21:5: note: candidates are:
    In file included from RelayActuator.ino:6:0:
    D:\Kit\Arduino\libraries\DHT/DHT.h:40:4: note: DHT::DHT(uint8_t, uint8_t, uint8_t)
    DHT(uint8_t pin, uint8_t type, uint8_t count=6);
    ^
    D:\Kit\Arduino\libraries\DHT/DHT.h:40:4: note: candidate expects 3 arguments, 0 provided
    D:\Kit\Arduino\libraries\DHT/DHT.h:38:7: note: DHT::DHT(const DHT&)
    class DHT {
    ^
    D:\Kit\Arduino\libraries\DHT/DHT.h:38:7: note: candidate expects 1 argument, 0 provided
    RelayActuator.ino: In function 'void setup()':
    RelayActuator.ino:48:7: error: 'class DHT' has no member named 'setup'
    RelayActuator.ino: In function 'void updateHumidityTemp()':
    RelayActuator.ino:72:26: error: 'class DHT' has no member named 'getHumidity'
    RelayActuator.ino:84:27: error: 'class DHT' has no member named 'getTemperature'
    RelayActuator.ino:90:25: error: 'class DHT' has no member named 'toFahrenheit'
    Error compiling.

    This report would have more information with
    "Show verbose output during compilation"
    enabled in File > Preferences.
    i have downloaded all needed libraries from here http://www.mysensors.org/download/ but cant compile!
    do i need ther DHT library?
    thanks!

    1 Reply Last reply
    0
    • T Offline
      T Offline
      TimO
      Hero Member
      wrote on last edited by
      #53

      @ewgor Hi!

      Using OpenHAB (1.X) with MySensors is a long and at the beginning frustrating process as OpenHAB itself don't support MySensors out of the box. I hope I'm able to change that with OpenHAB 2.0.

      1. OpenHAB 1.7.0 is stable. You don't have to use the snapshot release. But that won't solve your problems.

      2. You just need the serial binding from the addons. Copy "org.openhab.binding.serial-1.7.0-SNAPSHOT.jar" to "OPENHAB-HOME/addons". But I suppose you already did that, because of the error "Error opening serial port 'COM4'.

      3. https://github.com/openhab/openhab/wiki/Serial-Binding according to this "COM4@115200" should work fine. I've not tested it with windows yes. This is your main problem. Don't try to go further, nothing will work. Are you able to open the serial monitor in the Arduino Development Environment? With the correct baudrate you should see something like "Gateway startup complete".

      4. You're Arduino Development Environment can't find the libraries. I've extracted all libraries to "C:\Users\myUser\Documents\Arduino\libraries". It now looks like:

      
      Adafruit_BMP085
      BH1750
      Bounce2
      ...
      DHT
      ...
      MySensors
      ...
      

      The DHT library is part of the file you downloaded.

      E 1 Reply Last reply
      0
      • T TimO

        @ewgor Hi!

        Using OpenHAB (1.X) with MySensors is a long and at the beginning frustrating process as OpenHAB itself don't support MySensors out of the box. I hope I'm able to change that with OpenHAB 2.0.

        1. OpenHAB 1.7.0 is stable. You don't have to use the snapshot release. But that won't solve your problems.

        2. You just need the serial binding from the addons. Copy "org.openhab.binding.serial-1.7.0-SNAPSHOT.jar" to "OPENHAB-HOME/addons". But I suppose you already did that, because of the error "Error opening serial port 'COM4'.

        3. https://github.com/openhab/openhab/wiki/Serial-Binding according to this "COM4@115200" should work fine. I've not tested it with windows yes. This is your main problem. Don't try to go further, nothing will work. Are you able to open the serial monitor in the Arduino Development Environment? With the correct baudrate you should see something like "Gateway startup complete".

        4. You're Arduino Development Environment can't find the libraries. I've extracted all libraries to "C:\Users\myUser\Documents\Arduino\libraries". It now looks like:

        
        Adafruit_BMP085
        BH1750
        Bounce2
        ...
        DHT
        ...
        MySensors
        ...
        

        The DHT library is part of the file you downloaded.

        E Offline
        E Offline
        ewgor
        wrote on last edited by
        #54

        @TimO thanks for reply,

        1. first shot was with Openhab 1.7.0 from here http://www.openhab.org/downloads.html and than i followed your link from here https://openhab.ci.cloudbees.com/job/openHAB/ and tried with the SNAPSHOT 1.8.0 version, both of them works and i can test different examples from here with my laptop and 2 smartphones.
        2. every time i try a server, i have 2 folders with as follows: 1 folder is the original addons folder wich is empty and another one as a copy like addons1 in which i extracted all addons. Before starting the server i copy the needed addon (.jar file) in the original folder named addons, in my case the serial.jar.
        3. if the server is not started i can compile the SerialGateway code and i can upload it too into my arduino. The problem si that when i open the serial monitor of arduino IDE i get some strange chars like: \Ú or LÊ or Lœ and this is happening every time i open the serial monitor. I think is a baudrate problem but i cant see where in the SerialGateway sketch i can change this baudrate or should i change it directly in the library? By the way, can you please tell me, why its not working with different baudrates?
        4. i have all libraries from here http://www.mysensors.org/download/ copied and pasted directly in my arduino libraries folder which in my case is in D/kit/arduino/libraries. For DHT i have DHT library / DHT tester! Do i need other library? i Know i tested a sketch for DHT11 and an LCD and it worked.

        However, if i have the server started on my laptop its impossible to compile the SerialGateway sketch and i receive this error posted above. I even can't upload the sketch if i close the server, i need to restart my PC....

        Maybe it would be a beeter sollution to use Mqtt because i have a wiznet w5100 and a ENC28J60 ethernet module but the problem is (i asked somewhere here on the forum) that i cannot use or test Mosquitto broker, and so i cannot test a Mqtt connection. I downloaded the broker from the original page for my system, i have it installed on windows but i cannot access any of the .exe files because of some missing dll. After days of searching and a lot of struggling i got the dll's but didn't start because of some unexpected error! I know this is the subject of another topic but i didn't get a reply there so i ask here...
        If i cannot test a server on my machine how to purchase a RPI and moreover i never had a RPI so you can imagine how many problems i will face. Anyhow, this is my intention, to buy a RPI and to have a permanent installation.
        Don't know what to do .... :(((

        1 Reply Last reply
        0
        • T Offline
          T Offline
          TimO
          Hero Member
          wrote on last edited by
          #55

          Ok, I think we're getting closer.
          So, If you see strange chars in the serial monitor the baud rate of the serial monitor isn't right. Just change the baud rate in the serial monitor, it's a dropdown at the bottom right. If you set it to 115200 baud it should work (Gateway startup complete).

          The 115.200 is a fixed baud rate MySensors uses. It is faster than 9600 and the serial communication could be the bottleneck. In the MySensors library it is defined in MySensors.h. You may change that, but that won't help.

          I suppose you have a blocking issue, since both Arduino IDE and OpenHAB try to use the COM port. Try to make sure only one application at a time is running and using the port. At least OpenHAB should throw an error that the COM port is blocked. I'm not sure how Windows handles blocking.

          If you see "Gateway startup complete" in the Arduino IDE / serial monitor, close the Arduino IDE (and the serial monitor) and fire up OpenHAB with debugging enabled (start_debug.bat). Post everything the serial binding throws out here.

          Can't help you with MQTT because I haven't used it yet.

          E 1 Reply Last reply
          0
          • E Offline
            E Offline
            ewgor
            wrote on last edited by
            #56

            I changed the baud rate to 115200 and now it says "0;0;3;0;9;check wires" on both Arduino (Uno and Mega). I think i saw a topic here somewhere, do i need to change some pins in the SerialGateway sketch?

            1 Reply Last reply
            0
            • T Offline
              T Offline
              TimO
              Hero Member
              wrote on last edited by
              #57

              Check the connections between NRF24L01+ and Arduino Uno.

              In case of the Arduino Mega you have to change the sketch (CE/CSN Pin), just search the forum for an example.

              1 Reply Last reply
              0
              • E Offline
                E Offline
                ewgor
                wrote on last edited by
                #58

                I dont have any NRF24L01 in myhouse! what is this device? do i have to buy one to see this SerialGateway working between my PC and my Arduino board?
                For my Mega ive searched on the the forum but i dont understand how to change the CE/CSN pin ...
                I asked on some other topic but no answer.

                1 Reply Last reply
                0
                • tbowmoT Offline
                  tbowmoT Offline
                  tbowmo
                  Admin
                  wrote on last edited by
                  #59

                  @ewgor

                  Have you read this page ?

                  and this one.

                  NRF24L01 is the essentially the heart of the mysensors system, it's the radio which it's build uppon.

                  E 1 Reply Last reply
                  0
                  • tbowmoT tbowmo

                    @ewgor

                    Have you read this page ?

                    and this one.

                    NRF24L01 is the essentially the heart of the mysensors system, it's the radio which it's build uppon.

                    E Offline
                    E Offline
                    ewgor
                    wrote on last edited by
                    #60

                    @tbowmo yes i did, only is just i didnt understand that the NRF24L01 is a must! I already ordered a piece and in a few days i'll be able to test either the Serial Gateway or the Ethernet Gateway....

                    1 Reply Last reply
                    0
                    • T TimO

                      Ok, I think we're getting closer.
                      So, If you see strange chars in the serial monitor the baud rate of the serial monitor isn't right. Just change the baud rate in the serial monitor, it's a dropdown at the bottom right. If you set it to 115200 baud it should work (Gateway startup complete).

                      The 115.200 is a fixed baud rate MySensors uses. It is faster than 9600 and the serial communication could be the bottleneck. In the MySensors library it is defined in MySensors.h. You may change that, but that won't help.

                      I suppose you have a blocking issue, since both Arduino IDE and OpenHAB try to use the COM port. Try to make sure only one application at a time is running and using the port. At least OpenHAB should throw an error that the COM port is blocked. I'm not sure how Windows handles blocking.

                      If you see "Gateway startup complete" in the Arduino IDE / serial monitor, close the Arduino IDE (and the serial monitor) and fire up OpenHAB with debugging enabled (start_debug.bat). Post everything the serial binding throws out here.

                      Can't help you with MQTT because I haven't used it yet.

                      E Offline
                      E Offline
                      ewgor
                      wrote on last edited by ewgor
                      #61
                      This post is deleted!
                      1 Reply Last reply
                      0
                      • E Offline
                        E Offline
                        ewgor
                        wrote on last edited by ewgor
                        #62

                        i solved the problem with DHT, now i need to know how to configure Openhab in order to see the the gateway. I changed the COM in items already.
                        In order to test your sketch that one with DHT and 2 realys what should i do? do i need 2 arduinos: one as a gateway and 2nd as a node point? how many nRF modules do i need?
                        Now i have nRF24L01 but i dont know how to make it work with OpenHAB
                        In addons i have org.openhab.binding.serial-1.7.0.jar
                        Any help please?
                        Thanks.

                        1 Reply Last reply
                        0
                        • E Offline
                          E Offline
                          ewgor
                          wrote on last edited by ewgor
                          #63

                          Anyone, any idea how to test the serial gateway? At this point on the serial monitor i get 0;0;3;0;14;Gateway startup complete. How to test it with Openhab? PLS HELP :)
                          For gateway im using a UNO and i try to have my mega as a node point. If i use Arduino Mega as a gateway its ok, i couldnt find any connection scheme for the node point (mega or uno). Right now i see on the serial monitor of the node point check wires and on the gateway startup complete! Where is the problem? how to connect the node point with my relays and what should i see on the serial monitor? Again somebody pls help me understand how to test it with Openhab?

                          1 Reply Last reply
                          0
                          • T Offline
                            T Offline
                            TimO
                            Hero Member
                            wrote on last edited by
                            #64

                            For the Arduino Mega you have to change the connections. Check out this thread:

                            http://forum.mysensors.org/topic/249/arduino-mega-sensor-shield-2

                            When the "node point" starts up fine you should see a lot of messages coming on the serial monitor of the gateway. Then the communication between both nodes is working.

                            E 1 Reply Last reply
                            0
                            • T TimO

                              For the Arduino Mega you have to change the connections. Check out this thread:

                              http://forum.mysensors.org/topic/249/arduino-mega-sensor-shield-2

                              When the "node point" starts up fine you should see a lot of messages coming on the serial monitor of the gateway. Then the communication between both nodes is working.

                              E Offline
                              E Offline
                              ewgor
                              wrote on last edited by
                              #65

                              @TimO with your help again i managed to find the right pins on my mega and now with my dht11 connected i get the temp and hum values constantly. On the server side when i start the bat file or sh file i get the values on the node serial monitor but nothing apears on the localhost.
                              there are any changes that needs to be done in the items, rules or the sitemap?
                              thanks for replay.

                              1 Reply Last reply
                              0
                              • E Offline
                                E Offline
                                ewgor
                                wrote on last edited by ewgor
                                #66

                                today, trying to make it work i discovered that if i start the Openhab server i get the DHT11 values on the server and i can access the serial monitor of the node point but when i switch the arduino IDE to the serial gateway com4 i get this errors on the arduino IDE and i cannot acces the serial monitor:

                                Arduino: 1.5.8 (Windows 7), Board: "Arduino Mega or Mega 2560, ATmega2560 (Mega 2560)"
                                
                                processing.app.SerialException: Error opening serial port 'COM4'.
                                
                                	at processing.app.Serial.<init>(Serial.java:145)
                                
                                	at processing.app.Serial.<init>(Serial.java:90)
                                
                                	at processing.app.SerialMonitor.open(SerialMonitor.java:93)
                                
                                	at processing.app.Editor.handleSerial(Editor.java:2537)
                                
                                	at processing.app.EditorToolbar.mousePressed(EditorToolbar.java:357)
                                
                                	at java.awt.Component.processMouseEvent(Unknown Source)
                                
                                	at javax.swing.JComponent.processMouseEvent(Unknown Source)
                                
                                	at java.awt.Component.processEvent(Unknown Source)
                                
                                	at java.awt.Container.processEvent(Unknown Source)
                                
                                	at java.awt.Component.dispatchEventImpl(Unknown Source)
                                
                                	at java.awt.Container.dispatchEventImpl(Unknown Source)
                                
                                	at java.awt.Component.dispatchEvent(Unknown Source)
                                
                                	at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
                                
                                	at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
                                
                                	at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
                                
                                	at java.awt.Container.dispatchEventImpl(Unknown Source)
                                
                                	at java.awt.Window.dispatchEventImpl(Unknown Source)
                                
                                	at java.awt.Component.dispatchEvent(Unknown Source)
                                
                                	at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
                                
                                	at java.awt.EventQueue.access$200(Unknown Source)
                                
                                	at java.awt.EventQueue$3.run(Unknown Source)
                                
                                	at java.awt.EventQueue$3.run(Unknown Source)
                                
                                	at java.security.AccessController.doPrivileged(Native Method)
                                
                                	at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
                                
                                	at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
                                
                                	at java.awt.EventQueue$4.run(Unknown Source)
                                
                                	at java.awt.EventQueue$4.run(Unknown Source)
                                
                                	at java.security.AccessController.doPrivileged(Native Method)
                                
                                	at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
                                
                                	at java.awt.EventQueue.dispatchEvent(Unknown Source)
                                
                                	at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
                                
                                	at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
                                
                                	at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
                                
                                	at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
                                
                                	at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
                                
                                	at java.awt.EventDispatchThread.run(Unknown Source)
                                
                                Caused by: jssc.SerialPortException: Port name - COM4; Method name - openPort(); Exception type - Port busy.
                                
                                	at jssc.SerialPort.openPort(SerialPort.java:164)
                                
                                	at processing.app.Serial.<init>(Serial.java:141)
                                
                                	... 35 more
                                
                                Error opening serial port 'COM4'.
                                
                                  This report would have more information with
                                  "Show verbose output during compilation"
                                  enabled in File > Preferences.
                                
                                

                                On the serial monitor of the node point i receive this:

                                repeater started, id 101
                                send: 101-101-0-0 s=255,c=0,t=18,pt=0,l=5,st=ok:1.4.1
                                send: 101-101-0-0 s=255,c=3,t=6,pt=1,l=1,st=ok:0
                                send: 101-101-0-0 s=255,c=3,t=11,pt=0,l=5,st=ok:Relay
                                send: 101-101-0-0 s=255,c=3,t=12,pt=0,l=3,st=ok:1.0
                                send: 101-101-0-0 s=1,c=0,t=3,pt=0,l=0,st=fail:
                                send: 101-101-0-0 s=2,c=0,t=3,pt=0,l=0,st=ok:
                                send: 101-101-0-0 s=0,c=0,t=7,pt=0,l=0,st=ok:
                                send: 101-101-0-0 s=1,c=0,t=6,pt=0,l=0,st=ok:
                                Failed reading humidity from DHT
                                Failed reading temperature from DHT
                                Failed reading temperature from DHT
                                Failed reading temperature from DHT
                                Failed reading temperature from DHT
                                Failed reading temperature from DHT
                                Failed reading temperature from DHT
                                Failed reading temperature from DHT
                                Failed reading temperature from DHT
                                Failed reading temperature from DHT
                                Failed reading temperature from DHT
                                Failed reading temperature from DHT
                                Failed reading temperature from DHT
                                Failed reading temperature from DHT
                                Failed reading temperature from DHT
                                Failed reading temperature from DHT
                                Failed reading temperature from DHT
                                Failed reading temperature from DHT
                                Failed reading temperature from DHT
                                Failed reading temperature from DHT
                                Failed reading temperature from DHT
                                Failed reading temperature from DHT
                                Failed reading temperature from DHT
                                Failed reading temperature from DHT
                                Failed reading temperature from DHT
                                Failed reading temperature from DHT
                                Failed reading temperature from DHT
                                Failed reading temperature from DHT
                                Failed reading temperature from DHT
                                Failed reading temperature from DHT
                                Failed reading temperature from DHT
                                Failed reading temperature from DHT
                                Failed reading temperature from DHT
                                Failed reading temperature from DHT
                                Failed reading temperature from DHT
                                Failed reading temperature from DHT
                                Failed reading temperature from DHT
                                Failed reading temperature from DHT
                                Failed reading temperature from DHT
                                Failed reading temperature from DHT
                                Failed reading temperature from DHT
                                Failed reading temperature from DHT
                                Failed reading temperature from DHT
                                Failed reading temperature from DHT
                                Failed reading temperature from DHT
                                Failed reading temperature from DHT
                                Failed reading temperature from DHT
                                Failed reading temperature from DHT
                                Failed reading temperature from DHT
                                Failed reading temperature from DHT
                                Failed reading temperature from DHT
                                Failed reading temperature from DHT
                                Failed reading temperature from DHT
                                Failed reading temperature from DHT
                                Failed reading temperature from DHT
                                Failed reading temperature from DHT
                                Failed reading temperature from DHT
                                Failed reading temperature from DHT
                                Failed reading temperature from DHT
                                Failed reading temperature from DHT
                                Failed reading temperature from DHT
                                Failed reading temperature from DHT
                                Failed reading temperature from DHT
                                Failed reading temperature from DHT
                                Failed reading temperature from DHT
                                Failed reading temperature from DHT
                                Failed reading temperature from DHT
                                Failed reading temperature from DHT
                                Failed reading temperature from DHT
                                Failed reading temperature from DHT
                                Failed reading temperature from DHT
                                Failed reading temperature from DHT
                                Failed reading temperature from DHT
                                Failed reading temperature from DHT
                                Failed reading temperature from DHT
                                Failed reading temperature from DHT
                                Failed reading temperature from DHT
                                Failed reading temperature from DHT
                                Failed reading temperature from DHT
                                Failed reading temperature from DHT
                                Failed reading temperature from DHT
                                Failed reading temperature from DHT
                                Failed reading temperature from DHT
                                Failed reading temperature from DHT
                                Failed reading temperature from DHT
                                Failed reading temperature from DHT
                                Failed reading temperature from DHT
                                Failed reading temperature from DHT
                                Failed reading temperature from DHT
                                Failed reading temperature from DHT
                                Failed reading temperature from DHT
                                Failed reading temperature from DHT
                                Failed reading temperature from DHT
                                Failed reading temperature from DHT
                                Failed reading temperature from DHT
                                Failed reading temperature from DHT
                                Failed reading temperature from DHT
                                Failed reading temperature from DHT
                                Failed reading temperature from DHT
                                Failed reading temperature from DHT
                                Failed reading temperature from DHT
                                Failed reading temperature from DHT
                                Failed reading temperature from DHT
                                Failed reading temperature from DHT
                                Failed reading temperature from DHT
                                Failed reading temperature from DHT
                                Failed reading temperature from DHT
                                Failed reading temperature from DHT
                                Failed reading temperature from DHT
                                Failed reading temperature from DHT
                                Failed reading temperature from DHT
                                Failed reading temperature from DHT
                                Failed reading temperature from DHT
                                Failed reading temperature from DHT
                                Failed reading temperature from DHT
                                Failed reading temperature from DHT
                                Failed reading temperature from DHT
                                Failed reading temperature from DHT
                                Failed reading temperature from DHT
                                Failed reading temperature from DHT
                                Failed reading temperature from DHT
                                Failed reading temperature from DHT
                                Failed reading temperature from DHT
                                Failed reading temperature from DHT
                                Failed reading temperature from DHT
                                Failed reading temperature from DHT
                                Failed reading temperature from DHT
                                Failed reading temperature from DHT
                                Failed reading temperature from DHT
                                Failed reading temperature from DHT
                                Failed reading temperature from DHT
                                Failed reading temperature from DHT
                                Failed reading temperature from DHT
                                Failed reading temperature from DHT
                                Failed reading temperature from DHT
                                Failed reading temperature from DHT
                                Failed reading temperature from DHT
                                Failed reading temperature from DHT
                                Failed reading temperature from DHT
                                Failed reading temperature from DHT
                                Failed reading temperature from DHT
                                Failed reading temperature from DHT
                                Failed reading temperature from DHT
                                Failed reading temperature from DHT
                                Failed reading temperature from DHT
                                Failed reading temperature from DHT
                                Failed reading temperature from DHT
                                Failed reading temperature from DHT
                                Failed reading temperature from DHT
                                Failed reading temperature from DHT
                                Failed reading temperature from DHT
                                Failed reading temperature from DHT
                                Failed reading temperature from DHT
                                Failed reading temperature from DHT
                                Failed reading temperature from DHT
                                Failed reading temperature from DHT
                                Failed reading temperature from DHT
                                Failed reading temperature from DHT
                                Failed reading temperature from DHT
                                Failed reading temperature from DHT
                                Failed reading temperature from DHT
                                Failed reading temperature from DHT
                                Failed reading temperature from DHT
                                Failed reading temperature from DHT
                                Failed reading temperature from DHT
                                Failed reading temperature from DHT
                                Failed reading temperature from DHT
                                Failed reading temperature from DHT
                                Failed reading temperature from DHT
                                Failed reading temperature from DHT
                                Failed reading temperature from DHT
                                Failed reading temperature from DHT
                                Failed reading temperature from DHT
                                Failed reading temperature from DHT
                                Failed reading temperature from DHT
                                Failed reading temperature from DHT
                                Failed reading temperature from DHT
                                Failed reading temperature from DHT
                                Failed reading temperature from DHT
                                Failed reading temperature from DHT
                                Failed reading temperature from DHT
                                Failed reading temperature from DHT
                                Failed reading temperature from DHT
                                Failed reading temperature from DHT
                                Failed reading temperature from DHT
                                Failed reading temperature from DHT
                                Failed reading temperature from DHT
                                Failed reading temperature from DHT
                                Failed reading temperature from DHT
                                Failed reading temperature from DHT
                                Failed reading temperature from DHT
                                Failed reading temperature from DHT
                                Failed reading temperature from DHT
                                Failed reading temperature from DHT
                                Failed reading temperature from DHT
                                Failed reading temperature from DHT
                                Failed reading temperature from DHT
                                Failed reading temperature from DHT
                                Failed reading temperature from DHT
                                Failed reading temperature from DHT
                                Failed reading temperature from DHT
                                Failed reading temperature from DHT
                                Failed reading temperature from DHT
                                Failed reading temperature from DHT
                                Failed reading temperature from DHT
                                Failed reading temperature from DHT
                                Failed reading temperature from DHT
                                Failed reading temperature from DHT
                                Failed reading temperature from DHT
                                Failed reading temperature from DHT
                                Failed reading temperature from DHT
                                Failed reading temperature from DHT
                                Failed reading temperature from DHT
                                Failed reading temperature from DHT
                                Failed reading temperature from DHT
                                Failed reading temperature from DHT
                                Failed reading temperature from DHT
                                Failed reading temperature from DHT
                                Failed reading temperature from DHT
                                Failed reading temperature from DHT
                                Failed reading temperature from DHT
                                Failed reading temperature from DHT
                                Failed reading temperature from DHT
                                Failed reading temperature from DHT
                                Failed reading temperature from DHT
                                Failed reading temperature from DHT
                                Failed reading temperature from DHT
                                Failed reading temperature from DHT
                                Failed reading temperature from DHT
                                Failed reading temperature from DHT
                                Failed reading temperature from DHT
                                Failed reading temperature from DHT
                                Failed reading temperature from DHT
                                Failed reading temperature from DHT
                                Failed reading temperature from DHT
                                Failed reading temperature from DHT
                                Failed reading temperature from DHT
                                Failed reading temperature from DHT
                                Failed reading temperature from DHT
                                Failed reading temperature from DHT
                                Failed reading temperature from DHT
                                Failed reading temperature from DHT
                                Failed reading temperature from DHT
                                Failed reading temperature from DHT
                                Failed reading temperature from DHT
                                Failed reading temperature from DHT
                                Failed reading temperature from DHT
                                Failed reading temperature from DHT
                                Failed reading temperature from DHT
                                Failed reading temperature from DHT
                                Failed reading temperature from DHT
                                Failed reading temperature from DHT
                                Failed reading temperature from DHT
                                Failed reading temperature from DHT
                                Failed reading temperature from DHT
                                Failed reading temperature from DHT
                                Failed reading temperature from DHT
                                Failed reading temperature from DHT
                                Failed reading temperature from DHT
                                Failed reading temperature from DHT
                                Failed reading temperature from DHT
                                Failed reading temperature from DHT
                                Failed reading temperature from DHT
                                Failed reading temperature from DHT
                                Failed reading temperature from DHT
                                Failed reading temperature from DHT
                                Failed reading temperature from DHT
                                Failed reading temperature from DHT
                                Failed reading temperature from DHT
                                Failed reading temperature from DHT
                                Failed reading temperature from DHT
                                Failed reading temperature from DHT
                                Failed reading temperature from DHT
                                Failed reading temperature from DHT
                                Failed reading temperature from DHT
                                Failed reading temperature from DHT
                                Failed reading temperature from DHT
                                Failed reading temperature from DHT
                                Failed reading temperature from DHT
                                Failed reading temperature from DHT
                                Failed reading temperature from DHT
                                Failed reading temperature from DHT
                                Failed reading temperature from DHT
                                Failed reading temperature from DHT
                                Failed reading temperature from DHT
                                Failed reading temperature from DHT
                                Failed reading temperature from DHT
                                Failed reading temperature from DHT
                                Failed reading temperature from DHT
                                Failed reading temperature from DHT
                                Failed reading temperature from DHT
                                Failed reading temperature from DHT
                                Failed reading temperature from DHT
                                Failed reading temperature from DHT
                                Failed reading temperature from DHT
                                Failed reading temperature from DHT
                                Failed reading temperature from DHT
                                Failed reading temperature from DHT
                                Failed reading temperature from DHT
                                Failed reading temperature from DHT
                                Failed reading temperature from DHT
                                Failed reading temperature from DHT
                                Failed reading temperature from DHT
                                Failed reading temperature from DHT
                                send: 101-101-0-0 s=1,c=1,t=0,pt=7,l=5,st=ok:31.0
                                T: 31.00
                                send: 101-101-0-0 s=1,c=1,t=0,pt=7,l=5,st=fail:30.0
                                T: 30.00
                                send: 101-101-0-0 s=1,c=1,t=0,pt=7,l=5,st=ok:31.0
                                T: 31.00
                                
                                

                                and on the Openhab start.bat i see this:

                                2015-07-15 17:48:14.153 [INFO ] [runtime.busevents             ] - Arduino state
                                 updated to 0;0;3;0;9;read: 101-101-0 s=255,c=3,t=11,pt=0,l=5:Relay
                                101;255;3;0;11;Relay
                                0;0;3;0;9;read: 101-101-0 s=255,c=3,t=12,pt=0,l=3:1.0
                                101;255;3;0;12;1.0
                                0;0;3;0;9;read: 101-101-0 s=1,c=0,t=3,pt=0,l=0:
                                101;1;0;0;3;
                                0;0;3;0;9;read: 101-101-0 s=2,c=0,t=3,pt=0,l=0:
                                101;2;0;0;3;
                                0;0;3;0;9;read: 101-101-0 s=0,c=0,t=7,pt=0,l=0:
                                101;0;0;0;7;
                                0;0;3;0;9;read: 101-101-0 s=1,c=0,t=6,pt=0,l=0:
                                101;1;0;0;6;
                                
                                ArduinoUpdate -> 0;0;3;0;9;read: 101-101-0 s=255,c=3,t=11,pt=0,l=5:Relay
                                101;255;3;0;11;Relay
                                0;0;3;0;9;read: 101-101-0 s=255,c=3,t=12,pt=0,l=3:1.0
                                101;255;3;0;12;1.0
                                0;0;3;0;9;read: 101-101-0 s=1,c=0,t=3,pt=0,l=0:
                                101;1;0;0;3;
                                0;0;3;0;9;read: 101-101-0 s=2,c=0,t=3,pt=0,l=0:
                                101;2;0;0;3;
                                0;0;3;0;9;read: 101-101-0 s=0,c=0,t=7,pt=0,l=0:
                                101;0;0;0;7;
                                0;0;3;0;9;read: 101-101-0 s=1,c=0,t=6,pt=0,l=0:
                                101;1;0;0;6;
                                2015-07-15 17:48:15.171 [INFO ] [runtime.busevents             ] - Arduino state
                                 updated to 0;0;3;0;9;read: 101-101-0 s=1,c=1,t=0,pt=7,l=5:31.0
                                101;1;1;0;0;31.0
                                
                                ArduinoUpdate -> 0;0;3;0;9;read: 101-101-0 s=1,c=1,t=0,pt=7,l=5:31.0
                                101;1;1;0;0;31.0
                                2015-07-15 17:48:44.203 [INFO ] [runtime.busevents             ] - Arduino state
                                 updated to 0;0;3;0;9;read: 101-101-0 s=0,c=1,t=1,pt=7,l=5:35.0
                                101;0;1;0;1;35.0
                                
                                ArduinoUpdate -> 0;0;3;0;9;read: 101-101-0 s=0,c=1,t=1,pt=7,l=5:35.0
                                101;0;1;0;1;35.0
                                
                                

                                help :)

                                1 Reply Last reply
                                0
                                • T Offline
                                  T Offline
                                  TimO
                                  Hero Member
                                  wrote on last edited by
                                  #67

                                  The access to the serial port is exclusive, stop OpenHAB to access the serial port of The gateway with the arduino IDE.

                                  E 1 Reply Last reply
                                  0
                                  • T TimO

                                    The access to the serial port is exclusive, stop OpenHAB to access the serial port of The gateway with the arduino IDE.

                                    E Offline
                                    E Offline
                                    ewgor
                                    wrote on last edited by
                                    #68

                                    @TimO i saw that I can access the gateway and see what node point transmit but as you say without having the server start.
                                    How do I see temp and hum on the local host? And what do I need to do to switch the two LEDs from local host?
                                    As always, thanks for sharing a little part of your experience :)

                                    1 Reply Last reply
                                    0
                                    • T Offline
                                      T Offline
                                      TimO
                                      Hero Member
                                      wrote on last edited by
                                      #69

                                      Use something like this in the rules file:

                                      For a button (always sends on when activated):

                                      rule "Licht Flur EG"
                                              when
                                                      Item corridorLight01 received update
                                              then
                                                      sendCommand(Arduino, "102;1;1;0;2;1\n")
                                      

                                      For a switch use something like

                                      rule "Küche"
                                              when
                                                      Item kitchenLight01 received command
                                              then
                                                      if(receivedCommand==ON) {
                                                              sendCommand(Arduino, "102;1;1;0;2;1\n")
                                                      }
                                                      if(receivedCommand==OFF) {
                                                              sendCommand(Arduino, "102;1;1;0;2;0\n")
                                                      }
                                      
                                      end
                                      
                                      1 Reply Last reply
                                      0
                                      • E Offline
                                        E Offline
                                        ewgor
                                        wrote on last edited by
                                        #70

                                        So TimO you say your example above (arduinos sketches for the serial gateway and the 2nd one for temp, hum and two switches + openhab items, rules and sitemap) is not working? i just followed and nothing happen ... still strugling. Now you give me this example which has nothing to do with your example. If i want to use it i need to modify all files and i dont know how!
                                        Can anyone help me??

                                        1 Reply Last reply
                                        0
                                        • T Offline
                                          T Offline
                                          TimO
                                          Hero Member
                                          wrote on last edited by
                                          #71

                                          Well, I thought your base is my tutorial: http://forum.mysensors.org/topic/1194/tutorial-openhab-with-serial-gateway

                                          The advantage of OpenHAB is, you're very free and are able to do things you like to do. The disadvantage is, you currently have to "program" your rules.

                                          It would help to know your OpenHAB configurations, sketches and so on, because I'm using my own OpenHAB (and MySensors) configuration/installation, that certainly is not the best configuration für everyone.
                                          (But it works the way I want it to work ;-))

                                          You only asked for (and got) pieces of the puzzle, you have to put it together by yourself or ask for the complete solution, as you did in another thread. :D

                                          E 1 Reply Last reply
                                          0
                                          Reply
                                          • Reply as topic
                                          Log in to reply
                                          • Oldest to Newest
                                          • Newest to Oldest
                                          • Most Votes


                                          7

                                          Online

                                          11.7k

                                          Users

                                          11.2k

                                          Topics

                                          113.1k

                                          Posts


                                          Copyright 2025 TBD   |   Forum Guidelines   |   Privacy Policy   |   Terms of Service
                                          • Login

                                          • Don't have an account? Register

                                          • Login or register to search.
                                          • First post
                                            Last post
                                          0
                                          • MySensors
                                          • OpenHardware.io
                                          • Categories
                                          • Recent
                                          • Tags
                                          • Popular