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
Copy file name to clipboardExpand all lines: docs/readme.md
+18-18
Original file line number
Diff line number
Diff line change
@@ -1,30 +1,30 @@
1
-
# Arduino Cellular Library
1
+
# 📡 Arduino Cellular Library
2
2
3
-
4
-
## Initialising
3
+
## ⤵️ Initialising
5
4
This guide outlines the steps to establish cellular network connectivity using an Arduino equipped with a cellular modem. The process involves initializing the modem, setting necessary configurations, and establishing a connection to the network.
6
5
7
6
First, you need to include the ArduinoCellular library in your sketch. This library facilitates communication between your Arduino board and the cellular module.
8
7
9
-
```c
8
+
```cpp
10
9
#include<ArduinoCellular.h>
11
10
```
12
11
13
12
Create an instance of the ArduinoCellular class. This instance will be used to interact with the cellular module.
14
13
15
-
```c
14
+
```cpp
16
15
ArduinoCellular cellular = ArduinoCellular();
17
16
```
18
17
19
18
To begin, initialize the modem with basic configurations such as setting the modem to text mode, enabling intrrerupts etc. This is done by calling the begin() method on your cellular instance.
20
-
```c
19
+
```cpp
21
20
cellular.begin();
22
21
```
23
22
24
-
To connect to your mobile network and start a cellular data session, use the connect() method. This requires the APN (Access Point Name), login credentials (if any), and your SIM card's PIN number (if it's locked).
23
+
To connect to your mobile network and start a cellular data session, use the connect() method. This requires the APN (Access Point Name) and login credentials (if any). You can unlock your SIM card's using its PIN number (if it's locked).
@@ -33,7 +33,7 @@ Note: It's a best practice to store sensitive information like the GPRS APN, log
33
33
**arduino_secrets.h**
34
34
Create or edit the arduino_secrets.h file in your project directory and define the necessary secrets as follows:
35
35
36
-
```c
36
+
```cpp
37
37
#defineSECRET_GPRS_APN "your_apn_here"
38
38
#defineSECRET_GPRS_LOGIN "your_login_here"
39
39
#defineSECRET_GPRS_PASSWORD "your_password_here"
@@ -43,7 +43,7 @@ Create or edit the arduino_secrets.h file in your project directory and define t
43
43
Replace the placeholder values with the actual APN, login, password, and PIN number provided by your mobile network operator or SIM card provider.
44
44
45
45
46
-
## Network
46
+
## 🌐 Network
47
47
The Arduino environment provides a set of classes designed to abstract the complexities of handling network communications. Among these, the Client class plays a crucial role as it defines a standard interface for network communication across various Arduino-compatible networking libraries.
48
48
49
49
The Arduino networking stack is designed to simplify the process of implementing network communication for IoT (Internet of Things) projects. This stack encompasses both hardware (e.g., Ethernet shields, WiFi modules) and software components (libraries that interface with the hardware). The stack is built in a way that allows sketches (Arduino programs) to communicate over the network using common protocols like TCP and UDP without needing to delve into the low-level mechanics of these protocols.
@@ -63,13 +63,13 @@ This layered approach is not only modular but also highly flexible, allowing dev
63
63
64
64
### Network Client (OSI Layer 3)
65
65
Represents a basic client for network communication, suitable for protocols like TCP/IP.
@@ -78,28 +78,28 @@ For convenience we added getters for http and https clients.
78
78
### HTTP and HTTPS Clients:
79
79
These are high-level clients designed for web communication. They abstract the complexities of HTTP/HTTPS protocols, making it easy to send web requests and process responses.
The SMS functionality allows devices to exchange information with users or other systems through simple text messages, enabling a wide range of applications from remote monitoring to control systems or a fallback communication method when the others are not available.
90
90
91
91
### Reading SMS Messages
92
92
**getReadSMS():** This method returns a vector containing SMS messages that have already been read. It's particularly useful for applications that need to process or display messages that have been acknowledged.
93
93
94
-
**getUnreadSMS():**This method fetches a vector of unread SMS messages, allowing the application to process or notify users about new messages.
94
+
**getUnreadSMS():**This method fetches a vector of unread SMS messages, allowing the application to process or notify users about new messages.
95
95
96
96
Each SMS message is represented as an instance of the `SMS` class, which contains the sender's number, the message text, and a timestamp marking when the message was received.
97
97
98
98
99
99
### The SMS Class
100
100
The SMS class serves as a container for information related to a single SMS message. It includes the following attributes:
101
101
102
-
*`number`: The phone number from which the SMS was sent.
102
+
*`sender`: The phone number from which the SMS was sent.
103
103
*`message`: The body of the SMS message.
104
104
*`timestamp`: A timestamp indicating when the message was received by the module.
105
105
@@ -115,7 +115,7 @@ The method sendSMS() is designed for this purpose, taking two parameters:
115
115
116
116
This functionality allows Arduino devices to communicate outwardly to users or other systems, sending alerts, data, or control commands via SMS.
117
117
118
-
## Time and Location
118
+
## ⌚️📍 Time and Location
119
119
These features enable precise tracking of device locations and ensure synchronized operations across different systems. This guide focuses on utilizing GPS and cellular network capabilities for location tracking and time synchronization. It's important to note that GPS functionality is exclusively available in the Global Version of the modem, highlighting the need for appropriate hardware selection based on the project requirements.
0 commit comments