You would have to remove the DC bias with a blocking capacitor or by removing the DC bias inductor from the venus module first.
Read the “PowerHelix Electrical Integration Guidelines” from Sarantels website it provides everything you need to know.
You would have to remove the DC bias with a blocking capacitor or by removing the DC bias inductor from the venus module first.
Read the “PowerHelix Electrical Integration Guidelines” from Sarantels website it provides everything you need to know.
tz,
If you don’t have this already it may help!
google “an0011 skytraq”
Its the Dat*sheet for AGPS binary commands, its for the venus 5 but applies to the venus 6
Sparkfun you could add it to the products page as it took me ages to find.
Thanks - but not quite. It has some AGPS status commands, there’s a pointer to three other commands that do the upload but doesn’t document them. But I’ll keep looking
Yes I still cannot find the magical skytraq api source thats referred to by several of the dat*sheets, however this very handy chap seems to have figured it out or obtained the information from skytraq…
h**p://code.google.com/p/skytraq-datalogger/downloads/list
I’m busy trying to reverse engineer his code for my pic24 project, however I haven’t tried his software ‘as is’ becuase my venus is already attached to my pic.
Right to download the AGPS data
Send: 0xA0, 0xA1, 0x00, 0x01, 0x35, 0x35, 0x0D, 0x0A (start DL)
Rec: 0xA0, 0xA1, 0x00, 0x02,0x83, 0x35, 0xB6, 0x0D, 0x0A (ACK)
Send: “BINSIZE = %lu Checksum = %lu \0”
where BINSIZE is the data length and Checksum is the sum of all bytes %256
Rec: “OK\0”
do
Send a block of 8192 bytes of data or whatever is left
Rec: “OK\0”
while (there is more data)
Rec: “END\0” (the Venus seems to send this twice ??)
If the checksum is wrong you will recieve “Error2\0”
If you send too little data the Venus times out and resets disabling AGPS aiding
The example app by skytraq sends 2 checksums (the second is the sum of the first 0x10000 bytes %256) however this seems to be ignored in the venus 6 so I’ve left it out.
DC REdD
You have to preset the baud rate manually or using something else (only tested at 57600 or faster). It enables agps at the end after uploading.
Lots of holes and places to lock if something goes wrong but shows the method in just over 100 lines.
You also need to download Eph.dat
e.g. make sure Eph.dat is not already there (it will download to Eph.dat.1 otherwise) and do
wget ftp://skytraq:skytraq@60.250.205.31/ephemeris/Eph.dat
Linux/Posix based, adjust as needed.
#include <stdio.h>
#include <string.h>
#include <termios.h>
#include <unistd.h>
#include <fcntl.h>
static char string[64];
static void readtonull(int fd)
{
int l;
char *b = string;
for (;;) {
l = read(fd, b, 1);
if (l <= 0)
continue;
if (!*b++)
break;
}
printf("%s\n", string);
}
static unsigned char ephbuf[256 * 1024];
static const unsigned char setagps[8] = { 0xa0, 0xa1, 0x00, 0x01, 0x35, 0x35, 0x0d, 0x0a };
static const unsigned char agpsresp[9] = { 0xa0, 0xa1, 0x00, 0x02, 0x83, 0x35, 0xb6, 0x0d, 0x0a };
static const unsigned char agpsena[9] = { 0xa0, 0xa1, 0x00, 0x02, 0x33, 0x01, 0x32, 0x0d, 0x0a };
int main(int argc, char *argv[])
{
int fd;
char *gpsdev = "/dev/ttyUSB0";
unsigned i;
fd = open(gpsdev, O_RDWR);
if (fd < 0)
return -10;
struct termios tio;
if ((tcgetattr(fd, &tio)) == -1)
return -1;
cfmakeraw(&tio);
if ((tcsetattr(fd, TCSAFLUSH, &tio)) == -1)
return -1;
// add: find baud rate
unsigned char *ephdata;
long ephbytes;
ephdata = ephbuf;
int ofd = open("Eph.dat", O_RDONLY);
if (ofd < 0)
return -2;
ephbytes = read(ofd, ephbuf, 256 * 1024);
if (ephbytes < 65536)
return -3;
// checksum
unsigned char csuma, csumb = 0;
for (i = 0; i < 0x10000; i++)
csumb += ephdata[i];
csuma = csumb;
for (; i < ephbytes; i++)
csuma += ephdata[i];
// AGPS download startup: send command, get ack - maybe put in loop?
do { // flush input buffer
i = read(fd, string, 64);
} while( i == 64 );
printf( "Startup\n" );
write(fd, setagps, 8);
i = 0;
while ( i < 0 || string[0] != '\xa0')
i = read(fd, string, 1);
while (i < 64) {
i += read(fd, &string[i], 64 - i);
if (i > 0 && string[i-1] == 0x0a)
break;
}
printf( "Venus Ready\n" );
if (memcmp(&string[i - 9], agpsresp, 9))
return -6;
/* start the transmission */
sprintf(string, "BINSIZE = %ld Checksum = %d Checksumb = %d ", ephbytes, csuma, csumb);
printf("%s:", string);
write(fd, string, strlen(string) + 1);
readtonull(fd);
#define BLKSIZ 8192
while (ephbytes > 0) {
printf("%ld left:", ephbytes);
write(fd, ephdata, ephbytes > BLKSIZ ? BLKSIZ : ephbytes);
readtonull(fd); // OK
ephbytes -= BLKSIZ;
ephdata += BLKSIZ;
}
// Status "END" or "Error2"
readtonull(fd); // END
sleep(1);
write(fd, agpsena, 9);
// maybe get ack?
sleep(1);
close(fd);
return 0;
}
anyone know if the spi flash chip that SFE has is compatible with the venus module? or more importantly the chips they have in their eagle library?
i just don’t want to get screwed using one from the eagle library and have it not work with the gps.
The list of compatible flash chips are in the Skytraq/venus datasheet. I know the largest (64Mb) winbond works. It is available from DigiKey.
I don’t think the one you refer to is compatible, but it would be nice to have a link to check.
I found the SST 32mbit one from mouser has the same pin out as the eagle library. so i am going with that.
Thanks!
does anyone have Sarantel eagle files? preferable the Active Sarantel 1010021 antenna?
tz:
You have to preset the baud rate manually or using something else (only tested at 57600 or faster). It enables agps at the end after uploading.
Get time out at last block:
BINSIZE = 114638 Checksum = 89 Checksumb = 177 :.4f.4b.0OK
114638 left:.4f.4b.0OK
106446 left:.4f.4b.0OK
98254 left:.4f.4b.0OK
90062 left:.4f.4b.0OK
81870 left:.4f.4b.0OK
73678 left:.4f.4b.0OK
65486 left:.4f.4b.0OK
57294 left:.4f.4b.0OK
49102 left:.4f.4b.0OK
40910 left:.4f.4b.0OK
32718 left:.4f.4b.0OK
24526 left:.4f.4b.0OK
16334 left:.4f.4b.0OK
8142 left:.d.a.24.53.6b.79.54.72.61.71.2c.56.65.6e.75.73.36.
My current version may have some tweaks. Remember to use a current Eph.dat file (it may be that the one from the server has a problem - also insure you ftp in binary mode)
#include <stdio.h>
#include <string.h>
#include <termios.h>
#include <unistd.h>
#include <fcntl.h>
static char string[64];
static void readtonull(int fd)
{
int l;
char *b = string;
for (;;) {
l = read(fd, b, 1);
if (l <= 0)
continue;
if (!*b++)
break;
}
printf("%s\n", string);
}
static unsigned char ephbuf[256 * 1024];
static const unsigned char setagps[8] = { 0xa0, 0xa1, 0x00, 0x01, 0x35, 0x35, 0x0d, 0x0a };
static const unsigned char agpsresp[9] = { 0xa0, 0xa1, 0x00, 0x02, 0x83, 0x35, 0xb6, 0x0d, 0x0a };
static const unsigned char agpsena[9] = { 0xa0, 0xa1, 0x00, 0x02, 0x33, 0x01, 0x32, 0x0d, 0x0a };
int main(int argc, char *argv[])
{
int fd;
// char gpsdev[64] = "/dev/rfcomm0";
char gpsdev[64] = "/dev/ttyUSB0";
unsigned i;
if( argc > 1 )
strcpy( gpsdev, argv[1] );
fd = open(gpsdev, O_RDWR);
if (fd < 0)
return -10;
struct termios tio;
if ((tcgetattr(fd, &tio)) == -1)
return -1;
cfmakeraw(&tio);
if ((tcsetattr(fd, TCSAFLUSH, &tio)) == -1)
return -1;
// add: find baud rate
unsigned char *ephdata;
long ephbytes;
ephdata = ephbuf;
int ofd = open("Eph.dat", O_RDONLY);
if (ofd < 0)
return -2;
ephbytes = read(ofd, ephbuf, 256 * 1024);
if (ephbytes < 65536)
return -3;
// checksum
unsigned char csuma, csumb = 0;
for (i = 0; i < 0x10000; i++)
csumb += ephdata[i];
csuma = csumb;
for (; i < ephbytes; i++)
csuma += ephdata[i];
// AGPS download startup: send command, get ack - maybe put in loop?
printf( "Startup\n" );
do {
do { // flush input buffer
i = read(fd, string, 64);
} while( i == 64 );
write(fd, setagps, 8);
i = 0;
while ( i < 0 || string[0] != '\xa0')
i = read(fd, string, 1);
while (i < 64) {
i += read(fd, &string[i], 64 - i);
if (i > 0 && string[i-1] == 0x0a)
break;
}
} while( memcmp(&string[i - 9], agpsresp, 9) );
printf( "Venus Ready\n" );
/* start the transmission */
sprintf(string, "BINSIZE = %ld Checksum = %d Checksumb = %d ", ephbytes, csuma, csumb);
printf("%s:", string);
write(fd, string, strlen(string) + 1);
readtonull(fd);
#define BLKSIZ 8192
while (ephbytes > 0) {
printf("%ld left:", ephbytes);
write(fd, ephdata, ephbytes > BLKSIZ ? BLKSIZ : ephbytes);
readtonull(fd); // OK
ephbytes -= BLKSIZ;
ephdata += BLKSIZ;
}
// Status "END" or "Error2"
readtonull(fd); // END
sleep(1);
write(fd, agpsena, 9);
// maybe get ack?
sleep(1);
close(fd);
return 0;
}
Added sleep(1) before file transmission:
printf( "Venus Ready\n" );
+ sleep(1)
/* start the transmission */
sprintf(string, "BINSIZE = %ld Checksum = %d Checksumb = %d ", ephbytes, csuma, csumb);
Now it works:
# agps
Startup
Venus Ready
BINSIZE = 114638 Checksum = 89 Checksumb = 177 :OK
114638 left:OK
106446 left:OK
98254 left:OK
90062 left:OK
81870 left:OK
73678 left:OK
65486 left:OK
57294 left:OK
49102 left:OK
40910 left:OK
32718 left:OK
24526 left:OK
16334 left:OK
8142 left:OK
END
I have following problem:
I set the update rate to 5Hz (SRAM + Flash → bad idea) and now I am not able to send any commands (beside hot and warm start)
Baudrate is at 38400, receiving data (as before) over FTDI Basic. Error message: Timeout: GPS device no response.
Using SkyTraq 0.4.453
Any suggestion how to set the update rate back or to be able again to communicate with the gps?
thanks in advance!
One of the solder shorted jumpers selects flash v.s rom bootup. Check the datasheet and schematics.
thank you, reboot did work (1Hz update rate).
note to myself: read the manual before asking stupid questions
hps5:
thank you, reboot did work (1Hz update rate).note to myself: read the manual before asking stupid questions
This is unfortunately one of those things that isn’t obvious, so the question wasn’t stupid. The jumper pads aren’t labeled as to function, and you have to read just the right place in the datasheet to know it can even do this.