FEZ spider + GPS Extension and Extender

I have a FEZ spider (using framework 4.2) and a extender connected on socket 11, on the extender I have connected a GPS module (TX cable to pin 5 and RX cable to pin 4 on the extender). I use the GPS extension code from the codeshare: http://www.tinyclr.com/codeshare/entry/25

My serial connection code is (4800 baud is from the datasheet of the GPS module and works just fine with windows test application):

_port = new SerialPort("COM1", 4800, Parity.None, 8, StopBits.One);

But I do not receive any data from the GPS module and the gpstime stays on the minimum date.

Any idea what goes wrong?

you have not told us what gps device you are using.

you said you tested the gps device on windows a machine. how did you connect the device to the windows machine?

I’am using a Globalsat BU-353 S4 usb mouse. I did test this device with USB on my PC and it just works fine.

Datasheet: http://usglobalsat.com/store/download/688/bu353s4_ds.pdf

You can’t connect a USB device to a UART socket

You will need to use a USB - TTL like http://www.ghielectronics.com/catalog/product/287 - as far as i can tell…i could be wrong…

Will not work. That is to convert from serial to usb. Not usb to serial. There is no way that I know of to connect a USB device to a serial port.

You can look at using a USB Host module with the Spider, and plugging in the GPS into that. But I don’t know what driver the GPS uses, and I don’t know if the Spider will be able to talk to the USB device.

see i told you i could be wrong :slight_smile:

Well well well, 3 holes in the ground - i forgot i have the same module, found it and opened it up.
It appears to be an EM406 (see pic below)
Soooo that means the module is TTL and the cable will have an FTDI or similar to do the USB fluff.
So therefore you will be able to hook it up to the Spider by doing a wee bit of a snip and rewire.
I happily use a EM406 on my Cobra (the module on the right) just make sure you use both grounds.

this is exactly the way I connected the GPS mouse to the extender except for the second ground, I will connect that one now and try again.

But connecting the extender to socket 11 and using the my code should be ok?

Ok, so it is a serial GPS then, not USB. Quick question. You cut the cable. If you plug just the bit with the usb plug into the PC, do you still hear the “new device connected” sound?

To your problem. Is the module connected to COM1?
You can use this code to get the real serial object, where MySocket is the socket number where you connected your externder module:

            Gadgeteer.Interfaces.Serial a= new GT.Interfaces.Serial(Gadgeteer.Socket.GetSocket(MySocket, true, null,"U"),4800, GT.Interfaces.Serial.SerialParity.None, GT.Interfaces.Serial.SerialStopBits.One,8, GT.Interfaces.Serial.HardwareFlowControl.NotRequired,null);

@ GMod(Errol) - yes I still get the sound when I connect the GPS to my computer.

I have tried your code but still no data from GPS (while it does has a GPS fix).

I have connected the extender module to the spider socket number 11.

Not sure if this is much of a help… but

I am using the adafruit GPS mtk339 module on an extender. here is a pic of the setup. TX from the GPS goes to P5 on the Extender and RX on the GPS goes to P4.
i cheated as the adafruit GPS is 9600 and used the Seeed module in the program.gadgeteer designer and connected it to socket 9 on my spider and it works really well.

To make sure i was getting at least some data i just did this


gPS.NMEASentenceReceived +=new GPS.NMEASentenceReceivedHandler(gPS_NMEASentenceReceived);
void gPS_NMEASentenceReceived(GPS sender, string nmeaSentence)
        {
         Debug.Print(nmeaSentence);
        }

you can at least see if you are getting any data squirts.
Are you sure the GPS is 4800 baud??

This worked for me hooking up the TX pin from the EM406 to pin 5 of socket 2 on a CerbBee


using System;
using System.IO.Ports;
using System.Text;
using Microsoft.SPOT;
using GT = Gadgeteer;
using GTM = Gadgeteer.Modules;

namespace GadgeteerApp1
{
    public partial class Program
    {
        private Gadgeteer.Interfaces.Serial _gps;
        string _gpsString = String.Empty;

        void ProgramStarted()
        {
            _gps = new Gadgeteer.Interfaces.Serial(GT.Socket.GetSocket(2, true, null, null), 4800, GT.Interfaces.Serial.SerialParity.None, GT.Interfaces.Serial.SerialStopBits.One, 8, GT.Interfaces.Serial.HardwareFlowControl.NotRequired, null);
            _gps.DataReceived += new GT.Interfaces.Serial.DataReceivedEventHandler(GpsDataReceived);
            _gps.Open();
        }
        void GpsDataReceived(GT.Interfaces.Serial sender, SerialData data)
        {
            byte[] readBuffer = new byte[_gps.BytesToRead];
            _gps.Read(readBuffer, 0, readBuffer.Length);
            _gpsString += new String(Encoding.UTF8.GetChars(readBuffer));
            Debug.Print(_gpsString);
        }
    }
}


@ HughB - Yeah it is 4800 - i gotta get me some of those extenders…my hand was a bit shaky touching the wee pin on the socket in my test :slight_smile:

Somehow the problem is the gps mouse, not my code.

I did find an old sirf 3 module with antenna (serial), connected it to the extender and got a lot of NMEA back!

Thanks you alle for helping me so quick! I will use the GPS module instead.

Extenders are your friend :slight_smile: i have come to the conclusiont that you cannot have enough of them.

@ rbruinsma - it works fine attached to the PC via Usb?
I had initial problems when i didn’t connect both GND’s then all good.

@ HughB - Yeah i can see that now after today…new to theses fancy Gadgeteer pluggy things… :slight_smile:

another sirf3 works fine connected to the FEZ not the initial Bu-353 mouse. I cannor get than one to work even when connected the second ground.

@ rbruinsma - odd, o well at least you have another to play with…