
Yet another supported shield question (GPS)
#1
Posted 06 August 2010 - 07:04 PM
- Claiskessed, kekzenevito, aredrateliarm and 2 others like this
#2
Posted 06 August 2010 - 09:12 PM
Any thoughts as to whether I can use a SparkFun GPS shield and receiver (GPS-09817 / EM-406A ) with the Netduino/Net MicroFramework?
Amazon reports my Netduino is in transit - I can hardly wait!
Thanks for offering such a nifty product.
Thanks for your contagious enthusiasm!
We have an Adafruit GPS Log Shield Kit (v1.1) here that we're testing with the EM-406A. We'll test it out by Monday and report our results back on this thread. If it supports 3V3 signals alright, we'll get one of the SparkFun shields to test as well.
Chris
#3
Posted 09 August 2010 - 12:08 PM
#4
Posted 10 August 2010 - 06:20 AM
And thank you for the prompt response! I'll watch for your results later today.
remotewizard,
We tested the Adafruit GPS logger shield and it worked great. We're getting GPS data via the serial port (you can use either one). You need to create an OutputPort for the "power pin" and set it to false (0V). Then simply read the data from the GPS receiver module. We'll create some sample code for it in the near future and post it on our site, perhaps as a tutorial or project.
We've also ordered a Sparkun GPS shield to test (GPS-09817). It should arrive within about a week.
The SD card on the back of the Adafruit GPS logger shield may work with the upcoming Netduino v4.1.1 firmware as well (when we enable the FAT16/FAT32 and SD card file system support). We haven't tested this feature of the GPS logger shield, but we have tested the Adafruit MicroSD breakout board and the Adafruit data logger shield and the SD worked great on both of those.
So now what are you going to build as your first geo-location project?!?
Chris
#5
Posted 10 August 2010 - 06:36 AM
Here's some very rough test code I put together to make sure we were getting data from the GPS receiver. You might want to put this in an event handler-based class which parsed the data out and raised events whenever a new location was received.
But this will show you your GPS data stream

