Skip to content
This repository has been archived by the owner on Jan 29, 2023. It is now read-only.

UBLOX LARA support #7

Closed
ninora opened this issue Aug 29, 2021 · 23 comments
Closed

UBLOX LARA support #7

ninora opened this issue Aug 29, 2021 · 23 comments
Labels
enhancement New feature or request

Comments

@ninora
Copy link

ninora commented Aug 29, 2021

I am not sure if this is a bug or not supported case, here are the details.

I am using a custom board designed with MKR GSM 1400 in mind so for any purpose it is acting as the original MKR. The board works well with MKRGSM library and the original SARA-U201 module. however, when replacing the SARA with a UBLOX pin compatible LARA-R281 02B-00 module, I can't make it to work with GSM_Generic.

My end goal is to operate the LARA in LTE mode.

I have tested the hardware and it works fine, AT commands can be sent and even GSM Begin works using the original library so I believe the hardware is not the issue.

After trying several GSM_Generic examples I can only get to the point where the Serial says [GSM] begin: UART baud = 115200 and there it stops.

So I tested GSM_Generic on an original Arduino MKR GSM 1400 and got the following repeated output:

Starting GSMWebClient on SAMD MKRGSM1400
GSM_Generic v1.5.0
[GSM] begin: UART baud = 115200
AT+CFUN=16
[GSM] begin: reset error
[GSM] GSM::begin: _gsmData._state = GSM_ERROR
Not connected

I should add that the lib didn't work also on my custom board with SARA

Anyways thanks for the library and of course any hint is mostly appreciated.

@khoih-prog
Copy link
Owner

Hi @ninora

Thanks for your interest and tests on the library.

As I currently don't have MKR GSM 1400 as well as LARA-R281 02B-00, it's really difficult to help you without the related hardware.

I suggest you try with the original MKRGSM Library to be sure everything is OK with the hardware / firmware first.

This library, which targets the different boards from MKR GSM 1400, can be easily modified to provide support to the new combination then.

It's also beneficial if you can post the hardware design, or if confidential, at least the connection between SAMD21 and LARA-R281 02B-00.

Hi @tcpipchip, could you please help here by testing LARA-R281 02B-00 with nRF52840-based NINA_B302_ublox ?

@tcpipchip
Copy link

Hi @ninora

I only have here the LISA U200 and SARA G350, but looks that are compatible.

When you said

"when replacing the SARA", means removing completely and the replacing by the LARA ?

Can you put a SNIFFER (a UART-USB) in parallel, to see if the AT commands reaching/backing to/from your LARA ?

@khoih-prog
Copy link
Owner

Another note is that you have to uncomment the following line to use UBLOX_USING_RESET_PIN

#define UBLOX_USING_RESET_PIN             true

also check your hardware then add to defines.h

// Modify to use the correct pins according to your HW design
#define GSM_RESETN  (aau)
#define GSM_DTR     (bbu)

@ninora
Copy link
Author

ninora commented Aug 30, 2021

Thanks for the tips, activating the reset pin did the trick and both modules started responding to AT commands.

MKR GSM 1400
Works well, the board connected to the Internet and downloaded the webpage.

LARA on MKR GSM 1400 lookalike custom board
The LARA is connected exactly as the SARA would be connected on the MKR GSM 1400, SARA and LARA are pin compatible so looking at the 1400 schematics is what you'll see here, just with LARA instead of SARA. Therefore pin assignments also works well as if it was an Arduino MKR GSM 1400.

When tested with either MKRGSM or GSM_Generic with GSMWebClient.ino, it connects to GSM but obviously GPRS fails as I assume it suppose to connect to LTE:

AT+CGATT=1
AT+CGATT=1
OK
AT+UPSD=0,1,""
AT+UPSD=0,1,""
OK
AT+UPSD=0,2,""
AT+UPSD=0,2,""
ERROR

I am not sure how to take it from here, I did find several chapters discussing LTE with examples but have no experience in making it work as part of this library.

@khoih-prog
Copy link
Owner

Glad it's basically working for you now.

