MKR NB 1500 unable to connect to webserver

I am currently exploring the MKR NB 1500.
Running the sketch at https://docs.arduino.cc/tutorials/mkr-nb-1500/nb-web-client I am able to connect all fine to the network using nbAccess.begin and gprs.attachGPRS, but it refuses to connect to the server using client.connect.
I have tried different servers in addition to example.org, but every time the sketch just reports "connection failed" after a long timeout.
Reception is good, I am at -83 dBm, and I get IP address and DNS (checked by AT+CGCONTRDP in another sketch).
What can possibly be wrong?

Init with (true)
NB nbAccess(true);
and check the serial monitor for debug. If you can't solve the issue, paste the output here.

Thanks for tip!
Here is the output:

OK

AT+CGACT?

+CGACT: 1,1

OK

connecting...

AT+USOCR=6

+USOCR: 1

OK

AT+USOCO=1,"example.org",80

ERROR

AT+USOCL=1

OK

As mentioned, reports tell me that the MKR is connected to the network, but it looks like no traffic is forwarded through to the gateway.
In another test sketch I try to do a DNS lookup using AT+UDNSRN, but it fails:
(AT cmd string is here printed twice; first by me before issuing and then by embedded debug output)

DNS lookup of AT+UDNSRN=0,"example.org" : AT+UDNSRN=0,"example.org"

ERROR

So I suspect that something is preventing traffic from being forwarded in the network.

As can be seen from my previous post, the attempts for both DNS lookup and http connection fails with response ERROR.
That leads me to wondering whether there is some kind of blocking of traffic through the cellular network to the gateway, despite that the connection is reported to be all ok.

Command "GET PDP Context" with AT+CGCONTRDP returns both IP address and DNS addresses (namely the "normal" DNS addresses of this operator), however no gateway address.
Can this possibly be the reason, or does the SARA R410M simply forward anything up the pipe without a gateway address?
No netmask either, so it is probably a /32-connection?
For what I know, the DNS addresses can be hardcoded into the SIM, but I guess the 10.x.x.x-address is handed down the cell network?

Initially, when starting to test this SIM-card in the MKR NB 1500, it was connected to a data plan only allowing CAT-M. I then changed it to another plan, only allowing NB-IOT.
Since then I have had little time to fiddle with it, but I remember that at some point I was able to run the mentioned sketch successfully, dumping the http page contents to the serial terminal. Maybe that was when I still was on CAT-M, and that moving to NB-IOT has changed something.

I have opened a ticket at my operator Telenor, and hopefully the techs will dig into the details for me.

In order to cross-investigate possible causes:
Those of you that are able to run the mentioned web client test sketch successfully:

-Do you get a gateway address from "AT+CGCONTRDP" ?
-Do you succeed in a DNS lookup using AT+UDNSRN=0,"someurl" ?
-Which access technology do you use; CAT-M or NB-IOT?

There is something really funky going on here...
For a test I tried to ping my own IP address (obtained with AT+CGPADDR), response is ERROR
Then I thought that pinging localhost would be a winner...same.
Does not the SARA R410 maintain a regular routing table? Such would ensure that at least pinging localhost would get through?

GPRS IP address : 10.98.7.27
Pinging host: AT+UPING="10.98.7.27" : ERROR
Pinging host: AT+UPING="127.0.0.1" : ERROR

IMHO the main problem is that you can communicate only over that AT console. The 'computer' within the modem is 'unreachable'. Routing table? Probably. Nobody expect the u-blox engineer know. The answer you get over AT is ERROR - that's it. Hard to debug. Sometime you can read out errors over another AT command. Check the U-Blox manual.
Remember Little Britain's "Computer says NO"?

Never heard of Little Britain..I'm sorry!

