Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions vehicle/OVMS.V3/components/ovms_cellular/src/gsmpppos.h
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,10 @@ class GsmPPPOS : public InternalRamAllocated
int m_channel;
ppp_pcb* m_ppp;
struct netif m_ppp_netif;
bool m_connected;
volatile bool m_connected; // volatile: written by LwIP tiT task (core 1), read by modem task (core 0)
int m_connectcount;
int m_lasterrcode;
bool m_shutdown; // Flag to prevent data processing during shutdown
volatile bool m_shutdown; // volatile: same cross-core synchronization requirement
};

#endif //#ifndef __GSM_PPPOS__
19 changes: 17 additions & 2 deletions vehicle/OVMS.V3/components/ovms_cellular/src/ovms_cellular.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1191,9 +1191,24 @@ void modem::StandardLineHandler(int channel, OvmsBuffer* buf, std::string line)
int creg;
network_registration_t nreg = Unknown;
if (qp != string::npos)
creg = atoi(line.substr(qp+1,1).c_str());
{
// Distinguish query response (+CEREG: <n>,<stat>,...) from
// URC (+CEREG: <stat>,<lac>,...) by checking the second field:
// In query responses, <stat> is a single digit 0-8.
// In URCs with location info, <lac> is a hex value (e.g. "3E9").
int first = atoi(line.substr(8, qp-8).c_str());
std::string second_str = line.substr(qp+1);
size_t qp2 = second_str.find(',');
if (qp2 != string::npos) second_str = second_str.substr(0, qp2);
int second = atoi(second_str.c_str());
if (first >= 0 && first <= 2 && second >= 0 && second <= 8
&& second_str.length() <= 1)
creg = second; // Query response: first field is <n>, second is <stat>
else
creg = first; // URC: first field is <stat>
}
else
creg = atoi(line.substr(7,1).c_str());
creg = atoi(line.substr(8,1).c_str());
switch (creg)
{
case 0: case 4: nreg = NotRegistered; break;
Expand Down
2 changes: 1 addition & 1 deletion vehicle/OVMS.V3/components/simcom/src/simcom_7600.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ modem::modem_state1_t simcom7600::State1Ticker1(modem::modem_state1_t curstate)
switch (m_modem->m_state1_ticker)
{
case 10:
m_modem->tx("AT+CPIN?;+CREG=1;+CGREG=1;+CEREG=1;+CTZU=1;+CTZR=1;+CLIP=1;+CMGF=1;+CNMI=1,2,0,0,0;+CSDH=1;+CMEE=2;+CSQ;+AUTOCSQ=1,1;E0;S0=0\r\n");
m_modem->tx("AT+CPIN?;+CREG=1;+CGREG=1;+CEREG=2;+CTZU=1;+CTZR=1;+CLIP=1;+CMGF=1;+CNMI=1,2,0,0,0;+CSDH=1;+CMEE=2;+CSQ;+AUTOCSQ=1,1;E0;S0=0\r\n");
break;
case 12:
m_modem->tx("AT+CGMR;+CICCID\r\n");
Expand Down
4 changes: 2 additions & 2 deletions vehicle/OVMS.V3/support/sdkconfig.default.hw31
Original file line number Diff line number Diff line change
Expand Up @@ -574,7 +574,7 @@ CONFIG_LWIP_TCP_RTO_TIME=3000
#
CONFIG_LWIP_MAX_UDP_PCBS=16
CONFIG_UDP_RECVMBOX_SIZE=6
CONFIG_TCPIP_TASK_STACK_SIZE=3072
CONFIG_TCPIP_TASK_STACK_SIZE=4096
CONFIG_TCPIP_TASK_AFFINITY_NO_AFFINITY=
CONFIG_TCPIP_TASK_AFFINITY_CPU0=
CONFIG_TCPIP_TASK_AFFINITY_CPU1=y
Expand Down Expand Up @@ -627,7 +627,7 @@ CONFIG_OVMS_HW_CELLULAR_MODEM_BUFFER_SIZE=1024
CONFIG_OVMS_HW_CELLULAR_MODEM_UART_SIZE=2048
CONFIG_OVMS_HW_CELLULAR_MODEM_MUXCHANNEL_SIZE=2048
CONFIG_OVMS_HW_CELLULAR_MODEM_QUEUE_SIZE=50
CONFIG_OVMS_HW_CELLULAR_MODEM_STACK_SIZE=5120
CONFIG_OVMS_HW_CELLULAR_MODEM_STACK_SIZE=7168

#
# System Options
Expand Down