Keep failing to connect

I received the NB-IoT shield (deluxe dual band bundle which includes the arduino M0) last week and I am trying to get things working. I successfully loaded the example program (https://github.com/janvl1234/Sodaq_NBIoT_examples/tree/master/Sensors_NB-IoT/Sodaq_NB-IoT_All_Sensors) and I configured AllThingsTalk the way the tutorial suggested.

However, no matter what I do, I can’t get connected to the network. I know the board is attached correctly because when I disable all networking stuff I can see the sensor readings and they all respond.

In the example program I keep getting false returned from the “connect” method from the nbiot library. I already tried to change the minimum connectionstrenght and I have tested the connection by driving around to see if network coverage could be the problem (and it isn’t).

I understood both the nb-iot sim card and board should have been activated/registered before sending it to me. I think this is done because I could add my device to AllThingsTalk.

Is there anything else I forgot to do before I can connect?

Or is there anything else I did wrong?

Hi,

Maybe the AT+NCONFIG? settings are still on true.
Can you check of they are on false, or update them with the AT commands?
This only has to be done once.

http://support.sodaq.com/sodaq-one/at/

Regards,
Jan

1 Like

Hi Jan,

I’m testing the NB IoT shield in Singapore (Band 8). I face the same issue.

We got hold of a UBlox EVB Kit with the same module and I’m able to get connected to NB IoT network.

The list of commands provided in your does not help much.

Something seems to be not right with the shield, as i’m not able see even the Signal Quality (CSQ always returns 99,99)

Hi Jan,

Thanks for the reaction. I knew I missed something, I didn’t knew you had to change those values.

However, I have changed the settings to false but still there is no connection. AT+CSQ results in a constant 99,99 and AT+CGATT? results in 0 so no connection to the network is made. I have given it enough time to establish a connection (+30 minutes).

I recon this time the reason is that I am in a blind spot to the network?

Regards,
Paul

Hi Capellio,

Could you share the exact sequence that you are doing for connecting to the network? And the SIM-card is inserted properly in the holder (no visible damages)?

Blind spot may not be the issue. As mentioned in my earlier post, I can get a UBlox EVB kit connected to NB ioT network in seconds, and at the same place the NB IoT Shield fails to connect. And AT+CSQ results in a constant 99,99 for me too.

Hi Jan,

Is there a way to upgrade firmware on the UBlox SARA N200?

Well somehow it suddenly started to send data. I don’t know the reason but without any changes (since setting the config values) it appears to connect en successfully send data, even in-house (no GPS but that is as expected).

So I plugged it in my car for my wife to collect me some data (she had to drive 300 km for work). That was yesterday and no data was send, at all.

So today I plugged it into my PC again to see what is going on. And immediately it sends out data, again.

The setup in-house and in the car are the same (as in the same device and cable). The only difference is the power supply, at home I use an available USB port, in the car I use the cigarette lighter output. In the car the cell reception is better than in the house and also GPS should work. The car we drive is nothing special so I don’t suspect extra isolation or something to block any signals.

Edit: So it appears the serial monitor necessity was blocking the sketch. I ripped out all println’s and got it working now.

1 Like

I’m facing the same problem. I successfully setup de NB-IoT Shield while following the setup guidance (great work by the way!). I get the following response on AT+NCONFIG?:

AT+NCONFIG?

+NCONFIG:AUTOCONNECT,FALSE
+NCONFIG:CR_0354_0338_SCRAMBLING,FALSE
+NCONFIG:CR_0859_SI_AVOID,FALSE

OK

And the following response on AT+CSQ:
+CSQ:4,99

Seems to be good?!

When I upload the e.g. humidity / pressure example / GPS, I constantly get the “Failed to connect!” error message. What am I doing wrong?

Hi @gloridas

@Gregory did already write in an other tread about updating the module.

Hi Roel,

When you get a CSQ you have a signal, but you are not connected yet.
Are you able to send a message with the AT commands?

Regards,
Jan

Hi Jan,
Yes, I am able to send messages. I walked through the AT commands tutorial on support.sodaq.com and all commands were successful.
KR, Roel

Hi @roel

I am happy to hear all commands were successful.

After the successful connect and transmit by AT command, did you try again with the sketch?
Do you still get the error “Failed to connect!”?

Regards,
Jan

Hi @Jan,

I followed the following steps:

  1. upload the passthrough sketch
  2. Execute the list of AT commands
  3. upload e.g. GPS sketch or other sketch provided via Github

Please see the result in attached image

KR, Roel

Hi Roel,

Can you modify the library to provide us with more information.

To enable more debug information about the NB-IoT connection go to the library and edit Sodaq_nbIOT.cpp
Documents\Arduino\libraries\Sodaq_nbIOT\src\Sodaq_nbIOT.cpp

Remove the // on line 24
//#define DEBUG -> #define DEBUG

Make the module more sensetive by changing the _minRSSI on line 111
_minRSSI(-113) // dBm
to
_minRSSI(-103) // dBm
if you are still not able to connect update to
_minRSSI(-93) // dBm
-93 is GSM minimum, nbiot should be 20dBm more sensetive.

Can you share the debug output with us?

Regards,
Jan

Hi @Jan,

please find below the output of the HTS221_HumidityTemperature_nbiot_att and LPS22HB_Pressure_nbiot_demo. Humidity_Temperature the connection succeeded once (-103), as well as GPS example. The second time I got an error (see below). On the Pressure example I got an error directly the first time (-103). I will give it a try on -93.

Output Pressure example:
SODAQ LPS22HB Arduino Example

AUTOCONNECT… OK
CR_0354_0338_SCRAMBLING… OK
CR_0859_SI_AVOID… OK
rdResp: OK
rdResp: OK
rdResp: OK
rdResp: OK
rdResp: OK
rdResp: OK
rdResp: +CSQ:99,99
rdResp: OK
rdResp: +CSQ:99,99
rdResp: OK
rdResp: +CSQ:99,99
rdResp: OK
rdResp: +CSQ:99,99
rdResp: OK
rdResp: +CSQ:4,99
rdResp: OK
rdResp: +CSQ:3,99
rdResp: OK
rdResp: +CSQ:2,99
rdResp: OK
rdResp: +CSQ:2,99
rdResp: OK
rdResp: +CSQ:2,99
rdResp: OK
rdResp: +CSQ:3,99
rdResp: OK
rdResp: +CSQ:3,99
rdResp: OK
rdResp: +CSQ:3,99
rdResp: OK
rdResp: +CSQ:3,99
rdResp: OK
rdResp: +CSQ:3,99
rdResp: OK
Failed to connect!
1022.58 mbar
rdResp: OK
1022.60 mbar
rdResp: OK

Output HumidityTemperature example:
rdResp: OK
rdResp: +NCONFIG:AUTOCONNECT,FALSE
rdResp: +NCONFIG:CR_0354_0338_SCRAMBLING,FALSE
rdResp: +NCONFIG:CR_0859_SI_AVOID,FALSE
rdResp: OK
AUTOCONNECT… OK
CR_0354_0338_SCRAMBLING… OK
CR_0859_SI_AVOID… OK
rdResp: REBOOTING
rdResp:
rdResp: timed out
rdResp: ⸮
rdResp: timed out
rdResp: REBOOT_CAUSE_APPLICATION_AT
rdResp: Neul
rdResp: OK
rdResp: OK
rdResp: OK
rdResp: OK
rdResp: OK
rdResp: OK
rdResp: OK
rdResp: +CSQ:99,99
rdResp: OK
rdResp: +CSQ:99,99
rdResp: OK
rdResp: +CSQ:99,99
rdResp: OK
rdResp: +CSQ:99,99
rdResp: OK
rdResp: +CSQ:4,99
rdResp: OK
rdResp: +CSQ:1,99
rdResp: OK
rdResp: +CSQ:1,99
rdResp: OK
rdResp: +CSQ:1,99
rdResp: OK
rdResp: +CSQ:1,99
rdResp: OK
rdResp: +CSQ:1,99
rdResp: OK
rdResp: +CSQ:3,99
rdResp: OK
rdResp: +CSQ:3,99
rdResp: OK
rdResp: +CSQ:2,99
rdResp: OK
rdResp: +CSQ:2,99
rdResp: OK
Failed to connect!

Hi @roel,

Thanks for sharing the debug results.

When you change the minimal required dBm, it will take longer to get a valid CSQ to start to make a connection.
When you set it on -103 ( CSQ 5 ) or even -93 ( CSQ 10) it will not try to connect if the signal is too low.

With your debug information we can see that you are in a place with poor nb-iot coverage.
Set the minimal signal back to -113 and extend the timeouts to make a connection.

on line 351, you can override the timeout.
if (!attachGprs()) {
default is 30 * 1000, see .h file.
Make it bigger to see if you wait longer you can send a message.
if (!attachGprs(120 * 1000)) {

Hope you can send a message this way.

Regards,
Jan

1 Like

Thanks, my first test seems to be successfull. Thanks for your help so far, great work!

1 Like

I can’t help noticing the covarage keeps being dramatic (for me that is).
I have played a little with the minimal required dBm but the effects do not vary.

I put the board in my car this morning and drove to work, I have done this multiple times to different locations and each time I drove 100km or more. Failing to connect at start I could understand but there are multiple parts where the connection keeps failing for long periods of time. I added the plotted output of the GPS registrations in the picture below, each red dot is an registration, the pin is the last one (which wasn’t my destination).

And it’s not that my server isn’t receiving the data. Makerstudio also doesn’t registrate my driving during the same periods of time.

So my next try will be to follow your instructions of changing the timeout value at the attachGprs function call. That would require me to include the source files of the library which is possible but wouldn’t it be better to create an additional call to set this value? The same as the minimum RSSI.

1 Like

The way back had the same outcome. In the begin multiple registrations and just before Utrecht it disconnected and the remaining 70km never re-connected again.