Navigation

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

    jgporteous

    @jgporteous

    0
    Reputation
    13
    Posts
    266
    Profile views
    0
    Followers
    0
    Following
    Joined Last Online

    jgporteous Follow

    Best posts made by jgporteous

    This user hasn't posted anything yet.

    Latest posts made by jgporteous

    • RE: SerialGateway can't send to nodes via rules or Serial Monitor

      @jgporteous said:

      101;4;1;0;3;0

      Added ACK to one of my senors, node sending values correctly, but ACK failing.

      I've bumped up the CAP on the gateway to 330uF and no change 😞

      I also dropped bandwidth to 250Kbps and power to low, no change either.

      posted in Development
      jgporteous
      jgporteous
    • RE: SerialGateway can't send to nodes via rules or Serial Monitor

      I did another test, I sent all presentation of sensors to request ACK and this below is the output.
      Although there is only two fails, I think I'm going to have to setup dedicated power for each and try again... unless there is another way?

      Gateway:

      0;0;3;0;9;read: 101-101-0 s=255,c=3,t=11,pt=0,l=15,sg=0:Balcony Senso
      0;0;3;0;9;send: 0-0-101-101 s=255,c=3,t=11,pt=0,l=15,sg=0,st=fail:Bal
      101;255;3;0;11;Balcony Sensors
      0;0;3;0;9;read: 101-101-0 s=0,c=0,t=6,pt=0,l=9,sg=0:Soil Temp
      0;0;3;0;9;send: 0-0-101-101 s=0,c=0,t=6,pt=0,l=9,sg=0,st=ok:Soil Temp
      101;0;0;0;6;Soil Temp
      0;0;3;0;9;read: 101-101-0 s=1,c=0,t=6,pt=0,l=8,sg=0:Air Temp
      0;0;3;0;9;send: 0-0-101-101 s=1,c=0,t=6,pt=0,l=8,sg=0,st=fail:Air Tem
      101;1;0;0;6;Air Temp
      0;0;3;0;9;read: 101-101-0 s=2,c=0,t=7,pt=0,l=12,sg=0:Air Humitidy
      0;0;3;0;9;send: 0-0-101-101 s=2,c=0,t=7,pt=0,l=12,sg=0,st=fail:Air Hu
      101;2;0;0;7;Air Humitidy
      0;0;3;0;9;read: 101-101-0 s=4,c=0,t=3,pt=0,l=11,sg=0:Water Relay
      0;0;3;0;9;send: 0-0-101-101 s=4,c=0,t=3,pt=0,l=11,sg=0,st=ok:Water Re
      101;4;0;0;3;Water Relay
      0;0;3;0;9;read: 101-101-0 s=0,c=1,t=0,pt=7,l=5,sg=0:24.64
      101;0;1;0;0;24.64
      0;0;3;0;9;read: 101-101-0 s=1,c=1,t=0,pt=7,l=5,sg=0:23.00
      101;1;1;0;0;23.00
      0;0;3;0;9;read: 101-101-0 s=2,c=1,t=0,pt=7,l=5,sg=0:41
      101;2;1;0;0;41
      0;0;3;0;9;read: 101-101-0 s=3,c=1,t=0,pt=7,l=5,sg=0:76
      101;3;1;0;0;76
      0;0;3;0;9;read: 101-101-0 s=0,c=1,t=0,pt=7,l=5,sg=0:24.56
      101;0;1;0;0;24.56
      0;0;3;0;9;read: 101-101-0 s=2,c=1,t=0,pt=7,l=5,sg=0:42
      101;2;1;0;0;42
      

      Node:

      send: 101-101-0-0 s=255,c=0,t=17,pt=0,l=3,sg=0,st=ok:1.5
      send: 101-101-0-0 s=255,c=3,t=6,pt=1,l=1,sg=0,st=ok:0
      sensor started, id=101, parent=0, distance=1
      send: 101-101-0-0 s=255,c=3,t=11,pt=0,l=15,sg=0,st=ok:Balcony Sensors
      send: 101-101-0-0 s=255,c=3,t=12,pt=0,l=3,sg=0,st=fail:1.1
      send: 101-101-0-0 s=0,c=0,t=6,pt=0,l=9,sg=0,st=ok:Soil Temp
      send: 101-101-0-0 s=1,c=0,t=6,pt=0,l=8,sg=0,st=ok:Air Temp
      send: 101-101-0-0 s=2,c=0,t=7,pt=0,l=12,sg=0,st=ok:Air Humitidy
      send: 101-101-0-0 s=3,c=0,t=16,pt=0,l=11,sg=0,st=fail:Light Level
      send: 101-101-0-0 s=4,c=0,t=3,pt=0,l=11,sg=0,st=ok:Water Relay
      send: 101-101-0-0 s=4,c=1,t=0,pt=2,l=2,sg=0,st=fail:0
      read: 0-0-101 s=0,c=0,t=6,pt=0,l=9,sg=0:Soil Temp
      Incoming message: Soil Temp   Sensor: 0
      Value:
      Soil Temp
      send: 101-101-0-0 s=0,c=1,t=0,pt=7,l=5,sg=0,st=ok:24.64
      send: 101-101-0-0 s=1,c=1,t=0,pt=7,l=5,sg=0,st=ok:23.00
      send: 101-101-0-0 s=2,c=1,t=0,pt=7,l=5,sg=0,st=ok:41
      send: 101-101-0-0 s=3,c=1,t=0,pt=7,l=5,sg=0,st=ok:76
      read: 0-0-101 s=4,c=0,t=3,pt=0,l=11,sg=0:Water Relay
      Incoming message: Water Relay   Sensor: 4
      Value:
      Water Relay
      send: 101-101-0-0 s=0,c=1,t=0,pt=7,l=5,sg=0,st=ok:24.56
      send: 101-101-0-0 s=2,c=1,t=0,pt=7,l=5,sg=0,st=ok:42
      send: 101-101-0-0 s=0,c=1,t=0,pt=7,l=5,sg=0,st=ok:24.64
      send: 101-101-0-0 s=0,c=1,t=0,pt=7,l=5,sg=0,st=ok:24.56
      send: 101-101-0-0 s=2,c=1,t=0,pt=7,l=5,sg=0,st=ok:41```
      posted in Development
      jgporteous
      jgporteous
    • RE: SerialGateway can't send to nodes via rules or Serial Monitor

      I upgraded the Cap on the gateway to a 47uF and no change...

      This is the serial monitor of the Node, as you can see, it's successfully transmitting data:

      
      send: 101-101-0-0 s=0,c=0,t=6,pt=0,l=0,sg=0,st=ok:
      send: 101-101-0-0 s=1,c=0,t=6,pt=0,l=0,sg=0,st=ok:
      send: 101-101-0-0 s=2,c=0,t=7,pt=0,l=0,sg=0,st=ok:
      send: 101-101-0-0 s=3,c=0,t=16,pt=0,l=0,sg=0,st=ok:
      send: 101-101-0-0 s=4,c=0,t=3,pt=0,l=0,sg=0,st=ok:
      send: 101-101-0-0 s=4,c=1,t=0,pt=2,l=2,sg=0,st=ok:0
      send: 101-101-0-0 s=0,c=1,t=0,pt=7,l=5,sg=0,st=ok:24.73
      send: 101-101-0-0 s=1,c=1,t=0,pt=7,l=5,sg=0,st=ok:23.00
      send: 101-101-0-0 s=2,c=1,t=0,pt=7,l=5,sg=0,st=ok:39
      send: 101-101-0-0 s=3,c=1,t=0,pt=7,l=5,sg=0,st=ok:75
      send: 101-101-0-0 s=2,c=1,t=0,pt=7,l=5,sg=0,st=ok:42
      send: 101-101-0-0 s=0,c=1,t=0,pt=7,l=5,sg=0,st=ok:24.82
      send: 101-101-0-0 s=2,c=1,t=0,pt=7,l=5,sg=0,st=ok:41
      send: 101-101-0-0 s=0,c=1,t=0,pt=7,l=5,sg=0,st=ok:24.91
      send: 101-101-0-0 s=3,c=1,t=0,pt=7,l=5,sg=0,st=ok:74
      send: 101-101-0-0 s=0,c=1,t=0,pt=7,l=5,sg=0,st=ok:24.82
      send: 101-101-0-0 s=0,c=1,t=0,pt=7,l=5,sg=0,st=ok:24.91
      send: 101-101-0-0 s=3,c=1,t=0,pt=7,l=5,sg=0,st=ok:75
      send: 101-101-0-0 s=0,c=1,t=0,pt=7,l=5,sg=0,st=ok:24.82
      send: 101-101-0-0 s=2,c=1,t=0,pt=7,l=5,sg=0,st=ok:42
      send: 101-101-0-0 s=2,c=1,t=0,pt=7,l=5,sg=0,st=ok:41
      send: 101-101-0-0 s=0,c=1,t=0,pt=7,l=5,sg=0,st=ok:24.73
      send: 101-101-0-0 s=0,c=1,t=0,pt=7,l=5,sg=0,st=ok:24.64
      send: 101-101-0-0 s=0,c=1,t=0,pt=7,l=5,sg=0,st=ok:24.73
      send: 101-101-0-0 s=0,c=1,t=0,pt=7,l=5,sg=0,st=ok:24.64
      

      This is the serial output of the gateway, where I let it read for a while then send command via serial (101;4;1;0;3;0):

      0;0;3;0;9;read: 101-101-0 s=0,c=1,t=0,pt=7,l=5,sg=0:24.91
      101;0;1;0;0;24.91
      0;0;3;0;9;read: 101-101-0 s=3,c=1,t=0,pt=7,l=5,sg=0:74
      101;3;1;0;0;74
      0;0;3;0;9;read: 101-101-0 s=0,c=1,t=0,pt=7,l=5,sg=0:24.82
      101;0;1;0;0;24.82
      0;0;3;0;9;read: 101-101-0 s=0,c=1,t=0,pt=7,l=5,sg=0:24.91
      101;0;1;0;0;24.91
      0;0;3;0;9;read: 101-101-0 s=3,c=1,t=0,pt=7,l=5,sg=0:75
      101;3;1;0;0;75
      0;0;3;0;9;read: 101-101-0 s=0,c=1,t=0,pt=7,l=5,sg=0:24.82
      101;0;1;0;0;24.82
      0;0;3;0;9;read: 101-101-0 s=2,c=1,t=0,pt=7,l=5,sg=0:42
      101;2;1;0;0;42
      0;0;3;0;9;read: 101-101-0 s=2,c=1,t=0,pt=7,l=5,sg=0:41
      101;2;1;0;0;41
      Sending command from serial input...
      Destination: 101
      Sensor: 4
      sensorType: 0
      Type: 3
      Ack: 0
      Payload: 0
      0;0;3;0;9;send: 0-0-101-101 s=4,c=1,t=3,pt=4,l=4,sg=0,st=fail:0
      0;0;3;0;9;read: 101-101-0 s=0,c=1,t=0,pt=7,l=5,sg=0:24.73
      101;0;1;0;0;24.73
      0;0;3;0;9;read: 101-101-0 s=0,c=1,t=0,pt=7,l=5,sg=0:24.64
      101;0;1;0;0;24.64
      0;0;3;0;9;read: 101-101-0 s=0,c=1,t=0,pt=7,l=5,sg=0:24.73
      101;0;1;0;0;24.73
      0;0;3;0;9;read: 101-101-0 s=0,c=1,t=0,pt=7,l=5,sg=0:24.64
      101;0;1;0;0;24.64
      
      
      posted in Development
      jgporteous
      jgporteous
    • RE: SerialGateway can't send to nodes via rules or Serial Monitor

      @rvendrame said:

      ( arduino and radio)

      Hi,

      I'm powering the gateway from raspberry pi 2 and has a 10uF Cap.
      The node is powered from Arduino Nano and has a 22uF Cap.

      I have tried giving each radio module a separate power supply but that didn't help.

      What is interesting though, is that the module sends sensor values for 4 sensors and with ACK, the gateway (Arduino) replies successfully. The failure only comes when I try send from parse information from serial input.

      I think I'm going to try put bigger capacitors on each and see what happens... just not sure how big I can go 🙂

      J

      posted in Development
      jgporteous
      jgporteous
    • RE: SerialGateway can't send to nodes via rules or Serial Monitor

      Hi Everyone,

      I tried adding the following code to my gateway, to see if it will send the value to the sensor to set it, but it fails with:
      0;0;3;0;9;send: 0-0-101-101 s=2,c=1,t=2,pt=2,l=2,sg=0,st=fail:1

      Added to loop():

        if (!sentSensorValue)
        {
      	  delay(2500);
      	  MyMessage message;
      	  message.setDestination(101);
      	  message.setSensor(2);
      	  message.setType(2);
      	  message.set(1);
      
      	  gw.send(message);
      	  sentSensorValue = true;
        }
      
      posted in Development
      jgporteous
      jgporteous
    • RE: SerialGateway can't send to nodes via rules or Serial Monitor

      Hi Hek,

      I don't want to add a sensor to the gateway, I want to send a command to a node with the sensor.

      J

      posted in Development
      jgporteous
      jgporteous
    • RE: SerialGateway can't send to nodes via rules or Serial Monitor

      Ok, so if I take a step back and exclude OpenHab.

      Surly I should be able to send data from gateway to a node?
      I can send from node to gateway, and ACK is returned successfully.

      So, If I use a serial interface and send a string, like I did above, should that work with API 1.5?

      posted in Development
      jgporteous
      jgporteous
    • RE: SerialGateway can't send to nodes via rules or Serial Monitor

      @hek said:

      msg.setDestination

      Here is a silly question, do I need on msg variable per sensor on my arduino node - Currently I only have one, and do a msg.preset for each?

      These are the rules I have (only applicable to this problem):

      //switch function
      val org.eclipse.xtext.xbase.lib.Functions$Function4 switchOperation = [
          org.openhab.core.library.items.SwitchItem relayItem, 
          org.openhab.core.library.items.StringItem arduinoItem, 
          String arduinoDevMap,
          Integer subType|
          
          logInfo("Function: switchOperation ","Starting for " + relayItem.name)
          
          var Integer state = 0
          if (relayItem.state != null)
          {   if (relayItem.state == ON) {
              state = 1
          }
          else {
              state = 0
          }
          
          logInfo("Function: switchOperation ",arduinoDevMap + "1;1;" + subType + ";" + state )
          
          }
       
          arduinoItem.sendCommand(arduinoDevMap + "1;0;" + subType + ";" + state + "\n")
      ]
      
      // Mappings
      var HashMap<String, String> sensorToItemsMap = newLinkedHashMap(
          "101;0;"            -> "Balcony_Temperature_Soil"
          ,"Balcony_Temperature_Soil"       -> "101;0;"
          ,"101;1;"            -> "Balcony_Temperature_Air"
          ,"Balcony_Temperature_Air"       -> "101;1;"
          ,"101;2;"            -> "Balcony_Humidity_Air"
          ,"Balcony_Humidity_Air"       -> "101;2;"
          ,"101;3;"            -> "Balcony_Light_Lux"
          ,"Balcony_Light_Lux"       -> "101;3;"
          ,"101;4;"            -> "Balcony_Water_Relay"
          ,"Balcony_Water_Relay"      -> "101;4;"
      )
      
        
      
      rule "Balcony_Water_Relay Switch Rule"
          when
              Item Balcony_Water_Relay changed
          then
          logInfo("Water Relay","Changing state of Water Relay")
              switchOperation.apply(Balcony_Water_Relay, Arduino, sensorToItemsMap.get("Balcony_Water_Relay"), V_LIGHT)
              	
                     
      end 
      
      posted in Development
      jgporteous
      jgporteous
    • RE: SerialGateway can't send to nodes via rules or Serial Monitor

      let me look that up and try 🙂

      posted in Development
      jgporteous
      jgporteous
    • RE: SerialGateway can't send to nodes via rules or Serial Monitor

      Hi Hek,

      If you look at this: https://github.com/mysensors/Arduino/blob/development/libraries/MySensors/examples/SerialGateway/SerialGateway.ino

      Line 117 to 123 takes a message and sends it. This is what I'm trying to do, so my code is the same already. 🙂
      I'm just not sure why it's not working.

      J

      posted in Development
      jgporteous
      jgporteous