Код: Выбрать все
// M590 GSM
/*****************************************************************************
*
* Автор: Обушенков Алексей Андреевич
* Группа в ВК https://vk.com/engineer24
* Канал на YouTube https://www.youtube.com/channel/UCih0Gcl9IEdkR8deDJCiodg
* Инженерка Engineering room
*
*****************************************************************************
* Скетч собран по материалам сайта http://docs.blynk.cc/
*
* Библиотеки в составе проекта:
* https://github.com/blynkkk/blynk-library/releases/latest
* http://tiny.cc/tiny-gsm-readme
*****************************************************************************
*
* Модули в составе проекта:
*
* Arduino NANO CH340 USB драйвер (БЕЗ КАБЕЛЯ)(1,83 $) https://goo.gl/yQS7aa
* Блок питания из видео (3,52 $) https://goo.gl/3A8Jno
* M590E GSM (1,35 $) https://goo.gl/eLE5rG
*
* Еще разные виды M590:
*
* Еще вариант M590 (1,55 $) https://goo.gl/X49bjQ
* Маленький модуль M590 (3,01 $) https://goo.gl/k2yx2P
* Маленький в собранном виде GSM модуль M590 (6,87 $) https://goo.gl/7Uzab2
*/
/* Закоментируйте если нужно больше места */
#define BLYNK_PRINT Serial
// Select your modem:
//#define TINY_GSM_MODEM_SIM800
//#define TINY_GSM_MODEM_SIM900
#define TINY_GSM_MODEM_M590
//#define TINY_GSM_MODEM_A6
// Default heartbeat interval for GSM is 60
// If you want override this value, uncomment and set this option:
#define BLYNK_HEARTBEAT 30
#include <TinyGsmClient.h>
#include <BlynkSimpleSIM800.h>
// You should get Auth Token in the Blynk App.
// Go to the Project Settings (nut icon).
char auth[] = "e0e61c0ed4b44a81b9ed1aa767959092";
// Your GPRS credentials
// Leave empty, if missing user or pass
char apn[] = "";
char user[] = "";
char pass[] = "";
// Hardware Serial on Mega, Leonardo, Micro
//#define SerialAT Serial1
// or Software Serial on Uno, Nano
#include <SoftwareSerial.h>
SoftwareSerial SerialAT(2, 3); // RX, TX
TinyGsm modem(SerialAT);
void setup()
{
// Debug console
Serial.begin(9600);
delay(10);
// Set GSM module baud rate
SerialAT.begin(9600);
delay(3000);
// Restart takes quite some time
// To skip it, call init() instead of restart()
Serial.println("Initializing modem...");
modem.restart();
// Unlock your SIM card with a PIN
//modem.simUnlock("1234");
Blynk.begin(auth, modem, apn, user, pass);
}
void loop()
{
Blynk.run();
}