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
K

keczejo

@keczejo
About
Posts
6
Topics
1
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Node doesn't recieve message from gateway
    K keczejo

    I changed node arduino to mega and it worked first try. Thanks for help

    Troubleshooting

  • Node doesn't recieve message from gateway
    K keczejo

    @TheoL
    W5100 is powered from 5V because it has own regulator. I changed to serial gateway and it's node still doesn't find parent.

    Troubleshooting

  • Node doesn't recieve message from gateway
    K keczejo

    I added :

    #define MY_RF24_DATARATE RF24_1MBPS // see (https://forum.mysensors.org/topic/4631/nrf24l01-can-t-find-parent-on-gateway/7)
    

    but it didn't help.
    My node code:

    #include <Arduino.h>
    /*
     * The MySensors Arduino library handles the wireless radio link and protocol
     * between your home built sensors/actuators and HA controller of choice.
     * The sensors forms a self healing radio network with optional repeaters. Each
     * repeater and gateway builds a routing tables in EEPROM which keeps track of the
     * network topology allowing messages to be routed to nodes.
     *
     * Created by Henrik Ekblad <henrik.ekblad@mysensors.org>
     * Copyright (C) 2013-2019 Sensnology AB
     * Full contributor list: https://github.com/mysensors/MySensors/graphs/contributors
     *
     * Documentation: http://www.mysensors.org
     * Support Forum: http://forum.mysensors.org
     *
     * This program is free software; you can redistribute it and/or
     * modify it under the terms of the GNU General Public License
     * version 2 as published by the Free Software Foundation.
     *
     *******************************
     *
     * REVISION HISTORY
     * Version 1.0 - February 15, 2014 - Bruce Lacey
     * Version 1.1 - August 13, 2014 - Converted to 1.4 (hek)
     *
     * DESCRIPTION
     * This sketch provides a Dimmable LED Light using PWM and based Henrik Ekblad
     * <henrik.ekblad@gmail.com> Vera Arduino Sensor project.
     * Developed by Bruce Lacey, inspired by Hek's MySensor's example sketches.
     *
     * The circuit uses a MOSFET for Pulse-Wave-Modulation to dim the attached LED or LED strip.
     * The MOSFET Gate pin is connected to Arduino pin 3 (LED_PIN), the MOSFET Drain pin is connected
     * to the LED negative terminal and the MOSFET Source pin is connected to ground.
     *
     * This sketch is extensible to support more than one MOSFET/PWM dimmer per circuit.
     * http://www.mysensors.org/build/dimmer
     */
    
    // Enable debug prints to serial monitor
    #define MY_DEBUG
    
    // Enable and select radio type attached
    #define MY_RADIO_RF24
    #define MY_RF24_DATARATE RF24_1MBPS // see (https://forum.mysensors.org/topic/4631/nrf24l01-can-t-find-parent-on-gateway/7)
    
    //#define MY_RADIO_NRF5_ESB
    //#define MY_RADIO_RFM69
    //#define MY_RADIO_RFM95
    
    #include <MySensors.h>
    
    #define SN "DimmableLED"
    #define SV "1.1"
    
    #define LED_PIN 3      // Arduino pin attached to MOSFET Gate pin
    #define FADE_DELAY 10  // Delay in ms for each percentage fade up/down (10ms = 1s full-range dim)
    
    static int16_t currentLevel = 0;  // Current dim level...
    MyMessage dimmerMsg(0, V_DIMMER);
    MyMessage lightMsg(0, V_LIGHT);
    
    /***
     *  This method provides a graceful fade up/down effect
     */
    void fadeToLevel( int toLevel )
    {
    
    	int delta = ( toLevel - currentLevel ) < 0 ? -1 : 1;
    
    	while ( currentLevel != toLevel ) {
    		currentLevel += delta;
    		analogWrite( LED_PIN, (int)(currentLevel / 100. * 255) );
    		delay( FADE_DELAY );
    	}
    }
    
    
    
    
    /***
     * Dimmable LED initialization method
     */
    void setup()
    {
    	// Pull the gateway's current dim level - restore light level upon node power-up
    	request( 0, V_DIMMER );
    }
    
    void presentation()
    {
    	// Register the LED Dimmable Light with the gateway
    	present( 0, S_DIMMER );
    
    	sendSketchInfo(SN, SV);
    }
    
    /***
     *  Dimmable LED main processing loop
     */
    void loop()
    {
    }
    
    
    
    void receive(const MyMessage &message)
    {
    	if (message.getType() == V_LIGHT || message.getType() == V_DIMMER) {
    
    		//  Retrieve the power or dim level from the incoming request message
    		int requestedLevel = atoi( message.data );
    
    		// Adjust incoming level if this is a V_LIGHT variable update [0 == off, 1 == on]
    		requestedLevel *= ( message.getType() == V_LIGHT ? 100 : 1 );
    
    		// Clip incoming level to valid range of 0 to 100
    		requestedLevel = requestedLevel > 100 ? 100 : requestedLevel;
    		requestedLevel = requestedLevel < 0   ? 0   : requestedLevel;
    
    		Serial.print( "Changing level to " );
    		Serial.print( requestedLevel );
    		Serial.print( ", from " );
    		Serial.println( currentLevel );
    
    		fadeToLevel( requestedLevel );
    
    		// Inform the gateway of the current DimmableLED's SwitchPower1 and LoadLevelStatus value...
    		send(lightMsg.set(currentLevel > 0));
    
    		// hek comment: Is this really nessesary?
    		send( dimmerMsg.set(currentLevel) );
    
    
    	}
    }
    

    Node nrf connection:
    CE - 9
    CS - 10
    MOSI - 11
    MISO - 12
    SCK - 13

    Gateway connections:
    NRF:
    CE - 13
    CS - 22
    MOSI - 11
    MISO - 10
    SCK - 12
    W5100:
    MOSI - 51
    MISO - 50
    SCK - 52
    NSS - 53

    Troubleshooting

  • Node doesn't recieve message from gateway
    K keczejo

    @electrik it's led dimmer code with node id 10 added

    Troubleshooting

  • Node doesn't recieve message from gateway
    K keczejo

    @TheoL about 50cm but i tried putting node few meters away

    Troubleshooting

  • Node doesn't recieve message from gateway
    K keczejo

    I have ethernet gateway based on arduino mega and w5100. I'm trying to connect node to the gateway but i have no success. My gateway recieves find parrent from node and sends message back but node doesn't recieve it. I tried lots of things. I have 220uf capasitors on both radios. Node uses arduino uno.

    Gateway log:

    8845 TSF:MSG:READ,10-10-255,s=255,c=3,t=7,pt=0,l=0,sg=0:
    8850 TSF:MSG:BC
    8851 TSF:MSG:FPAR REQ,ID=10
    8854 TSF:CKU:OK,FCTRL
    8856 TSF:MSG:GWL OK
    9560 !TSF:MSG:SEND,0-0-10-10,s=255,c=3,t=8,pt=1,l=1,sg=0,ft=0,st=NACK:0
    10848 TSF:MSG:READ,10-10-255,s=255,c=3,t=7,pt=0,l=0,sg=0:
    10853 TSF:MSG:BC
    10855 TSF:MSG:FPAR REQ,ID=10
    10857 TSF:CKU:OK,FCTRL
    10859 TSF:MSG:GWL OK
    11517 !TSF:MSG:SEND,0-0-10-10,s=255,c=3,t=8,pt=1,l=1,sg=0,ft=0,st=NACK:0
    12850 TSF:MSG:READ,10-10-255,s=255,c=3,t=7,pt=0,l=0,sg=0:
    12856 TSF:MSG:BC
    12857 TSF:MSG:FPAR REQ,ID=10
    12860 TSF:CKU:OK,FCTRL
    12862 TSF:MSG:GWL OK
    13475 !TSF:MSG:SEND,0-0-10-10,s=255,c=3,t=8,pt=1,l=1,sg=0,ft=0,st=NACK:0
    14853 TSF:MSG:READ,10-10-255,s=255,c=3,t=7,pt=0,l=0,sg=0:
    14858 TSF:MSG:BC
    14860 TSF:MSG:FPAR REQ,ID=10
    14862 TSF:CKU:OK,FCTRL
    14864 TSF:MSG:GWL OK
    15432 !TSF:MSG:SEND,0-0-10-10,s=255,c=3,t=8,pt=1,l=1,sg=0,ft=0,st=NACK:0
    

    Node log:

    16 MCO:BGN:INIT NODE,CP=RNNNA---,FQ=16,REL=255,VER=2.3.2
    26 TSM:INIT
    28 TSF:WUR:MS=0
    34 TSM:INIT:TSP OK
    36 TSM:INIT:STATID=10
    38 TSF:SID:OK,ID=10
    39 TSM:FPAR
    44 ?TSF:MSG:SEND,10-10-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK:
    2052 !TSM:FPAR:NO REPLY
    2054 TSM:FPAR
    2058 ?TSF:MSG:SEND,10-10-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK:
    4065 !TSM:FPAR:NO REPLY
    4067 TSM:FPAR
    4071 ?TSF:MSG:SEND,10-10-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK:
    6078 !TSM:FPAR:NO REPLY
    6080 TSM:FPAR
    6084 ?TSF:MSG:SEND,10-10-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK:
    8091 !TSM:FPAR:FAIL
    8092 TSM:FAIL:CNT=1
    8094 TSM:FAIL:DIS
    8096 TSF:TDI:TSL
    
    Troubleshooting
  • Login

  • Don't have an account? Register

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