Rak5860 module NB-IoT with Hologram sim

Dear Community , Thenks in advance for who will help me .

I bought wisblock kit for a project with Lora, because i need a gps tracker and lora don’t have enought public gateway in my area i decide to modify my project adding Rak5860 Iot Module, and for reduce the trubles, i had order Hologram sim.
I took from examples Hologram_Tcp.ino, i’m happy that Gps work, but my problem is that it doesn’t connect to the network .
I live in italy but i think it doesen’t matter , i’d tried the SIM on a old Galaxy S6 and it work fine , but from module, it don’t connect to the network … some idea ?

serial output :

07:12:55.598 → +QGPSLOC: 051254.000,4532.1126N,1158.0636E,1.4,44.5,3,0.00,0.0,0.0,0
07:12:57.585 →
07:12:57.585 → OK
07:12:57.585 →
07:12:57.585 → {“k”:"+C7pOb8=",“d”:4532.1126N,1158.0636E,“t”:“TOPIC1”}
07:13:00.525 →
07:13:03.509 →
07:18:04.507 → Send test data to Hologram via TCP!
07:18:24.019 →
07:18:24.019 → OK
07:18:24.019 →
07:18:46.493 →
07:18:46.493 → +QGPSLOC: 051845.000,4532.1201N,1158.0307E,1.4,-19.-7,3,0.00,0.0,0.1
07:18:46.493 →
07:18:48.481 →
07:18:48.481 → OK
07:18:48.481 →
07:18:48.481 → {“k”:"+C7pOb8=",“d”:4532.1201N,1158.0307E,“t”:“TOPIC1”}
07:18:51.421 →
07:18:54.410 →
07:23:55.414 → Send test data to Hologram via TCP!
07:24:14.947 →
07:24:14.947 → OK
07:24:14.947 →
07:24:40.314 →
07:24:40.314 → +QGPSLOC: 052439.000,4532.1062N,1158.0950E,2.9,23.0,3,0.00,0.0,0.0,5
07:24:42.307 →
07:24:42.307 → OK
07:24:42.307 →
07:24:42.307 → {“k”:"+C7pOb8=",“d”:4532.1062N,1158.0950E,“t”:“TOPIC1”}
07:24:45.207 →
07:24:48.191 →
07:29:49.225 → Send test data to Hologram via TCP!
07:30:08.741 →
07:30:08.741 → OK
07:30:08.741 →
07:30:49.785 →
07:30:49.785 → +QGPSLOC: 053049.000,4532.1004N,1158.0759E,1.5,14.3,3,0.00,0.0,0.0,0
07:30:51.735 →
07:30:51.735 → OK
07:30:51.735 →
07:30:51.735 → {“k”:"+C7pOb8=",“d”:4532.1004N,1158.0759E,“t”:“TOPIC1”}
07:30:54.682 →
07:30:57.671 →
07:35:58.675 → Send test data to Hologram via TCP!
07:36:18.209 →
07:36:18.209 → OK
07:36:18.209 →
07:36:30.915 →
07:36:30.915 → +QGPSLOC: 053630.000,4532.0978N,1158.0722E,1.5,30.7,3,0.00,0.0,0.0,1
07:36:32.856 →
07:36:32.856 → OK
07:36:32.856 →
07:36:32.856 → {“k”:"+C7pOb8=",“d”:4532.0978N,1158.0722E,“t”:“TOPIC1”}
07:36:35.778 →
07:36:38.803 →
07:41:39.775 → Send test data to Hologram via TCP!
07:41:59.313 →
07:41:59.313 → OK
07:41:59.313 →
07:46:54.255 →
07:46:54.255 → OK
07:46:54.255 →
07:46:54.255 → {“k”:"+C7pOb8=",“d”:,“t”:“TOPIC1”}
07:46:57.173 →
07:47:00.174 →
07:52:01.178 → Send test data to Hologram via TCP!
07:52:20.720 →
07:52:20.720 → OK
07:52:20.720 →
07:54:12.047 →
07:54:12.047 → +QGPSLOC: 055411.000,4532.1137N,1158.0580E,2.0,9.5,3,0.00,0.0,0.0,3

07:54:14.017 →
07:54:14.017 → OK
07:54:14.017 →
07:54:14.017 → {“k”:"+C7pOb8=",“d”:4532.1137N,1158.0580E,“t”:“TOPIC1”}
07:54:16.936 →
07:54:19.936 →
07:59:20.959 → Send test data to Hologram via TCP!
07:59:40.472 →
07:59:40.472 → OK
07:59:40.472 →
08:03:29.015 →
08:03:29.015 → +QGPSLOC: 060328.000,4532.1116N,1158.0669E,2.2,41.6,3,0.00,0.0,0.0,

08:03:30.954 →
08:03:30.954 → OK
08:03:30.954 →
08:03:30.954 → {“k”:"+C7pOb8=",“d”:4532.1116N,1158.0669E,“t”:“TOPIC1”}
08:03:33.910 →
08:03:36.882 →
08:08:37.869 → Send test data to Hologram via TCP!
08:08:57.445 →
08:08:57.445 → OK
08:08:57.445 →
08:10:32.166 →
08:10:32.166 → +QGPSLOC: 061031.000,4532.1042N,1158.0821E,2.3,47.6,3,0.00,0.0,0.0,4
08:10:34.115 →
08:10:34.115 → OK
08:10:34.115 →
08:10:34.115 → {“k”:"+C7pOb8=",“d”:4532.1042N,1158.0821E,“t”:“TOPIC1”}
08:10:37.040 →
08:10:40.031 →
08:15:41.035 → Send test data to Hologram via TCP!
08:16:00.560 →
08:16:00.560 → OK
08:16:00.560 →
08:20:55.499 →
08:20:55.499 → OK
08:20:55.499 →
08:20:55.499 → {“k”:"+C7pOb8=",“d”:,“t”:“TOPIC1”}
08:20:58.432 →
08:21:01.457 →
08:26:02.418 → Send test data to Hologram via TCP!
08:26:21.957 →
08:26:21.957 → OK
08:26:21.957 →
08:31:16.922 →
08:31:16.922 → OK
08:31:16.922 →
08:31:16.922 → {“k”:"+C7pOb8=",“d”:,“t”:“TOPIC1”}
08:31:19.837 →
08:31:22.820 →

Code :

/**
@file Hologram_Tcp.ino
@author rakwireless.com
@brief BG77 tcp test with Hologram, send gps data to server
@version 0.1
@date 2020-12-28
@copyright Copyright (c) 2020
**/

#define BG77_POWER_KEY WB_IO1
#define BG77_GPS_ENABLE WB_IO2

String bg77_rsp = “”;

//Hologarm tcp message format is jason. Remember to replace the card key in type k.
//About key details: Device keys – Hologram
//About message details: Embedded APIs | References | Hologram
String hologram_msg_pre = “{“k”:”+C7pOb8=",“d”:";
String hologram_msg_suff = “,“t”:“TOPIC1”}”;
String hologram_msg = “”;
String send_data_length_at = “”;
String gps_data = “”;

void setup()
{
time_t serial_timeout = millis();
Serial.begin(115200);
while (!Serial)
{
if ((millis() - serial_timeout) < 5000)
{
delay(100);
}
else
{
break;
}
}
Serial.println(“RAK11200 Cellular TEST With Hologram sim card!”);

//BG77 init , Check if the modem is already awake

time_t timeout = millis();
bool moduleSleeps = true;
Serial1.begin(115200);
delay(1000);
pinMode(BG77_GPS_ENABLE, OUTPUT);
digitalWrite(BG77_GPS_ENABLE, 1);
Serial1.println(“ATI”);
//BG77 init
while ((millis() - timeout) < 6000)
{
if (Serial1.available())
{
String result = Serial1.readString();
Serial.println(“Modem response after start:”);
Serial.println(result);
moduleSleeps = false;
}
}
if (moduleSleeps)
{
// Module slept, wake it up
pinMode(BG77_POWER_KEY, OUTPUT);
digitalWrite(BG77_POWER_KEY, 0);
delay(1000);
digitalWrite(BG77_POWER_KEY, 1);
delay(2000);
digitalWrite(BG77_POWER_KEY, 0);
delay(1000);
}
Serial.println(“BG77 power up!”);

//active and join to the net, this part may depend on some information of your operator.
bg77_at(“AT+CFUN=1,0”, 500);
delay(2000);
bg77_at(“AT+CPIN?”, 500);
delay(2000);
bg77_at(“AT+QNWINFO”, 500);
delay(2000);
bg77_at(“AT+QCSQ”, 500);
delay(2000);
bg77_at(“AT+CSQ”, 500);
delay(2000);
bg77_at(“AT+QIACT=1”, 3000);
delay(2000);

//open tcp link with Hologram server
bg77_at(“AT+QIOPEN=1,0,“TCP”,“cloudsocket.hologram.io”,9999,0,1”, 5000);
delay(2000);

}
void parse_gps()
{
int index1 = gps_data.indexOf(’,’);

if(strstr(gps_data.c_str(),“E”) != NULL)
{
int index2 = gps_data.indexOf(‘E’);
gps_data = gps_data.substring(index1+1,index2+1);
}
if(strstr(gps_data.c_str(),“W”) != NULL)
{
int index3 = gps_data.indexOf(‘W’);
gps_data = gps_data.substring(index1+1,index3+1);
}

}

void get_gps()
{
int gps_count = 300;
int timeout = 1000;
while(gps_count–)
{
Serial1.write(“AT+QGPSLOC?\r”);
timeout = 1000;
while (timeout–)
{
if (Serial1.available())
{
gps_data += char(Serial1.read());
}
delay(1);
}
if(strstr(gps_data.c_str(),“CME ERROR”) != NULL)
{
gps_data = “”;
continue;
}
if(strstr(gps_data.c_str(),“E”) != NULL || strstr(gps_data.c_str(),“W”) != NULL)
{
Serial.println(gps_data);
parse_gps();
break;
}
}
}

//this function is suitable for most AT commands of bg96. e.g. bg96_at(“ATI”)
void bg77_at(char *at, uint16_t timeout)
{
char tmp[256] = {0};
int len = strlen(at);
strncpy(tmp, at, len);
uint16_t t = timeout;
tmp[len] = ‘\r’;
Serial1.write(tmp);
delay(10);
while (t–)
{
if (Serial1.available())
{
bg77_rsp += char(Serial1.read());
}
delay(1);
}
Serial.println(bg77_rsp);
bg77_rsp = “”;
}

void send_test_data()
{
//open gps, gsm/nb will stop work now
bg77_at(“AT+QGPS=1,1”, 20000);
//get gps data, this will cost some time
get_gps();
//close gps
bg77_at(“AT+QGPSEND”, 2000);
//combine the data packet
hologram_msg = hologram_msg_pre+gps_data+hologram_msg_suff;
Serial.println(hologram_msg);
gps_data = “”;
//send data length command
char tmp[256] = {0};
send_data_length_at = “AT+QISEND=0,” + hologram_msg.length();
strncpy(tmp, send_data_length_at.c_str(), send_data_length_at.length());
bg77_at(tmp, 3000);
delay(2000);
//send data
memset(tmp,0,256);
strncpy(tmp, hologram_msg.c_str(), hologram_msg.length());
bg77_at(tmp, 1000);
delay(1000);
}

void loop()
{
Serial.println(“Send test data to Hologram via TCP!”);
send_test_data();
//consider the gps fix time, interval should be long
delay(300000);
}

and this is the begin of serial output :

06:53:41.482 → BG77 power up!
06:53:42.000 →
06:53:42.000 → RDY
06:53:42.000 →
06:53:42.000 → OK
06:53:42.000 →
06:53:44.481 →
06:53:44.481 → +CME ERROR: 10
06:53:44.481 →
06:53:44.481 → APP RDY
06:53:44.481 →
06:53:46.971 →
06:53:46.971 → +QNWINFO: No Service
06:53:46.971 →
06:53:46.971 → OK
06:53:46.971 →
06:53:49.502 →
06:53:49.502 → +QCSQ: “NOSERVICE”
06:53:49.502 →
06:53:49.502 → OK
06:53:49.502 →
06:53:51.987 →
06:53:51.987 → +CSQ: 99,99
06:53:51.987 →
06:53:51.987 → OK
06:53:51.987 →
06:53:56.937 →
06:53:56.937 → ERROR
06:53:56.937 →
06:54:03.834 →
06:54:03.834 → OK
06:54:03.834 →
06:54:03.834 → +QIOPEN: 0,561
06:54:03.834 →
06:54:05.805 → Send test data to Hologram via TCP!
06:54:25.332 →
06:54:25.332 → OK
06:54:25.332 →
06:55:03.422 →
06:55:03.422 → +QGPSLOC: 045503.000,4532.0975N,1158.0607E,1.5,37.3,3,0.00,0.0,0.0,

06:55:05.391 →
06:55:05.391 → OK
06:55:05.391 →
06:55:05.391 → {“k”:"+C7pOb8=",“d”:4532.0975N,1158.0607E,“t”:“TOPIC1”}
06:55:08.360 →
06:55:11.314 →
07:00:12.349 → Send test data to Hologram via TCP!

Hi @projectsbminfo ,

NB-IoT is not available in Hologram Network. Only LTE CAT-M1.

Sadly, LTE CAT-M1 for hologram is only available in US. So it wont be available there in Italy.

Please have a look on the Hologram coverage here - Global IoT Coverage | Hologram

Can you try to check other cellular operators there in Italy who has NB-IoT or LTE-M1 available in their network?

dear Mr Carlowan ,
Thank you for the quickly answer , For me any band is ok, i have to transfer only few data, hologram sim is working fine, i test with a samsung s6 smartphone, i read the documentation but i didn’t find an AT command for connect with the first network available , can you help me ?


RAK5860 uses BG77 which only supporte NB-IOT and LTE-M.

Your phone supports 2G, 3G and 4G LTE that’s why it is working. But the module can’t.

Thank you so much fot your reply, i have another question . I bought a Vodafone NB Iot standard compilant sim , and i used the example script " cellular ping " , that is based on UNICOMM nb.iot sim, but it doesen’t connect to the network , i’ve read the quelctel At command user manual but i didn’t find a valid example that explain wich AT command the program must sent to the board for setup the SIM . I also seen that in many script the APN is not specified and i didn’t undestand why .

serial output :

10:47:58.957 → Modem response after start:
10:47:58.957 →
10:47:58.957 → Quectel
10:47:58.957 → BG77
10:47:58.957 → Revision: BG77LAR02A04
10:47:58.957 →
10:47:58.957 → OK
10:47:58.957 →
10:47:58.957 → BG77 power up!
10:47:59.477 →
10:47:59.477 → Quectel
10:47:59.477 → BG77
10:47:59.477 → Revision: BG77LAR02A04
10:47:59.477 →
10:47:59.477 → OK
10:47:59.477 →
10:48:01.956 →
10:48:01.956 → OK
10:48:01.956 →
10:48:04.449 →
10:48:04.449 → OK
10:48:04.449 →
10:48:06.948 →
10:48:06.948 → ERROR
10:48:06.948 →
10:48:09.448 →
10:48:09.448 → OK
10:48:09.448 →
10:48:11.953 →
10:48:11.953 → OK
10:48:11.953 →
10:48:14.459 →
10:48:14.459 → +CPIN: READY
10:48:14.459 →
10:48:14.459 → OK
10:48:14.459 →
10:48:16.965 →
10:48:16.965 → +QNWINFO: No Service
10:48:16.965 →
10:48:16.965 → OK
10:48:16.965 →
10:48:19.463 →
10:48:19.463 → +QCSQ: “NOSERVICE”
10:48:19.463 →
10:48:19.463 → OK
10:48:19.463 →
10:48:21.963 →
10:48:21.963 → +CSQ: 99,99
10:48:21.963 →
10:48:21.963 → OK
10:48:21.963 →
10:48:26.907 →
10:48:26.907 → ERROR
10:48:26.907 →
10:48:28.893 → Begin receive packet from www.baidu.com!
10:48:38.693 →
10:48:38.693 → OK
10:48:38.693 →
10:48:38.693 → +QPING: 561
10:48:38.693 →
10:48:39.672 → Begin receive packet from www.baidu.com!

program :

/**
@file Cellular_Ping.ino
@author rakwireless.com
@brief BG77 ping with www.baidu.com via NB-IOT
@version 0.1
@date 2020-12-28
@copyright Copyright (c) 2020
**/

#define BG77_POWER_KEY WB_IO1
String bg77_rsp = “”;

void setup()
{
time_t serial_timeout = millis();
Serial.begin(115200);
while (!Serial)
{
if ((millis() - serial_timeout) < 5000)
{
delay(100);
}
else
{
break;
}
}
Serial.println(“RAK11200 Cellular TEST With Vodafone V-sim card!”);

// Check if the modem is already awake
time_t timeout = millis();
bool moduleSleeps = true;
Serial1.begin(115200);
delay(1000);
Serial1.println(“ATI”);
//BG77 init
while ((millis() - timeout) < 6000)
{
if (Serial1.available())
{
String result = Serial1.readString();
Serial.println(“Modem response after start:”);
Serial.println(result);
moduleSleeps = false;
}
}
if (moduleSleeps)
{
// Module slept, wake it up
pinMode(BG77_POWER_KEY, OUTPUT);
digitalWrite(BG77_POWER_KEY, 0);
delay(1000);
digitalWrite(BG77_POWER_KEY, 1);
delay(2000);
digitalWrite(BG77_POWER_KEY, 0);
delay(1000);
}
Serial.println(“BG77 power up!”);

bg77_at("ATI", 500);
delay(2000);
bg77_at("AT+CGDCONT=1,\"IP\",\"snbiot\"", 500);
delay(2000);
bg77_at("AT+QCFG=\"nwscanseq\",03,1", 500);
delay(2000);
bg77_at("AT+QCFG=\"band\",F,2000095,2000095", 500);
delay(2000);
bg77_at("AT+QCFG=\"iotopmode\",1,1", 500);
delay(2000);
bg77_at("AT+CFUN=1,0", 500);
delay(2000);
bg77_at("AT+CPIN?", 500);
delay(2000);
bg77_at("AT+QNWINFO", 500);
delay(2000);
bg77_at("AT+QCSQ", 500);
delay(2000);
bg77_at("AT+CSQ", 500);
delay(2000);
bg77_at("AT+QIACT=1", 3000);
delay(2000);

}

//this function is suitable for most AT commands of bg96. e.g. bg96_at(“ATI”)
void bg77_at(char *at, uint16_t timeout)
{
char tmp[256] = {0};
int len = strlen(at);
strncpy(tmp, at, len);
uint16_t t = timeout;
tmp[len] = ‘\r’;
Serial1.write(tmp);
delay(10);
while (t–)
{
if (Serial1.available())
{
bg77_rsp += char(Serial1.read());
}
delay(1);
}
Serial.println(bg77_rsp);
bg77_rsp = “”;
}

void ping_at(char *at)
{
char tmp[256] = {0};
int len = strlen(at);
uint16_t timeout = 10000;
strncpy(tmp, at, len);
tmp[len] = ‘\r’;
Serial1.write(tmp);
delay(10);

while (timeout--)
{
	if (Serial1.available())
	{
		bg77_rsp += char(Serial1.read());
	}
	delay(1);
}
Serial.println(bg77_rsp);
bg77_rsp = "";

}

void loop()
{
Serial.println(“Begin receive packet from www.baidu.com!”);
ping_at(“AT+QPING=1,“www.baidu.com””);
delay(1000);
}