Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork218
Add TLS support to Portenta CAT.M1/NB IoT GNSS Shield#759
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Merged
Uh oh!
There was an error while loading.Please reload this page.
Merged
Changes fromall commits
Commits
Show all changes
20 commits Select commitHold shift + click to select a range
d8add39 GSMUdp: fix file header
pennam984b4fd GSM: add isConnected() method
pennam03be367 Add GSMSSLClient class
pennam69e563e MbedClient add possibility to set socket timeout in constructor
pennam4cedb61 MbedClient::connectSSL set timeout before TLS handshake starts
pennam389a2c9 MbedSSLClient add possibility to set socket timeout in constructor
pennam89cec9f GSMClient: set default socket timeout
pennam703289d GSM: Add GSMSSLClient example
pennamef79b5b GSM: fix file headers
pennam66b026a GSM: remove unused function
pennambed5201 GSM: rename debug() method into trace()
pennam2cb24df GSM: fix identation and spacing
pennam5131eef GSM: use define for RESET and power ON pin
pennamafb706d edge_control: enable cellular connectivity
facchinmd7ae070 edge_control: reduce rtos.main-thread-stack-size to 4K
pennamdc22e05 edge_control: TLS enable SHA1
pennamf0e429a GSM: edge_control add pins definitions
pennama4d9a38 MbedSSLClient: load certificates from filesystem only if supported
pennam74d0c52 Add Gemalto Cinterion mbed-os patches
pennam149883b CI: remove GSM library from target GIGA
pennamFile filter
Filter by extension
Conversations
Failed to load comments.
Loading
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Jump to file
Failed to load files.
Loading
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
There are no files selected for viewing
1 change: 0 additions & 1 deletion.github/workflows/compile-examples.yml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
66 changes: 66 additions & 0 deletionslibraries/GSM/examples/GSMSSLClient/GSMSSLClient.ino
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,66 @@ | ||
| /* | ||
| GSMSSLlient | ||
| This sketch connects to a website (https://ifconfig.me) | ||
| using the Portenta CAT.M1/NB IoT GNSS Shield and TLS. | ||
| */ | ||
| #include <GSM.h> | ||
| #include "arduino_secrets.h" | ||
| char pin[] = SECRET_PIN; | ||
| char apn[] = SECRET_APN; | ||
| char username[] = SECRET_USERNAME; | ||
| char pass[] = SECRET_PASSWORD; | ||
| const char server[] = "ifconfig.me"; | ||
| const char* ip_address; | ||
| int port = 443; | ||
| GSMSSLClient client; | ||
| void setup() { | ||
| Serial.begin(115200); | ||
| while(!Serial) {} | ||
| Serial.println("Starting Carrier Network registration"); | ||
| if(!GSM.begin(pin, apn, username, pass, CATM1, BAND_3 | BAND_20 | BAND_19)){ | ||
| Serial.println("The board was not able to register to the network..."); | ||
| // do nothing forevermore: | ||
| while(1); | ||
| } | ||
| Serial.println("\nStarting connection to server..."); | ||
| // if you get a connection, report back via serial: | ||
| if (client.connect(server, port)) { | ||
| Serial.println("connected to server"); | ||
| // Make a HTTP request: | ||
| client.println("GET /ip HTTP/1.1"); | ||
| client.print("Host: "); | ||
| client.println(server); | ||
| client.println("Connection: close"); | ||
| client.println(); | ||
| } else { | ||
| Serial.println("unable to connect to server"); | ||
| } | ||
| } | ||
| void loop() { | ||
| // if there are incoming bytes available | ||
| // from the server, read them and print them: | ||
| while (client.available()) { | ||
| char c = client.read(); | ||
| Serial.write(c); | ||
| } | ||
| // if the server's disconnected, stop the client: | ||
| if (!client.connected()) { | ||
| Serial.println(); | ||
| Serial.println("disconnecting from server."); | ||
| client.stop(); | ||
| // do nothing forevermore: | ||
| while (true); | ||
| } | ||
| } |
4 changes: 4 additions & 0 deletionslibraries/GSM/examples/GSMSSLClient/arduino_secrets.h
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| #define SECRET_PIN "" | ||
| #define SECRET_APN "" | ||
| #define SECRET_USERNAME "" | ||
| #define SECRET_PASSWORD "" |
98 changes: 40 additions & 58 deletionslibraries/GSM/src/GSM.cpp
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
36 changes: 30 additions & 6 deletionslibraries/GSM/src/GSM.h
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
24 changes: 24 additions & 0 deletionslibraries/GSM/src/GSMClient.cpp
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| /* | ||
| GSMClient.cpp | ||
| Copyright (c) 2023 Arduino SA. All right reserved. | ||
| This library is free software; you can redistribute it and/or | ||
| modify it under the terms of the GNU Lesser General Public | ||
| License as published by the Free Software Foundation; either | ||
| version 2.1 of the License, or (at your option) any later version. | ||
| This library is distributed in the hope that it will be useful, | ||
| but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
| Lesser General Public License for more details. | ||
| You should have received a copy of the GNU Lesser General Public | ||
| License along with this library; if not, write to the Free Software | ||
| Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | ||
| */ | ||
| #include "GSMClient.h" | ||
| arduino::GSMClient::GSMClient(): MbedClient(100) { | ||
| } |
4 changes: 4 additions & 0 deletionslibraries/GSM/src/GSMClient.h
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
24 changes: 24 additions & 0 deletionslibraries/GSM/src/GSMSSLClient.cpp
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| /* | ||
| GSMSSLClient.cpp | ||
| Copyright (c) 2023 Arduino SA. All right reserved. | ||
| This library is free software; you can redistribute it and/or | ||
| modify it under the terms of the GNU Lesser General Public | ||
| License as published by the Free Software Foundation; either | ||
| version 2.1 of the License, or (at your option) any later version. | ||
| This library is distributed in the hope that it will be useful, | ||
| but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
| Lesser General Public License for more details. | ||
| You should have received a copy of the GNU Lesser General Public | ||
| License along with this library; if not, write to the Free Software | ||
| Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | ||
| */ | ||
| #include "GSMSSLClient.h" | ||
| arduino::GSMSSLClient::GSMSSLClient(): MbedSSLClient(100) { | ||
| } |
Oops, something went wrong.
Uh oh!
There was an error while loading.Please reload this page.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.