TinyGPS and Spark Core

Thanks so much, @kvarma!

So I did what you said, but it still doesn’t seem to be working. It properly flashed and went through all the light phases specificied but when I use ‘spark list’ in the command line it only says my core is online, it doesn’t list any behavior.

I’ve attached a picture, and I’m wondering if maybe I don’t have it set up correctly?? I attached VIN to VIN, GND to GND, TX (Spark) to RX (Adafruit) and RX (Spark) to TX (Adafruit) but I feel like maybe the way I have it set up, the Adafruit isn’t being accessed because the lines are kinda loose fit. Is there a better way to connect it?? And is there a way to log out what is going on in my Core’s brain??

I’m trying to pull this together for a presentation I have this afternoon (I know, short notice, but not a presentation killer if I don’t have it just a bonus if I do). The long term goal is much larger and due in August but this will be a great start!

And I’ll keep y’all updated the whole way for sure!

Hi @realjoet

The way you have to hookup wires connected to the GPS module is not good. You should solder a header in those holes instead. As it stands now, you probably are getting bad connections.

3 Likes

@realjoet, @bko is absolutely right! Once you have the header installed, you may also need to swap the RX and TX lines between the module and the Core.

1 Like

As @bko and @peekay123 pointed out, you should solder a header to get it working. Regarding the logging, you can put Serial.println() anywhere you want and using a terminal application you can easily watch what is going on there. Also make sure you try outside building, inside building it will take more and more time for the GPS fix.

2 Likes

What do you mean by outside building vs inside building??

Hi @realjoet

A GPS needs to “see” the sky with no roof or walls blocking the signal in order to guarantee that it can get get a signal from enough satellites to get a fix on your position.

Sometimes a GPS will work indoors but often not very well.

2 Likes

Awesome. Thanks, @bko!

I’m done soldering the header that came with the GPS module (not the best job but it works) but now when I start connecting things my Core shuts off. It’s running when I plug in the VIN to VIN, RX to TX and TX to RX but when I plug in the GND my Core shuts off

Any idea what might be causing that?? Just FYI my core is not connected to wifi but it is plugged into my computer. I’m connected to wifi and everything else seems to be set up correctly, but stuck on this piece.

Could it be something to do with me being connected to VIN as opposed to 3V3?? It shuts off regardless of what side I plug it into the GND

Hi @realjoet

Your soldering does not look good. You appear to have shorted out all the pins on the GPS.

Is there someone near you with an electronics background that you can ask for help?

All you have to do is look at the pins soldered on the core where each individual pin is soldered without shorting to the next on either side for an example of how to do it.

3 Likes

You mean since the solder is touching multiple pins at once the connections are all blending together??

There’s no one around me with an electronics background at the moment but could probably find one later on. The problem is how thick my solder is, I think. I grabbed the wrong one at the store and the solder itself is 2-3x thicker than the pins

Hi @realjoet

I would try to find the help of a local experienced electronics person since now you have a big mess to clean up there before it can ever work again.

You should not try to use the GPS in this state–you are shorting out the power supply and could damage your computer or what ever is being used to power the breadboard.

Electronic solder (here in the USA) is generally less than 1/16th of inch in diameter and I like thinner solder (1/32 of an inch) for most things. This corresponds to about 1.5mm to 0.8mm in diameter. The solder should be specifically for electronic components and not for plumbing or other uses and should have a flux core.

2 Likes

Right on. Can’t I just heat up the solder again to melt it off and then re-solder with a thinner solder, @bko??

The solder I have now must be for something else, it’s 1/8th of an in in diameter. Also, is this the flux you’re talking about??

I do have people I could get to help me, but do you know of a good soldering tutorial?? I’d really like to learn how to do this myself as I’m really interested in getting into IoT long term.

@realjoet, the solder you selected is for plumbing work! What type of soldering iron are you using?

Hi @realjoet

That solder is unfortunately very much the wrong thing. And the mess it has made will not be that easy to clean up if you don’t have experience I am afraid.

Here is are Adafruit and Sparkfun (no relation to Spark) tutorials:

https://learn.sparkfun.com/tutorials/how-to-solder---through-hole-soldering

3 Likes

Thanks guys. @bko @peekay123

I took off as much solder as I could and then janked it together to get the light flashing on my GPS module and my spark working when I plug in the GND so all is good on the circuit blowing front.