I plugged TX, RX, and PWR into pins D0, D1, and D2. This corresponds to serial port 1 (COM1) and a "powerpin" of D2.
using System; using System.IO.Ports; using System.Threading; using Microsoft.SPOT; using Microsoft.SPOT.Hardware; using SecretLabs.NETMF.Hardware; using SecretLabs.NETMF.Hardware.Netduino; namespace GpsLogger { public class Program { public static void Main() { // write your code here SerialPort serialPort = new SerialPort("COM1", 4800, Parity.None, 8, StopBits.One); serialPort.Open(); // pin D2 off = gps module turned on OutputPort powerPin = new OutputPort(Pins.GPIO_PIN_D2, false); while (true) { int bytesToRead = serialPort.BytesToRead; if (bytesToRead > 0) { // get the waiting data byte[] buffer = new byte[bytesToRead]; serialPort.Read(buffer, 0, buffer.Length); // print out our received data Debug.Print(new String(System.Text.Encoding.UTF8.GetChars(buffer))); } Thread.Sleep(100); // wait a bit so we get a few bytes at a time... } } } }
#6
Posted 10 August 2010 - 12:31 PM
#7
Posted 10 August 2010 - 02:17 PM

#8
Posted 11 August 2010 - 01:23 AM
My netduino just arrived and I gotta say I'm pretty excited.
I decided to try out the GPS integration as a starter project but I can't seem to get the SerialPort class to resolve.
using System.IO.Ports; ... SerialPort serialPort = new SerialPort("COM1", 4800, Parity.None, 8, StopBits.One);I get the old:
like I'm missing a reference but I'm quite certain that I'm not. Do I have a .Net (not micro) compatibility issue?The type or namespace name 'SerialPort' could not be found (are you missing a using directive or an assembly reference?)
Patrick
#9
Posted 11 August 2010 - 01:30 AM
#10
Posted 11 August 2010 - 01:36 AM
Not that I can see...I could be mistaken, but I think the SerialPort class is in the Microsoft.SPOT.Hardware namespace for .NET MF.
EDIT: It seems that RedHermit was correct.
.Net Micro framework 4.0 and greater has the SerialPort class in the Microsoft.SPOT.Hardware.SerialPort namespace. Had to add the reference and using.
Thanks!
#11
Posted 11 August 2010 - 02:28 AM
...like I'm missing a reference but I'm quite certain that I'm not. Do I have a .Net (not micro) compatibility issue?
Good question. We'll be sure to cover this in a tutorial.
Here's what you need to do:
* Click on the Project menu > Add References...
* Click on the first tab (.NET) if it is not already selected
* Select the "Microsoft.SPOT.Hardware.SerialPort" assembly.
* Press OK
That's it! You just needed the SerialPort support assembly in your project.
Does that work for you?
Chris
EDIT: You answered your own question while I was typing this

#12
Posted 11 August 2010 - 12:09 PM
#13
Posted 11 August 2010 - 01:27 PM
#14
Posted 11 August 2010 - 03:24 PM
Thanks for all the responses; it's nice to see an active forum for such a young device.
The GPS is working perfectly now and I plan on posting some code for an NMEA interpreter once I get it finished up.
The members of this community are pretty terrific.
Awesome news on the GPS... I'm looking forward to seeing what you build with it.
#15
Posted 19 August 2010 - 03:07 AM

Attached Files
#16
Posted 30 August 2010 - 02:42 AM


#17
Posted 19 April 2012 - 06:35 PM
Good question. We'll be sure to cover this in a tutorial.
Here's what you need to do:
* Click on the Project menu > Add References...
* Click on the first tab (.NET) if it is not already selected
* Select the "Microsoft.SPOT.Hardware.SerialPort" assembly.
* Press OK
That's it! You just needed the SerialPort support assembly in your project.
Chris,
Sorry to jump in on this thread, but tryign to follow this example and add the SerialPort assemply, and in following your above, there is no .NET lisitings at all in the Refrences window. What am I missing?
Thanks,
Maddawg
#18
Posted 19 April 2012 - 06:39 PM
#19
Posted 20 April 2012 - 05:46 PM
#20
Posted 27 May 2012 - 03:22 AM
I build the Adafruit Kit with the EM-406A based on this tutorial by Bob Cravens.
Then just ran the code from above (post #5).
But even after walking around about 30 minutes outside with blue sky and no clouds, I still not get a fix.
Does anyone has an idea what the problem could be or how I can debug the possible problem (I'm a programmer not electrician)
Powering on and off the GPS module works fine when switching Pins.GPIO_PIN_D2 from 'false' to 'true' and back. The LED on the GPS receiver gets red(on) or is off(off). I read in other posts, that it will start blinking as soon as it got a fix...but never saw that ;-(
Connection is TX ==> D0; RX ==> D1; PWR ==> D2
As sample output with the program above looks like this.
According to the this reference NMEA sentence info I interpreted my output like this:
- No fix available ($GPRMC,000117.056,V,...)
- and no satellites found ($GPGSA,A,1,...)
$PSRFTXT,Version:GSW3.5.0_3.5.00.00-SDK-3EP2.01 *46 $PSRFTXT,Version2:F-GPS-03-1006231*2A $PSRFTXT,WAAS Enable*66 $PSRFTXT,TOW: 0*25 $PSRFTXT,WK: 1519*69 $PSRFTXT,POS: 6378137 0 0*2A $PSRFTXT,CLK: 96250*25 $PSRFTXT,CHNL: 12*73 $PSRFTXT,Baud rate: 4800*65 $GPRMC,000117.056,V,,,,,,,150209,,,N*46 $GPGGA,000118.045,,,,,0,00,,,M,0.0,M,,0000*5F $GPGSA,A,1,,,,,,,,,,,,,,,*1E$ GPRMC,000118.045,V,,,,,,,150209,,,N*4B $GPGGA,000119.048,,,,,0,00,,,M,0.0,M,,0000*53 $GPGSA,A,1,,,,,,,,,,,,,,,*1E $GPRMC,000119.048,V,,,,,,,150209,,,N*47 $GPGGA,000120.056,,,,,0,00,,,M,0.0,M,,0000*56 $GPGSA,A,1,,,,,,,,,,,,,,,*1E $GPGSV,1,1,00*79 $GPRMC,000120.056,V,,,,,,,150209,,,N*42 $GPGGA,000121.045,,,,,0,00,,,M,0.0,M,,0000*55 $GPGSA,A,1,,,,,,,,,,,,,,,*1E $GPRMC,000121.045,V,,,,,,,150209,,,N*41 and so on.....
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users