GPS + RF433 Not working together.



  • I need to get GPS location while a Trigger occurs. I'm sending trigger via 433Mhz RF transmitter. In the receiver, part contains a GPS module (NEO-7M) to get GPS location and RF 433Mhz to receiver RF message. (Refer code) My problem is by combining GPS + RF. GPS module not giving location details. While checking i found that while (gps.available( gps_port )) not running while #include <VirtualWire.h> is occur. I got a similar error while using SoftwareSerial.h with Radiohead.h

    What is the problem with these two libraries? Why Serial.available() not working in this code

    #include <NMEAGPS.h>
    #include <NeoSWSerial.h>
    #include <VirtualWire.h> 
    
    byte message[VW_MAX_MESSAGE_LEN]; // a buffer to store the incoming messages
    byte messageLength = VW_MAX_MESSAGE_LEN; // the size of the message
    int received_number = 0;
    int LED = 5;
    int i =0;
    
    
    NeoSWSerial gps_port(6,7);
    NMEAGPS gps;
    
    
    void setup(){
      Serial.begin(9600);
      Serial.println( F("GPS Start") );  // F macro saves RAM
    
      gps_port.begin(9600);
      vw_set_rx_pin(11); // pin
      vw_setup(2000); // bps
      vw_rx_start();
    }
    
    void loop(){
        // Set buffer to size of expected message
        uint8_t buf[1];
        uint8_t buflen = sizeof(buf);
        // Check if received packet is correct size
      if (vw_get_message(message, &messageLength)) // non-blocking
      {
        Serial.print("Potentiometer: ");
          //Serial.print(message[i]);
          received_number = message[i];
        Serial.println(received_number);
    
          if(received_number == 1){
            Serial.println("Triggered");
            getGpsData();    
          }
        }
    }
    
    void getGpsData() {
      Serial.println("im here");
      while (gps.available( gps_port )) {
        
        gps_fix fix = gps.read();
        if (fix.valid.location) {
          
          float outArray[2];
          outArray[0] = fix.latitude();  // Arrays start at 0, not 1.  Did you really mean [1] here?
          outArray[1] = fix.longitude();
    
          Serial.println( F("Latitude:") );
          Serial.println( outArray[0], 6 );
          Serial.println( F("Longitude:") );
          Serial.println( outArray[1], 6 );
          Serial.println("___________");
        }
        else {
          Serial.println("GPS Not availble");
        }
      }
    }
    


  • @rafitc99 said in GPS + RF433 Not working together.:

    I got a similar error while using

    Can you share the error here, also share the library link that you are using.



  • @salmanfaris Not syntax error. its not reading GPS data. That's the problem.



  • What output you are getting? Just some zeros?



  • @salmanfaris No any output. Arduino not wating for GPS data.Not runing this loop while (gps.available( gps_port ))



  • does it return one/true when you are testing only with gps and gps.available( gps_port )?



  • @salmanfaris gps.available( gps_port ) Is not return a True case.



  • @salmanfaris for running while(gps.avaible()); MCU need to wait some time. but after adding VirtualWire library it's not waiting for Serial.available()



  • @rafitc99 said in GPS + RF433 Not working together.:

    ps.available( gps_port ) Is not return a True case.

    Then how is the while loop will work? It should return!



  • @rafitc99 said in GPS + RF433 Not working together.:

    library it's not waiting for Serial.available()

    did you try manual waiting? Instead of delay, you can use mills, so the background works will keep run.


Log in to reply
 

Recent Posts

  • P

    @Anudeep Thanks a lot m8, I actually made a very silly mistake of including the https:// while entering FIREBASE_HOST, where I must have entered the Domain name alone and removed the https:// extension.

    Thanks again for replying that quick. Cheers.

    read more
  • A

    Hello @Palani, In the Firebase, there are two types of storage,

    Cloud Firestore (Very recent one & NoSQL database) Realtime Database (To which we upload the data using NodeMCU)

    In the Arduino Code, you can see that there is a variable named FIREBASE_AUTH.

    This variable should be assigned to the Database secret. This you can find in Project Settings -> Service accounts -> Database Secrets.

    My mistake is, i have mistakenly assigned thay to Web API key. This is found at Project Settings -> General.

    The error can also occur when u don't initialise a proper realtime database in Firebase. (This is not my case).

    read more
  • P

    @Anudeep Hello Anudeep could you please help me out by elaborating the fix to get rid of that error?
    Thanks in advance.

    read more
  • At Adobe, weโ€™re focused on bringing together the most intelligent, driven, diverse set of individuals and give them the freedom to nurture their intellectual curiosity. We provide them with the necessary resources and support to shape their ideas into tangible results.
    Through the Adobe India Women-in-Technology Scholarship, we are striving towards creating gender equality in science, technology and engineering domains by encouraging women to showcase their excellence in computing and technology and become future leaders and role models in the field.

    ๐—›๐—ผ๐˜„ ๐˜๐—ผ ๐—ฎ๐—ฝ๐—ฝ๐—น๐˜†?

    Applications must be submitted through their dedicated application portal which opens on August 20th, 2020 and will close on September 20th, 2020, 5 pm India time.

    ๐—”๐—ฝ๐—ฝ๐—น๐—ถ๐—ฐ๐—ฎ๐˜๐—ถ๐—ผ๐—ป ๐—ฑ๐—ฒ๐—ฎ๐—ฑ๐—น๐—ถ๐—ป๐—ฒ:

    Application deadline: September 20th, 2020, 5 pm India time.

    Visit:- https://research.adobe.com/adobe-india-women-in-technology-scholarship/

    read more
  • @kowshik1729 If you are using an external high-speed switch, there is only one one clock generator for both wifi and BLE and the high-speed switch you mentioned is Ultra-Wideband (UWB) 3โ€“8 GHz from its datasheet

    b2da6871-9110-40f1-8ff0-d8313547a17a-image.png

    you also check this solution that I shared in the previous post.

    @salmanfaris said in BT and WiFi Dual Core simultaneous operation using ESP32?:

    There is a special option called โ€œSoftware controls WiFi/ Bluetooth coexistenceโ€ it can control the ESP32's Bluetooth and Wi-Fi coexistence using software, more details: https://www.espressif.com/sites/default/files/documentation/ESP32_FAQs__EN.pdf

    read more