Yes it's annoying that I don't get any more information, just "ERROR"
Today I tried to swap SIMcards between the MKR and a Mikrotik KNOT with a Quectel BG77.
Both cards are on a NB-IOT plan, and when starting up the KNOT with the card from the MKR, it connected immediately and did HTTP POST all fine...
Starting the MKR on the other card (which has worked fine in the KNOT for months, it took a rather long time to register, AT+CEREG? returned only 0,0 for ages.. but then finally it reported a connection with 0,2 (registered to Home network).
But the rest is as disappointing as with the original card...tells me I'm connected but no DNS lookup or webserver connection.

Unfortunately the AT command negotiation in the KNOT is concealed inside RouterOS, only a PPP connection that connects but i dunno what it actually does to get there...

This really puzzles me...

Exactly.. My experience is that some antennas of the same carrier had LTE-M enabled and some not. Connectivity was poor. Then i gave up on LTE-M because IMHO it was just a short hype. Maybe it's better these days, don't know.

Priceless!! :rofl: :rofl: :rofl:
Can't believe I've been around for more than half a century without seeing this!

Back to business...: Need to attack this problem somehow...the above experiment tells me that the SIMcard itself somehow works.
Could it be that the way the Arduino MKRNB library handles connection setup for some reason does not match some operators?
Or some RAT modes? I have set RAT=NB-IOT using AT+URAT.

Good for you! I wish i would be able to see Little Britain for the FIRST time. A highlight in european TV history.

Have you tried all RAT modes?
Make 100% sure that you have good covarge with this bands from this carrier at your place before step on.

Coverage is more than good enough, signal varies between -70 and -80.
Your suggestion made me try setting RAT=CAT-M using AT+URAT=7 and then it worked, thank you!!
(Due to my data plan being named NB-IOT I have previously set RAT=8, NB-IOT)
Then I tried AT+URAT=8,7 (NB-IOT with fallback to CAT-M) and it also worked!
I have now asked my operator Telenor why RAT=NB-IOT does not work. I believed it ought to do, due to my data plan name NB-IOT.

Anybody else who has been fiddling around with different RATs and has experienced the same?

EDIT:
DNS lookup using AT+UDNSRN=0,"example.org" and PING using AT+UPING="8.8.8.8" still doesn't work.

But you are attached to the gprs data network? (I mean not the mobile network)
I mean

if ((nbAccess.begin(PINNUMBER) == NB_READY) &&
        (gprs.attachGPRS() == GPRS_READY)) {
      connected = true;
 Serial.println("Connected!");
    } else {
      Serial.println("Not connected");
      delay(1000);
    }

Yes I'm connected to GPRS all fine.

The other day I managed to schedule a debugging session with my operator Telenor.
Thanks to 3rd line support I got a few log files from the internals in their network, captured as I was trying to connect.
When in RAT mode 8 NB-IOT trying to connect to with AT+USOCO=0,"example.org",80 I can see from the logs that the modem only does numerous DNS lookups of the hostname, however never connects to the server.
Opening a connection based on IP address issuing AT+USOCO=0,"93.184.216.34”,80 works immediately.
When on RAT mode 7, CAT-M, connecting works fine both with hostname and IP Address.

In my opinion, this clearly points towards a bug in the SATA R410M-02B.

I see that I'm on the following firmware version: L0.0.00.00.05.06 [Feb 03 2018 13:00:41], i.e a rather old one.
Browsing forums I've found methods to update , like this: Update firmware on mkr1500 UBLOX SARA-R410M-02B · Issue #27 · arduino-libraries/MKRNB · GitHub
however I cannot find anywhere to download the correct image for my modem.

I have sent an e-mail to U-Blox support requesting firmware/instructions, exited to see what they come up with:-)

Yes do that. Check the thread.

Which thread?

Got a reply from U-Blox.
From what I have found out, as I'm on a pre-Cambrian FW version, my only option is to solder an usb cable to the PCB and use Easyflash..

Do Arduino still push MKR NB 1500s with these old R410M-02B versions?
Let's say I came to the point where I want to push a larger amount of an MKR NB 1500-baced device to the market, a series of only 100 pcs would keep me occupied with the soldering iron and Easyflash for days or even for weeks just to bring the FW up to standards...

There was a guy offering a board where you can put your MKR without soldering for updates if you need to bulk the process. Arduino just solders what they get from ublox with the firmware installed on it.

Here it is:

Thank you for pointing me in that direction instarep!
Exactly what I need, I'm about to order one. :grinning:

Finally got my hands on this cradle :grin:
Downloaded and installed Easyflash 13.03 and obtained FW SARA-R410M-02B-04-P1-L0000000512A0221-000K00.
Installed the Serial passthrough script, connected the cradle via USB and then what I assume is the USB port appears in devmgr.
But where do I find USB drivers for it?
Tried 2.0.9.6 for W10 64 bit from this page: Qualcomm CDMA Technologies MSM Drivers Download for Windows 10, 8.1, 7, Vista, XP but it refused to install.

I have the feeling that I'm pretty close now, can anyone help me with the USB drivers??

image

Uhh, it's been a while.. I used:

https://www.u-blox.com/en/ubx-viewer/view/qud.win_.1.1_installer_10057.4.zip?url=https%3A%2F%2Fwww.u-blox.com%2Fsites%2Fdefault%2Ffiles%2Fqud.win_.1.1_installer_10057.4.zip

After connecting the modem, the modem should apear automatic as a modem in the windows device list

Thank you Instarep!
Installing USB drivers was a breeze with this package.
Modem appeared as COM6 as expected.
Loaded passthrough script, ran Easyflash and started the upgrade procedure.
Upon unplugging and re-plugging the cradle as instructed, COM6 re-appeared.
Firstly, Easyflash appeared to almost complete the backup stage before it complained about an error.
Starting all over again brought me past this, and Easyflash continued the procedure.
Then, when trying to start actual upload of the image to the SARA chip it suddenly ended up stuck in a loop with something like:
Waiting for device...
<1>
<2>
<3>
<1>
...and so on.
It never got past this.

I then tried to start all over again. First, to verify I could reach the MKR I re-installed my "normal" test sketch which sets up an IOT connection. Sketch ran, but it never got any response from the modem, i.e. no AT commands echoed.
Then I installed the passthrough sketch again but this time COM6, "Qualcomm..." never emerged.
Restart of computer did not help.

So has something been screwed up in the SARA chip?
Anyhow I can rectify?