PPP with NNDK 3.0 and MODM7AE70
Posted: Fri Mar 15, 2019 4:30 am
I am trying to integrate a GSM/GPRS (SIM868) working with PPP on the MODM7AE70.
So far, I have encountered the following issues.
1. In constants.h, PPP_PRIO is set to (44); CONFIG_SERVER_PRIO is also set to (44), so the OSTaskCreatewName in PPPDial() fails with no warning. Is there a reason for setting PPP_PRIO to the same priority as CONFIG_SERVER_PRIO? I set the PPP_PRIO to (46) and at least the task starts.
2. There seems to be several "endian" issues in ahdlc.cpp. I lost track of all of them, but here are the main ones:
a) In ahdlc.cpp - ahdlc_transmit() puts the two crc bytes into the packet in the wrong order.
b) In ahdlc.cpp - ahdlc_receive() at the //Adjust section, the compare if (*pWord != 0xFF03) always fails, it works if I change it to (*pWord != 0x03FF); same issue with the next compare if (*pWord & 0x0100) it works if I change it to if (*pWord & 0x0001).
3. There may also be some "endian" issues in PPP.cpp, but I lost track of changes because the iprintf(%X) function seems to print out in the wrong order. That confused me and I made a lot of changes, which I subsequently changed back. At some point, I will have to clean up my altered PPP.cpp file and do a compare to the original.
I have gotten the PPP running but still have issues.
After sending a config packet, reading the config packet from the GMRS, and sending back an ACK, there is a read of part of a packet from the GMRS, and then the Restart_Interval expires (not matter how high it is set) and a new config packet is sent. After that, the receive packet completes, but with a new id and I get a "Got ACK For wrong seq" message.
The negotiations progress until I get an IPADDR4 from the GMRS and then the connection drops.
I suspect that there is an endian issue that I missed, but I haven't been able to debug it yet.
Any help or advise would be appreciated.
Ed
So far, I have encountered the following issues.
1. In constants.h, PPP_PRIO is set to (44); CONFIG_SERVER_PRIO is also set to (44), so the OSTaskCreatewName in PPPDial() fails with no warning. Is there a reason for setting PPP_PRIO to the same priority as CONFIG_SERVER_PRIO? I set the PPP_PRIO to (46) and at least the task starts.
2. There seems to be several "endian" issues in ahdlc.cpp. I lost track of all of them, but here are the main ones:
a) In ahdlc.cpp - ahdlc_transmit() puts the two crc bytes into the packet in the wrong order.
b) In ahdlc.cpp - ahdlc_receive() at the //Adjust section, the compare if (*pWord != 0xFF03) always fails, it works if I change it to (*pWord != 0x03FF); same issue with the next compare if (*pWord & 0x0100) it works if I change it to if (*pWord & 0x0001).
3. There may also be some "endian" issues in PPP.cpp, but I lost track of changes because the iprintf(%X) function seems to print out in the wrong order. That confused me and I made a lot of changes, which I subsequently changed back. At some point, I will have to clean up my altered PPP.cpp file and do a compare to the original.
I have gotten the PPP running but still have issues.
After sending a config packet, reading the config packet from the GMRS, and sending back an ACK, there is a read of part of a packet from the GMRS, and then the Restart_Interval expires (not matter how high it is set) and a new config packet is sent. After that, the receive packet completes, but with a new id and I get a "Got ACK For wrong seq" message.
The negotiations progress until I get an IPADDR4 from the GMRS and then the connection drops.
I suspect that there is an endian issue that I missed, but I haven't been able to debug it yet.
Any help or advise would be appreciated.
Ed