This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

RSSI and RSRP on THINGY.91

Dear, 

Im trying to measure the RSSI with THINGY:91, I found on the document  nrf91_at_commands_v1.1.pdf about

1. AT+CSQ

      +CSQ: <rssi>,<ber>

Note: Not detectable, RAT not supported. Use +CESQ and %CESQ for E-UTRA signal quality.

2. AT + CESQ 

    +CESQ: <rxlev>,<ber>,<rscp>,<ecno>,<rsrq>,<rsrp>

<rsrp>
0 – RSRP < −140 dBm
1 – When −140 dBm ≤ RSRP < −139 dBm
2 – When −139 dBm ≤ RSRP < −138 dBm
...
95 – When −46 dBm ≤ RSRP < −45 dBm
96 – When −45 dBm ≤ RSRP < −44 dBm
97 – When −44 dBm ≤ RSRP
255 – Not known or not detectable

I am using AT+CESQ to find RSRP 

and, i found some document about RSRP range: 

https://wiki.teltonika.lt/view/RSRP_and_RSRQ

But, when I tested to measure it, i got: 

I set the devices (3) in my freezer, and got the RSRP < -100dBm, 

is it conflict here? On the document, they say: NO signal when RSRP < -100dBm, but, I measured -120dBm, and I still received the data from my THINGY:91 - it means : still signal 

I am using Telia NB-IOT( Unit1) Telia LTE-M(Unit2) and Telenor LTE-M(Unit3)

My question is: RSRP vs Signal strength range? RSRP for no signal?

Thanks 

BR, 

Hoang Nguyen

