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
S

Spezialtrick

@Spezialtrick
About
Posts
7
Topics
3
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Wake up NRF24 from sleeping
    S Spezialtrick

    I already did, but i can't find the mistake. :(

    It's for an LED candle.

    Is the mistake in here?

    gw.sleep(SLEEP_TIME); //sleep a bit
    
    Troubleshooting

  • Wake up NRF24 from sleeping
    S Spezialtrick

    Thats my sketch:

    #include <MySigningNone.h>
    #include <MyTransportNRF24.h>
    #include <MyTransportRFM69.h>
    #include <MyHwATMega328.h>
    #include <MySensor.h>
    #include <SPI.h>
    
    #define RELAY_1  3  // 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
    
    // NRFRF24L01 radio driver (set low transmit power by default) 
    MyTransportNRF24 radio(RF24_CE_PIN, RF24_CS_PIN, RF24_PA_LEVEL_GW);  
    
    MyHwATMega328 hw;
    
    MySensor gw(radio, hw);
    
    unsigned long AWAKE_TIME = 20000; // Sleep time (in milliseconds)
    unsigned long SLEEP_TIME = 7000; // Sleep time (in milliseconds)
    
    void setup()  
    {   
      // Initialize library and add callback for incoming messages
      gw.begin(incomingMessage, AUTO, true);
      // Send the sketch version information to the gateway and Controller
      gw.sendSketchInfo("Relay", "1.0");
      
      // Fetch relay status
      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)
        gw.present(sensor, S_LIGHT);
        // Then set relay pins in output mode
        pinMode(pin, OUTPUT);   
        // Set relay to last known state (using eeprom storage) 
        digitalWrite(pin, gw.loadState(sensor)?RELAY_ON:RELAY_OFF);
      }
    }
    
    
    void loop() 
    {
      // Alway process incoming messages whenever possible
      gw.process();
      Serial.print(" Awake for "); Serial.print(AWAKE_TIME); Serial.print(" ms");
      delay(AWAKE_TIME);
      Serial.print(" Sleeping for "); Serial.print(SLEEP_TIME); Serial.print(" ms");
      gw.sleep(SLEEP_TIME); //sleep a bit
    }
    
    void incomingMessage(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
         gw.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());
       } 
    }``````
    

    In my eyes the NRF24 doesn't wake up, because i can't send messages to the node.

    It also just uses 3,8 mA, when it's awoken.

    Troubleshooting

  • Wake up NRF24 from sleeping
    S Spezialtrick

    Hello Guys,

    how can i wake up the NRF24 from sleeping mode without sending a message?

    Troubleshooting

  • RFID Lock Sensor/Actuator (1.4)
    S Spezialtrick

    Is it possible to update the following sketch to make it work with the current MySensors 1.4 release?

    https://github.com/wbcode/ham/blob/master/arduino/MySensorRFIDandRGB/SendRfidToGateway/SendRfidToGateway.ino

    That would be very great , because I am a Arduino beginner and not able to do it... :(

    It would offer me the opportunity to send the Tag/Card IDs to FHEM .

    Development rfid pn532 lock
  • Login

  • Don't have an account? Register

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