The hard RAK831 cafe part 2

After closer look the DIO3 and DIO4 leds light up but only on downlink activity (when responding to OTAA join request) but I see none of the DIO0 - DIO2 leds doing anything.

Need help in accessing the GPS module in the converter board from RPI3. Can someone point me in the right direction? thanks!

forgot to ask you @jmarcelino at the conference… how is that new rak832 board performing ?
any indication yet … tnx

1 Like

Build your own RAK831 based gateway

This document is based on a workshop held during The Things Network Conference 2018.

https://www.thethingsnetwork.org/docs/gateways/rak831/

2 Likes

RAK mini PCIe

1 Like

@rakwireless

I’m not sure what’s happening on AliExpress but searching for RAK831 or ‘RAK LoRa’ only comes up with a store called ‘Smile with me’ with very high prices (60+% higher) for the RAK (gateway) products (nothing to smile about).

For those interested in RAK Wireless products, use this URL for the ‘RAK Wireless Module Store’ on AliExpress: https://www.aliexpress.com/store/2805180

A similar question has been asked before: The hard RAK831 cafe part 2 - #51 by ursm
@ursm Have you succeeded in finding more information yet?

Unfortunately still no answer after 2+ months, while there should be people on the forum who know more about this subject. (I’m not one of them currently, I don’t have a GPS on my gateway yet.)

The GPS serves two purposes:

  • A 1 pps (pulse per second) logic signal that is used for timing purposes by the gateway software.
  • To provide the actual coordinates to the gateway software.

Each of these features requires different support in the gateway software.

Many GPS modules are connected via UART/serial port (Rx/Tx) including the GPS module on the RAK Raspberry Pi converter board (if a GPS module is present). On earlier versions of the RAK converter board the GPS Rx and Tx pins were not connected. On recent versions they are wired via two jumpers.

In the gateway software one can configure if a real GPS, a fake GPS or no GPS is used. I am unaware what happens when the ‘real GPS’ option is selected and if any support for reading out a GPS is already available in the gateway software or that it requires additional software to be installed.

Maybe @kersing knows if GPS support is present in the gateway software and how reading out GPS coordinates can be enabled.

Last week I received my RAK831 from China. I’ve used an Orange Pi Zero for the “backhaul”. A full description (in Dutch for now) can be found here

2 Likes

I just manadged to read the GPS stream via serial, but not able to manipulate it into the actual position

I haven’t used RAK831 with gps yet, in theory al that is required is to specify there is a gps and which (device) file to use for access. Works with RPi, iC880a and a GPS module.

Do you mean device like /dev/ttyS0 ?

Are there any special settings required for GPS bitrate, GPS protocol etc.?

No, I mean a device file like ‘/dev/ttyAMA0’ (which happens to be the file I use)

Yes there are special settings. Can be found in the code on github. (9600, uBlox or NMEA protocol for those too lazy)

Raspberry Pi 3 and the Serial Port

Source: https://raspberrypi.stackexchange.com How do I make Serial work on the Raspberry Pi 3

This answer is still correct, and explains in more detail the nature of the changes, but most users of current Raspbian should just run sudo raspi-config Select Interfacing Options / Serial then specify if you want a Serial console (probably no) then if you want the Serial Port hardware enabled (probably yes). Then use /dev/serial0 in any code which accesses the Serial Port.

The BCM2837 on the Raspberry Pi3 has 2 UARTs (as did its predecessors), however to support the Bluetooth functionality the fully featured PL011 UART was moved from the header pins to the Bluetooth chip and the mini UART made available on header pins 8 & 10.

This has a number of consequences for users of the serial interface.

The /dev/ttyAMA0 previously used to access the UART now connects to Bluetooth.
The miniUART is now available on /dev/ttyS0.
In the latest operating system software there is a /dev/serial0 which selects the appropriate device so you can replace /dev/ttyAMA0 with /dev/serial0 and use the same software on the Pi3 and earlier models.

Unfortunately there are a number of other consequences:

The mini UART is a secondary low throughput UART intended to be used as a console.

The mini Uart has the following features:
• 7 or 8 bit operation.
• 1 start and 1 stop bit.
• No parities.
• Break generation.
• 8 symbols deep FIFOs for receive and transmit.
• SW controlled RTS, SW readable CTS.
• Auto flow control with programmable FIFO level.
• 16550 like registers.
• Baudrate derived from system clock.

There is no support for parity and the throughput is limited, 
but the latter should not affect most uses.

There is one killer feature “Baudrate derived from system clock” which makes the miniUART useless as the this clock can change dynamically e.g. if the system goes into reduced power or in low power mode.

Modifying the /boot/config.txt removes this dependency by adding the following line at the end:
core_freq=250

This fixes the problem and appears to have little impact. The SPI clock frequency and ARM Timer are also dependent on the system clock.

For some bizarre reason the default for Pi3 using the latest 4.4.9 kernel is to DISABLE UART. To enable it you need to change enable_uart=1 in /boot/config.txt. (This also fixes the core_freq so this is no longer necessary.)

Finally if you don’t use Bluetooth (or have undemanding uses) it is possible to swap the ports back in Device Tree. There is a pi3-miniuart-bt and pi3-disable-bt module which are described in /boot/overlays/README.

.
.

Not everyone here on the forum is a seasoned Linux expert (me included) but many try to operate their gateway as good as possible and learn new things (TTN is community driven).
Many will not dive directly into the source code as their first source of information (and others will).

i was able to access the GPS module by enabling SPI using the RESIN_HOST_CONFIG_dtparam device config variable with a value of i2c_arm=on,spi=on. i also added this device config RESIN_HOST_CONFIG_enable_uart with a vaue of 1. i was then able to access the GPS by reading from /dev/ttyS0. :slight_smile:

then i set GW_GPS to true and GW_GPS_PORT to /dev/ttyS0. the gateway was able to read the gps.

3 Likes

Enabling (or disabling) SPI and I2C do not effect the Serial Port (UART) so are not required for the GPS.
SPI is required for the RAK831 board though.

It will be /dev/ttyS0 that did the trick (together with enabling GPS in the gateway config).

To enable the serial port for use with a GPS it is best to explicitly enable the Serial Port and disable Console over the Serial Port with raspi-config (see ‘Raspberry Pi 3 and the Serial Port’ in my previous post).
This will make modifications to the cmdline.txt and config.txt files on the boot partition.
I’m not sure how that should be done when using RESION.IO.

1 Like

RESIN_HOST_CONFIG_enable_uart=1 would enable /dec/ttyS0

1 Like

Was looking at GPS options for my RAK gateway setup, decided to just buy a cheap USB device an have a play with it (I guessed there maybe a hidden pps pin), took some opening but then noticed that this model has PPS available, not sure what EN pin mean mind - need to test now.

20180228_091629329_iOS

EN for Enable?

I know, but why, this operates on power up - data comes through as expected, I got a pulse on the pps pin with my meter too - not sure what is left to enable :slight_smile:

Nice quote. If you look at the instructions for the resin.io builds you will notice for the RPi3 it mentions:
RESIN_HOST_CONFIG_dtoverlay pi3-miniuart-bt

This does exactly what is mentioned at the end of the quote so ttyAMA0, the full UART becomes available for the GPS. For GPS use I would recommend to always use the full UART, not the mini one.

2 Likes