Skip to content

PDP Type needs to be IPV4V6 #12396

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 14, 2020
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ static const intptr_t cellular_properties[AT_CellularDevice::PROPERTY_MAX] = {
1, // AT_CSMP
1, // AT_CMGF
1, // AT_CSDH
1, // PROPERTY_IPV4_STACK
0, // PROPERTY_IPV4_STACK

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should probably define all IPV4, IPV6 and IPV4V6 to 1, or AT_CellularContext::get_context() fails to find IPV4/IPV6 only contexts.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Enabling IPV4 results in failed communication with AT&T IoT SIMs. The ublox radio automatically populates context 1 with IP as the PDP type and doesn't allow the user to change it to IPV4V6. If mbed detects a PDP type of IPV4, it sets the LWIP stack to IPV4 which fails to communicate. However if the LWIP stack is set/forced to IPV4V6 communication is successful. With the change I made, mbed sets context 2 with the same APN as context 1 but PDP type as IPV4V6. Though probably not ideal, it works with all the SIM cards we have. I plan to put a note on our mbed page describing where and why users might need to change this setting.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@felser Do you mean that the initial context PDP type is IP, but it has actually just IPV6 address? Can you have traces with cellular.debug-at: true?

It seems your modem allows multiple contexts with the same APN name, but that's not a generic case. It could be better to force the initial context to IPV4V6? For that, you need to disable initial context activation (e.g. AT+CIPCA could work if you are not in LTE), or detach from the network, delete the one modem created and create a new PDP with IPV4V6 before attaching again.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here is an example of what it returns from AT+CGDCONT?...
+CGDCONT: 1,”IP”,”m2m.com.attz”,”10.254.68.252”,0,0,0,0
I was unable to find a way to force context 1 to be IPV4V6. Every time I change it then register it goes back to IP. I don't see the command AT+CIPCA or any other command in the ublox manual to disable initial context activation. I'm not sure I'd want to use that if I could given that this change appears to work without complication.

The radio (kind of) allows multiple contexts with the same APN. According to ublox, after I sent them debug capture with their debug tool, the call on CID 2 is actually routed to CID 1. So all this change is really doing is telling mbed to use IPV4V6 stack.

Our code is specific to this ublox radio. We have no other radio on this platform. This change is working well for all SIMs I have tested.

FYI, I can connect and send data on context 1 using the radio stack or Windows dial up networking but mbed-os does not work. At one point I edited the AT_CellularContext code to force IPV4V6 to the nsapi_ppp_connect(...) call. That works on context 1.

0, // PROPERTY_IPV6_STACK
0, // PROPERTY_IPV4V6_STACK
1, // PROPERTY_IPV4V6_STACK
0, // PROPERTY_NON_IP_PDP_TYPE
1, // PROPERTY_AT_CGEREP
1, // PROPERTY_AT_COPS_FALLBACK_AUTO
Expand Down