You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

36 lines
718 B

8 years ago
  1. /**************************************************************
  2. *
  3. * To run this tool, you need to install StreamDebugger library:
  4. * https://github.com/vshymanskyy/StreamDebugger
  5. *
  6. **************************************************************/
  7. #include <TinyGsmClient.h>
  8. #include <StreamDebugger.h>
  9. char apn[] = "YourAPN";
  10. char user[] = "";
  11. char pass[] = "";
  12. StreamDebugger GsmSerial(Serial1, Serial);
  13. GsmClient gsm(GsmSerial);
  14. void setup() {
  15. // Set console baud rate
  16. Serial.begin(115200);
  17. delay(10);
  18. // Set GSM module baud rate
  19. GsmSerial.begin(115200);
  20. delay(3000);
  21. gsm.networkConnect(apn, user, pass);
  22. // Access AT commands from Serial
  23. GsmSerial.directAccess();
  24. }
  25. void loop() {
  26. }