Browse Source

Update examples

v_master
Volodymyr Shymanskyy 8 years ago
parent
commit
87298eacce
5 changed files with 22 additions and 8 deletions
  1. +4
    -1
      examples/BlynkClient/BlynkClient.ino
  2. +5
    -2
      examples/FileDownload/FileDownload.ino
  3. +4
    -1
      examples/MqttClient/MqttClient.ino
  4. +5
    -2
      examples/WebClient/WebClient.ino
  5. +4
    -2
      tools/SimpleTest/SimpleTest.ino

+ 4
- 1
examples/BlynkClient/BlynkClient.ino View File

@ -62,9 +62,12 @@ void setup()
delay(3000); delay(3000);
// Restart takes quite some time // Restart takes quite some time
// You can skip it in many cases
// To skip it, call init() instead of restart()
modem.restart(); modem.restart();
// Unlock your SIM card with a PIN
//modem.simUnlock("1234");
Blynk.begin(auth, modem, apn, user, pass); Blynk.begin(auth, modem, apn, user, pass);
} }


+ 5
- 2
examples/FileDownload/FileDownload.ino View File

@ -43,8 +43,11 @@ void setup() {
delay(3000); delay(3000);
// Restart takes quite some time // Restart takes quite some time
// You can skip it in many cases
// To skip it, call init() instead of restart()
modem.restart(); modem.restart();
// Unlock your SIM card with a PIN
//modem.simUnlock("1234");
} }
void printPercent(uint32_t readLength, uint32_t contentLength) { void printPercent(uint32_t readLength, uint32_t contentLength) {
@ -81,7 +84,7 @@ void loop() {
// if you get a connection, report back via serial: // if you get a connection, report back via serial:
if (!client.connect(server, 80)) { if (!client.connect(server, 80)) {
Serial.println(" failed");
Serial.println(" fail");
delay(10000); delay(10000);
return; return;
} }


+ 4
- 1
examples/MqttClient/MqttClient.ino View File

@ -68,9 +68,12 @@ void setup() {
delay(3000); delay(3000);
// Restart takes quite some time // Restart takes quite some time
// You can skip it in many cases
// To skip it, call init() instead of restart()
modem.restart(); modem.restart();
// Unlock your SIM card with a PIN
//modem.simUnlock("1234");
Serial.print("Waiting for network..."); Serial.print("Waiting for network...");
if (!modem.waitForNetwork()) { if (!modem.waitForNetwork()) {
Serial.println(" fail"); Serial.println(" fail");


+ 5
- 2
examples/WebClient/WebClient.ino View File

@ -39,8 +39,11 @@ void setup() {
delay(3000); delay(3000);
// Restart takes quite some time // Restart takes quite some time
// You can skip it in many cases
// To skip it, call init() instead of restart()
modem.restart(); modem.restart();
// Unlock your SIM card with a PIN
//modem.simUnlock("1234");
} }
void loop() { void loop() {
@ -64,7 +67,7 @@ void loop() {
Serial.print("Connecting to "); Serial.print("Connecting to ");
Serial.print(server); Serial.print(server);
if (!client.connect(server, 80)) { if (!client.connect(server, 80)) {
Serial.println(" failed");
Serial.println(" fail");
delay(10000); delay(10000);
return; return;
} }


+ 4
- 2
tools/SimpleTest/SimpleTest.ino View File

@ -47,10 +47,12 @@ void setup() {
delay(3000); delay(3000);
// Restart takes quite some time // Restart takes quite some time
// You can skip it in many cases
SerialMon.println("Restarting modem...");
// To skip it, call init() instead of restart()
modem.restart(); modem.restart();
// Unlock your SIM card with a PIN
//modem.simUnlock("1234");
SerialMon.println("Waiting for network... "); SerialMon.println("Waiting for network... ");
if (modem.waitForNetwork()) { if (modem.waitForNetwork()) {
SerialMon.println("OK"); SerialMon.println("OK");


Loading…
Cancel
Save