iC880/Raspi and Neo6 GPS problem

Evening all,

So I’m trying to get my development gateway up and running with the above GPS module.

I read this thread (Raspberry Pi 3 + IC880a + GPS) which despite being for the containerised resio.io setup, was very useful. In short: the module is soldered in, I had it working fine with Raspian and gpsd.

I’ve since disabled the gpsd service, and reconfigured the Pi to route the module via the h/w UART. sudo cat /dev/ttyAMA0 shows the NMEA data stream. I’ve physically disconnected the RX wire from the GPS module.

I enable gps in config and restart, and the packet forwarder appears to pick up the GPS fine (see log below). However, at some point along the process I seem to have screwed up something, as it doesn’t start the concentrator :frowning:

Feels like I’m very close, I’m not even convinced it’s related to the GPS module itself. I’m open to suggestions where to look next!

Mark

*** Poly Packet Forwarder for Lora Gateway ***
Version: 2.1.0
*** Lora concentrator HAL library version info ***
Version: 3.1.0; Options: native;


INFO: Little endian host
INFO: found global configuration file global_conf.json, parsing it
INFO: global_conf.json does contain a JSON object named SX1301_conf, parsing SX1301 parameters
INFO: lorawan_public 1, clksrc 1
INFO: Configuring TX LUT with 16 indexes
INFO: radio 0 enabled (type SX1257), center frequency 867500000, RSSI offset -166.000000, tx enabled 1
INFO: radio 1 enabled (type SX1257), center frequency 868500000, RSSI offset -166.000000, tx enabled 0
INFO: Lora multi-SF channel 0> radio 1, IF -400000 Hz, 125 kHz bw, SF 7 to 12
INFO: Lora multi-SF channel 1> radio 1, IF -200000 Hz, 125 kHz bw, SF 7 to 12
INFO: Lora multi-SF channel 2> radio 1, IF 0 Hz, 125 kHz bw, SF 7 to 12
INFO: Lora multi-SF channel 3> radio 0, IF -400000 Hz, 125 kHz bw, SF 7 to 12
INFO: Lora multi-SF channel 4> radio 0, IF -200000 Hz, 125 kHz bw, SF 7 to 12
INFO: Lora multi-SF channel 5> radio 0, IF 0 Hz, 125 kHz bw, SF 7 to 12
INFO: Lora multi-SF channel 6> radio 0, IF 200000 Hz, 125 kHz bw, SF 7 to 12
INFO: Lora multi-SF channel 7> radio 0, IF 400000 Hz, 125 kHz bw, SF 7 to 12
INFO: Lora std channel> radio 1, IF -200000 Hz, 250000 Hz bw, SF 7
INFO: FSK channel> radio 1, IF 300000 Hz, 125000 Hz bw, 50000 bps datarate
INFO: global_conf.json does contain a JSON object named gateway_conf, parsing gateway parameters
INFO: gateway MAC address is configured to AA555A0000000000
INFO: Found 2 servers in array.
INFO: Server 0 configured to “127.0.0.1”, with port up “1680” and port down "1681"
INFO: Server 1 configured to “iot.semtech.com”, with port up “1680” and port down "1680"
INFO: Found 5 system calls in array.
INFO: System command 0: "df -m"
INFO: System command 1: "free -h"
INFO: System command 2: "uptime"
INFO: System command 3: "who -a"
INFO: System command 4: "uname -a"
INFO: monitor hostname or IP address is configured to "127.0.0.1"
INFO: monitor port is configured to "2008"
INFO: ghost hostname or IP address is configured to "127.0.0.1"
INFO: ghost port is configured to "1918"
INFO: downstream keep-alive interval is configured to 10 seconds
INFO: statistics display interval is configured to 30 seconds
INFO: upstream PUSH_DATA time-out is configured to 100 ms
INFO: packets received with a valid CRC will be forwarded
INFO: packets received with a CRC error will NOT be forwarded
INFO: packets received with no CRC will NOT be forwarded
INFO: GPS serial port path is configured to "/dev/ttyAMA0"
INFO: SSH path is configured to "/usr/bin/ssh"
INFO: SSH port is configured to 22
INFO: HTTP port is configured to 80
INFO: NGROK path is configured to "/usr/bin/ngrok"
INFO: Reference latitude is configured to 10.000000 deg
INFO: Reference longitude is configured to 20.000000 deg
INFO: Reference altitude is configured to -1 meters
INFO: GPS is enabled
INFO: Using fake GPS coordinates instead of real.
INFO: antenna_gain 0 dBi
INFO: Upstream data is enabled
INFO: Downstream data is enabled
INFO: Ghoststream data is disabled
INFO: Radiostream data is enabled
INFO: Statusstream data is enabled
INFO: Beacon is disabled
INFO: Monitor is disabled
INFO: Platform configured to "IMST + Rpi"
INFO: Contact email configured to "operator@gateway.tst"
INFO: Description configured to "Update me"
INFO: found local configuration file local_conf.json, parsing it
INFO: redefined parameters will overwrite global parameters
INFO: local_conf.json does not contain a JSON object named SX1301_conf
INFO: local_conf.json does contain a JSON object named gateway_conf, parsing gateway parameters
INFO: gateway MAC address is configured to B827EBFFFE329883
INFO: Found 1 servers in array.
INFO: Server 0 configured to “router.eu.thethings.network”, with port up “1700” and port down "1700"
INFO: packets received with a valid CRC will be forwarded
INFO: packets received with a CRC error will NOT be forwarded
INFO: packets received with no CRC will NOT be forwarded
INFO: GPS serial port path is configured to "/dev/ttyAMA0"
INFO: Reference latitude is configured to 51.489900 deg
INFO: Reference longitude is configured to 0.304300 deg
INFO: Reference altitude is configured to 12 meters
INFO: GPS is enabled
INFO: Using real GPS if available.
INFO: antenna_gain 0 dBi
INFO: Upstream data is enabled
INFO: Downstream data is enabled
INFO: Ghoststream data is disabled
INFO: Radiostream data is enabled
INFO: Statusstream data is enabled
INFO: Beacon is disabled
INFO: Monitor is disabled
INFO: Contact email configured to "mark@annasach.net"
INFO: Description configured to "LoRaWAN Brentford Development"
INFO: [main] TTY port /dev/ttyAMA0 open for GPS synchronization
INFO: Successfully contacted server router.eu.thethings.network
INFO: [main] Starting the concentrator
ERROR: [main] failed to start the concentrator

PS - I haven’t yet connected the PPS output to the iC880a, as this isn’t needed and I’m trying to solve one problem at a time.

And it’s also very fiddly soldering :wink:

Should not be as long as your GPS module has PPS output. PPS input for the iC880a is on the 20 pin connector as well as on the second u.FL connector, so take your pick.

Is SPI enabled on the RPi?

I mean on the Neo6 module itself. My eyes and hands aren’t quite as good as they used to be :wink:

OK, what’s going on here… this is (at least) the 3rd or 4th time I’ve enabled SPI, per your suggestion! I didn’t check this because I knew I’d done it. :confused: Doesn’t it persist?

It should persist. However I haven’t tested with recent Raspian images as I’m using resin.io exclusively for gateways lately.

Thanks - again - for your help.

I’ll check online and see if I can find anything.

I’m wondering if it isn’t losing SPI state, but rather than Raspi3 SPI timing problem you’ve mentioned on other threads? :think:

In the meantime I’ve got my magnifying lamp out and soldered up the PPS connection :slight_smile:

I’ve ordered a Pi 2B. If I can’t get this sorted I’ll give it a go with that.

Oddly, my production gateway doesn’t have this issue… but then it doesn’t get switched off!

In the meantime, on the off-chance that I messed something up at system level, I’ve reflashed the card from my safety copy again. Concentrator is coming up reliably…

GPS is giving errors tho. I’ve remapped the serial ports on the Pi3, so sudo cat /dev/ttyAMA0 gives this with the iC880a disconnected:

$GPGSV,3,3,10,27,84,096,24,30,13,316,*7D

$GPRMC,224213.630,V,080318,M*4D

$GPVTG,M*33

$GPZDA,224213.630,08,03,2018,00,00*57

$GPTXT,01,01,01,ANTENNA OK*35

$GPGGA,224214.630,0,00,25.5,*62

$GPGLL,224214.630,V,M*7F

$GPGSA,A,1,25.5,25.5,25.5*02

$GPGSV,3,1,10,07,16,291,08,51,294,28,10,53,118,11,10,263,*70

$GPGSV,3,2,10,15,08,034,16,38,179,21,21,067,26,12,168,*78

$GPGSV,3,3,10,27,84,096,24,30,13,316,*7D

$GPRMC,224214.630,V,080318,M*4A

$GPVTG,M*33

$GPZDA,224214.630,08,03,2018,00,00*50

$GPTXT,01,01,01,ANTENNA OK*35

$GPGGA,224215.630,0,00,25.5,*63

$GPGLL,224215.630,V,M*7E

$GPGSA,A,1,25.5,25.5,25.5*02

$GPGSV,3,1,10,07,16,291,08,51,294,28,10,53,118,11,10,263,*70

$GPGSV,3,2,10,15,08,034,16,38,179,21,21,067,26,12,168,*78

$GPGSV,3,3,10,27,84,096,24,30,13,316,*7D

$GPRMC,224215.630,V,080318,M*4B

$GPVTG,M*33

$GPZDA,224215.630,08,03,2018,00,00*51

$GPTXT,01,01,01,ANTENNA OK*35

