Navigation

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

    Posts made by gryzli133

    • ESP32 with builtin Ethernet as Gateway - f.e. WT32-ETH01

      It would be great to get ESP32 over Ethernet as Gateway, all the troubles with SPI etc would be gone. There are no delays at all (tested with ESPhome). It is much better then Arduino with Ethernet over SPI (no delays, not blocking the loop when cable not attached etc) and better than ESP32 gateway over WiFi - because it is hardwired 😉

      What do you think about it?

      posted in Feature Requests
      gryzli133
      gryzli133
    • RE: PJON on RS485

      RS485 is supported natively by MySensors, you don't really need PJON for that.

      posted in Feature Requests
      gryzli133
      gryzli133
    • RE: Supporting cover tilt position

      @hypnosiss have you shared your code already? Could you put here a link to your solution. I would like to see how did you managed to connect V_VAR1 to second slider. Thanks in advance!

      posted in Home Assistant
      gryzli133
      gryzli133
    • RE: 💬 Building a wired RS485 sensor network

      You can also try using PJON - it has solved all the issues that I was facing with RS485 and other wired solutions (like all sensors on the Gateway). It will be released officially in MySensors 2.4.0, but you can test is already now (alpha):
      https://github.com/tekka007/MySensors

      You can read more here:
      https://github.com/mysensors/MySensors/pull/1278

      posted in Announcements
      gryzli133
      gryzli133
    • RE: Dimmer sketches - array and multiple PWM led pins

      Did someone got the idea why 100% in Domoticz is 99% in MySensors? Is MySensors limiting dimmer to 99% or is this caused by Domoticz?

      posted in Development
      gryzli133
      gryzli133
    • RE: Transport based on single wire PJON protocol

      Hi Giovanni, did I understood good, that PJON will be included in next release of MySensors? 🙂

      posted in Development
      gryzli133
      gryzli133
    • RE: Locally attached sensors are hanging with MQTT Gateway (W5100 LAN Interface)

      @mfalkvidd can it be requested as new feature? For serial gateway this works without any problems...

      posted in Troubleshooting
      gryzli133
      gryzli133
    • RE: Locally attached sensors are hanging with MQTT Gateway (W5100 LAN Interface)

      I forgot to mention, I already use this at the beginning:

      #define MY_TRANSPORT_WAIT_READY_MS 1

      It is working for Serial Gateway, but seems no to work with MQTT Gateway....

      posted in Troubleshooting
      gryzli133
      gryzli133
    • Locally attached sensors are hanging with MQTT Gateway (W5100 LAN Interface)

      Dear all,

      I have a centrally controlled system for my Lights and Blinds. I use Arduino MEGA with Ethernet shield and MQTT Gateway. There is no radio, it is cotrolling only locally attached sensors (Lights and Blinds -> buttons and relays). When I have good LAN connection everything is working fine, but when I disconnect the cable, or switch off the Router, then it is not responding. The serial is printing this info only:
      (...)
      1879015 GWT:TPC:IP=0.0.0.0
      1880017 GWT:RMQ:MQTT RECONNECT
      1880321 GWT:TPC:IP=0.0.0.0
      1881324 GWT:RMQ:MQTT RECONNECT
      (...)

      Is there a way to say, that locally sensors and logic have a priority if there is problem with connection?

      posted in Troubleshooting
      gryzli133
      gryzli133
    • RE: Transport based on single wire PJON protocol

      @giovanni-blu-mitolo would it be possible for you to refresh the PJON transport layer? Maybe even try with new pull request for PJON transport? I think I'm out of skills to do it by myself. The phissically setup is quite easy, you need one Arduino board as Serial Gateway and one as node. The communication is then running over PJON between arduinos. From Gateway you can see over Serial Monitor if the communication is running well.

      I'm trying to build a floor heating controller for all my house. The idea is to have an Arduino (probably ESP8266 with switched off WiFi) with OLED display (SH1106 using u8g2 lib) and BME280 sensor (Temp+Baro+Hum) in each room. All these should communicate with Arduino Mega as Serial Gateway and main controller for the Valves. For now the only problem is the communication between Arduino Mega and multiple ESP8266 over PJON. It would be even enough to get it work outside MySensors, but I get some trouble. For test I have programm the ESP8266 room thermostat that is communicating with other ESP8266 over PJON. But sometimes I cannot get any data over PJON. Have no idea where is the problem, sometimes it is working, sometimes not... Do you think, that the problem could be SW i2c for the OLED diplay?

      posted in Development
      gryzli133
      gryzli133
    • RE: Transport based on single wire PJON protocol

      WOW, just find that PJON protocol, quite good stuff! Working more reliable than RS485 on my work table 🙂

      I'm creating smart home solution that will work 100% on cable. Because there are some known issues with RS485, PJON would be the great alternative for my project. Is there an official support for MySensors already?

      posted in Development
      gryzli133
      gryzli133
    • RE: How to force MySensors to start setup and loop before connect to Gateway?

      It works, thank you 😉

      posted in General Discussion
      gryzli133
      gryzli133
    • How to force MySensors to start setup and loop before connect to Gateway?

      Dear All,

      the reliability is the key of the system for me. So I decide to have local functions, that do not need gateway/HUB to be usable. I use Domoticz. In my primary setup, there is my Domoticz server on RPi 3 and multiple Arduino Mega as Serial Gateway. These Mega are controlling lights and Roller Shutters in my house. Every light/blind has it own button, connected to Mega's Input pin. The same Mega is controlling also the relays. The adventage is that no metter if there is Internet or even if Domoticz Server is running, the local buttons and relays are always working - domoticz is just an "extra feature" for my system.

      The problem is, when I would like to add some extra devices connected by nrf24l+ and have the same functionality (this means, that the local function is always available, also without connection to gateway), there is a problem. As long, as the slave cannot reach the gateway, the arduino's loop function is not running. Is it possible to get the loop function running even without the gateway on the slave?

      posted in General Discussion
      gryzli133
      gryzli133
    • RE: How can I include MyMessage object in my own class?

      You are great guys! It compile already, later I will also check the functionality 😉

      posted in Development
      gryzli133
      gryzli133
    • RE: How can I include MyMessage object in my own class?

      nobody can help? ;-(

      posted in Development
      gryzli133
      gryzli133
    • How can I include MyMessage object in my own class?

      Dear all, I have been trying to change my Arduino Mega project controlling 16 relays for Light on/off. The board is working standalone as gateway for Domoticz. The reason is, I want to have bullet proof Smart Home with only one point of failture - in this case arduino Mega. Untill now I was separately creating every button/relay, so a lot of code. I though it would be nice, to create a class switch, and then create a array of 16 objects of class switch. This will make the code looking much better. The problem is, I need to create object MyMessage in my own class switch, how can I do it? The code is compiling until I declare MyMessage msg(child_id, V_LIGHT) inside the class switch. I will leave code for single switch and my code trying convert it to class object.

      Original working code:

      
      
      // Enable debug prints to serial monitor
      #define MY_DEBUG 
      
      
      // Enable and select radio type attached
      //#define MY_RADIO_NRF24
      //#define MY_RADIO_RFM69
      
      // Set LOW transmit power level as default, if you have an amplified NRF-module and
      // power your radio separately with a good regulator you can turn up PA level. 
      //#define MY_RF24_PA_LEVEL RF24_PA_LOW
      
      // Enable serial gateway
      #define MY_GATEWAY_SERIAL
      
      // Define a lower baud rate for Arduino's running on 8 MHz (Arduino Pro Mini 3.3V & SenseBender)
      #if F_CPU == 8000000L
      #define MY_BAUD_RATE 38400
      #endif
      
      // Flash leds on rx/tx/err
      // #define MY_LEDS_BLINKING_FEATURE
      // Set blinking period
      // #define MY_DEFAULT_LED_BLINK_PERIOD 300
      
      // Inverses the behavior of leds
      // #define MY_WITH_LEDS_BLINKING_INVERSE
      
      // Enable inclusion mode
      #define MY_INCLUSION_MODE_FEATURE
      // Enable Inclusion mode button on gateway
      #define MY_INCLUSION_BUTTON_FEATURE
      
      // Inverses behavior of inclusion button (if using external pullup)
      //#define MY_INCLUSION_BUTTON_EXTERNAL_PULLUP
      
      // Set inclusion mode duration (in seconds)
      #define MY_INCLUSION_MODE_DURATION 60 
      // Digital pin used for inclusion mode button
      #define MY_INCLUSION_MODE_BUTTON_PIN  3 
      
      // Uncomment to override default HW configurations
      //#define MY_DEFAULT_ERR_LED_PIN 4  // Error led pin
      //#define MY_DEFAULT_RX_LED_PIN  6  // Receive led pin
      //#define MY_DEFAULT_TX_LED_PIN  5  // the PCB, on board LED
      
      #include <SPI.h>
      #include <MySensors.h>  
      #include <Bounce2.h>
      
      // Enable repeater functionality for this node
      #define MY_REPEATER_FEATURE
      
      
      #define RELAY_1  4  // Arduino Digital I/O pin number for first relay (second on pin+1 etc)
      #define NUMBER_OF_RELAYS 1 // Total number of attached relays
      #define RELAY_ON 1  // GPIO value to write to turn on attached relay
      #define RELAY_OFF 0 // GPIO value to write to turn off attached relay
      
      #define BUTTON_PIN A1
      
      
      void before() { 
        for (int sensor=1, pin=RELAY_1; sensor<=NUMBER_OF_RELAYS;sensor++, pin++) {
          // Then set relay pins in output mode
          pinMode(pin, OUTPUT);   
          // Set relay to last known state (using eeprom storage) 
          digitalWrite(pin, loadState(sensor)?RELAY_ON:RELAY_OFF);
        }
      }
      Bounce debouncer = Bounce();
      
      void setup() { 
        // Setup locally attached sensors
        delay(10000);
         // Setup the button.
        pinMode(BUTTON_PIN, INPUT_PULLUP);
        // After setting up the button, setup debouncer.
        debouncer.attach(BUTTON_PIN);
        debouncer.interval(5);
        //presentation();
      }
      void presentation()  
      {   
        // Send the sketch version information to the gateway and Controller
        sendSketchInfo("Relay", "1.0");
      
        for (int sensor=1, pin=RELAY_1; sensor<=NUMBER_OF_RELAYS;sensor++, pin++) {
          // Register all sensors to gw (they will be created as child devices)
          present(sensor, S_LIGHT);
        }
      }
      
      MyMessage msg(1, V_LIGHT);
      
      void loop() { 
        // Send locally attached sensor data here 
        if (debouncer.update()) {
          // Get the update value.
          int value = debouncer.read();
          // Send in the new value.
          if(value == LOW){
               saveState(1, !loadState(1));
               digitalWrite(RELAY_1, loadState(1)?RELAY_ON:RELAY_OFF);
               send(msg.set(loadState(1)));
          }
        }
      }
      
      
      void receive(const MyMessage &message) {
        // We only expect one type of message from controller. But we better check anyway.
        if (message.type==V_LIGHT) {
           // Change relay state
           digitalWrite(message.sensor-1+RELAY_1, message.getBool()?RELAY_ON:RELAY_OFF);
           // Store state in eeprom
           saveState(message.sensor, message.getBool());
           // Write some debug info
           Serial.print("Incoming change for sensor:");
           Serial.print(message.sensor);
           Serial.print(", New status: ");
           Serial.println(message.getBool());
         } 
      }
      

      Here the new object oriented version:

      
      
      // Enable debug prints to serial monitor
      #define MY_DEBUG 
      
      
      // Enable and select radio type attached
      //#define MY_RADIO_NRF24
      //#define MY_RADIO_RFM69
      
      // Set LOW transmit power level as default, if you have an amplified NRF-module and
      // power your radio separately with a good regulator you can turn up PA level. 
      //#define MY_RF24_PA_LEVEL RF24_PA_LOW
      
      // Enable serial gateway
      #define MY_GATEWAY_SERIAL
      
      // Define a lower baud rate for Arduino's running on 8 MHz (Arduino Pro Mini 3.3V & SenseBender)
      #if F_CPU == 8000000L
      #define MY_BAUD_RATE 38400
      #endif
      
      // Flash leds on rx/tx/err
      // #define MY_LEDS_BLINKING_FEATURE
      // Set blinking period
      // #define MY_DEFAULT_LED_BLINK_PERIOD 300
      
      // Inverses the behavior of leds
      // #define MY_WITH_LEDS_BLINKING_INVERSE
      
      // Enable inclusion mode
      #define MY_INCLUSION_MODE_FEATURE
      // Enable Inclusion mode button on gateway
      #define MY_INCLUSION_BUTTON_FEATURE
      
      // Inverses behavior of inclusion button (if using external pullup)
      //#define MY_INCLUSION_BUTTON_EXTERNAL_PULLUP
      
      // Set inclusion mode duration (in seconds)
      #define MY_INCLUSION_MODE_DURATION 60 
      // Digital pin used for inclusion mode button
      #define MY_INCLUSION_MODE_BUTTON_PIN  3 
      
      // Uncomment to override default HW configurations
      //#define MY_DEFAULT_ERR_LED_PIN 4  // Error led pin
      //#define MY_DEFAULT_RX_LED_PIN  6  // Receive led pin
      //#define MY_DEFAULT_TX_LED_PIN  5  // the PCB, on board LED
      
      // Enable repeater functionality for this node
      #define MY_REPEATER_FEATURE
      
      #include <SPI.h>
      #include <MySensors.h>  
      #include <Bounce2.h>
      
      
      
      class Switch
      { 
        public:
        uint8_t child_id;
        int buttonPin;
        int relayPin;
        bool relayON;
        bool relayOFF;
        Bounce debouncer = Bounce();
      
        
        
        Switch(int childId, int button, int relay, int debaunce, bool invertedRelay)
        {
          child_id = childId;
          buttonPin = button;
          relayPin = relay;
          relayON = !invertedRelay;
          relayOFF = invertedRelay;
          pinMode(buttonPin, INPUT_PULLUP);
          debouncer.attach(buttonPin);
          debouncer.interval(debaunce);
          pinMode(relayPin, OUTPUT);
          digitalWrite(relayPin, loadState(child_id)?relayON:relayOFF); 
        }
        
        MyMessage msg(child_id, V_LIGHT);
        
        void Update()
        {
          if (debouncer.update()) 
          {
            // Get the update value.
            int value = debouncer.read();
            // Send in the new value.
            if(value == LOW)
            {
               saveState(child_id, !loadState(child_id));
               digitalWrite(relayPin, loadState(child_id)?relayON:relayOFF);
               send(msg.set(loadState(child_id)));
            }
          }    
        }
      
        void Present()
        {
          present(child_id, S_LIGHT);
        }
      
        void Update(const MyMessage &message)
        {
          // We only expect one type of message from controller. But we better check anyway.
          if (message.type==V_LIGHT && message.sensor==child_id) 
          {
             // Change relay state
             digitalWrite(relayPin, message.getBool()?relayON:relayOFF);
             // Store state in eeprom
             saveState(message.sensor, message.getBool());
             // Write some debug info
             Serial.print("Incoming change for sensor:");
             Serial.print(message.sensor);
             Serial.print(", New status: ");
             Serial.println(message.getBool());
           } 
        }
      };
      
      
      
      void setup() 
      { 
        // Setup locally attached sensors
        delay(10000);
      }
      void presentation()  
      {   
        // Send the sketch version information to the gateway and Controller
        sendSketchInfo("Relay", "1.0");
      }
      
      void loop() 
      { 
      
      }
      
      
      void receive(const MyMessage &message) {
      
      }
      

      PS: if you move the line with: MyMessage msg(child_id, V_LIGHT); at the before class declaration and change the child_id to f.e. 1, everything is compiling....

      posted in Development
      gryzli133
      gryzli133
    • RE: Yet another simple roller shutter (cover) node

      is there any way to see all the communication between Node and Domoticz? I have already successfully changed the programm to compile on ESP8266, so I could use WiFi gateway and connected to serial check what happend in the communication. But i'm still too new to mysensors to get the full debug info...

      posted in My Project
      gryzli133
      gryzli133
    • RE: Yet another simple roller shutter (cover) node

      What controller did you test already? I have domoticz, but it seems like domoticz has problem with percentage...

      posted in My Project
      gryzli133
      gryzli133
    • RE: Yet another simple roller shutter (cover) node

      did you already try to change the radio module with RS485 module?

      posted in My Project
      gryzli133
      gryzli133
    • RE: Yet another simple roller shutter (cover) node

      Great job! Do you have an alternative that I can connect the nodes to gateway through Wire (i2c, RS485 etc)?

      posted in My Project
      gryzli133
      gryzli133