{"id":24,"date":"2017-09-05T11:26:26","date_gmt":"2017-09-05T10:26:26","guid":{"rendered":"https:\/\/computenodes.net\/?p=24"},"modified":"2025-01-17T16:04:34","modified_gmt":"2025-01-17T16:04:34","slug":"adding-a-gps-receiver-to-the-ic880a-lorawan-concentrator","status":"publish","type":"post","link":"https:\/\/computenodes.net\/2017\/09\/05\/adding-a-gps-receiver-to-the-ic880a-lorawan-concentrator\/","title":{"rendered":"Adding a GPS Receiver to the iC880A LoRaWAN concentrator"},"content":{"rendered":"

Hardware setup<\/h1>\n

The iC880A <\/a>is a popular PCB for creating a multichannel LoRaWAN base station.\u00a0 It is supplied with pads for the addition of a u-blox LEA-6T<\/a>.\u00a0 As well as adding the GPS receiver module several other components have to be added including a power supply, USB connector and associated passives \/ TVS protection diodes.<\/p>\n\n\n\n
\n

\"\"
IMST iC880A prior to the GPS module and associated components being added.<\/figcaption><\/figure><\/td>\n
\n

\"\"
IMST iC880A with ublox GPS soldered on and SAW-filter bypassed<\/figcaption><\/figure><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n

However, following the instructions provided produces a system that enable communication with the GPS receiver but is unable to receive any satellite signal.\u00a0This is due to a couple of problems, in order to debug these the Hardware Integration Manual for the LEA-6T<\/a> is needed.<\/p>\n

The first stage of the debugging was to identify that the active antenna connected to the SMA was not receiving power.\u00a0 Whilst debugging this stage it was confirmed it was an aerial problem as when probing for DC voltage on the antenna connector the multi-meter probes were acting as antenna enabling signal to be received and a lock to be obtained.<\/p>\n

 <\/p>\n

\"\"
LEA-6x antenna circuit design from https:\/\/www.u-blox.com\/sites\/default\/files\/products\/documents\/LEA-NEO-MAX-6_HIM_(UBX-14054794).pdf<\/a><\/figcaption><\/figure>\n

The first problem is in the power supply circuit for the active antenna. R_BIAS (R959) is the recommended 10 Ohms, however, there also appears to be R958 connected to the V_ANT pin. R958 is a 0 Ohm resistor to ground meaning V_ANT is now tied to 0V and therefore unable to power the active antenna. Upon removal of R958, it was possible to observe 3V at the RF pin suitable for powering an LNA as part of the antenna. However, the antenna was still receiving satellite signals.<\/p>\n

This led to the diagnosis of a further problem the instructions from IMST have a IC (U950) between RF_IN on the receiver and the SMA connector on the PCB.\u00a0 This component is a SF1186K-3<\/a>, which is a SAW Filter<\/a>, which is designed to only pass the required frequency, thus improving noise rejection.\u00a0 This, chip also blocks DC (Minimum 35dB rejection) meaning the antenna does not receive power.\u00a0 As can be seen from the integration manual, the receiver does not require this filter, so it was remove and bypassed (visible in the bottom right of the second photo).\u00a0 Having completed this modification the GPS receiver is now able to receive the satellite signal and get a position lock.\u00a0 This was tested using the u-centre software available from u-blox connected via USB.<\/p>\n

Finally the GPS serial output is connected to the Pi onboard serial port.\u00a0 This can either be done using jumper leads.\u00a0 For development we are using the Raspberry PI iC880A Lora Concentrator Gateway Shield<\/a>, however, this doesn’t have these ports connected, so patch wire was used to connect the required pins.<\/p>\n

Software Setup<\/h1>\n

Now the GPS is able to communicate both with the Pi and satellites a bit of software configuration is needed.\u00a0 The Pi is now connected to UART1 of the GPS receiver needs configuration.\u00a0 This can be done in u-centre, view -> configuration).\u00a0\u00a0 Before leaving a page you need to click send to actually tell the GPS unit about the change.<\/p>\n

The first things is to enable NMEA output on the serial port connected to the Pi.\u00a0 This is under the ‘PRT’ section. UART1 should be set to NMEA out @ baudrate 9600.<\/p>\n

The GPS module is now sending lots of NMEA messages to the Pi, most of which are ignored by the LoRa gateway.\u00a0 The only messages that the code parses match $G?RMC & $G?GGA.\u00a0 All other messages can be turned off using the ‘MSG’ section of the configuration.<\/p>\n

Having made the changes to the configuration these need to be made persistent.\u00a0 Go to ‘CFG’, make sure “save current configuration” is selected and then click send.\u00a0 These changes should now persist.<\/p>\n

Make sure that the serial port is enabled on the Rapsberry Pi using raspi-config.\u00a0 Do not enable a console on the serial port.<\/p>\n

Finally change the local_config.json to enable the GPS receiver.\u00a0 The configuration used on the node used for testing is<\/p>\n

\r\n    "gateway_conf": {\r\n    "gateway_ID": "B827EBFFFEXXXXXX",\r\n    "servers": [\r\n        {\r\n            "server_address": "router.eu.thethings.network",\r\n            "serv_port_up": 1700,\r\n            "serv_port_down": 1700,\r\n            "serv_enabled": true\r\n        }\r\n    ],\r\n    "gps_tty_path": "\/dev\/serial0",\r\n    "contact_email": "test@example.com",\r\n    "description": "GPS-test-node",\r\n    "fake_gps": false,\r\n    "forward_crc_valid": true,\r\n    "forward_crc_error": false,\r\n    "forward_crc_disabled": true\r\n    }\r\n}\r\n<\/pre>\n

 <\/p>\n