BTW, I can help by sending you an original MKR GSM 1400 free of charge for development, please use this to send me a private message.

I'd appreciate your contribution and will contact you via PM. As you know, there are too many different boards / modules on the market, I already bought lots of them to test and provide library's support, but won't never have enough.

I believe GPRS were tested and working for this library by co-author Miguel ( @tcpipchip ), who is a U. professor and an expert in hardware / Ublox.

Check

  1. GSM_Blynk on NINA_B302_ublox with u-blox SARA-G350 GSM_GPRS modem
  2. NINA B302 ACCESSING BLYNK VIA GSM - SARA G350

I think Miguel can guide you with GPRS / LTE. Be patient.

Cheers,

@ninora
Copy link
Author

ninora commented Aug 30, 2021

@tcpipchip Hi Miguel, I wonder if you can help getting the LARA to use the library and have LTE connectivity with the GSMClient constructor. Thanks!

@khoih-prog
Copy link
Owner

It's very helpful if you can use SerialGSMPassthrough example and issue AT commands, according to the Ublox' AT Commands Examples, to know which sets of commands is working OK.

Then it's much easier for us to add the LARA Modem's support. As you know, without the real LARA, everything we think is just assumption / hypothesis.

We'll work together by updating the code, then you'll make the real test.

I'm going to invite you to my Private Discussion repo, and will proceed from there, as the lengthy / private discussion is not appropriate here.

@tcpipchip
Copy link

tcpipchip commented Aug 30, 2021

@ninora

Can you very if that AT COMMANDS works on LARA ?

https://www.twilio.com/docs/iot/supersim/cellular-modem-knowledge-base/ublox-supersim

@khoih-prog
Copy link
Owner

Thanks @tcpipchip

Have a look especially at LARA-R203 / LARA-R211 Cat-1/2G/3G

  • Check the GPRS attachment status, which should be 1: AT+CGATT?
  • Configure the APN for GPRS profile 0: AT+UPSD=0,1,"super"
  • Optionally, save the GPRS config to non-volatile memory (NVM): AT+UPSDA=0,1
  • Activate the GPRS connection: AT+UPSDA=0,3
  • The modem will respond with: +UUPSDA: 0,"100.64.80.24"
  • Ensure the GPRS connection is up: AT+UPSND=0,8
  • The modem will respond with: +UPSND: 0,8,1
  • The final parameter of the response will be 1 if the GPRS connection is up.
  • Optionally, request the currently assigned IP address: AT+UPSND=0,0
  • This will generate a response like: +UPSND: 0,0,"100.64.80.24"

@ninora
Copy link
Author

ninora commented Aug 30, 2021

Thanks guys, this worked as expected.

Initialization

Configure APN
AT+CGATT?
+CGATT: 1

Check the GPRS attachment status
AT+UPSD=0,1,"super"
OK

Save config
AT+UPSDA=0,1
OK

Activate GPRS
AT+UPSDA=0,3
OK
+UUPSDA: 0,"10.174.88.81"

Ensure the GPRS connection is up
AT+UPSND=0,8
+UPSND: 0,8,1
OK

Request IP address
AT+UPSND=0,0
+UPSND: 0,0,"10.174.88.81"
OK
+UPSND: 0,0,"100.64.80.24"

Ping

AT+UPING="8.8.8.8"
OK
+UUPING: 1,32,"dns.google","8.8.8.8",109,108
+UUPING: 2,32,"dns.google","8.8.8.8",109,108
+UUPING: 3,32,"dns.google","8.8.8.8",109,109
+UUPING: 4,32,"dns.google","8.8.8.8",109,105

HTTP GET

Reset profile
AT+UHTTP=0
OK

Server name
AT+UHTTP=0,1,"api.ipify.org"
OK

Port
AT+UHTTP=0,5,443
OK

TLS encryption
AT+UHTTP=0,6,1
OK

Perform GET, store respons
AT+UHTTPC=0,1,"/",""
OK
+UUHTTPCR: 0,1,1

