Skip to content

BG96 CELLULAR : check context_type value #12340

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

Closed

Conversation

jeromecoutant
Copy link
Collaborator

Summary of changes

From AT commands BG96 manual:
https://www.quectel.com/UploadImage/Downlad/Quectel_BG96_TCP(IP)_AT_Commands_Manual_V1.0.pdf

it seems that only 2 values are possible:

<context_type> Integer type. The protocol type.
1 IPV4
2 IPV6*

@AriParkkila

Impact of changes

Migration actions required

Documentation


Pull request type

[x] Patch update (Bug fix / Target update / Docs update / Test update / Refactor)
[] Feature update (New feature / Functionality change / New API)
[] Major update (Breaking change E.g. Return code change / API behaviour change)

Test results

[] No Tests required for this change (E.g docs only update)
[x] Covered by existing mbed-os tests (Greentea or Unittest)
[] Tests / results supplied as part of this PR

Reviewers


@mergify mergify bot added the needs: work label Jan 30, 2020
@ciarmcom
Copy link
Member

@jeromecoutant, thank you for your changes.
@ARMmbed/mbed-os-wan @ARMmbed/mbed-os-maintainers please review.

@ciarmcom ciarmcom requested review from a team January 30, 2020 18:00
@@ -70,7 +70,7 @@ ControlPlane_netif *QUECTEL_BG96_CellularContext::get_cp_netif()
nsapi_error_t QUECTEL_BG96_CellularContext::do_user_authentication()
{
uint8_t type = (uint8_t)_pdp_type;
if ((uint8_t)_pdp_type < 1) {
if (((uint8_t)_pdp_type < 1) || ((uint8_t)_pdp_type > 2)) {

Choose a reason for hiding this comment

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

According to BG96_TCP/IP_AT_Commands_Manual_V1.1 context_type IPv4v6 (value 3) is also valid for +QICSGP.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This value 3 didn't work with my modem... Maybe this v1.1 needs some specific modem version ?

Choose a reason for hiding this comment

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

Yes, BG96 firmware update could help?

@0xc0170
Copy link
Contributor

0xc0170 commented Feb 5, 2020

@AriParkkila @jeromecoutant From the review above , is there anything that needs to be done or this is ready

@AriParkkila
Copy link

@0xc0170 This is not good to be merged.

@jeromecoutant If you can't upgrade your BG96 firmware then you could try to override this function, as it seems that at least BG96 Revision: BG96MAR02A07M1G accepts IPV4V6, see the log below where IPV4V6 is value 3:

00021979ms][INFO][CELL]: AT TX (10): AT+QICSGP=
[00021986ms][INFO][CELL]: AT TX ( 1): 1
[00021991ms][INFO][CELL]: AT TX ( 1): ,
[00021997ms][INFO][CELL]: AT TX ( 1): 3
[00022003ms][INFO][CELL]: AT TX ( 1): ,
[00022008ms][INFO][CELL]: AT TX ( 1): "
[00022014ms][INFO][CELL]: AT TX ( 7): default
[00022020ms][INFO][CELL]: AT TX ( 1): "
[00022026ms][INFO][CELL]: AT TX ( 1): ,
[00022032ms][INFO][CELL]: AT TX ( 1): "
[00022037ms][INFO][CELL]: AT TX ( 1): "
[00022043ms][INFO][CELL]: AT TX ( 1): ,
[00022049ms][INFO][CELL]: AT TX ( 1): "
[00022054ms][INFO][CELL]: AT TX ( 1): "
[00022060ms][INFO][CELL]: AT TX ( 1): ,
[00022066ms][INFO][CELL]: AT TX ( 1): 1
[00022071ms][INFO][CELL]: AT TX ( 1): <cr>
[00022084ms][INFO][CELL]: AT RX ( 2): <cr><ln>
[00022085ms][INFO][CELL]: AT RX ( 4): OK<cr><ln>

@jeromecoutant
Copy link
Collaborator Author

Hi
Yes, configuration command is OK,
but connection to 2G network is failing in my case...

@AriParkkila
Copy link

@jeromecoutant Can you share the AT traces about failing (and successful) connection?

@jeromecoutant
Copy link
Collaborator Author

Mmm it seems that my patch reverts your #12227...
Could you indicate what is IOTCELL-2384 ?

@AnttiKauppila
Copy link

AnttiKauppila commented Feb 6, 2020

@jeromecoutant We had to fix an issue arised and we did it according to Quectel's forum thread:
https://forums.quectel.com/t/what-is-the-difference-between-cgdcont-and-qicsgp/152
0 is possible value for Cellular stack as some modems supports that but BG96 does not and that is why we default to IPv4 in that case. Like Ari mentioned newer modems are supporting dual mode so your limitation will prevent the usage for that. You can find latest documents here: https://www.quectel.com/ProductDownload/bg96.html

This PR should not be merged because of above reason!

@jeromecoutant
Copy link
Collaborator Author

Maybe we should use AT+QICSGP? instead of CGDCONT in get_context() ?

@jeromecoutant
Copy link
Collaborator Author

Maybe delete_current_context() as well should be overwritten in BG96 ?

@bulislaw
Copy link
Member

ping

@AriParkkila
Copy link

@jeromecoutant It seems that QICSGP and CGDCONT make somewhat overlapping configuration, and CGDCONT may not be needed when configuring modem's TCP/IP stack. However, CGDCONT seems still to be the way to query a list of contexts (with APN). BG96 driver could clear QICSGP parameters at delete_current_context(), but I don't know if that has any change. Do see some problem how BG96 works with the current implementation?

@jeromecoutant
Copy link
Collaborator Author

Do see some problem how BG96 works with the current implementation?

Yes, got some "pre-configured" context in my BG96 module with the expected APN and PDP-type 3.
It can't work as long as I don't patch something to force type 1...

@jeromecoutant
Copy link
Collaborator Author

I didn't try "cellular.clear-on-connect" option yet

@AriParkkila
Copy link

@jeromecoutant If BG96 does not accept IPv4v6 for QICSGP, it's likely because of an old firmware. If you can't update BG96 firmware to accept IPv4v6, I guess you need to patch it just in your project.

@jeromecoutant jeromecoutant deleted the DEV_CELLULAR_PATCH2 branch February 20, 2020 08:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants