All Projects → carrascoacd → Arduinosim800l

carrascoacd / Arduinosim800l

Arduino HTTP & FTP client for SIM800L/SIM800 boards to perform GET and POST requests to a JSON API as well as FTP uploads.

Projects that are alternatives of or similar to Arduinosim800l

Winscp
WinSCP is a popular free SFTP and FTP client for Windows, a powerful file manager that will improve your productivity. It supports also Amazon S3, FTPS, SCP and WebDAV protocols. Power users can automate WinSCP using .NET assembly.
Stars: ✭ 794 (+525.2%)
Mutual labels:  ftp, ftp-client
Json Api Dart
JSON:API client for Dart/Flutter
Stars: ✭ 53 (-58.27%)
Mutual labels:  json-api, http-client
Ftps
Implementation of the FTPS protocol for Golang.
Stars: ✭ 24 (-81.1%)
Mutual labels:  ftp, ftp-client
Adafruit sensor
Common sensor library
Stars: ✭ 757 (+496.06%)
Mutual labels:  arduino, library
Easyddns
Easy to Use ESP8266 DDNS Update Client Library.
Stars: ✭ 96 (-24.41%)
Mutual labels:  arduino, library
Jsftp
Light and complete FTP client implementation for Node.js
Stars: ✭ 766 (+503.15%)
Mutual labels:  ftp, ftp-client
Easygo
基于Kotlin、OkHttp的声明式网络框架,像写HTML界面一样写网络调用代码
Stars: ✭ 40 (-68.5%)
Mutual labels:  library, http-client
Curl
A command line tool and library for transferring data with URL syntax, supporting DICT, FILE, FTP, FTPS, GOPHER, GOPHERS, HTTP, HTTPS, IMAP, IMAPS, LDAP, LDAPS, MQTT, POP3, POP3S, RTMP, RTMPS, RTSP, SCP, SFTP, SMB, SMBS, SMTP, SMTPS, TELNET and TFTP. libcurl offers a myriad of powerful features
Stars: ✭ 22,875 (+17911.81%)
Mutual labels:  library, ftp
Arduinoxinput
XInput library for USB capable Arduino boards
Stars: ✭ 126 (-0.79%)
Mutual labels:  arduino, library
Shiftregister74hc595
Arduino library that simplifies the usage of shift registers
Stars: ✭ 82 (-35.43%)
Mutual labels:  arduino, library
Taskscheduler
Cooperative multitasking for Arduino, ESPx and STM32 microcontrollers
Stars: ✭ 613 (+382.68%)
Mutual labels:  arduino, library
Aioftp
ftp client/server for asyncio (http://aioftp.readthedocs.org)
Stars: ✭ 116 (-8.66%)
Mutual labels:  ftp, ftp-client
Esp Dash
A blazing fast library to create a functional dashboard for ESP8266 and ESP32
Stars: ✭ 548 (+331.5%)
Mutual labels:  arduino, library
Ftp
FTP client package for Go
Stars: ✭ 785 (+518.11%)
Mutual labels:  ftp, ftp-client
Filestash
🦄 A modern web client for SFTP, S3, FTP, WebDAV, Git, Minio, LDAP, CalDAV, CardDAV, Mysql, Backblaze, ...
Stars: ✭ 5,231 (+4018.9%)
Mutual labels:  ftp, ftp-client
Drivebackupv2
Uploads Minecraft backups to Google Drive/OneDrive or by (S)FTP
Stars: ✭ 26 (-79.53%)
Mutual labels:  ftp, ftp-client
Openiothub
💖A free IoT (Internet of Things) platform and private cloud. [一个免费的物联网和私有云平台,支持内网穿透]
Stars: ✭ 371 (+192.13%)
Mutual labels:  arduino, ftp
Node Libcurl
libcurl bindings for Node.js
Stars: ✭ 447 (+251.97%)
Mutual labels:  http-client, ftp
Dmxusb
DMXUSB emulates an ENTTEC-compatible DMXKing USB to DMX serial device with one, two, or n universes.
Stars: ✭ 66 (-48.03%)
Mutual labels:  arduino, library
Rust Ftp
FTP client for Rust
Stars: ✭ 110 (-13.39%)
Mutual labels:  ftp, ftp-client

Donate

Arduino SIM800L library

A smart HTTP & FTP library based on Seeeduino that implements the AT HTTP commands to perform GET and POST requests to a JSON API as well as FTP uploads.

Support

  • Your board has to support the standard SoftwareSerial library. It doesn't work with HardwareSerial based boards for the moment.
  • The API response format has to be a valid JSON.
  • The library has been tested against Arduino Uno and Arduino Nano.

Instalation

Download the ZIP library and then import it: Sketch -> Include Library -> Add .ZIP Library ...

Quick start!

How to do a GET request! 👍

unsigned int RX_PIN = 7;
unsigned int TX_PIN = 8;
unsigned int RST_PIN = 12;

const char BEARER[] PROGMEM = "gprs-service.com";

HTTP http(9600, RX_PIN, TX_PIN, RST_PIN);
http.connect(BEARER);

char response[256];
Result result = http.get("your.api.com", response);

Serial.println(response);

http.disconnect();

How to do a POST request! 👍

unsigned int RX_PIN = 7;
unsigned int TX_PIN = 8;
unsigned int RST_PIN = 12;
const char BEARER[] PROGMEM = "gprs-service.com";

HTTP http(9600, RX_PIN, TX_PIN, RST_PIN);
http.connect(BEARER);

char response[256];
Result result = http.post("your.api.com", "{\"date\":\"12345678\"}", response);

Serial.println(response);

http.disconnect();

How to do a FTP upload! 👍

unsigned int RX_PIN = 7;
unsigned int TX_PIN = 8;
unsigned int RST_PIN = 12;
const char BEARER[] PROGMEM = "gprs-service.com";
const char FTP_SERVER[] PROGMEM = "ftp.server";
const char FTP_USER[] PROGMEM = "user";
const char FTP_PASS[] PROGMEM = "pass";

FTP ftp(9600, RX_PIN, TX_PIN, RST_PIN);
ftp.putBegin(BEARER, "example.txt", FTP_SERVER, FTP_USER, FTP_PASS);
ftp.putWrite("hello!", sizeof("hello!"));
ftp.putEnd();

I suggest the ArduinoJSON library for parsing the JSON response, then you can play with the values easily.

HTTP. How it works?

In order to perform a request, the library follows these steps:

Configure Bearer:
  • AT+CREG? -> try until 0,1 (connected to the network)
  • AT+SAPBR=3,1,"Contype","GPRS" -> wait for OK
  • AT+SAPBR=3,1,"APN","movistar.es" -> wait for OK
  • AT+SAPBR=1,1 -> wait for OK
HTTP GET:
  • AT+HTTPINIT -> wait for OK
  • AT+HTTPPARA="CID",1 -> wait for OK
  • AT+HTTPPARA="URL","your.api.com"-> wait for OK
  • AT+HTTPSSL=0 -> wait for OK (1 when URL starts with "https://")
  • AT+HTTPACTION=0 -> wait for 200
  • AT+HTTPREAD -> read buffer and parse it
  • AT+HTTPTERM -> wait for OK
  • AT+SAPBR=0,1
HTTP POST:
  • AT+HTTPINIT -> wait for OK
  • AT+HTTPPARA="CID",1 -> wait for OK
  • AT+HTTPPARA="URL","your.api.com" -> wait for OK

For example, if we have this body: {"location_id": 238, "fill_percent": 90}

  • AT+HTTPPARA="CONTENT","application/json"
  • AT+HTTPDATA=strlen(body),10000 -> wait for DOWNLOAD, then write the body and wait 10000
  • AT+HTTPSSL=0 -> wait for OK (1 when URL starts with "https://")
  • AT+HTTPACTION=1 -> wait for ,200,
  • AT+HTTPREAD -> read buffer and parse it
  • AT+HTTPTERM -> wait for OK
  • AT+SAPBR=0,1

Future improvements

  • Support of HardwareSerial.
  • Support of more content types, not only JSON (application/json).

Development

  • Lint: cppcheck --enable=all .
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].