Read file containing respons
AT+URDFILE="http_last_response_0"
+URDFILE: "http_last_response_0",178,"HTTP/1.1 200 OK
Server: Cowboy
Connection: close
Content-Type: text/plain
Vary: Origin
Date: Mon, 30 Aug 2021 20:26:50 GMT
Content-Length: 11
Via: 1.1 vegur

2.53.14.197"
OK

@tcpipchip
Copy link

that´s good!

@khoih-prog
Copy link
Owner

Hi @ninora

I suggest you test all the features similar to those of SaraR4, using AT commands, to see if LaraR2 behaves as expected.

Then let us know if everything is OK, we can write the new Modem files for LARA-R281 02B-00, such as

  1. Modem_LaraR2_Generic.h
  2. Modem_LaraR2_Extra_Generic.h

specifically for this LARA R2 modem for you to test.

Will start this within this week.

@khoih-prog khoih-prog added the enhancement New feature or request label Aug 31, 2021
@khoih-prog
Copy link
Owner

Hi @ninora

The new release GSM_Generic v1.6.0 has just been published.

Your contribution, by requesting enhancement to support u-blox LARA-R2xx LTE Cat 1 Modem, has been noted in Contributions and Thanks

Please have more thorough tests and report any issue here.

Best Regards,


Release v1.6.0

  1. Add support to u-blox LARA-R2xx LTE Cat 1 Modem

@ninora
Copy link
Author

ninora commented Aug 31, 2021

Thanks for the credit!

I wasn't able to connect using v1.6.0, below please find a shortened version of the output (same results with SECRET_GPRS_APN="ltedata.apn" and SECRET_GPRS_APN = "", normally I don't need to send a value):

GPRSPing.ino output:

Starting GPRSPing on SAMD MKRGSM1400
GSM_Generic v1.6.0
[GSM] begin: UART baud = 115200
[GSM] begin: Reset
[GSM] begin: Reset done
[GSM] begin: Check autosense
:
:
[GSM] lowPowerMode: DTR LOW, exit lowPowerMode
AT+UPSV=3
OK
[GSM] begin: Modem OK
:
:
AT+CPIN?
+CPIN: READY

OK
AT+CMGF=1
OK
AT+UDCONF=1,1
OK
AT+CTZU=1
OK
AT+UDTMFD=1,2
OK
AT+CREG?
+CREG: 0,0

OK

+UMWI: 0,1
[GSM] GSMClient::handleUrc: usr = +UMWI: 0,1

+UMWI: 0,2
[GSM] GSMClient::handleUrc: usr = +UMWI: 0,2

+UMWI: 0,3
[GSM] GSMClient::handleUrc: usr = +UMWI: 0,3

+UMWI: 0,4
[GSM] GSMClient::handleUrc: usr = +UMWI: 0,4

AT+CREG?
+CREG: 0,0
OK
:
:
:
AT+CREG?
+CREG: 0,1
OK

AT+UCALLSTAT=1
OK

[GSM] GSM::begin: _gsmData._state = GSM_IDLE
AT+CGATT=1
OK

AT+UPSD=0,1,""
OK

AT+UPSD=0,2,""
ERROR

Not connected

@tcpipchip
Copy link

Try to disable assyncronous message of modem, it´s a AT command, i dont remember which at moment!
+UMWI: 0,1
[GSM] GSMClient::handleUrc: usr = +UMWI: 0,1

+UMWI: 0,2
[GSM] GSMClient::handleUrc: usr = +UMWI: 0,2

+UMWI: 0,3
[GSM] GSMClient::handleUrc: usr = +UMWI: 0,3

+UMWI: 0,4
[GSM] GSMClient::handleUrc: usr = +UMWI: 0,4

@ninora
Copy link
Author

ninora commented Aug 31, 2021

Looking into disabling asynchronous messages, I will report later, in the meanwhile, it looks as if the module get connected to LTE from reboot using the set of commands below and from there ping works as expected, so perhaps we don't need gsmAccess.begin? Makes sense?

Configure APN
AT+CGATT?
+CGATT: 1

