Timer for UDP Rx using BC66 module

there is no reason for the RX not to work if TX is ok

Yes, I don’t know, but I notice that some times I didn’t received any RX due to the fact the server doesn’t received the TX packet.

I am continuing trying to figure out what is happening, at the same time I trying to fix some bugs, so it is going to take me a while…

Thank you very much for your help, I will update with my results. Right now, I trying to test with a timer for RX around 60 seconds.

Best regards.

Hi WizIO,

1º. After get bigger the timer for Rx from 8 secs to 60 secs, It seems to be that is working better and the number of errors are reduced a lot. Some times I have to wait for 75 seconds to receive a byte. In my personal view, it is too much, but probably it is an issue related to the operator. So I am going to talk to him in order to find out what is happening.

2º. Besides I am checking the ql_socket.h library. I have a weirdo issue related to NB-IoT connection. I am using the same mechanism that in the example: example_udpclient_api.c.

(GetCGATT == 1) and (network_status == NW_STAT_REGISTERED or NW_STAT_REGISTERED_ROAMING)
Get Local IP
Get DNS

And then I execute the function:

Ql_IpHelper_GetIPByHostName(CONTEXT_ID, SERVER_IP, Callback_GetIpByName);

But it never is executed the Callback: Callback_GetIpByName, due to the fact I have a timer for this of 60 seconds.

Do you thing this timer is too small?

And other times, I get an error in the Callback_GetIpByName. In this case, What do I have to do for try again?

Best regards.

btw: on cell connection SET your DNS servers (or Google 8.8.8.8 & 8.8.4.4) don`t use default

and check your RX level…

for me and my operator ( 900 MHz ) TCP / IP communication is “good” for NB ( maximum latency ~10 sec, normal is second two … worldwide )

1 Like

Right now I have the default DNSs: 8.8.8.8 and 114.114.114.114. So I am going to change these for: 8.8.8.8 and 8.8.4.4.

By the way, this configuration is stored in the intern FVRAM?? Or Do I have to configure everytime the module BC66 inits?

Best regards.

default DNS is stored in ROM as const… I don`t know for NVDM records

1 Like

Ok, I am trying to change the DNSs with this function:

#define DNS_PRIMARY “8.8.8.8”
#define DNS_SECONDARY “8.8.4.4”

/* Set DNS */
Ql_memset(dns_info.primaryAddr, 0x00, sizeof(dns_info.primaryAddr));
Ql_strcpy(dns_info.primaryAddr, DNS_PRIMARY);
Ql_memset(dns_info.bkAddr, 0x00, sizeof(dns_info.bkAddr));
Ql_strcpy(dns_info.bkAddr, DNS_SECONDARY);
ret = Ql_SetDNSAddress(0, &dns_info);
if (ret != SOC_SUCCESS) {
APP_DEBUG(prt_debug, “[ERROR] SetDNSAddress: %d\r\n”, ret);
} else {
APP_DEBUG(prt_debug, “[INFO] SetDNSAddress. Primary: %s - Secondary: %s\r\n”, DNS_PRIMARY, DNS_SECONDARY);
}

And I didn’t get any error, however, after reading with the DNSs with this function I read again the default DNSs: 8.8.8.8 and 114.114.114.114:

ret =Ql_GetDNSAddress(0, &dns_info);
if (ret == SOC_SUCCESS) {
APP_DEBUG(prt_debug, “[INFO] Get DNS address successfully: %s - bkAddr: %s\r\n”,
dns_info.primaryAddr, dns_info.bkAddr);
dns_flag = TRUE;
} else {
APP_DEBUG(prt_debug, “[ERROR] Get DNS address failure: %d\r\n”, ret);
}

Do you have any suggestions? I am doing something wrong, but I don’t know what.

Best regards.

#define DNS_1 "1.2.3.4" 
#define DNS_2 "5.6.7.8" 
    ST_Dns_Info_t d;
    memset(&d, 0, sizeof(ST_Dns_Info_t)); 
    d.ip_type = IP_TYPE_IPV4;
    strcpy(d.primaryAddr, DNS_1);
    strcpy(d.bkAddr, DNS_2);
    res = Ql_SetDNSAddress(0, &d);
    DBG("[APP] SET DNS: %d\n", res);
    res = Ql_GetDNSAddress(0, &d);
    DBG("[APP] GET DNS: %d, %s, %s\n", res, d.primaryAddr, d.bkAddr);

