Navigation

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

    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
    • 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