From b690b3eac94fdd487799ac3c98ef5a810b01937b Mon Sep 17 00:00:00 2001 From: Khoi Hoang <57012152+khoih-prog@users.noreply.github.com> Date: Sun, 19 Apr 2020 15:23:06 -0400 Subject: [PATCH] Fix messed-up README.md --- README.md | 176 +++++++++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 153 insertions(+), 23 deletions(-) diff --git a/README.md b/README.md index 9d97308..c2c1655 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,6 @@ ## BlynkGSM_Manager [![arduino-library-badge](https://www.ardu-badge.com/badge/BlynkGSM_Manager.svg?)](https://www.ardu-badge.com/BlynkGSM_Manager) -[![GitHub release](https://img.shields.io/github/release/khoih-prog/BlynkGSM_Manager.svg)](https://github.com/khoih-prog/BlynkGSM_Manager/releases) -[![GitHub](https://img.shields.io/github/license/mashape/apistatus.svg)](https://github.com/khoih-prog/BlynkGSM_Manager/blob/master/LICENSE) -[![contributions welcome](https://img.shields.io/badge/contributions-welcome-brightgreen.svg?style=flat)](#Contributing) -[![GitHub issues](https://img.shields.io/github/issues/khoih-prog/BlynkGSM_Manager.svg)](http://github.com/khoih-prog/BlynkGSM_Manager/issues) ### Releases v1.0.8 @@ -184,8 +180,131 @@ MenuItem myMenuItems [] = {}; uint16_t NUM_MENU_ITEMS = 0; #endif +/////// // End dynamic Credentials /////////// +``` + +Also see examples: +1. [TTGO_TCALL_GSM](examples/TTGO_TCALL_GSM) +2. [ESP32_GSM](examples/ESP32_GSM) +3. [ESP8266_GSM](examples/ESP8266_GSM) + + +## So, how it works? + +If it detects no valid stored Credentials or it cannot connect to the Blynk server in 30 seconds, it will switch to ***Configuration Mode***. You will see your built-in LED turned ON. In `Configuration Mode`, it starts a WiFi access point called ***ESP_xxxxxx***. Connect to it using password ***MyESP_xxxxxx***. + +You can set: + +1. static Config Portal IP address by using `Blynk_WF.setConfigPortalIP(IPAddress(xxx, xxx, xxx, xxx))` +2. random Config Portal WiFi channel by using `Blynk_WF.setConfigPortalChannel(0)` +3. selected Config Portal WiFi channel by using `Blynk_WF.setConfigPortalChannel(channel)` + +
+ +
+ +After you connected, go to http://192.168.4.1., the Browser will display the following page: + ++ +
+ +Enter your credentials (WiFi SSID/Password/WiFi-Token, GPRS APN/User/Pass/PIN, Blynk Server/Port/GSM-Token). + ++ +
-/////// // End dynamic Credentials ///////////#define USE_DYNAMIC_PARAMETERS true +Then click ***Save***. After the board auto-restarted, you will see if it's connected to your Blynk server successfully. + + +This `Blynk.begin()` is not a blocking call, so you can use it for critical functions requiring in loop(). +Anyway, this is better for projects using Blynk just for GUI (graphical user interface). + +In operation, if GSM/GPRS or Blynk connection is lost, `Blynk_WF.run()` or `Blynk_GSM.run()` will try reconnecting automatically. Therefore, `Blynk_WF.run()` `Blynk_GSM.run()` and must be called in the `loop()` function. Don't use: + +```cpp +void loop() +{ + if (Blynk.connected()) + Blynk_WF.run(); + + ... +} +``` +just + +```cpp +void loop() +{ + Blynk_WF.run(); + ... +} +``` + +## Example [TTGO_TCALL_GSM](examples/TTGO_TCALL_GSM) +Please take a look at other examples, as well. + +``` +#ifndef ESP32 +#error This code is intended to run on the ESP32 platform! Please check your Tools->Board setting. +#endif + +#define BLYNK_PRINT Serial +#define BLYNK_HEARTBEAT 60 + +// TTGO T-Call pin definitions +#define MODEM_RST 5 // Pin D5 mapped to pin GPIO5/SPISS/VSPI_SS of ESP32 +#define MODEM_PWKEY 4 // Pin D4 mapped to pin GPIO4/ADC10/TOUCH0 of ESP32 +#define MODEM_POWER_ON 23 // Pin D23 mapped to pin GPIO23/VSPI_MOSI of ESP32 +#define MODEM_TX 27 // Pin D27 mapped to pin GPIO27/ADC17/TOUCH7 of ESP32 +#define MODEM_RX 26 // Pin D26 mapped to pin GPIO26/ADC19/DAC2 of ESP32 +#define I2C_SDA 21 // Pin D21 mapped to pin GPIO21/SDA of ESP32 +#define I2C_SCL 22 // Pin D22 mapped to pin GPIO22/SCL of ESP32 + +// Select your modem: +#define TINY_GSM_MODEM_SIM800 +//#define TINY_GSM_MODEM_SIM808 +//#define TINY_GSM_MODEM_SIM868 +//#define TINY_GSM_MODEM_SIM900 +//#define TINY_GSM_MODEM_SIM5300 +//#define TINY_GSM_MODEM_SIM5320 +//#define TINY_GSM_MODEM_SIM5360 +//#define TINY_GSM_MODEM_SIM7000 +//#define TINY_GSM_MODEM_SIM7100 +//#define TINY_GSM_MODEM_SIM7500 +//#define TINY_GSM_MODEM_SIM7600 +//#define TINY_GSM_MODEM_SIM7800 +//#define TINY_GSM_MODEM_UBLOX +//#define TINY_GSM_MODEM_SARAR4 +//#define TINY_GSM_MODEM_M95 +//#define TINY_GSM_MODEM_BG96 +//#define TINY_GSM_MODEM_A6 +//#define TINY_GSM_MODEM_A7 +//#define TINY_GSM_MODEM_M590 +//#define TINY_GSM_MODEM_MC60 +//#define TINY_GSM_MODEM_MC60E +//#define TINY_GSM_MODEM_XBEE +//#define TINY_GSM_MODEM_SEQUANS_MONARCH + +// Increase RX buffer if needed +#define TINY_GSM_RX_BUFFER 1024 + +//#define USE_BLYNK_WM false +#define USE_BLYNK_WM true + +#define USE_SPIFFS false +//#define USE_SPIFFS true + +#define EEPROM_SIZE 2048 +#define EEPROM_START 256 + +#include