Parents
  • Hello,

    receiver sensitivity for Cat-M1 is -108 dBm and -107 dBm for low band and mid band respectively. For Cat-NB1/Cat-NB2 it's -114 and -113 dBm. It makes sense that you'll still receive something when the RSRP is close to -100 dBm.

  • Dear

    I am using THING:91 with NB-IoT of Telia (Norway)  to measure the temperature, .., RSRP, and send the data to my webserver.

    It will send 1 package in each hour. and its staying underground, and I got the data from my thingy:91 (RSRP) 

    My problem: when the signal is bad (RSRP < -130 dBM), it stopped working and couldnt reconnect at kl.19.24. 

    At kl.13.20 , it did NOT send any package (because of bad signal), then, it sent again 14.23. 

    My statemachine: 

     My main: 

    void main(void)
    {
          
         
          env_sensors_init();
          env_sensors_start_polling();
          battery_monitor_init();
          printk("modem_configure\n");
          modem_configure();
      
          while(1){
                                         
                 
                  
                    printk("-----------------------\n\r");
                    sensor_data_read();
                    ENCR_HTTP_POST();
                    k_sleep(DELAYPOST); 
                
                   
            
           
          }
    
    }

    Connecting: modem_configure(); 

    Read the temperature,battery,.., RSRP: sensor_data_read()

    encrypted and send  (HTTP_POST): ENCR_HTTP_POST

    sleep: 1hr

    When the THINGY:91 stays underground, the signal is so bad ( RSRP = -130 dBm), and the worst case, NO signal, then, it couldnt POST (HTTP _POST), it will return ERROR, and I tried to reconnect:

    void ENCR_HTTP_POST (void){
    //FPOST: postData
    int err = snprintk_post(FPost,HTTP_HOST,HTTP_PORT);
                
                if(!err){
                    
                    printk("done http post \n\r");
                }
                else {
                    printk("httppost is error \n\r");
                     goto reconnect; 
                }
             return ; 
    reconnect: 
          printk("reconnect network .......\n\r");
          reconnect_nw();
          //modem_configure(); 
         
    }

    my reconnect_nw() (similar to modem_configure()) 

    void reconnect_nw(void){
                    
                    int err;
    		printk("ReConnecting to LTE network. ");
    		printk("This may take several minutes.\n");
    		//ui_led_set_pattern(UI_LTE_CONNECTING);
    
    		err = lte_lc_init_and_connect();
    		if (err) {
    			printk("LTE link could not be established.\n");
                            error_handler(ERROR_LTE_LC, err);
    			
    		}
    
    		printk("Connected to LTE network\n");
    }
    

    and, my snprintk_post(): ( I m using http post from : https://github.com/Rallare/fw-nrfconnect-nrf/blob/nrf9160_samples/samples/nrf9160/https_simple/src/main.c is it your? )

    int snprintk_post (char *PostString, char *HTTP_HOST, int HTTP_PORT)
    {
         
       int poststat = '0';
       struct sockaddr_in local_addr;
       struct addrinfo *res;
       printk("Webserver: http://%s:%d \n\r",HTTP_HOST,HTTP_PORT); 
    
       local_addr.sin_family = AF_INET;
       local_addr.sin_port = htons(0);
       local_addr.sin_addr.s_addr = 0;
     
        int err = getaddrinfo(HTTP_HOST, NULL, NULL, &res);
        printk("get addrinfo\n\r");
        printk("getaddrinfo err: %d\n\r", err);
        
        if(!err) {
           printk("network is OK: \n\r");
        }
    
        else {
             printk("network is error: \n\r");
             return CONFIG_LTE_ERR ; 
        }
        
        ((struct sockaddr_in *)res->ai_addr)->sin_port = htons(HTTP_PORT);
        
       
        char send_buf[MAXLINE + 1];
        int send_data_len_post  = snprintk(send_buf,
    				         500, 
    				         POST_TEMPLATE, HTTP_PATH,
    				         HTTP_HOST, strlen(PostString),
    				         PostString);
    
         printf("send_buf is: %s \n",send_buf);
         printk("send_data_len_post: %d\n\r", send_data_len_post);
         
         int client_fd = socket(AF_INET, SOCK_STREAM, 0);
    
         printk("client_fd: %d\n\r", client_fd);
         err = bind(client_fd, (struct sockaddr *)&local_addr, sizeof(local_addr));
         printk("bind err: %d\n\r", err);
         if(!err )
            {
              printk("bindnetwork is OK: \n\r");
              
             }
         else
            {
              printk("network is error: \n\r");
              return CONFIG_LTE_ERR ; 
             }
        
    
        
         //err = blocking_connect(client_fd, (struct sockaddr *)res->ai_addr,sizeof(struct sockaddr_in));
    
          err = connect(client_fd, (struct sockaddr *)res->ai_addr, sizeof(struct sockaddr_in));
    	if (err > 0) {
    		printk("connect err: %d\n", errno);
    		goto clean_up;
    	}
         //err = blocking_connect(client_fd, (struct sockaddr *)res->ai_addr,sizeof(struct sockaddr_in));
         printk("connect err: %d\n\r", err);
         
         int num_bytes = send(client_fd, send_buf, send_data_len_post, 0);
        
         printk("send err: %d\n\r", num_bytes);
         
         
         printk("Close socket \n\r");
         err = close(client_fd);
         
         freeaddrinfo(res);
         printk("============================== DONE SENDING =============================================== \n\r");
        
         return 0; 
         
    clean_up:
    	freeaddrinfo(res);
    	err = close(client_fd);
            
    }

    Could you plz help me. I dont know why, it stopped working. 

     I tested it many times before I put it underground ( try to put it in the freezer, ..., somewhere with bad signal), and it worked

    Thanks so much 

    MVH, 

    Hoang Nguyen 

  • Hoang said:
    1. With the external antenna, which one is suitable for THINGY:91 ( NB-IoT Telia) 

     Which frequency bands are you going to use? The ideal antenna will depend on the frequencies.

  • Which frequency bands are you going to use? The ideal antenna will depend on the frequencie

    1. Telia NB IoT (800 MHz): 801-811 downlink 842-852 uplink

    2. Telia NB IoT (1800 MHz): 1745-1765 downlink 1840-1860 uplink

  • Hi

    I may find a problem with my thingy91.

    In my HTTP POST: 

    detail of my HTTP_POST: 

    int snprintk_post (char *PostString, char *HTTP_HOST, int HTTP_PORT)
    {
         
      
       struct sockaddr_in local_addr;
       struct addrinfo *res;
       printk("Webserver: http://%s:%d \n\r",HTTP_HOST,HTTP_PORT); 
    
       local_addr.sin_family = AF_INET;
       local_addr.sin_port = htons(0);
       local_addr.sin_addr.s_addr = 0;
     
        int err = getaddrinfo(HTTP_HOST, NULL, NULL, &res);
        printk("get addrinfo\n\r");
        printk("getaddrinfo err: %d\n\r", err);
        
        if(!err) {
           printk("network is OK: \n\r");
        }
    
        else {
             printk("network is error: \n\r");
             return CONFIG_LTE_ERR ; 
        }
        
        ((struct sockaddr_in *)res->ai_addr)->sin_port = htons(HTTP_PORT);
        
       
        char send_buf[MAXLINE + 1];
        int send_data_len_post  = snprintk(send_buf,
    				         500, 
    				         POST_TEMPLATE, HTTP_PATH,
    				         HTTP_HOST, strlen(PostString),
    				         PostString);
    
         printf("send_buf is: %s \n",send_buf);
         printk("send_data_len_post: %d\n\r", send_data_len_post);
         
         int client_fd = socket(AF_INET, SOCK_STREAM, 0);
    
         printk("client_fd: %d\n\r", client_fd);
         err = bind(client_fd, (struct sockaddr *)&local_addr, sizeof(local_addr));
         printk("bind err: %d\n\r", err);
         if(!err )
            {
              printk("bindnetwork is OK \n\r");
              
             }
         else
            {
              printk("network is error: \n\r");
              return CONFIG_LTE_ERR ; 
             }
        
    
         //hng: 17012020 testing bad signal
    
         //err = blocking_connect(client_fd, (struct sockaddr *)res->ai_addr,sizeof(struct sockaddr_in));
    
          err = connect(client_fd, (struct sockaddr *)res->ai_addr, sizeof(struct sockaddr_in));
    	if (err > 0) {
    		printk("connect err: %d\n", errno);
    		goto clean_up;
    	}
         //err = blocking_connect(client_fd, (struct sockaddr *)res->ai_addr,sizeof(struct sockaddr_in));
         printk("connect err: %d\n\r", err);
         /*
         if(!err )
            {
              printk("blocking_connectnetwork is OK: \n\r");
              
             }
         else
          {
               printk("network is error: \n\r");
               return CONFIG_LTE_ERR ; 
          }
          */
         int num_bytes = send(client_fd, send_buf, send_data_len_post, 0);
        
         printk("num_bytes sent: %d\n\r", num_bytes);
         
         //get the fb from webserver ; 
         /*
         int tot_num_bytes = 0;
         do {
    		
             num_bytes =blocking_recv(client_fd, recv_buf, RECV_BUF_SIZE, 0);
             tot_num_bytes += num_bytes;
             if (num_bytes <= 0) {
    			break;
    		             }
    	// printk("%s \n\r", recv_buf);
    	} while (num_bytes > 0);
         */
         printk("Close socket \n\r");
         err = close(client_fd);
         
         freeaddrinfo(res);
         printk("============================== DONE SENDING =============================================== \n\r");
         //poststat = true; 
         return 0; 
         
    clean_up:
    	freeaddrinfo(res);
    	err = close(client_fd);
            
    }

    If the bad signal  came  ( < -135 dBm) when http_posting, it may return HTTP_ERR

    connect(client_fd, (struct sockaddr *)res->ai_addr, sizeof(struct sockaddr_in));

    i used to get the error from this step)

    then, I tried to reconnect_nw():   lte_lc_init_and_connect()

    And, I may  get the ERROR:

    Exception occurred in Secure State
    ***** HARD FAULT *****
      Fault escalation (see below)
    ***** BUS FAULT *****
      Precise data bus error
      BFAR Address: 0x50008120
    ***** Hardware exception *****
    Current thread ID = 0x2002abec
    Faulting instruction address = 0x74b056ee
    Fatal fault in ISR! Spinning...

    The problem: The network haven't disconnected yet !!! HTTP_POST returned the ERROR, but I dont know exactly why, and what kind of error?

    If I tried:  DISconnect before reconnect_nw(), I wont get any ERROR.  

    What kind of error can we meet in HTTP POST? 

    ( I m sure, my webserver is OK)

    COuld you help me, I want to know about what kind of error can we meet in http post, and the solution for each of them?

    Thanks so much

    MVH

    Hoang Nguyen

  • Hoang said:
    What kind of error can we meet in HTTP POST? 

    I'm not sure what you're referring to. Is this "HTTP POST" something in the SDK or something you have written?

Reply Children
Related