Modem hangs if concurrenttly at command is sent


#1

what happens if the openat app tries to send an sms and concurrently the modem receives an at command?
It seems the whole fasttrack hangs and not answers anymore. It is reasonable?

there is a way to reset the modem via serial port without to remove the power?

thanks
Luca


#2

the suspected code of the openat app is:

void sms_ctrl_handler(u8 Event, u16 Nb) {
	switch (Event) {
	case ADL_SMS_EVENT_SENDING_ERROR://  An error occurred during SMS sending
		trace_send_error(Nb);
	case ADL_SMS_EVENT_SENDING_OK:
		//sending next
		if (i < phone_numbers_count)
			adl_smsSend(sms_handle, number[i++], msg, ADL_SMS_MODE_TEXT);
		else
			adl_smsUnsubscribe(sms_handle);

 ....
         }
}

void notify(){
           sms_handle = adl_smsSubscribe(sms_handler, sms_ctrl_handler,
                ADL_SMS_MODE_TEXT);
           i = 0;
           adl_smsSend(sms_handle, number[i++], msg, ADL_SMS_MODE_TEXT);
}

I suspect that while openat is executing this code, the modem receives an at command through serial


#3

after a deeper investigation it seems that no concurrent at command causes the hang.
Simply after a while the modem answer anymore.
Can be that traces creates problem to the modem? I uploaded(downloaded) the debug dwl and they are many TRACE(1,…)


#4

Please describe in detail what, exactly, you actually mean by that.

Too many traces in an Interrupt Handler - especially a Low-Level handler - can certainly cause problems.

Other than that, I’ve never seen “heavy” tracing affect the application - some trace information might get lost, but I’ve not seen the application affected.

So make use of the other TRACE levels so that you can intelligently control how much TRACE is emitted…


#5

the modem is connected with serial port to a linux host
on that host runs smstools daemon that asks each 20 secs the status of the modem (registered, signal, num of incoming messages)
each minute the daemon sends an custom at command that is handled by the openat app.
when the command is received the openat app simply reset a counter. There is a timer that each 10 minutes increase the counter and if it reaces a value then sends a sms.

The openat app is a watchdog that receives a ping from the host and after a certain number of lost pings the app sends an alert sms.

What happens is that after a while the smstools logs no more the status of the modem and cannot send sms.
I stopped the smstools daemon and connected with minicom to the modem, but there is no way to send commands. The only way to recover is to unplug the power of the modem.

This happens after some days of work.

Don’t think i’am using low level interrupts

thanks