Navigation

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

    niccodemi

    @niccodemi

    12
    Reputation
    115
    Posts
    1359
    Profile views
    1
    Followers
    0
    Following
    Joined Last Online

    niccodemi Follow

    Best posts made by niccodemi

    • RE: [SOLVED] Problems with Ethernet Gateway (Arduino Ethernet Shield)

      @korttoma

      exit Arduino ide, download latest Master library 1.4.1

      Patch file RF24_config.h (xxxx\MySensors\utility) to enable softspi,

      uncomment (remove //) #define SOFTSPI

      and change pin numbers as below:

      const uint8_t SOFT_SPI_MISO_PIN = 15;
      const uint8_t SOFT_SPI_MOSI_PIN = 14;
      const uint8_t SOFT_SPI_SCK_PIN = 16;

      Connecto radio and gateway as per instructions for ethernet gateway except MISO, MOSI and SCK.
      These connect as below
      radio MOSI to arduino A0,
      radio MISO to arduino A1,
      radio SCK to arduino A2.

      start arudino ide 1.5.8, open Ethernet Gateway sketch and amend/add below lines

      add this line: #include <DigitalIO.h>

      comment UIPEthernet.h (//#include <UIPEthernet.h>)

      uncomment Ethernet.h (#include <Ethernet.h>)

      and choose IP address

      posted in Troubleshooting
      niccodemi
      niccodemi
    • RE: Remote Access

      @Velo17 I am still on IPv4. I use DDClient as an update agent. I think it works with majority of providers such as NO-IP and DYNU.

      posted in MyController.org
      niccodemi
      niccodemi
    • RE: Looking for LED 7-segment cover plate

      @BartE I believe what you are looking for is called bezel - check this website.

      As for cover you could modify general pvc electric box or have one printed.

      posted in General Discussion
      niccodemi
      niccodemi
    • RE: Out of memory in pressureSensor example

      @portals I had same issue - see this thread.

      Download latest library, disable debug and follow @BulldogLowell advice. I managed to get dynamic memory to 75% and that seems sufficient - it has been running for a week now without issues.

      posted in Bug Reports
      niccodemi
      niccodemi
    • RE: What is the difference between arduino nano (FT232 chip) and arduino nano CH340 chip ?

      @Oitzu I am only not sure whether Vera supports CH340.

      posted in Troubleshooting
      niccodemi
      niccodemi
    • RE: relay 2 or 4 or 8 channel ?!

      @reza if you are looking for solution to control relays without buttons then you can use default mysensors relay-actuator sketch.

      You only need to change this line according to the number of relays you want to control (this will work with 2 and 4 channel relays).

      #define NUMBER_OF_RELAYS 1 // Total number of attached relays

      For 8 channel I think you would need custom sketch.
      Check this thread. Sketch posted there allows you to assign individual pins.

      posted in My Project
      niccodemi
      niccodemi
    • RE: 1.4 gateway not working

      @p0lar, did you do everything as described in this thread?

      Can you ping the gateway?

      posted in Vera
      niccodemi
      niccodemi
    • RE: Upgrading to 2.0 sketch dificulty

      @andmaster

      I've used below sketch with 1.6 development version; it compiles also with 2.0.0 but I have not tested it. This sketch uses toggle buttons.

      //MultiRelayButton Sketch, MySensors 1.6, toggle switch
      
      #define MY_RADIO_NRF24
      
      #define MY_REPEATER_FEATURE
      
      #include <MySensors.h>
      #include <SPI.h>
      #include <Bounce2.h>
      #define RELAY_ON 0                      // switch around for ACTIVE LOW / ACTIVE HIGH relay
      #define RELAY_OFF 1                     // switch around for ACTIVE LOW / ACTIVE HIGH relay
      //
      
      #define noRelays 4                     //2-4, define number of relays
      const int relayPin[] = {14,15,16,17};          //  relay pins - should match noRelays
      const int buttonPin[] = {3,4,5,6};      //  button pins - should match noRelays
      
      class Relay             // relay class, store all relevant data (equivalent to struct)
      {
      public:                                      
        int buttonPin;                   // physical pin number of button
        int relayPin;             // physical pin number of relay
        boolean relayState;               // relay status (also stored in EEPROM)
      };
      
      Relay Relays[noRelays]; 
      Bounce debouncer[noRelays];
      MyMessage msg[noRelays];
      
      void setup(){
          sendHeartbeat();
          wait(100);
          // Initialize Relays with corresponding buttons
          for (int i = 0; i < noRelays; i++){
          Relays[i].buttonPin = buttonPin[i];              // assign physical pins
          Relays[i].relayPin = relayPin[i];
          msg[i].sensor = i;                                   // initialize messages
          msg[i].type = V_LIGHT;   
          pinMode(Relays[i].buttonPin, INPUT_PULLUP);
          wait(100);
          pinMode(Relays[i].relayPin, OUTPUT);
          Relays[i].relayState = loadState(i);                               // retrieve last values from EEPROM
          digitalWrite(Relays[i].relayPin, Relays[i].relayState? RELAY_ON:RELAY_OFF);   // and set relays accordingly
          send(msg[i].set(Relays[i].relayState? true : false));                  // make controller aware of last status  
          wait(50);
          debouncer[i] = Bounce();                        // initialize debouncer
          debouncer[i].attach(buttonPin[i]);
          debouncer[i].interval(20);
          wait(50);
          }
      }
      void presentation()  {
            sendSketchInfo("MultiRelayButton", "1.0");
            wait(100);
            for (int i = 0; i < noRelays; i++)
            present(i, S_LIGHT);                               // present sensor to gateway
            wait(100);
      }
      void loop()
      {
          for (byte i = 0; i < noRelays; i++) {
              if (debouncer[i].update()) {
                  Relays[i].relayState = !Relays[i].relayState;
                  digitalWrite(Relays[i].relayPin, Relays[i].relayState?RELAY_ON:RELAY_OFF);
                  send(msg[i].set(Relays[i].relayState? true : false));
                  // save sensor state in EEPROM (location == sensor number)
                  saveState( i, Relays[i].relayState );
              }                 
          }
          wait(20);
      }
      // process incoming message 
      void receive(const MyMessage &message){        
         if (message.type == V_LIGHT){ 
         if (message.sensor <noRelays){            // check if message is valid for relays..... previous line  [[[ if (message.sensor <=noRelays){ ]]]
         Relays[message.sensor].relayState = message.getBool(); 
         digitalWrite(Relays[message.sensor].relayPin, Relays[message.sensor].relayState? RELAY_ON:RELAY_OFF); // and set relays accordingly
         saveState( message.sensor, Relays[message.sensor].relayState ); // save sensor state in EEPROM (location == sensor number)
         }
        }
        wait(20);
      }
      
      posted in Troubleshooting
      niccodemi
      niccodemi
    • RE: Openhab multiple gateways

      @TimO thanks, that's great. Do I have to change the bridge name (gateway) for the second bridge to something else? Can I use same node IDs on both gateways?

      Bridge mysensors:bridge-ser:gateway [ serialPort="/dev/pts/2", sendDelay=200 ] {
      	humidity 		hum01 	[ nodeId=172, childId=0 ]
      	temperature		temp01 	[ nodeId=172, childId=1 ]
              light			light01 [ nodeId=105, childId=0  ]
              light			light02 [ nodeId=105, childId=1 ]
        }
      Bridge mysensors:bridge-eth:gateway [ ipAddress="127.0.0.1", tcpPort=5003, sendDelay=200 ] {
      	humidity 		hum01 	[ nodeId=172, childId=0 ]
      	temperature		temp01 	[ nodeId=172, childId=1 ]
              light			light01 [ nodeId=105, childId=0 ]
              light			light02 [ nodeId=105, childId=1 ]
        }
      
      posted in OpenHAB
      niccodemi
      niccodemi
    • RE: relay 2 or 4 or 8 channel ?!

      @Reza below is example for 4 channel relay

      #define NUMBER_OF_RELAYS 4

      It is that simple. If you will use this sketch then connect relays to pins 3, 4, 5 and 6.
      You will be able to control each relay independently.
      Relay actuator sketch allows you to control relays only via controller ie Veralite. Relay actuator with button sketch allows you to control relays via controller AND physical button (light switch).

      posted in My Project
      niccodemi
      niccodemi

    Latest posts made by niccodemi

    • RE: OH3 - MySensors Binding

      After upgrading OH from 3.2.0 to 3.3.0 and placing latest Mysensors binding (3.3.0-SNAPSHOT) into addon folder I can only get it to "Installed" status but not "active".

      Any advise how to remove following issues?

      openhab> feature:install openhab-transport-serial
      openhab> feature:install openhab-core-io-transport-mqtt
      openhab> diag 291
      openHAB Add-ons :: Bundles :: MySensors Binding (291)
      -----------------------------------------------------
      Status: Installed
      Unsatisfied Requirements:
      osgi.wiring.package; filter:="(osgi.wiring.package=org.openhab.binding.mqtt.handler)"
      osgi.wiring.package; filter:="(osgi.wiring.package=org.openhab.binding.mysensors.action)"
      osgi.wiring.package; filter:="(osgi.wiring.package=org.openhab.binding.mysensors.config)"
      osgi.wiring.package; filter:="(osgi.wiring.package=org.openhab.binding.mysensors.factory)"
      Declarative Services
      
      posted in OpenHAB
      niccodemi
      niccodemi
    • RE: OH3 - MySensors Binding

      Hi,

      I just upgraded Linux Openhab version from "openHAB 3.1.0.M2" to "openHAB 3.1.0.M3". Since upgrade I cannot use / activate MySensors binding anymore (it worked in previous version - M2).
      I cleaned openhab cache, rebooted computer; feature:install openhab-transport-serial and feature:install openhab-core-io-transport-mqtt are properly installed and active. When I place Mysensors.jar to Addons folder the file gets recognized but it is listed only as Installed, not active.

      openhab> bundle:list | grep MySensors
      266 x Installed x  80 x 3.1.0.202012312203      x openHAB Add-ons :: Bundles :: MySensors Binding
      

      Log shows following error:

       [WARN ] [org.apache.felix.fileinstall         ] - Error while starting bundle: file:/usr/share/openhab/addons/org.openhab.binding.mysensors-3.1.0.jar
      org.osgi.framework.BundleException: Could not resolve module: org.openhab.binding.mysensors [266]
        Unresolved requirement: Import-Package: org.apache.commons.lang; version="[2.6.0,3.0.0)"
      
              at org.eclipse.osgi.container.Module.start(Module.java:444) ~[org.eclipse.osgi-3.12.100.jar:?]
              at org.eclipse.osgi.internal.framework.EquinoxBundle.start(EquinoxBundle.java:383) ~[org.eclipse.osgi-3.12.100.jar:?]
              at org.apache.felix.fileinstall.internal.DirectoryWatcher.startBundle(DirectoryWatcher.java:1260) [bundleFile:3.6.4]
              at org.apache.felix.fileinstall.internal.DirectoryWatcher.startBundles(DirectoryWatcher.java:1233) [bundleFile:3.6.4]
              at org.apache.felix.fileinstall.internal.DirectoryWatcher.doProcess(DirectoryWatcher.java:520) [bundleFile:3.6.4]
              at org.apache.felix.fileinstall.internal.DirectoryWatcher.process(DirectoryWatcher.java:365) [bundleFile:3.6.4]
              at org.apache.felix.fileinstall.internal.DirectoryWatcher.run(DirectoryWatcher.java:316) [bundleFile:3.6.4]
      
      

      Does anyone know how to resolve this issue / install missing requirement?

      posted in OpenHAB
      niccodemi
      niccodemi
    • RE: Openhab multiple gateways

      @TimO thanks, that's great. Do I have to change the bridge name (gateway) for the second bridge to something else? Can I use same node IDs on both gateways?

      Bridge mysensors:bridge-ser:gateway [ serialPort="/dev/pts/2", sendDelay=200 ] {
      	humidity 		hum01 	[ nodeId=172, childId=0 ]
      	temperature		temp01 	[ nodeId=172, childId=1 ]
              light			light01 [ nodeId=105, childId=0  ]
              light			light02 [ nodeId=105, childId=1 ]
        }
      Bridge mysensors:bridge-eth:gateway [ ipAddress="127.0.0.1", tcpPort=5003, sendDelay=200 ] {
      	humidity 		hum01 	[ nodeId=172, childId=0 ]
      	temperature		temp01 	[ nodeId=172, childId=1 ]
              light			light01 [ nodeId=105, childId=0 ]
              light			light02 [ nodeId=105, childId=1 ]
        }
      
      posted in OpenHAB
      niccodemi
      niccodemi
    • Openhab multiple gateways

      Hi,

      is it possible to configure multiple MySensors gateways (ie one serial and one ethernet) on single Openhab server?

      posted in OpenHAB
      niccodemi
      niccodemi
    • RE: water flow sensor YF-B5

      @yveaux is there any way to convert flow in l/min to pulses per liter?

      Another user posted below info; is that accurate?

        • Flow meter using Honeywell C7195A2001B which has a hall sensor that pulses at 7 Hz per liter/min
      • we count only upgoing pulses, so in our case we get:
      • 7 pulses per second at 1 l/min
      • 420 pulses per liter
      • 420000 pulses per m3
      • Flow meter Caleffi 316 which has a hall sensor that pulses at 8.8 Hz per liter/min (according to specs)
      • In reality the frequency is about 30% lower in my case, so we have to correct this with a factor of 1.3.
      • 8.8 pulses per second at 1 l/min
      • 528 pulses per liter
      • 528000 pulses per m3
      • 528000/1.3 = 406154
      posted in Troubleshooting
      niccodemi
      niccodemi
    • water flow sensor YF-B5

      Hi,

      I would like to use YF-B5 water flow sensor with default mysensors water-meter sketch. I need help getting correct PULSE_FACTOR value based on below specs:

      1 Appearance Product identification clear, accurate and meet the requirements
      2 water pressure> 1.75MPa
      3 Operating voltage range DC5 ~ 15V
      4 Insulation resistance> 100MΩ
      5 Accuracy (in 1 ~ 25L \ MIN) ± 3%
      6 Flow Pulse Characteristics (6.6 * Q) Q = L / Min ± 3%
      7 Output pulse high> DC 4.7V (input voltage DC 5V)
      8 Output pulse low level <DC 0.5V (input voltage DC 5V)
      9 Output pulse duty cycle 50% ± 10%

      #define MY_DEBUG
      
      // Enable and select radio type attached
      #define MY_RADIO_NRF24
      //#define MY_RADIO_NRF5_ESB
      //#define MY_RADIO_RFM69
      //#define MY_RADIO_RFM95
      
      #include <MySensors.h>
      
      #define DIGITAL_INPUT_SENSOR 3                  // The digital input you attached your sensor.  (Only 2 and 3 generates interrupt!)
      
      #define PULSE_FACTOR 1000                       // Number of blinks per m3 of your meter (One rotation/liter)
      
      #define SLEEP_MODE false                        // flowvalue can only be reported when sleep mode is false.
      
      #define MAX_FLOW 40                             // Max flow (l/min) value to report. This filters outliers.
      
      posted in Troubleshooting
      niccodemi
      niccodemi
    • RE: Relay control - bistable switch instead of monostable.

      I am using below sketch; make sure that number of relays matches number of relayPins and buttonPins.

      //MultiRelayButton Sketch, MySensors 1.6, toggle switch
      
      #define MY_RADIO_NRF24
      
      #define MY_REPEATER_FEATURE
      
      //Set Static node id
      //#define MY_NODE_ID 250
      
      #include <MySensors.h>
      #include <SPI.h>
      #include <Bounce2.h>
      #define RELAY_ON 0                      // switch around for ACTIVE LOW / ACTIVE HIGH relay
      #define RELAY_OFF 1
      //
      
      #define noRelays 2                     //2-4
      const int relayPin[] = {14,15};          //  switch around pins to your desire
      const int buttonPin[] = {3,4};      //  switch around pins to your desire
      
      class Relay             // relay class, store all relevant data (equivalent to struct)
      {
      public:                                      
        int buttonPin;                   // physical pin number of button
        int relayPin;             // physical pin number of relay
        boolean relayState;               // relay status (also stored in EEPROM)
      };
      
      Relay Relays[noRelays]; 
      Bounce debouncer[noRelays];
      MyMessage msg[noRelays];
      
      void setup(){
          sendHeartbeat();
          wait(100);
          // Initialize Relays with corresponding buttons
          for (int i = 0; i < noRelays; i++){
          Relays[i].buttonPin = buttonPin[i];              // assign physical pins
          Relays[i].relayPin = relayPin[i];
          msg[i].sensor = i;                                   // initialize messages
          msg[i].type = V_LIGHT;   
          pinMode(Relays[i].buttonPin, INPUT_PULLUP);
          wait(100);
          pinMode(Relays[i].relayPin, OUTPUT);
          Relays[i].relayState = loadState(i);                               // retrieve last values from EEPROM
          digitalWrite(Relays[i].relayPin, Relays[i].relayState? RELAY_ON:RELAY_OFF);   // and set relays accordingly
          send(msg[i].set(Relays[i].relayState? true : false));                  // make controller aware of last status  
          wait(50);
          debouncer[i] = Bounce();                        // initialize debouncer
          debouncer[i].attach(buttonPin[i]);
          debouncer[i].interval(20);
          wait(50);
          }
      }
      void presentation()  {
            sendSketchInfo("MultiRelayButton", "1.0");
            wait(100);
            for (int i = 0; i < noRelays; i++)
            present(i, S_LIGHT);                               // present sensor to gateway
            wait(100);
      }
      void loop()
      {
          for (byte i = 0; i < noRelays; i++) {
              if (debouncer[i].update()) {
                  Relays[i].relayState = !Relays[i].relayState;
                  digitalWrite(Relays[i].relayPin, Relays[i].relayState?RELAY_ON:RELAY_OFF);
                  send(msg[i].set(Relays[i].relayState? true : false));
                  // save sensor state in EEPROM (location == sensor number)
                  saveState( i, Relays[i].relayState );
              }                 
          }
          wait(20);
      }
      // process incoming message 
      void receive(const MyMessage &message){        
         if (message.type == V_LIGHT){ 
         if (message.sensor <noRelays){            // check if message is valid for relays..... previous line  [[[ if (message.sensor <=noRelays){ ]]]
         Relays[message.sensor].relayState = message.getBool(); 
         digitalWrite(Relays[message.sensor].relayPin, Relays[message.sensor].relayState? RELAY_ON:RELAY_OFF); // and set relays accordingly
         saveState( message.sensor, Relays[message.sensor].relayState ); // save sensor state in EEPROM (location == sensor number)
         }
        }
        wait(20);
      }
      posted in Troubleshooting
      niccodemi
      niccodemi
    • RE: Remote Access

      @Mitja-Blazinsek I had similar issue. I found the cause was port 8443 itself. When I changed Mycontroller config to use another port (8442 or 8444) and opened it, I was able to access Mycontroller from external networks.

      posted in MyController.org
      niccodemi
      niccodemi
    • RE: How to scan rf remote

      as emc2 said; alternatively if rc-switch doesn't work for you (unlikely) you can also try with Remoteswitch library.

      posted in Development
      niccodemi
      niccodemi