Conectando o arduino na nuvem

831 views
706 views

Published on

Apresentação exibida no The Developer's Conference 2013 na trilha Arduino. Desenvolvida por Fabio Costa Mângia, diretor de integração na Smartapps.

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
831
On SlideShare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
5
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Conectando o arduino na nuvem

  1. 1. Globalcode – Open4education Conectando o Arduino à Nuvem Fabio Costa Mângia Engenheiro Eletricista e Diretor de Integração da Smartapps
  2. 2. Globalcode – Open4education Computação em nuvem do inglês, Cloud Computing
  3. 3. Globalcode – Open4education API Smartapps Smartbox GETPOST PHP
  4. 4. Globalcode – Open4education Smartbox Arduino Mega2560 R3 Teclado de Membrana Matricial Display 4 linhas x 20 caracteres – HD44780 (Interface I2c) WiFi Shield Case feito em acrílico cortado a laser Solarbotics
  5. 5. Globalcode – Open4education
  6. 6. Globalcode – Open4education
  7. 7. Globalcode – Open4education
  8. 8. Globalcode – Open4education API Smartapps Funcionamento simples: Requisições HTTP – TCP GET => Recebe dados do servidor POST => Envia dados ao servidor Arduino trabalha como cliente! Requisitos para funcionamento: const char AuthID[] = "NDNiYTEW (...) VHdMYVFCaw”; (base64) const char UserID[] = "3775158088eba25dade2776955d4cb46";
  9. 9. Globalcode – Open4education GET Serial.println("connecting..."); client.println("GET /api/fp/to HTTP/1.1"); client.println("Host: smartapps_IP"); client.print("Authorization: Basic "); client.println(AuthID); client.println(); leitura_resposta(){ se resposta recebida salva sessao Serial.println(“Conectado!”); senao Serial.println(“ERRO!”); }
  10. 10. Globalcode – Open4education POST String PostData = "produto=PAO&quantidade=100" client.print("POST /api/fp/to/smartbox/"); client.print(UserID); client.println("/dados/ HTTP/1.1"); client.println("Host: 177.71.182.171"); client.print("Authorization: Basic "); client.println(AuthID); client.print("Cookie: PHPSESSID="); client.println(PHPSESSID); client.println("Content-Type: application/x-www-form-urlencoded"); client.print("Content-Length: "); client.println(PostData.length()); client.println("Connection: close"); client.println(); client.print(PostData); client.println();
  11. 11. Globalcode – Open4education Shield GSM Biblioteca API PCB e outros dispositivos
  12. 12. Globalcode – Open4education
  13. 13. Globalcode – Open4education Obrigado! arduino@smartapps.com.br fabio.costa@smartapps.com.br www.smartapps.com.br Fabio Costa Mângia
  14. 14. Globalcode – Open4education Agradecimentos Ao Professor Rodrigo Almeida Orientador TCC https://sites.google.com/site/rmaalmeida/

×