# Rak811 Tracker Board

**URL:** <https://www.thethingsnetwork.org/forum/t/rak811-tracker-board/11006>\
**Category:** End Devices (Nodes)\
**Created:** [December 7, 2017, 1:39am UTC](https://www.thethingsnetwork.org/forum/t/rak811-tracker-board/11006 "2017-12-07T01:39:45Z")\
**Posts on this page:** 20\
**Page:** 13

<div class="post-metadata">

**Author:** ![jpmeijers](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/jpmeijers/32/48543_2.png) [@jpmeijers](https://www.thethingsnetwork.org/forum/u/jpmeijers)\
**Post date:** [April 25, 2018, 12:43pm UTC](https://www.thethingsnetwork.org/forum/t/rak811-tracker-board/11006/252 "2018-04-25T12:43:12Z")

</div>

> [@jcaridadhdez](#):
>
> this for the encoder:  
> int32\_t lat = latitude \* 10000;  
> int32\_t lon = longitude \* 10000;  
> int16\_t alt = altitudeGps \* 100;  
> int8\_t hdev = hdopGps \* 10;

**HDOP:** Almost, but this gives you a range of -12.9 - 12.8. Rather go with unsigned ints to get a range of 0 - 25.6 because hdop will always be positive.

**Altitude:** Why do you need centimetre accuracy, while the altitude accuracy you get from the GPS is in the order of 10’s of metres. Better to stick to metre resolution to save space.

**Lat:** You multiply by 10000, so you end up with a value in the range -900’000 - 900’000. You then store it in a 32bit int, which has a range of -2’147’483’647 - 2’147’483’648. You are therefore **wasting** (4’294’967’296 - 900’000 - 900’000 / 4’294’967’296 = **99.958%**!

Rather use the format as suggested by @RussNelson, which can be found [on github](https://github.com/jpmeijers/RN2483-Arduino-Library/blob/master/examples/TheThingsUno-GPSshield-TTN-Mapper-binary/TheThingsUno-GPSshield-TTN-Mapper-binary.ino#L178). This format was designed to not waste a single bit, therefore maximising the resolution and minimising the LoRa time on air.

---

<div class="post-metadata">

**Author:** ![jcaridadhdez](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/jcaridadhdez/32/40195_2.png) [@jcaridadhdez](https://www.thethingsnetwork.org/forum/u/jcaridadhdez)\
**Post date:** [April 25, 2018, 1:32pm UTC](https://www.thethingsnetwork.org/forum/t/rak811-tracker-board/11006/254 "2018-04-25T13:32:00Z")

</div>

I was wondering about the reason of choice one or the other format, (@RussNelson suggested to use yours) , thank you for the explain, it saves me a couple of hours.  
I will use your format as soon as I get some free time  
My purpose was just to give OlofAst another way to test.

---

<div class="post-metadata">

**Author:** ![RussNelson](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/russnelson/32/44142_2.png) [@RussNelson](https://www.thethingsnetwork.org/forum/u/RussNelson)\
**Post date:** [April 25, 2018, 9:07pm UTC](https://www.thethingsnetwork.org/forum/t/rak811-tracker-board/11006/255 "2018-04-25T21:07:55Z")

</div>

Hmmmm… I think I need a better antenna. I missed out on a bunch of places that I _know_ have good reception. And/or increase the rate of transmission.

[https://ttnmapper.org/special.php?node=crynwr-rak-1&alldates=on&gateways=on&lat=-76.36&lon=42.38](https://ttnmapper.org/special.php?node=crynwr-rak-1&alldates=on&gateways=on&lat=-76.36&lon=42.38)

---

<div class="post-metadata">

**Author:** ![quintin5010](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/quintin5010/32/35697_2.png) [@quintin5010](https://www.thethingsnetwork.org/forum/u/quintin5010)\
**Post date:** [April 27, 2018, 8:26am UTC](https://www.thethingsnetwork.org/forum/t/rak811-tracker-board/11006/256 "2018-04-27T08:26:05Z")

</div>

Hi

How would you go about connecting, a sensor to the trackerboard.

is there 2 gpio pins that i can use?

---

<div class="post-metadata">

**Author:** ![musti](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/musti/32/20484_2.png) [@musti](https://www.thethingsnetwork.org/forum/u/musti)\
**Post date:** [April 27, 2018, 10:45am UTC](https://www.thethingsnetwork.org/forum/t/rak811-tracker-board/11006/257 "2018-04-27T10:45:44Z")

</div>

I have operational devices with [GitHub - jcaridadhdez/RAK811-tracker: Example code for RAK811 nodes with GPS on board, transmitting their coordinates in the payload of the LoRaWAN packet in a format that is compatible with TTN Mapper.](https://github.com/jcaridadhdez/RAK811-tracker) code, programming has been slightly tricky, but on Ubuntu the following works for me:

> sudo apt-get install stm32flasher
> 
> cd
> 
> pio run
> 
> \<move BOOT jumper on RAK811 board, plug in usb\>
> 
> stm32flash /dev/ttyUSB0 -j  
> stm32flash /dev/ttyUSB0 -k  
> stm32flash /dev/ttyUSB0 -e 0 -w .pioenvs/rak811/firmware.bin
> 
> \<if any of the above commands fail, unplug and plug back in until it works\>

---

<div class="post-metadata">

**Author:** ![RussNelson](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/russnelson/32/44142_2.png) [@RussNelson](https://www.thethingsnetwork.org/forum/u/RussNelson)\
**Post date:** [April 27, 2018, 1:03pm UTC](https://www.thethingsnetwork.org/forum/t/rak811-tracker-board/11006/258 "2018-04-27T13:03:53Z")

</div>

Without a doubt. What kind of device do you want to connect?

---

<div class="post-metadata">

**Author:** ![quintin5010](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/quintin5010/32/35697_2.png) [@quintin5010](https://www.thethingsnetwork.org/forum/u/quintin5010)\
**Post date:** [April 27, 2018, 6:14pm UTC](https://www.thethingsnetwork.org/forum/t/rak811-tracker-board/11006/259 "2018-04-27T18:14:30Z")

</div>

Hi Russ

I’m trying to connect a ultrasonic sensor, I think I got vcc and ground, but just need 2 pins for trig and echo.

will the following pins work?

```
pinMode(PA1,OUTPUT); // Physical pin PA1 on the board ?
pinMode(PA15,INPUT); / Physical pin PA15 on the board ?
digitalWrite(PA1,LOW); // Pin PA1 | LOW is off / HIGH is on ?
digitalWrite(PA15,LOW); // Pin PA51

```

Thanks!

![rak](https://www.thethingsnetwork.org/forum/uploads/default/original/2X/3/3dca28b5cd4badd945310d8ee6258019632e50d0.jpg)

---

<div class="post-metadata">

**Author:** ![RussNelson](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/russnelson/32/44142_2.png) [@RussNelson](https://www.thethingsnetwork.org/forum/u/RussNelson)\
**Post date:** [April 28, 2018, 2:25am UTC](https://www.thethingsnetwork.org/forum/t/rak811-tracker-board/11006/260 "2018-04-28T02:25:41Z")

</div>

All these pins are brought out to the 10 pin headers on one side or the other.  
All are GPIO.  
All are 5V tolerant.  
PB12 and PA1 are also ADC inputs

PB12 1 available  
PA8 4 available  
PB3 8 available  
PB5 9 available  
PB2 6 available  
PA1 7 available

PA15 is used to control power to the GPS.

---

<div class="post-metadata">

**Author:** ![quintin5010](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/quintin5010/32/35697_2.png) [@quintin5010](https://www.thethingsnetwork.org/forum/u/quintin5010)\
**Post date:** [April 28, 2018, 8:13am UTC](https://www.thethingsnetwork.org/forum/t/rak811-tracker-board/11006/261 "2018-04-28T08:13:08Z")

</div>

Awesome  
Thanks for the info…

---

<div class="post-metadata">

**Author:** ![OlofAst](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/olofast/32/25844_2.png) [@OlofAst](https://www.thethingsnetwork.org/forum/u/OlofAst)\
**Post date:** [April 28, 2018, 11:36am UTC](https://www.thethingsnetwork.org/forum/t/rak811-tracker-board/11006/262 "2018-04-28T11:36:00Z")

</div>

Has anyone tried RAK811 on mbed?  
[https://os.mbed.com/](https://os.mbed.com/)  
In MBED release 5.8.2 RAK811 support was added.  
But maybe that is for a separate thread, will add one when I have time to look at this.

[https://os.mbed.com/teams/Semtech/code/LoRaWAN-NAMote72-Application-Demo/](https://os.mbed.com/teams/Semtech/code/LoRaWAN-NAMote72-Application-Demo/)

---

<div class="post-metadata">

**Author:** ![RussNelson](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/russnelson/32/44142_2.png) [@RussNelson](https://www.thethingsnetwork.org/forum/u/RussNelson)\
**Post date:** [April 28, 2018, 5:21pm UTC](https://www.thethingsnetwork.org/forum/t/rak811-tracker-board/11006/263 "2018-04-28T17:21:37Z")

</div>

Anybody tried using the board without an external active GPS antenna? I did, and got no GPS fix at all.

My goal for today is to design a 3D printed case for the tracker, holding an 18650 battery and the tracker together. I dropped my tracker and bent the antenna’s SMA connector. Gotta protect the poor thing if I’m going out and about with it!

---

<div class="post-metadata">

**Author:** ![nicbkw](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/nicbkw/32/44893_2.png) [@nicbkw](https://www.thethingsnetwork.org/forum/u/nicbkw)\
**Post date:** [April 28, 2018, 7:31pm UTC](https://www.thethingsnetwork.org/forum/t/rak811-tracker-board/11006/264 "2018-04-28T19:31:32Z")

</div>

Hi @OlofAst, I tried the original RAK811 board (no GPS) and needed to post a question on the mbed forum - [https://os.mbed.com/questions/81016/LoRaWAN-support-for-MTB\_RAK811-target-in/](https://os.mbed.com/questions/81016/LoRaWAN-support-for-MTB_RAK811-target-in/)

---

<div class="post-metadata">

**Author:** ![BoRRoZ](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/borroz/32/44234_2.png) [@BoRRoZ](https://www.thethingsnetwork.org/forum/u/BoRRoZ)\
**Post date:** [May 1, 2018, 1:19pm UTC](https://www.thethingsnetwork.org/forum/t/rak811-tracker-board/11006/265 "2018-05-01T13:19:25Z")

</div>

2 posts were merged into an existing topic: [RAK811-Trackerboard with mbed & Arduino frameworks](https://www.thethingsnetwork.org/forum/t/rak811-trackerboard-with-mbed-arduino-frameworks/13571)

---

<div class="post-metadata">

**Author:** ![jezd](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/jezd/32/46461_2.png) [@jezd](https://www.thethingsnetwork.org/forum/u/jezd)\
**Post date:** [April 30, 2018, 11:00pm UTC](https://www.thethingsnetwork.org/forum/t/rak811-tracker-board/11006/266 "2018-04-30T23:00:07Z")

</div>

are you able to share your code?

---

<div class="post-metadata">

**Author:** ![OlofAst](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/olofast/32/25844_2.png) [@OlofAst](https://www.thethingsnetwork.org/forum/u/OlofAst)\
**Post date:** [May 1, 2018, 1:14pm UTC](https://www.thethingsnetwork.org/forum/t/rak811-tracker-board/11006/268 "2018-05-01T13:14:02Z")

</div>

Not sure if I am doing this right but for those interested in development for the RAK811-Trackerboard with mbed os arduino, please look here.

> [@RAK811-Trackerboard with mbed & Arduino frameworks](https://www.thethingsnetwork.org/forum/t/rak811-trackerboard-with-mbed-arduino-frameworks/13571):
>
> The RAK811 Trackerboard thread i getting quite big. If you want to add hardware you might want to consider using the Arduino or mbed frameworks. This guy is working on an Arduino port, [https://github.com/stm32duino/Arduino\_Core\_STM32](https://github.com/stm32duino/Arduino_Core_STM32) Also some people are looking at the mbed framework that recently has added support for the RAK811 board. However using the mbed framework with OS fills the entire flash and not the basic support for the gps and sensor. I would like to get the people interested…

---

<div class="post-metadata">

**Author:** ![mistery](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/mistery/32/25844_2.png) [@mistery](https://www.thethingsnetwork.org/forum/u/mistery)\
**Post date:** [May 6, 2018, 6:48pm UTC](https://www.thethingsnetwork.org/forum/t/rak811-tracker-board/11006/269 "2018-05-06T18:48:37Z")

</div>

> **[goran-mahovlic/RAK811-GPS-FORWARDER](https://github.com/goran-mahovlic/RAK811-GPS-FORWARDER)**
>
> Contribute to goran-mahovlic/RAK811-GPS-FORWARDER development by creating an account on GitHub.

I have created code to bridge GPS serial and USB serial.  
Idea is to set GPS to low power mode to send data only every few minutes not every sec.  
GPS \> USB is working nicely  
I still do not know how GPS config message ends so I send byte by byte.  
I do not see any change when I send config to GPS ☹

![GPS-RAK-wireless3](https://www.thethingsnetwork.org/forum/uploads/default/original/2X/8/80d7add4e05b94983d296d6ec423982487b3a012.png)

---

<div class="post-metadata">

**Author:** ![kersing](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/kersing/32/44777_2.png) [@kersing](https://www.thethingsnetwork.org/forum/u/kersing)\
**Post date:** [May 6, 2018, 7:50pm UTC](https://www.thethingsnetwork.org/forum/t/rak811-tracker-board/11006/270 "2018-05-06T19:50:37Z")

</div>

Rak831? The lorawan gateway module? Why would you want to set the gps to low power for a gateway?  
Or did you make a mistake in the numbers and are you referring to the rak811 (the subject of this thread)?

---

<div class="post-metadata">

**Author:** ![mistery](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/mistery/32/25844_2.png) [@mistery](https://www.thethingsnetwork.org/forum/u/mistery)\
**Post date:** [May 6, 2018, 8:43pm UTC](https://www.thethingsnetwork.org/forum/t/rak811-tracker-board/11006/271 "2018-05-06T20:43:30Z")

</div>

> [@kersing](#):
>
> gateway

Yes missed no. it is 811 🙂  
Moved to 811 [GitHub - goran-mahovlic/RAK811-GPS-FORWARDER](https://github.com/goran-mahovlic/RAK811-GPS-FORWARDER)  
Tnx

---

<div class="post-metadata">

**Author:** ![RussNelson](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/russnelson/32/44142_2.png) [@RussNelson](https://www.thethingsnetwork.org/forum/u/RussNelson)\
**Post date:** [May 14, 2018, 5:00am UTC](https://www.thethingsnetwork.org/forum/t/rak811-tracker-board/11006/272 "2018-05-14T05:00:22Z")

</div>

Progress. I have a 3D printed part that holds the battery and board together reasonably securely.  
I have figured out how to talk to the software over the serial port.  
My thought is to use one of the GPIO pins to put it into serializing mode.  
That would let you enter the id and key of your application.  
It will be stored in the EEPROM, along with other things like the delay between transmissions, and whether you wanted to upload the accelerometer data and/or battery data.  
That, plus an integration with ttnmapper would let you do mapping without having to compile any code.  
I could make binaries for any of the regions. That could probably also be turned into a run-time selection, but it would also make the code larger. I haven’t checked to see how close we are to filling up the code space.

---

<div class="post-metadata">

**Author:** ![rsoft](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/rsoft/32/16653_2.png) [@rsoft](https://www.thethingsnetwork.org/forum/u/rsoft)\
**Post date:** [May 14, 2018, 9:57am UTC](https://www.thethingsnetwork.org/forum/t/rak811-tracker-board/11006/273 "2018-05-14T09:57:21Z")

</div>

> [@rchaudet](#):
>
> Also, current source code doesnt allow you to reach low power mode: it checks for power supply type and is coded to always be “USB\_POWER” (in timer.c TImerLowPowerHandler() ). just remove this condition or define “BATTERY\_POWER” in GetBoardPowerSource(). Once you have done that, low power will work but LoRa connectivity won’t, because the board is put in deep sleep straight after starting joining process. What I did is replacing DeviceState = DEVICE\_STATE\_SLEEP after printf(“OTAA Join Start… \r\n”) by another state I added in enum eDeviceState: DEVICE\_STATE\_WAITCONFIRM. Sleep mode works properly, MCU consumes almost nothing but since others components like GPS are always ON despite of that, the board will still consume more than 20 mA in best cases.

I dont use GPS module (not soldered).  
I removed power LED, software disabled LED1 & LED2. Now current consumption of board is:  
Hold the RESET button - 39.5 mA;  
Wait mode - 6.5 mA;  
Transmit of packet - 68.8 mA;  
Two short strange consumption after transmit - 22.2 mA.  
Now drop of voltage is 70 mV per one day (18650). I would very much like to get values in microamperes in sleep mode.

I did as you wrote, but I can not put the device into sleep mode.  
Are you able to share your code? Or working example, please.

With best regards.

[Previous page](https://www.thethingsnetwork.org/forum/t/rak811-tracker-board/11006.md?page=12)

[Next page](https://www.thethingsnetwork.org/forum/t/rak811-tracker-board/11006.md?page=14)