$GPGGA,224216.630,0,00,25.5,60
$GPGLL,224216.630,V,M
7D
$GPGSA,A,1,25.5,25.5,25.5*02
$GPGSV,3,1,10,07,16,291,08,51,294,28,10,53,118,11,10,263,*70
$GPGSV,3,2,10,15,08,034,16,38,179,21,21,067,26,12,168,*78

Once I reconnect the concentrator, gps opens ok but I get all this spam:

Mar 8 21:37:44 ttn-tw8 ttn-gateway[334]: INFO: Contact email configured to "mark@annasach.net"
Mar 8 21:37:44 ttn-tw8 ttn-gateway[334]: INFO: Description configured to "LoRaWAN Brentford Development"
Mar 8 21:37:44 ttn-tw8 ttn-gateway[334]: INFO: [main] TTY port /dev/ttyAMA0 open for GPS synchronization
Mar 8 21:37:44 ttn-tw8 ttn-gateway[334]: INFO: Successfully contacted server router.eu.thethings.network
Mar 8 21:37:44 ttn-tw8 ttn-gateway[334]: INFO: [main] Starting the concentrator
Mar 8 21:37:44 ttn-tw8 ttn-gateway[334]: INFO: [main] concentrator started, radio packets can now be received.
Mar 8 21:37:44 ttn-tw8 ttn-gateway[334]: INFO: [up] Thread activated for all servers.
Mar 8 21:37:44 ttn-tw8 ttn-gateway[334]: INFO: [down] Thread activated for all server router.eu.thethings.network
Mar 8 21:37:44 ttn-tw8 ttn-gateway[334]: INFO: GPS thread activated.
Mar 8 21:37:44 ttn-tw8 ttn-gateway[334]: WARNING: [gps] read() returned value <= 0
Mar 8 21:37:44 ttn-tw8 ttn-gateway[334]: WARNING: [gps] read() returned value <= 0
Mar 8 21:37:44 ttn-tw8 ttn-gateway[334]: WARNING: [gps] read() returned value <= 0
Mar 8 21:37:44 ttn-tw8 ttn-gateway[334]: WARNING: [gps] read() returned value <= 0
Mar 8 21:37:44 ttn-tw8 ttn-gateway[334]: WARNING: [gps] read() returned value <= 0
Mar 8 21:37:44 ttn-tw8 ttn-gateway[334]: WARNING: [gps] read() returned value <= 0
Mar 8 21:37:44 ttn-tw8 ttn-gateway[334]: WARNING: [gps] read() returned value <= 0
Mar 8 21:37:44 ttn-tw8 ttn-gateway[334]: WARNING: [gps] read() returned value <= 0
Mar 8 21:37:44 ttn-tw8 ttn-gateway[334]: WARNING: [gps] read() returned value <= 0
Mar 8 21:37:44 ttn-tw8 ttn-gateway[334]: WARNING: [gps] read() returned value <= 0
Mar 8 21:37:44 ttn-tw8 ttn-gateway[334]: WARNING: [gps] read() returned value <= 0
Mar 8 21:37:44 ttn-tw8 ttn-gateway[334]: WARNING: [gps] read() returned value <= 0
Mar 8 21:37:44 ttn-tw8 ttn-gateway[334]: WARNING: [gps] read() returned value <= 0
Mar 8 21:37:44 ttn-tw8 ttn-gateway[334]: WARNING: [gps] read() returned value <= 0
Mar 8 21:37:44 ttn-tw8 ttn-gateway[334]: WARNING: [gps] read() returned value <= 0
Mar 8 21:37:44 ttn-tw8 ttn-gateway[334]: WARNING: [gps] read() returned value <= 0
Mar 8 21:37:44 ttn-tw8 ttn-gateway[334]: WARNING: [gps] read() returned value <= 0
Mar 8 21:37:44 ttn-tw8 ttn-gateway[334]: WARNING: [gps] read() returned value <= 0
Mar 8 21:37:44 ttn-tw8 ttn-gateway[334]: WARNING: [gps] read() returned value <= 0
Mar 8 21:37:44 ttn-tw8 ttn-gateway[334]: WARNING: [gps] read() returned value <= 0
Mar 8 21:37:44 ttn-tw8 ttn-gateway[334]: WARNING: [gps] read() returned value <= 0
Mar 8 21:37:44 ttn-tw8 ttn-gateway[334]: WARNING: [gps] read() returned value <= 0
Mar 8 21:37:44 ttn-tw8 ttn-gateway[334]: WARNING: [gps] read() returned value <= 0
Mar 8 21:37:44 ttn-tw8 ttn-gateway[334]: WARNING: [gps] read() returned value <= 0
Mar 8 21:37:44 ttn-tw8 ttn-gateway[334]: WARNING: [gps] read() returned value <= 0
Mar 8 21:37:44 ttn-tw8 ttn-gateway[334]: WARNING: [gps] read() returned value <= 0
Mar 8 21:37:44 ttn-tw8 ttn-gateway[334]: WARNING: [gps] read() returned value <= 0
Mar 8 21:37:44 ttn-tw8 ttn-gateway[334]: WARNING: [gps] read() returned value <= 0
Mar 8 21:37:44 ttn-tw8 ttn-gateway[334]: WARNING: [gps] read() returned value <= 0
Mar 8 21:37:44 ttn-tw8 ttn-gateway[334]: WARNING: [gps] read() returned value <= 0
Mar 8 21:37:44 ttn-tw8 ttn-gateway[334]: WARNING: [gps] read() returned value <= 0
Mar 8 21:37:44 ttn-tw8 ttn-gateway[334]: WARNING: [gps] read() returned value <= 0

