mDot with GPS on Weather Shield

Home Forums mDot/xDot mDot with GPS on Weather Shield

Viewing 24 posts - 1 through 24 (of 24 total)
  • Author
    Posts
  • #12368
    Michael
    Participant

    I’ve successfully interfaced the SparkFun Weather Shield to a UDK2/mDot.

    Now I’m trying to add the mini-GPS module to the Weather Shield.

    I need to set up a serial port to the GPS and this is where I run into trouble.

    1) The recommended process (according to Sparkfun) is to use the “Soft” serial interface which needs two digital data signals from the mDot that are not, as far as I can tell, actually wired to the mDot when using the UDK2.
    2) The “other’ method, of course is to use the “Hard” serial interface (which, best I can tell, is a true UART) And…there’s some sample code available that appears to support this…but the instantiation seems hose up my existing USB debug connection.

    Any suggestions?

    • This topic was modified 8 years, 6 months ago by Michael.
    • This topic was modified 8 years, 6 months ago by Michael.
    #12372
    Mike Fiore
    Blocked

    Michael,

    The mDot has a “hard” serial port available in addition to the USB debug port. Here’s a link to the pinout:

    https://developer.mbed.org/platforms/MTS-mDot-F411/#pinout-diagram

    You should be able to create a mbed Serial object with those two pins to communicate with your GPS module.

    Hope this helps!

    Cheers,

    Mike

    #12374
    Michael
    Participant

    Hi Mike,
    Thanks for the quick response… actually I *am* trying to use the hard interface, since, as a hardware guy, it was clear the wires just weren’t there for the “soft”.

    However I thought I had compatible example code, but upon further inspection it warns against an overlap with the USB pins…so…

    I don’t really know how to do what you suggested (Serial object).
    Can you spoon feed me just a bit more?

    Thanks!

    #12375
    Mike Fiore
    Blocked

    Michael,

    Pins PA_9 & PA_10 are the USB debug interface. The other available UART is on pins PA_2/SERIAL_TX & PA_3/SERIAL_RX. Are you using PA_2 & PA_3? If not, please try those, e.g.

    
    Serial gps(SERIAL_TX, SERIAL_RX);
    

    The default baud rate of mbed Serial objects is 9600. You can change it with the Serial::baud() function.

    Cheers,

    Mike

    #12376
    Michael
    Participant

    Yes, I was already using those pins as you recommend in your post

    For my debug output I’ve had all along
    Serial pc(PA_9,PA_10);
    and later in the code, a call to
    pc.baud(115200);
    That worked fine for a few weeks…

    Then today I tried to add GPS functionality:
    SerialGPS gps(PA_3, PA_2, 4800);
    or

    Serial gps(PA_3, PA_2);
    gps.baud(4800);

    …and now the debug doesn’t output anything

    • This reply was modified 8 years, 6 months ago by Michael.
    • This reply was modified 8 years, 6 months ago by Michael.
    • This reply was modified 8 years, 6 months ago by Michael.
    #12381
    Mike Fiore
    Blocked

    Michael,

    Two things:

    1) I don’t think 4800 baud is supported. I suggest using 9600 or faster.

    2) Is SerialGPS a class you’ve defined? If you use a standard Serial object instead, does that work?

    Cheers,

    Mike

    #12382
    Michael
    Participant

    1) I think the default for the GPS is 4800 – besides that should only screw up the GPS, not the USB debug port.

    2) I tweaked my post probably while you were responding. Yes, it’s still busted with the standard.

    #12384
    Jason Reiss
    Keymaster

    Have you tried:

    
    Serial gps(PA_2, PA_3);
    

    The TX pin should be first.

    Also you could see if any debug comes out at the mbed default 9600 if there are issues before the application is loaded.

    #12387
    Michael
    Participant

    >>The TX pin should be first.

    Sigh – after all my unraveling of the schematics etc I still got this wrong?

    But does that affect the operation of the debug port?

    #12389
    Jason Reiss
    Keymaster

    The app won’t start, there should be debug message

    “pinmap not found for peripheral”

    #12395
    Michael
    Participant

    I was able to verify, with a sniffer of sorts (TTL-to-USB), that the GPS module is beaconing at a 1Hz rate its various $G messages. The messages appear on the Weather Shield pin marked “RX” which, according to the schematic, makes it to the “D0” pin of the mDot – which should have been OK. I was not able to get the code to “get” anything however.

    So after some scrutiny I found there are several jumpers on the UDK2 board, located in a cluster that’s identified as JP98. The default location of one of the jumpers disrupts GPS module’s TX output. (It appears to tie this output to another output from the 232 chip)

    #12502
    Görkem Polat
    Participant

    Hi,


    #include "TinyGPS.h"

    Serial gpsSerial(PA_2,PA_3);
    gpsSerial.baud(9600);
    TinyGPS GPS;

    This worked fine for me, I used the TinyGPS for NMEA parsing.

    I am also trying to integrate GPS module to mDot. Yet, GPS module needs 3V to 3.6V. How can it be sourced from mDot?

    I am sourcing the mDot with 3.7V single cell LiPo battery, it is a bit higher for GPS module.

    VOUT pin provides 3V @ 25mA which is not sufficient for GPS, it must be cabaple of at least 40 mA.

    Any suggestions?

    #12503
    Andrew Lindsay
    Participant

    You probably want to add a 3.3V voltage regulator or even just a diode and rely on the forward voltage drop to reduce the voltage to below 3.6V. Also note that even though the LiPo battery says 3.7V, it could be as high as 4.1V.

    Andrew

    #13717
    Ashu Joshi
    Participant

    I am observing a debug output problem with SerialGPS. However I think I have narrowed it down to a combination of presence of mDot.h and SerialGPS.h – still NOT able to figure out the place of conflict but I have two starter programs – both of them do NOT interface to the LoRa radio. Both of them have code included for the Grove GPS – and I am using hte SerialGPS library. On the program that does NOT include the mDot.h – the program works fine and I am able to print the values of the GPS. However on the other program where I am setting up the mDot as well with mDot.h included in the program – the Serial output goes for a toss or locks up.

    Any idea on what may be going on?

    #13720
    Mike Fiore
    Blocked

    Hi Ashu,

    Can you explain in more detail what happens when you have mDot.h and SerialGPS.h in your application?

    In your version of the application without the mDot library, is RTOS still included in the application? Aka, does anything include rtos.h?

    Cheers,

    Mike

    #13722
    Ashu Joshi
    Participant

    Mike,

    I am glad you asked that question because yes there is another difference – I have mbed-rtos as well along with mDot. I had to include it because mDot needs rtos.h.

    So this is another difference between the two code bases…

    Ashu

    #13723
    Mike Fiore
    Blocked

    That’s what I suspected. Can you explain in detail what happens when your application has both libmDot (with mbed-rtos) and SerialGPS included?

    #13724
    Ashu Joshi
    Participant

    The short version of what happens is that at the beginning of the program before I go in a loop to read the BME280 sensor – I print out to the console the config values of mDot. This printing is erratic – sometimes it prints only 20% of the config, sometimes it gets stuck on the first line, sometimes it makes it almost to the first sensor output BUT it basically freezes – that is no more console output.

    I suspect though that the system is up because I have the LED blink at the beginning and I can see the LED still blinking.

    Including the header file of course does not do anything – its only when I declare the pins:

    SerialGPS gps(PA_2, PA_3);

    #14176
    Ashu Joshi
    Participant

    Any thoughts on how to resolve the issue with mbed-rtos and SerialGPS?

    #14179
    Mike Fiore
    Blocked

    Ashu,

    Can you post your source code?

    -Mike

    #14184
    Ashu Joshi
    Participant

    Mike – I have posted the code base on mBed: https://developer.mbed.org/users/AshuJoshi/code/SensorInterface/

    Note that this does NOT have of the actual GPS processing code because as from my earlier inputs – the mere inclusion & declaration causes this problem – so I did NOT move the over the code for actual GPS processing from another project where there is no libmdot, and hence I did not need mbed-rtos.

    I have the deep sleep example also in there but it has problems that I have asked in another thread.

    #14205
    Mike Fiore
    Blocked

    Ashu,

    I took a look at the code you posted and nothing jumped out at me. However, you mentioned that you didn’t include the GPS processing code which is presumably where the issue is. If you post the entire application, I’ll try to take a look at it.

    Moving in a slightly different direction, MultiTech also has a mDot product called the MTDOT-BOX which might suit your needs.

    http://www.multitech.com/brands/multiconnect-mdot-box

    The MTDOT-BOX has onboard sensors, GPS, and an LCD screen in addition to the mDot module. We have an example application that uses all of these sensors and does LoRa communication as well.

    Cheers,

    Mike

    #14217
    Ashu Joshi
    Participant

    Mike – I can send you the GPS code that I used – basically copied it from an example for SerialGPS with the Grove Kit. However the reason why there is NO code is because my serial console and also my transmit loop was either hanging or getting locked up. As mentioned before – I started removing code to find out what the issue was. The same code works and GPS module reports when I do NOT have libmdot (and mbed-rtos) in the project. In the source I sent you – to get it to hang – just UNCOMMENT the line that is declaring or rather assigning/initializing the GPS:

    SerialGPS gps(PA_2, PA_3);

    I am not sure what is going on – would PA_2/PA_3 conflict with something else?

    #14363
    daniel de kock
    Participant

    I have been able to parse nmea sentences using a TinyGPS+ port ( very similar to TinyGPS – same author) by using bufferedSerial to buffer the NMEA strings so that TinyGPS can parse them in the main loop

    I have these imports :

    #include "TinyGPSplus.h" // can also use TinyGPS
    #include "BufferedSerial.h"

    then I create these :

    TinyGPSPlus gps;
    BufferedSerial uartGPS(XBEE_DOUT, XBEE_DIN,1024); // tx, rx,buffer size //
    

    in main ( before the usual “while(1)” loop: ( “Setup()” in ArduinoLand
    I set up the baudrate of the GPS interface :

    // set up UART to recieve GPS strings
        logInfo("setting up GPS serial port");
        uartGPS.baud(9600);

    and then in the While(1) loop ( or if you are From ArduinoLand (loop() )

    // parse all the data in the serial buffer
            while(uartGPS.readable()>0) {
               // gps << uartGPS.getc();
                gps.encode((char)uartGPS.getc());
            }

    you can then read the GPS parameters off exacly like the TinyGPS / TinyGPS+ libraries show , ie.
    int altitudeGps = gps.altitude.meters();

Viewing 24 posts - 1 through 24 (of 24 total)
  • You must be logged in to reply to this topic.