I am developing OpenCPU code for a BC66-NA module, having firmware BC66NADAR01A01_BETA0310.
First question:
Can I use a serial connection in OpenCPU (to a virtual port) to send AT commands to the modem and receive the responses? Or can I only use the RIL interface?
Second question:
I am trying to create an UDP connection using the RIL interface. The modem is configured and connecting properly, I create a socket using:
The return value is 0. After that i expect to receive an URC “+QIOPEN: 0,0” when listening to MSG_ID_URC_INDICATION messages. But I don’'t receive that. After opening the socket I use the RIL_SOC_QISENDEX to send data to the server. This data is received on the server, but I don’t get the URC “SEND OK”
The server sends data to the modem in response. So i expect to receive the URC “QIURC:”, but I don’t receive that either.
I do receive other URC’s like URC_EGPRS_NW_STATE_IND and URC_SIM_CARD_STATE_IND.
If I perform the AT commands manually (using USB connection) I do see the URC messages appear in the terminal. So the command’s are correct (also the server receives the data correctly).
Hi Bart
Can I use a serial connection in OpenCPU (to a virtual port) to send AT commands to the modem and receive the responses? Or can I only use the RIL interface?
AT commands can only be encapsulated using the RIL interface.
Second question:
The return value is 0.This indicates that the operation was successful and URC will not be returned.
If you need to print URC, you need to Encapsulation yourself.
How do i receive/encapsulate the URC? Because currently I don’t see it while I am checking for messages. I also don’t receive the URC indicating the server send a message to the BC66 module.
This is the code i use for that:
Ql_OS_GetMessage(&msg);
switch(msg.message) {
case MSG_ID_USER_START:
break;
case MSG_ID_RIL_READY:
Ql_RIL_Initialize();
DebugPrintf(“Initialise RIL\n”);
enableModem();
break;
case MSG_ID_URC_INDICATION:
switch (msg.param1) {
Socket_Urc_Param_t *params;
case URC_SOCKET_OPEN:
params = msg.param2;
modemstatus.socketId = params->connectID;
DebugPrintf(“Got socket: %d\n”, modemstatus.socketId);
break;
case URC_SOCKET_CLOSE:
modemstatus.socketId = -1;
break;
default:
DebugPrintf("<-- Other URC: type=%d\r\n", msg.param1);
break;
}
break;
default:
break;
}
Hi Bart
First add the state machine to be added to the enumeration type in the figure below.
Write a processing function in URC.c and add it to the array of structures accepted by the kernel.
After processing, put the URC and the corresponding processing function in the structure array of the specified URC.
That was what I already changed, but the problem is that the URC’s for new data from the server and opening the socket are not received.
For now i solved it for our application to open the socket in buffered mode and actively poll the socket state and the presence of new server data. This works fine for us but still something seems to be wrong with the missing URC’s
Hi Bart
URC needs to add the code printout manually. The software implementation method has also been told to you in the last reply, you can try to complete.