The two sentences that contain the location data, RMC and GGA do not actually contain any location data. If the GPS does not have a fix (you do have it outdoors I hope) then the empty lat and long fields are normally replaced by commas to indicate null fields. These commas are not there.

Is this a geniune Ublox Neo 6 that you got from a reputable supplier ?

1 Like

Hi there

It’s a genuine module. It does struggle to get a fix as my workbench is indoors, although the final location is in my roof space. I’ll try moving it!

Thanks

Well… I think it’s kosher:

Thats the whole point about fakes, they make them look kosher.

Anyway, the forum software is the case of the confusion, it is omitting the strings of commas that are normally present in a NMEA sentence without a fix, below is two copies of a sentence from one on my GPSs, the first is a straight copy to the forum, the second I deleberatly put spaces between the groups of commas;

$GPGGA,091258.00,0,00,99.99,*61
$GPGGA,091258.00, , , , ,0,00,99.99, , , , , ,*61

One wonders what other characters the forum software strips out …

Hmm. I did have it running and getting a fix with cgps and gpsd properly under raspbian. Checked that before I moved on to trying to get it working with the concentrator.

Still could be a formatting issue I suppose…

May-be put this kind of information in a code block? [ code ] … [ /code ] (skip the spaces)

Just some comma's without spaces
,,,,,,,
Idem with spaces
, , , , 

What do you mean ‘forum software’?

Something’s seriously wrong… syslog and daemon.log are filling up and /var is running out of space.

Could you try mp_pkt_fwd? (Easiest is resin.io.) There have been a couple of updates to low level libraries after the version you are using that are included in MP forwarder.

OK, some progress.

First of all there was a dry joint on my TX wiring :roll_eyes: Fixing that means I get reliable data from the module.

In case I’d screwed something up at system level, I did a clean install of Stretch and got the GPS module set up and working first. That gets me reliable position information on ttyAMA0. Yay.

$GPRMC,225036.000,A,51xx.xxxx,N,000xx.xx,W,0.00,200.38,090318,A*71

I then installed and configured the LoRa software per the ttn-zh wiki (https://github.com/ttn-zh/ic880a-gateway/wiki). Everything is up and running and the concentrator appears to be seeing the GPS:

Mar 9 22:47:09 ttn-dev-gw ttn-gateway[538]: INFO: Reference longitude is configured to 0.000000 deg
Mar 9 22:47:09 ttn-dev-gw ttn-gateway[538]: INFO: Reference altitude is configured to 0 meters
Mar 9 22:47:09 ttn-dev-gw ttn-gateway[538]: INFO: GPS is enabled

I say ‘appears’… it isn’t throwing any errors about opening the serial port. I’m slightly suspicious that I can still cat /ttyAMA0 in another shell. However:

Mar 9 22:49:32 ttn-dev-gw ttn-gateway[538]: ### [GPS] ###
Mar 9 22:49:32 ttn-dev-gw ttn-gateway[538]: # Invalid gps time reference (age: 1520635659 sec)
Mar 9 22:49:32 ttn-dev-gw ttn-gateway[538]: # Manual GPS coordinates: latitude 0.00000, longitude 0.00000, altitude 0 m
Mar 9 22:49:32 ttn-dev-gw ttn-gateway[538]: ##### END #####

I’m getting this despite the fact that the timestamp on each sentence format is correct. I’ve also patched the PPS output from the GPS module to pin 19 on the iC880a concentrator.

I’m prepared to look at the resin option, but it feels like I’m so close that I’d really like to get it working as it stands…!

Mark

PS: fun fact - another problem I found was that with the module and antenna in the case, it doesn’t get a fix; with them out of the case, it works. The module (not antenna) was sandwiched between Raspi and concentrator - is it possible RFI was interfering with the signal? It’s still indoors by the way.

PS - I know the time ref in the log is unix 1970 default date.

GPSs are highly marginal indoors, just about anything could make reception worse, or indeed better.

1 Like