diff --git a/libgammu/phone/at/atgen.c b/libgammu/phone/at/atgen.c index b617137494..577920c441 100644 --- a/libgammu/phone/at/atgen.c +++ b/libgammu/phone/at/atgen.c @@ -4725,8 +4725,11 @@ GSM_Error ATGEN_Reset(GSM_StateMachine *s, gboolean hard) } smprintf(s, "Resetting device\n"); - /* Siemens 35 */ - error = ATGEN_WaitForAutoLen(s, "AT+CFUN=1,1\r", 0x00, 20, ID_Reset); + /* Regular phones */ + error = ATGEN_WaitForAutoLen(s, "AT+CFUN=0\r", 0x00, 20, ID_Reset); + if (error == ERR_NONE) { + error = ATGEN_WaitForAutoLen(s, "AT+CFUN=1,1\r", 0x00, 20, ID_Reset); + } if (error != ERR_NONE) { /* Siemens M20 */ diff --git a/smsd/core.c b/smsd/core.c index 0161394e12..ff2b1aa42e 100644 --- a/smsd/core.c +++ b/smsd/core.c @@ -2196,6 +2196,11 @@ GSM_Error SMSD_MainLoop(GSM_SMSDConfig *Config, gboolean exit_on_failure, int ma if (error == ERR_EMPTY) { lastnothingsent = lastloop; } + if (error == ERR_UNKNOWN) { + /* Huawei devices may return UNKNOWN errors. A soft reset may help to recover */ + SMSD_LogError(DEBUG_INFO, Config, "Resetting the device because of error", error); + force_reset = TRUE; + } /* We don't care about other errors here, they are handled in SMSD_SendSMS */ } if (Config->shutdown) {