Testing<\/h1>\n

Due to the poor quality of GPS signal available in my office and in the (basement) electronics lab testing has had to wait until the weather has been good enough to spend some time outside.\u00a0 This has meant waiting rather longer than hoped, but that’s the British weather for you! When suitable weather did arrive I took the gateway and a client device outside and setup on a picnic bench outside the office.\u00a0 On starting the poly_pkt_fwd script there was the usual output stream with some additional lines shown below.<\/p>\n

INFO: Validation thread activated.\r\nWARNING: [gps] GPS out of sync, keeping previous time reference\r\nWARNING: [gps] GPS out of sync, keeping previous time reference\r\nINFO: [down] for server router.eu.thethings.network PULL_ACK received in 299 ms\r\nINFO: [down] for server router.eu.thethings.network PULL_ACK received in 82 ms\r\nINFO: [down] for server router.eu.thethings.network PULL_ACK received in 93 ms\r\n\r\n##### 2017-08-01 17:06:10 GMT #####\r\n### [UPSTREAM] ###\r\n# RF packets received by concentrator: 0\r\n# CRC_OK: 0.00%, CRC_FAIL: 0.00%, NO_CRC: 0.00%\r\n# RF packets forwarded: 0 (0 bytes)\r\n# PUSH_DATA datagrams sent: 0 (0 bytes)\r\n# PUSH_DATA acknowledged: 0.00%\r\n### [DOWNSTREAM] ###\r\n# PULL_DATA sent: 3 (100.00% acknowledged)\r\n# PULL_RESP(onse) datagrams received: 0 (0 bytes)\r\n# RF packets sent to concentrator: 0 (0 bytes)\r\n# TX errors: 0\r\n### [GPS] ###\r\n# Valid gps time reference (age: 1 sec)\r\n# System GPS coordinates: latitude 50.93680, longitude -1.40584, altitude 69 m\r\n##### END #####\r\n<\/pre>\n

As can be seen at first start up the GPS receiver hadn’t yet got a decent lock so the forwarder ignore the data that it was receiving from the device and kept going with the time the device had from NTP. Shortly afterwards it can be seen that the GPS had achieved a lock and was being used as the time reference.<\/p>\n