I’ll probably look for some help but I appreciate the tutorials. Here’s where I’m at now, and maybe I can get it working for class even tho the circuit is not tightly sealed.

The solder iron I’m using is a Weller, I’m not sure what the heat measure was on the package but I got it from my grandpa’s hardware store since I’m a broke student, which is probably the ultimate problem with this. He did say he made sure I got one with a lower power range though since I’m not working with plumbing issues.

Any recommendations for solder irons??

1 Like

That’s a pretty amazing recovery job on the solder! Can you come fix my botched jobs?

As for the soldering iron, even a cheap 15W/30W* soldering iron is sufficient for heat production. For those irons, getting a hold of a smaller tip is key. I have a Weller WES51 soldering station, but I purchased a 1/64" tip that is about perfect for soldering headers like that. You don’t need a tip that fine, but if you can find one that’s smaller than the tip pictured will help.

* 15W/30W just means an iron capable of 15W or 30W, usually selectable by a switch on or near the grip. Be careful, though, as they usually don’t have an on/off switch and simply start heating as soon as you plug it into an outlet.

3 Likes

Haha thanks, @wgbartley!

Ya the tip on my iron and the solder itself is very large so that’ll help in the future. I kinda get what I’m doing because I grew up in an auto body shop but just need practice.

I’ll keep you guys updated with how things are going. We’re trying to make a prototype of something similar to Disney’s MagicBand but with live GPS and some other capabilities. Just wondering, but should I start a separate thread to continue it or would it be best to keep coming back to this thread??

Appreciate all the help over the 24 hours @krvarma, @Moors7, @bko, @peekay123!

1 Like

@realjoet, it may be a good idea to start a new topic

Right on. Will do.

One last question: When I use a Serial.print() should I be calling ‘spark list’ in CLI or should the response automatically be printed without any calls?? @krvarma @peekay123 @bko @Moors7

Getting a console going has probably been my biggest problem with this when it comes to trouble shooting. I’ve been told to download CoolTerm, but I’m really comfortable with my iTerm2/Oh My Zsh setup I already have.

@realjoet, to get Serial.print to work, you first need to have Serial.begin() in your code (with a baudrate, eg. 9600). With your computer connected via USB, you will need to open a terminal program (I run Win 7 and use Putty) to view the serial data stream from the Core.

I do have a Serial.begin(9600) in my setup function and then I have Serial1.print() within other functions to check if things are working. I’m connected USB and running iTerm2 with Oh My Zsh plugins for Mac

void setup(){
    Serial1.begin(9600);
}

Here’s all my code, I suppose that might help:

// This #include statement was automatically added by the Spark IDE.
#include "TinyGPS/TinyGPS.h"


TinyGPS gps;
char szInfo[64];
// Every 15 minutes 
int sleep = 15 * 60 * 1000;

void setup(){
    Serial1.begin(9600);
}

void loop(){
    bool isValidGPS = false;
    
    for (unsigned long start = millis(); millis() - start < 1000;){
        // Check GPS data is available
        while (Serial1.available()){
            char c = Serial1.read();
            Serial1.print(c); // Manually entered by realjoet
            
            // parse GPS data
            if (gps.encode(c))
                isValidGPS = true;
        }
    }

    // If we have a valid GPS location then publish it
    if (isValidGPS){
        Serial1.print("GPS location is working: " + isValidGPS); // Manually entered by realjoet
        float lat, lon;
        unsigned long age;
    
        gps.f_get_position(&lat, &lon, &age);
        
        sprintf(szInfo, "%.6f,%.6f", (lat == TinyGPS::GPS_INVALID_F_ANGLE ? 0.0 : lat), (lon == TinyGPS::GPS_INVALID_F_ANGLE ? 0.0 : lon));
    }
    else{
        // Not a vlid GPS location, jsut pass 0.0,0.0
        // This is not correct because 0.0,0.0 is a valid GPS location, we have to pass a invalid GPS location
        // and check it at the client side
        Serial1.print("GPS location is working: " + isValidGPS); // Manually entered by realjoet
        sprintf(szInfo, "0.0,0.0");
    }
    
    Spark.publish("gpsloc", szInfo);
    
    // Sleep for some time
    delay(sleep);
}
1 Like