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
  1. Home
  2. Troubleshooting
  3. Serial Gateway cannot retrieve serial messages when gw.beginn() is invoked (RESOLVED)

Serial Gateway cannot retrieve serial messages when gw.beginn() is invoked (RESOLVED)

Scheduled Pinned Locked Moved Troubleshooting
nrf24l01+serial gatewaynano
6 Posts 2 Posters 3.3k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    SparkAndHale
    wrote on last edited by SparkAndHale
    #1

    THREAD RESOLVED: CHINESE SUPPLIER DID SEND WRONG RADIO MODULE: NRF24L01 instead of NRF24L01+
    Do not buy from ebay-member alice1101983. They send NRF24L01 instead of NRF24L01+.

    Hi, I'm using a Arduino Nano v3 as recommended for my Serial Gateway. I hooked up the radio module as described (http://www.mysensors.org/build/connect_radio) and I simply want to send a message from the Serial Monitor (either Arduino IDE 1.6 or CodeBender).

    Subsequently I copied the MySensors SerialGateway.ino from the example repository. See here: https://github.com/mysensors/Arduino/blob/master/libraries/MySensors/examples/SerialGateway/SerialGateway.ino

    I disable all the gw variables since I only want to test the serial input with serialEvent(). That works! I go ahead and remove the comment characters in front of the gw variables. Recompile and upload. Now the messages are not retrieved and never outputed on the Serial Monior Screen. I also selected the NewLine Argument in the drop down box. No success.

    Why is gw.beginn() having that influence on that serial input/output?

    I tested if the radio LEDs (TX,RX,ERR) indicate something. They fully light up as if there would be constant communication.
    The only thing I get when I startup (and change to baud rate 115200 in the serial monitor) is: 0;0;3;0;9;check wires. Well that is an indicator! But I DONT want to wire them any other than recommended here: http://www.mysensors.org/build/connect_radio
    Or is the wireing for the Arduino Nano different from the Arduino Pro Mini?

    Any clue why that serial gateway cannot read from the serial COM port when gw.beginn() is invoked?

    This is my code:

    #include <SPI.h>  
    #include <MySensor.h>  
    #include <MyGateway.h>  
    #include <stdarg.h>
    
    #define INCLUSION_MODE_TIME 1 // Number of minutes inclusion mode is enabled
    #define INCLUSION_MODE_PIN 3 // Digital pin used for inclusion mode button
    
    
    MyGateway gw(DEFAULT_CE_PIN, DEFAULT_CS_PIN, INCLUSION_MODE_TIME, INCLUSION_MODE_PIN,  6, 5, 4);
    
    char inputString[MAX_RECEIVE_LENGTH] = "";    // A string to hold incoming commands from serial/ethernet interface
    int inputPos = 0;
    boolean commandComplete = false;  // whether the string is complete
    
    void setup()  
    { 
       //Set Auto by MySensonsrs
       //Serial.begin(115200);
      gw.begin();
    }
    
    void loop()  
    { 
      gw.processRadioMessage();   
      if (commandComplete) {
        // A command wass issued from serial interface
        // We will now try to send it to the actuator
        Serial.println(inputString);
        gw.parseAndSend(inputString);
        commandComplete = false;  
        inputPos = 0;
      }
    }
    /*
      SerialEvent occurs whenever a new data comes in the
     hardware serial RX.  This routine is run between each
     time loop() runs, so using delay inside loop can delay
     response.  Multiple bytes of data may be available.
     */
    void serialEvent() {
      while (Serial.available()) {
        // get the new byte:
        char inChar = (char)Serial.read(); 
        // if the incoming character is a newline, set a flag
        // so the main loop can do something about it:
        Serial.println(inChar);
        if (inputPos<MAX_RECEIVE_LENGTH-1 && !commandComplete) { 
          if (inChar == '\n') {
            inputString[inputPos] = 0;
            commandComplete = true;
          } else {
            // add it to the inputString:
            inputString[inputPos] = inChar;
            inputPos++;
          }
        } else {
           // Incoming message too long. Throw away 
            inputPos = 0;
        }
      }
    }
    
    1 Reply Last reply
    0
    • hekH Offline
      hekH Offline
      hek
      Admin
      wrote on last edited by
      #2

      It sets baud rate
      https://github.com/mysensors/Arduino/blob/master/libraries/MySensors/MyGateway.cpp#L37

      1 Reply Last reply
      1
      • S Offline
        S Offline
        SparkAndHale
        wrote on last edited by
        #3

        Yes. That's the case. I meant one needs to set the BAUD in the Arduino IDE Serial Monitor.

        I do NOT need to wire the Nano any different with the NRF24L01+ than the Arduino Pro Mini, right? http://www.mysensors.org/build/connect_radio

        hekH 1 Reply Last reply
        0
        • S SparkAndHale

          Yes. That's the case. I meant one needs to set the BAUD in the Arduino IDE Serial Monitor.

          I do NOT need to wire the Nano any different with the NRF24L01+ than the Arduino Pro Mini, right? http://www.mysensors.org/build/connect_radio

          hekH Offline
          hekH Offline
          hek
          Admin
          wrote on last edited by
          #4

          @SparkAndHale said:

          I do NOT need to wire the Nano any different with the NRF24L01+ than the Arduino Pro Mini, right?

          No.

          1 Reply Last reply
          0
          • S Offline
            S Offline
            SparkAndHale
            wrote on last edited by SparkAndHale
            #5
            This post is deleted!
            1 Reply Last reply
            0
            • S Offline
              S Offline
              SparkAndHale
              wrote on last edited by SparkAndHale
              #6

              I looking with a magnifying glass at the chip, i noted that this is NOT NRF24L01+ but just a NRF24L01 without the plus.

              I used this smaller versions and they worked immediately. I_GATEWAY_READY message appeared. http://www.ebay.com/itm/2-4G-NRF24L01-PA-LNA-Wireless-Module-with-Ceramic-Antenna-1-27mm-/400746941364?pt=LH_DefaultDomain_0&hash=item5d4e610bb4

              MySensors did post a warning on that: http://forum.mysensors.org/topic/728/radio-setup-give-check-wires/16

              THREAD RESOLVED.

              1 Reply Last reply
              0
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              12

              Online

              11.7k

              Users

              11.2k

              Topics

              113.1k

              Posts


              Copyright 2025 TBD   |   Forum Guidelines   |   Privacy Policy   |   Terms of Service
              • Login

              • Don't have an account? Register

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