Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
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.There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.