Navigation

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

    Topics created by airmedic79

    • airmedic79

      Help me build a RFM69 gateway using wemos d1 + keyestudio RFM69 shield
      Troubleshooting • • airmedic79  

      1
      0
      Votes
      1
      Posts
      32
      Views

      No one has replied

    • airmedic79

      Help me build a 6-light-sensor & 2 ch relay node.
      Troubleshooting • • airmedic79  

      3
      0
      Votes
      3
      Posts
      31
      Views

      Heizelmann

      Only if you send a correct message from the controller to the node the receive function is called. I don't see a receive in your log. I think in your case the receive-function is not called (or called with a wrong message type or node id). Put a serial.print("receive() is called with type "); serial.println(message.getType()); on top of the receive function to see if the receive function is called and which type is handed over..
    • airmedic79

      Requesting for help building traffic light led module node
      Troubleshooting • • airmedic79  

      5
      0
      Votes
      5
      Posts
      41
      Views

      airmedic79

      I am sharing my sketch. Based on the sketch below, I am using this led light to show air quality status (good for green, normal for yellow and bad for red). This sketch is just a switch so you should make some automation in HA. https://www.amazon.com/Traffic-Display-Module-Arduino-Mini-Traffic/dp/B07SZMRSDN #define MY_DEBUG #define MY_RADIO_RF24 #define MY_NODE_ID 16 #define MY_RF24_PA_LEVEL RF24_PA_LOW #include <MySensors.h> #define CHILD_ID_GREEN 1 #define CHILD_ID_YELLOW 2 #define CHILD_ID_RED 3 #define GREEN_PIN 3 #define YELLOW_PIN 4 #define RED_PIN 5 bool greenState = false; bool yellowState = false; bool redState = false; MyMessage msgGreen(CHILD_ID_GREEN, V_LIGHT); MyMessage msgYellow(CHILD_ID_YELLOW, V_LIGHT); MyMessage msgRed(CHILD_ID_RED, V_LIGHT); void setup() { Serial.begin(115200); pinMode(GREEN_PIN, OUTPUT); pinMode(YELLOW_PIN, OUTPUT); pinMode(RED_PIN, OUTPUT); wait(200); } void presentation() { // Initialize the MySensors communication sendSketchInfo("Traffic Light Node", "1.0"); present(CHILD_ID_GREEN, S_LIGHT); present(CHILD_ID_YELLOW, S_LIGHT); present(CHILD_ID_RED, S_LIGHT); } void loop() { // Send initial values of the LEDs to the controller send(msgGreen.set(greenState ? 1 : 0)); send(msgYellow.set(yellowState ? 1 : 0)); send(msgRed.set(redState ? 1 : 0)); // Other tasks in the loop if needed // ... // Add a delay to control how often the initial values are sent delay(5000); // Send initial values every 5 seconds (adjust as needed) } void receive(const MyMessage &message) { // Check which LED to control based on the message received if (message.sensor == CHILD_ID_GREEN && message.type == V_LIGHT) { greenState = !greenState; // Toggle the state digitalWrite(GREEN_PIN, greenState ? HIGH : LOW); // Set the pin accordingly send(msgGreen.set(greenState ? 1 : 0)); // Report back the new state } else if (message.sensor == CHILD_ID_YELLOW && message.type == V_LIGHT) { yellowState = !yellowState; digitalWrite(YELLOW_PIN, yellowState ? HIGH : LOW); send(msgYellow.set(yellowState ? 1 : 0)); } else if (message.sensor == CHILD_ID_RED && message.type == V_LIGHT) { redState = !redState; digitalWrite(RED_PIN, redState ? HIGH : LOW); send(msgRed.set(redState ? 1 : 0)); } }