[APP] Begin
[APP] SET DNS: 0
[APP] GET DNS: 0, 1.2.3.4, 5.6.7.8
[APP] Ril Ready

It seems to be that it is working when I write and read sequentially. I read, write and read again the DNSs at the first begining:

/* Get DNS /
Ql_memset(&dns_info, 0x00, sizeof(ST_Dns_Info_t));
ret = Ql_GetDNSAddress(0, &dns_info);
if (ret == SOC_SUCCESS) {
APP_DEBUG(prt_debug, “[INFO] Get DNS address successfully: %s - bkAddr: %s\r\n”, dns_info.primaryAddr, dns_info.bkAddr);
} else {
APP_DEBUG(prt_debug, “[ERROR] Get DNS address: %d\r\n”, ret);
}
/
Set DNS /
Ql_memset(&dns_info, 0x00, sizeof(ST_Dns_Info_t));
dns_info.ip_type = IP_TYPE_IPV4;
dns_info.addr_len = IP_ADDR_LEN;
Ql_strcpy(dns_info.primaryAddr, DNS_PRIMARY);
Ql_strcpy(dns_info.bkAddr, DNS_SECONDARY);
ret = Ql_SetDNSAddress(0, &dns_info);
if (ret != SOC_SUCCESS) {
APP_DEBUG(prt_debug, “[ERROR] SetDNSAddress: %d\r\n”, ret);
} else {
APP_DEBUG(prt_debug, “[INFO] SetDNSAddress. Primary: %s - Secondary: %s\r\n”, DNS_PRIMARY, DNS_SECONDARY);
}
/
Get DNS */
Ql_memset(&dns_info, 0x00, sizeof(ST_Dns_Info_t));
ret = Ql_GetDNSAddress(0, &dns_info);
if (ret == SOC_SUCCESS) {
APP_DEBUG(prt_debug, “[INFO] Get DNS address successfully: %s - bkAddr: %s\r\n”, dns_info.primaryAddr, dns_info.bkAddr);
} else {
APP_DEBUG(prt_debug, “[ERROR] Get DNS address: %d\r\n”, ret);
}

And this is the result:


[INFO] SetQNBIOTEVENT: 1
[INFO] SetQNBIOTRAI: 2
[INFO] Get DNS address successfully: 0.0.0.0 - bkAddr: 0.0.0.0
[INFO] SetDNSAddress. Primary: 8.8.8.8 - Secondary: 8.8.4.4
[INFO] Get DNS address successfully: 8.8.8.8 - bkAddr: 8.8.4.4
[INFO] NBIoTSetUp2 OK

But after that, I check the DNSs again, when I get the IP and at that moment, the DNSs are different:

[INFO] Get local IP successfully: 10.44.117.242
[INFO] Get DNS address successfully: 8.8.8.8 - bkAddr: 114.114.114.114

So it seems to be that the module is changing the DNSs. I don’t know if it is an issue related to OpenCPU or not.

Perhaps I have to set the DNS after getting the IP not before:

Besides, the DNS aren’t save to NVRAM.

So, I am going to setting the DNSs just after getting the IP.

check your RX level
try use external antena for exeriment
what is your operator band/MHz

yep, another bug… on cell connection the module kernel restore DNS to default

[APP] SET DNS: 0
[APP] GET DNS: 0, 8.8.8.8, 8.8.4.4
[APP] Ril Ready
[MSG] 2 1
[APP] DNS: 0, 8.8.8.8, 8.8.4.4
[MSG] 3 2
[APP] DNS: 0, 8.8.8.8, 8.8.4.4
[MSG] 3 1
[APP] DNS: 0, 8.8.8.8, 8.8.4.4
[MSG] 101 0
[APP] DNS: 0, 8.8.8.8, 114.114.114.114

These are my data related to signal [B20 band]:

TX LEV: -53dBm
BER: 0%
RSRQ: -7
RSRP: -59 dBm

I’ve checked with different kind of antennas: anntena chips and external antennas.

How can we report this bug?

Is there any official way?

Best regards.

just write to your Local Quectel Support or write a ticket

1 Like