I am confused by one aspect of the behaviour of the system, and that is the transmission of beacons. In the global_conf file the transmission of beacons is disabled. This is confirmed by the following line in the logs.<\/p>\n

INFO: Beacon is disabled\r\n<\/pre>\n

However, it would appear that the device still tries to send a beacon.<\/p>\n

NOTE: [down] beacon ready to send (frequency 0 Hz)\r\n--- Beacon payload ---\r\n0xEE - 0xFF - 0xC0 - 0x00 - 0x00 - 0x00 - 0x00 - 0x84\r\n0x00 - 0x80 - 0xA1 - 0x91 - 0x59 - 0x38 - 0x0E - 0x1C\r\n0x8C - 0x00 - 0x00 - 0x00 - 0x00 - 0x00 - 0x00 - 0x00\r\n--- end of payload ---\r\nWARNING: [down] beacon was scheduled but failed to TX\r\n<\/pre>\n

Further testing was carried out and it was identified that the PPS output of the u-blox module was not actually connected to the PPS line used by the transceiver (and available on the header). The failure of transmission was because the expected rising edge never arrived rather than anything with the actual transmission going wrong. On the iC880A PCB there is a test pad available by the timepulse output of the u-blox module. So it was a simple matter of linking the two together. Having done this it was tested again and it worked giving the following output when transmitting a beacon.<\/p>\n

\r\nNOTE: [down] beacon ready to send (frequency 0 Hz)\r\n--- Beacon payload ---\r\n0xEE - 0xFF - 0xC0 - 0x00 - 0x00 - 0x00 - 0x00 - 0x84\r\n0x00 - 0x80 - 0x62 - 0x94 - 0x59 - 0x38 - 0x0E - 0x1C\r\n0x8C - 0x00 - 0x00 - 0x00 - 0x00 - 0x00 - 0x00 - 0x00\r\n--- end of payload ---\r\nNOTE: [down] beacon sent successfully\r\n<\/pre>\n

Although why it is transmitting a beacon with the flag set to false is still a mystery to me.<\/p>\n

I’m lucky in that I have experience working with 0402 components which meant soldering on the passives was a feasbile proposition, and the uBlox module itself is a reasonable size for hand soldering. However, the SAW filter was beyond my abilities (many thanks to my colleague Graeme Bragg for his help with this.) so the fact it is not needed reduces the complexity of this modification considerably. Even so it’s not something I would recommend people without experience of hand soldering 0402 components tries. Which got us thinking there must be an easier way to add GPS receivers onto this iC880A concentrator boards. More to follow.<\/p>\n","protected":false},"excerpt":{"rendered":"

Hardware setup The iC880A is a popular PCB for creating a multichannel LoRaWAN base station.\u00a0 It is supplied with pads for the addition of a u-blox LEA-6T.\u00a0 As well as adding the GPS receiver module several other components have to be added including a power supply, USB connector and associated passives \/ TVS protection diodes.
Continue reading Adding a GPS Receiver to the iC880A LoRaWAN concentrator<\/span> <\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[9,2,8],"tags":[],"class_list":["post-24","post","type-post","status-publish","format-standard","hentry","category-gps","category-lorawan","category-raspberry-pi","col-1"],"_links":{"self":[{"href":"https:\/\/computenodes.net\/wp-json\/wp\/v2\/posts\/24","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/computenodes.net\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/computenodes.net\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/computenodes.net\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/computenodes.net\/wp-json\/wp\/v2\/comments?post=24"}],"version-history":[{"count":8,"href":"https:\/\/computenodes.net\/wp-json\/wp\/v2\/posts\/24\/revisions"}],"predecessor-version":[{"id":56,"href":"https:\/\/computenodes.net\/wp-json\/wp\/v2\/posts\/24\/revisions\/56"}],"wp:attachment":[{"href":"https:\/\/computenodes.net\/wp-json\/wp\/v2\/media?parent=24"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/computenodes.net\/wp-json\/wp\/v2\/categories?post=24"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/computenodes.net\/wp-json\/wp\/v2\/tags?post=24"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}