BC66 with OpenCPU and problems sending UDP packets

Hi everyone,

I have a lot of problems with del module BC66 (FW: BC66NBR01A10) sending UDP packets with OpenCPU V1.5

I am using the library ql_socket, that it seems to be It is more recommendable than ril_socket.

I think I know which the problem is, but I don’t know to solve it.

I am using the function Ql_SOC_SendTo to send data by UDP, when the IP server is a hostname I have to use the function Ql_IpHelper_GetIPByHostName and everything works fine apparently, but sometimes the function Ql_IpHelper_GetIPByHostName fail, and I don’t know what to manage this error. You can see this ticket: Problems with the fucntion Ql_IpHelper_GetIPByHostName using OpenCPU

So I decided to use a fixed IP instead a hostname in order to avoid using the function Ql_IpHelper_GetIPByHostName, but know It seems to be that the function Ql_SOC_SendTo is executed successfully but the module BC66 isn’t in RCC_CONNECTED mode so the Tx doesn’t occur but I don’t get any error, so I am sure that the UDP Tx fails due to the fact the module is in IDLE.

The question is: ¿How can I make sure that the module is in RCC_CONNECTED state before trying to send an UDP packet?

Hello, it is suggested to use AT instruction to inquire before sending data, and make sure that the module is registered on the network before data interaction.

I hope my answer is helpful to you.

1 Like

Hi bobby.zhang.

It seems to be there isn’t any way to guarantee at 100% that the device is connected before sending the UDP packet. Or at least I didn’t know how to do it.

Before sending the UDP message I always check the device is register, the attach is ok and that I have an IP. But sometimes sending the UDP packet fails. I always try three times, so it isn’t a problem of loosing packets.

Best regards,
Oscar