Altitude measurement on RAK8211NB

Issue: Altitude measurement jumps and does not seems accurate

Setup:

Details:

{
“time”: “16:15:00”,
“lat”: 52.36088166666, “lon”: 4.86607166666, “fix”: 1, “satellites”: 4, “altitude”: 88.5 }
{
“time”: “16:15:02”,
“lat”: 52.3603, “lon”: 4.86507, “fix”: 1, “satellites”: 4, “altitude”: -30.6 }
{
“time”: “16:15:03”,
“lat”: 52.360275, “lon”: 4.865085, “fix”: 1, “satellites”: 4, “altitude”: -30.7 }
{
“time”: “16:15:04”,
“lat”: 52.36026333333, “lon”: 4.86507333333, “fix”: 1, “satellites”: 4, “altitude”: -31.9 }
{
“time”: “16:15:05”,
“lat”: 52.360235, “lon”: 4.86501, “fix”: 1, “satellites”: 4, “altitude”: -38.5 }
{
“time”: “16:15:06”,
“lat”: 52.36024666666, “lon”: 4.864945, “fix”: 1, “satellites”: 4, “altitude”: -41.4 }
{
“time”: “16:15:07”,
“lat”: 52.36020166666, “lon”: 4.86488666666, “fix”: 1, “satellites”: 4, “altitude”: -49.7 }
{
“time”: “16:15:08”,
“lat”: 52.36019333333, “lon”: 4.86493666666, “fix”: 1, “satellites”: 4, “altitude”: -47.4 }
{
“time”: “16:15:09”,
“lat”: 52.36018833333, “lon”: 4.86504666666, “fix”: 1, “satellites”: 4, “altitude”: -39.8 }
{
“time”: “16:15:10”,
“lat”: 52.36025166666, “lon”: 4.86513666666, “fix”: 1, “satellites”: 4, “altitude”: -31.9 }
{
“time”: “16:15:11”,
“lat”: 52.360245, “lon”: 4.86516333333, “fix”: 1, “satellites”: 4, “altitude”: -30.3 }
{
“time”: “16:15:12”,
“lat”: 52.36030333333, “lon”: 4.865265, “fix”: 1, “satellites”: 4, “altitude”: -18.9 }
{
“time”: “16:15:13”,
“lat”: 52.36030666666, “lon”: 4.86529666666, “fix”: 1, “satellites”: 4, “altitude”: -16.2 }
{
“time”: “16:15:14”,
“lat”: 52.36032166666, “lon”: 4.86530833333, “fix”: 1, “satellites”: 4, “altitude”: -13 }
{
“time”: “16:15:15”,
“lat”: 52.36033333333, “lon”: 4.86558, “fix”: 1, “satellites”: 4, “altitude”: 4.2 }
{
“time”: “16:15:16”,
“lat”: 52.36031833333, “lon”: 4.86544666666, “fix”: 1, “satellites”: 4, “altitude”: -5.8 }
{
“time”: “16:15:17”,
“lat”: 52.36027, “lon”: 4.86561166666, “fix”: 1, “satellites”: 4, “altitude”: 0.5 }
{
“time”: “16:15:18”,
“lat”: 52.36024666666, “lon”: 4.86563333333, “fix”: 1, “satellites”: 4, “altitude”: 0.6 }
{
“time”: “16:15:19”,
“lat”: 52.360225, “lon”: 4.86554333333, “fix”: 1, “satellites”: 4, “altitude”: -6.9 }
{
“time”: “16:15:20”,
“lat”: 52.36022333333, “lon”: 4.865545, “fix”: 1, “satellites”: 4, “altitude”: -6.6 }
{
“time”: “16:15:21”,
“lat”: 52.36022666666, “lon”: 4.86553333333, “fix”: 1, “satellites”: 4, “altitude”: -6.8 }
{
“time”: “16:15:22”,
“lat”: 52.36022666666, “lon”: 4.865525, “fix”: 1, “satellites”: 4, “altitude”: -7.1 }
{
“time”: “16:15:23”,
“lat”: 52.36022166666, “lon”: 4.86552833333, “fix”: 1, “satellites”: 4, “altitude”: -6.8 }
{
“time”: “16:15:24”,
“lat”: 52.36022333333, “lon”: 4.86552166666, “fix”: 1, “satellites”: 4, “altitude”: -7 }
{
“time”: “16:15:25”,
“lat”: 52.36022833333, “lon”: 4.86551166666, “fix”: 1, “satellites”: 4, “altitude”: -7.1 }
{
“time”: “16:15:26”,
“lat”: 52.36023166666, “lon”: 4.86550166666, “fix”: 1, “satellites”: 4, “altitude”: -7.4 }
{
“time”: “16:15:27”,
“lat”: 52.36023333333, “lon”: 4.865495, “fix”: 1, “satellites”: 4, “altitude”: -7.4 }
{
“time”: “16:15:28”,
“lat”: 52.360235, “lon”: 4.86548833333, “fix”: 1, “satellites”: 4, “altitude”: -7.4 }
{
“time”: “16:15:29”,
“lat”: 52.36023833333, “lon”: 4.86548166666, “fix”: 1, “satellites”: 4, “altitude”: -7 }
{
“time”: “16:15:30”,
“lat”: 52.36023833333, “lon”: 4.86547666666, “fix”: 1, “satellites”: 4, “altitude”: -6.7 }
{
“time”: “16:15:31”,
“lat”: 52.36027666666, “lon”: 4.86553333333, “fix”: 1, “satellites”: 5, “altitude”: 1.3 }
{
“time”: “16:15:32”,
“lat”: 52.36028666666, “lon”: 4.86554333333, “fix”: 1, “satellites”: 5, “altitude”: 3.6 }
{

Hi,

Which version of firmware do you use? The code for now is open, and you can refer to this
https://github.com/RAKWireless/RUI_itracker_platform_firmware

Hi Nero,

I am using espruino_2v05_RAK8211.
Link you sent shows 404

Hello, the RAK8211NB module you are using has been discontinued. I cannot reproduce your problem here. The driver of this sensor (L_70_R) is in the address you cannot open just now. Our current RAK5010 module can replace the RAK8211NB module. During the use of the RAK5010 module, the accuracy of latitude and longitude differs within a few meters.


#include <stdint.h>
#include <stdlib.h>
#include <math.h>
#include <stdio.h>
#include <string.h>
#include “board_basic.h”
#include “gps.h”
#include “hal_uart.h”

/*!

  • \brief Buffer holding the raw data received from the gps
    /
    uint8_t Gps_buffer[512] = {0};
    uint8_t Gps_gpgga[128] = {0};
    uint32_t GpsSize = 0;
    /
    !
  • \brief Maximum number of data byte that we will accept from the GPS
    */

void Gps_data_update(uint8_t data)
{
if(GpsSize >= 512)
{
GpsSize = 0;
}
Gps_buffer[GpsSize++] = data;
uint8_t *ptr = NULL;
uint16_t i = 0;
ptr = strstr(Gps_buffer,"$GPGGA");
if( ptr != NULL)
{
memcpy(Gps_gpgga,ptr,128);
}
for(i = 0; i<128; i++)
{
if(Gps_gpgga[i] == ‘\n’)
{
memset(&Gps_gpgga[i+1],0,128-i-1);
break;
}
}
}
void gps_data_checksum(char *str)
{
int i = 0;
int result = 0;
char check[10] = {0};
char result_2[10] = {0};
int j = 0;

while(str[i] != '$')
{
    i++;
}
for(result=str[i+1],i=i+2;str[i]!='*';i++)
{
    result^=str[i];
}
i++;
for(;str[i]!= '\0';i++)
{
    check[j++] = str[i];
}
sprintf(result_2,"%X",result);
//NRF_LOG_INFO( "result_2 = %s\r\n",result_2);
//NRF_LOG_INFO( "check = %s\r\n",check);

if(strncmp(check,result_2,2) != 0)
{
    NRF_LOG_INFO( "gps data verify failed");
}

}
void gps_data_get(uint8_t *data, uint8_t len)
{
gps_data_checksum(Gps_gpgga);
memcpy(data,Gps_gpgga,len);
}

void Gps_Gpio_Init()
{
nrf_gpio_cfg_output(GPS_PWR_ON_PIN);
nrf_gpio_cfg_output(GPS_RESET_PIN);
nrf_gpio_cfg_input(GPS_STANDBY_PIN,NRF_GPIO_PIN_PULLUP);
}

void Gps_power_up( void )
{
GPS_PWR_OFF;
delay_ms(1000);
GPS_PWR_ON;

GPS_RESET_LOW;
delay_ms(2000);
GPS_RESET_HIGH;

}

void Gps_Init(void)
{
Gps_Gpio_Init();
Gps_power_up();
}

void Gps_standby(void)
{
nrf_gpio_cfg_output(GPS_STANDBY_PIN);
nrf_gpio_pin_write (GPS_STANDBY_PIN, 0);
}


I have just purchased 5010 module. I’ll inform you on my findings. Please note that my concern was not lat and lon, but altitude