Check the GPRS attachment status
AT+UPSD=0,1,"super"
OK

Save config
AT+UPSDA=0,1
OK

Activate GPRS
AT+UPSDA=0,3
OK
+UUPSDA: 0,"10.174.88.81"

Ensure the GPRS connection is up
AT+UPSND=0,8
+UPSND: 0,8,1
OK

@ninora
Copy link
Author

ninora commented Aug 31, 2021

Checkout my email regarding remote access to LARA's board.

@khoih-prog
Copy link
Owner

Looking into disabling asynchronous messages, I will report later, in the meanwhile, it looks as if the module get connected to LTE from reboot using the set of commands below and from there ping works as expected, so perhaps we don't need gsmAccess.begin? Makes sense?

Makes sense. Will have a look, try that and update code for you to test.

It'll be messy for a while, so I'll upload the tempo code later on private repo until all tests are OK.

@ninora
Copy link
Author

ninora commented Aug 31, 2021

New private version seem to work fine!

I will post the ping sketch output below and tomorrow will do more tests.
One fix - Modem_LaraR2_Extra_Generic.h Line 106 missing ; after GPRS_STATE_ACTIVATE_IP
Thanks and GN!

GPRSPing.ino output

Starting GPRSPing on SAMD MKRGSM1400
GSM_Generic v1.6.0
[GSM] begin: UART baud = 115200
[GSM] begin: Reset
[GSM] begin: Reset done
[GSM] begin: Check autosense

AT
OK

[GSM] lowPowerMode: DTR LOW, exit lowPowerMode

AT+UPSV=3
OK
[GSM] begin: Modem OK

AT+CPIN?
ERROR
:
:
AT+CPIN?
+CPIN: READY
OK

AT+CMGF=1
OK

AT+UDCONF=1,1
OK

AT+CTZU=1
OK

AT+UDTMFD=1,2
OK

+UMWI: 0,1
[GSM] GSMClient::handleUrc: usr = +UMWI: 0,1

+UMWI: 0,2
[GSM] GSMClient::handleUrc: usr = +UMWI: 0,2

+UMWI: 0,3
[GSM] GSMClient::handleUrc: usr = +UMWI: 0,3

+UMWI: 0,4
[GSM] GSMClient::handleUrc: usr = +UMWI: 0,4

AT+CREG?
+CREG: 0,0
OK
:
:
AT+CREG?
+CREG: 0,1
OK

AT+UCALLSTAT=1
OK

[GSM] GSM::begin: _gsmData._state = GSM_IDLE

AT+CGATT=1
OK

AT+UPSD=0,1,"ltedata.apn"
OK

AT+UPSDA=0,3
OK

+UUPSDA: 0,"10.162.139.15"
[GSM] GSMClient::handleUrc: usr = +UUPSDA: 0,"10.162.139.15"

AT+UPSND=0,8
+UPSND: 0,8,1
OK

Pinging www.google.com: AT+UPING="www.google.com",1,32,5000,128
AT+UPING="www.google.com",1,32,5000,128
OK

+UUPING: 1,32,"www.google.com","216.58.212.164",110,96
[GSM] GSMClient::handleUrc: usr = +UUPING: 1,32,"www.google.com","216.58.212.164",110,96
SUCCESS! RTT = 96 ms

@khoih-prog
Copy link
Owner

Modem_LaraR2_Extra_Generic.h fixed in v1.6.1-r2

@khoih-prog
Copy link
Owner

Hi @ninora , @tcpipchip

The new release GSM_Generic v1.6.1 has just been published.

Best Regards,


Release v1.6.1

  1. Fix GPRS issue for u-blox LARA-R2xx LTE Cat 1 Modem

@khoih-prog
Copy link
Owner

Hi @ninora

Glad everything is OK for you now. We've enjoyed working with you to solve the problem so far.

I'm closing this issue and please open new one if you get bugs / new requests.

Best Regards,

BTW, Many thanks for your MKR GSM1400 you contributed. It'll certainly be helpful in next issue / project.

@tcpipchip
Copy link

nice!!!!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants