You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
description: 'Learn how to set up the Arduino® Portenta Cat. M1/NB IoT GNSS Shield and get a quick overview of its functionality. Obtain information regarding pins and how to use the different communication technologies.'
3
+
description: 'Learn how to set up the Portenta Cat. M1/NB IoT GNSS Shield and get a quick overview of its functionality. Obtain information regarding pins and how to use the different communication technologies.'
The **Arduino® Portenta Cat. M1/NB IoT GNSS Shield** is a board that enables cellular connectivity with both Cat. M1 and NB-IoT networks. Easily track your valuable assets across the city or worldwide by choosing among GPS, GLONASS, Galileo or BeiDou Satellite navigation system.
25
+
The **Arduino Portenta Cat. M1/NB IoT GNSS Shield** is a board that enables cellular connectivity with both Cat. M1 and NB-IoT networks. Easily track your valuable assets across the city or worldwide by choosing among GPS, GLONASS, Galileo or BeiDou Satellite navigation system.
26
26
27
-
This article is a collection of guides, API calls and tutorials that can help you get started with the Arduino® Portenta Cat. M1/NB IoT GNSS Shield board. You can also visit the [documentation product page for the Arduino® Portenta Cat. M1/NB IoT GNSS Shield](/hardware/portenta-cat-m1-nb-iot-gnss-shield) for more in-depth tutorials about the different features.
27
+
This article is a collection of guides, API calls and tutorials that can help you get started with the Portenta Cat. M1/NB IoT GNSS Shield board. You can also visit the [documentation product page for the Portenta Cat. M1/NB IoT GNSS Shield](/hardware/portenta-cat-m1-nb-iot-gnss-shield) for more in-depth tutorials about the different features.
28
28
29
29
## Core
30
30
31
-
The Arduino® Portenta Cat. M1/NB IoT GNSS Shield uses the libraries from the [Arduino Mbed OS Portenta core](https://github.com/arduino/ArduinoCore-mbed).
31
+
The Portenta Cat. M1/NB IoT GNSS Shield uses the libraries from the [Arduino Mbed OS Portenta core](https://github.com/arduino/ArduinoCore-mbed).
32
32
33
33
***The libraries are included in the mbed Core version greater than 2.6.1***
34
34
35
35
## Installation
36
36
37
-
### Arduino IDE 1.8.X
37
+
### Arduino IDE
38
38
39
-
The Portenta Cat. M1/NB IoT GNSS Shield can be programmed through the **Classic Arduino IDE 1.8.X**. To install your board, you can check out the guide below:
39
+
The Portenta Cat. M1/NB IoT GNSS Shield can be programmed through the **Classic Arduino IDE 1.8.X** and **Arduino IDE 2**.
40
40
41
-
-[Installing the Arduino Mbed OS Portenta Boards core](/software/ide-v1/tutorials/getting-started/cores/arduino-mbed_portenta)
42
-
43
-
### Arduino IDE 2
44
-
45
-
The Portenta Cat. M1/NB IoT GNSS Shield can be programmed through the **Arduino IDE 2**. To install your board, you can check out the guide below:
41
+
To install your board, you can check out the guides below:
46
42
43
+
-[Installing the Arduino Mbed OS Portenta Boards core](/software/ide-v1/tutorials/getting-started/cores/arduino-mbed_portenta)
47
44
-[How to use the board manager with the Arduino IDE 2](https://www.arduino.cc/en/Tutorial/getting-started-with-ide-v2/ide-v2-board-manager)
48
45
49
46
### Web Editor
@@ -53,6 +50,7 @@ The board can be programmed through the **Web Editor**. To get started with your
53
50
-[Getting started with the Web Editor](/cloud/web-editor/tutorials/getting-started/getting-started-web-editor)
54
51
55
52
## Pins
53
+
56
54
As a Portenta family shield, it uses High Density Connectors to interface with the Portenta board which is connected to.
57
55
58
56

@@ -75,7 +73,7 @@ Make sure you go to the `arduino_secrets.h` tab and:
75
73
76
74
APN stands for 'Access Point Name'. An APN is a gateway between a cellular network and the Internet.
77
75
78
-
After finishing this setup, compile and upload the program. If everything went fine, you should see the HTML content of the webpage printed in the Serial Monitor.
76
+
After finishing this setup, compile, and upload the program. If everything went fine, you should see the HTML content of the webpage printed in the Serial Monitor.
79
77
80
78
***Sometimes it takes time to connect to the provider's APN, please be patient, it can take up to 30 minutes. If you cannot connect after that time, make sure you entered the correct SIM pin and the APN. If the issue persists, contact your provider and verify whether Cat. M1 is enabled on your SIM card.***
81
79
@@ -85,47 +83,93 @@ To get familiar with the commands, you can take a look at the [GSM library](http
85
83
86
84
This library contains some commands that are quite different, because it leverages mbed APIs. In this case, it uses the NetworkInterface, CellularContext and CellularDevice classes. For more information about API visit [https://os.mbed.com/docs/mbed-os/v6.14/apis/network-interface-apis.html](https://os.mbed.com/docs/mbed-os/v6.14/apis/network-interface-apis.html).
|`GSM.begin(PIN, APN, USERNAME, PASSWORD, CATNB/CATM1, BAND_#)`| Unlock the SIM card using the PIN parameter and connects to the provider |
89
+
|`GSMClient`| Client constructor, on the examples we define it as client |
90
+
|`GSM.getTime()`| Returns the time, you can set a new one with setTime() |
91
+
|`GSM.getLocalTime()`| Returns the local time |
92
+
|`GSM.setTime()`| Set the time, it will be saved and it can be read with getTime() |
93
+
|`GSM.debug()`| After this command, the Serial Monitor will output more detailed info about the GSM class commands, connections, etc... |
94
+
|`GSMClient.connect(server,port)`| Connect to a remote server |
95
+
|`GSMClient.available()`| Check if the server that is connected to has some bytes ready to be read |
96
+
|`GSMClient.read()`| Returns data from the server |
97
+
|`GSMClient.stop()`| Disconnects from the server |
98
+
99
+
### Available Frequency Bands
100
+
101
+
It is possible to establish a connection within desired frequency band for the Portenta Cat. M1/NB IoT GNSS Shield. To do this, you need to define frequency bands for `GSM.begin(PIN, APN, USERNAME, PASSWORD, CATNB/CATM1, BAND_#)` by replacing `BAND_#` with desired band.
102
+
103
+
The **list of available frequency bands** that can be used for the device's credential configuration is as follows:
104
+
105
+
| 32-bit Hexadecimal Value | LTE Band | Band Designation | Argument Designation |
These are Cat.M and Cat.NB frequency bands that are available for use with TX62-W, referred to as the LTE Cat.M1 and Cat.NB1 Engine. The Portenta Cat. M1/NB IoT GNSS Shield is capable of the present network connectivity thanks to its onboard TX62-W Cellular-GNSS LPWAN modem.
123
+
124
+
The band configuration is available to allow the user to restrict to a specific or combination of frequency bands. It helps to operate under enforced frequency policy requirements, or to lower the network search time, reducing the device power consumption.
125
+
126
+
If you leave the frequency band `BAND_#` field blank for the `GSM.begin(PIN, APN, USERNAME, PASSWORD, CATNB/CATM1, BAND_#)` method, it will configure using the default setting, which allows it to search within all available supported bands. The Portenta Cat. M1/NB IoT GNSS Shield will then select a compatible network automatically depending on the availability in the operating region.
127
+
128
+
Each country has a compatible frequency band, so it is a good practice to check the if desired band is suitable for its region. You can check the frequency band compatibility of the region by using a website that compiles network status such as [here](https://www.frequencycheck.com/countries).
102
129
103
130
#### Connect to Your Provider
104
131
105
132
You need to enter the Pin code and the APN link of your provider.
106
-
The user name and password depend on your provider; they are required to authenticate with the APN gateway. These values can usually be found by searching online for APN credentials + provider name. Sometimes they can be left blank.
107
133
108
-
This sketch will initialize the SIM card and connect to your provider network
134
+
The username and password depend on your provider; these are required to authenticate with the APN gateway. These values can usually be found by searching online for APN credentials and provider names. Sometimes they can be left blank.
135
+
136
+
The following sketch will initialize the SIM card and connect to your provider network within supported bands:
The following example shows how the `GSM.begin()` method would look if you were to define the frequency band for the shield to mask multiple bands to be used or searched. The `BAND_20` and `BAND_19` are one example of a combination of bands to configure credential to restrict the shield's network to the compatible region. It will allow to increase the network search speed and reduce the time spent seeking, saving power consumption of the device.
Please check how the frequency band configuration works briefly within the [Available Frequency Bands section](#available-frequency-bands). The list of available frequency bands for the shield's cellular connectivity configuration can also be found in the previous [section](#available-frequency-bands).
172
+
129
173
#### Send a HTTP GET Request and Receive Data
130
174
131
175
The following sketch will connect to your provider and use a HTTP GET request to get data from the server you are connected to. In this case, it connects to "example.com" and prints out the content through the Serial Monitor.
@@ -210,17 +254,15 @@ Make sure you go to the `arduino_secrets.h` tab and:
| `GPS.available()` | Check if the GPS has new data to be read |
262
+
| `GPS.read()` | Returns a `char` with the reading from the GPS module |
263
+
| `GPS.readAndPrint()` | Output data on the Serial Monitor, only if there is new data |
264
+
| `GPS.readAndDrop()` | Read the data and do nothing with it |
265
+
| `GPS.checkGNSSEngine()` | Check if the GNSS modem is receiving data correctly |
224
266
225
267
#### Get GPS Data
226
268
@@ -276,7 +318,7 @@ To do so, you can use an **NMEA parser**. This will convert messages received fr
276
318
277
319
In this way, it is possible to interact with the data that you need for your application, for instance getting only latitude and longitude. You will be able to save those values into variables, instead of having the whole NMEA messages.
278
320
279
-
Open the example from the library at **Examples > 107-Arduino-NMEA-Parser > NMEA-Basic** and add the following:
321
+
Open the example from the library at **Examples > 107-Arduino-NMEA-Parser > NMEA-Basic** and add the following:
280
322
281
323
Include the needed libraries.
282
324
@@ -337,6 +379,7 @@ One way to save power on your project is to enable the GPS module only when it n
337
379
//stop and disable the GNSS engine
338
380
GPS.end();
339
381
```
382
+
340
383
By using this method, you don't need to initialize the GPS inside the `setup()`.
341
384
342
385
## Conclusion
@@ -345,10 +388,5 @@ This cheat sheet is written as a quick reference to look up the GSM and GPS feat
345
388
346
389
## Troubleshooting
347
390
348
-
### Getting Compiling Errors Using GPS and GSM
349
-
350
-
Make sure you included first the `GPS.h` library and then the `GSM.h`
351
-
352
-
### Can't Upload the Sketch
353
-
354
-
Sometimes, while the GPS module is getting readings, you will not be able to upload a new sketch. Double tap the reset button on your Portenta H7 and upload the new sketch.
391
+
- If you are getting compiling errors using GPS and GSM, make sure you included first the `GPS.h` library and then the `GSM.h`.
392
+
- Sometimes, while the GPS module is getting readings, you will not be able to upload a new sketch. Double tap the reset button on your Portenta H7 and upload the new sketch.
0 commit comments