Giter Site home page Giter Site logo

loragateway's Introduction

passerelleLoRa

Projet BTS SNIR 2ème année Gateway between a weather MicroStation using LoRa modulation and a web server. This depo is segmented in different programs for arduino using ATMEGA328P and SAMD21.

Attention !

Because we're using two arduino shields using SPI communication, we need to select a chip select for each shield. I decided to use D11 for the Ethernet shield (10 for the LoRa, 4 for the SD).

To do this, edit w5100.h in the default ethernet librairy in the installation folder of your arduino IDE (on windows, in administrator mode ‪C:\Program Files (x86)\Arduino\libraries\Ethernet\src\utility\w5100.h)

On this case, you need to change this line #define ETHERNET_SHIELD_SPI_CS 10 to #define ETHERNET_SHIELD_SPI_CS 11

loragateway's People

Contributors

dakprofsnir avatar flavienhaas avatar jdmassard avatar

Watchers

 avatar  avatar  avatar

loragateway's Issues

request POST

c'est de la bonne ou pas ? le coup de mettre la requête dans un string est beau jeu

Serial.begin(115200);
while(!Serial){}
WiFiClient client;
const char* host="http://jsonplaceholder.typicode.com/";
String PostData = "title=foo&body=bar&userId=1";

if (client.connect(host, 80)) {

client.println("POST /posts HTTP/1.1");
client.println("Host: jsonplaceholder.typicode.com");
client.println("Cache-Control: no-cache");
client.println("Content-Type: application/x-www-form-urlencoded");
client.print("Content-Length: ");
client.println(PostData.length());
client.println();
client.println(PostData);

long interval = 2000;
unsigned long currentMillis = millis(), previousMillis = millis();

while(!client.available()){

  if( (currentMillis - previousMillis) > interval ){

    Serial.println("Timeout");
    blinkLed.detach();
    digitalWrite(2, LOW);
    client.stop();     
    return;
  }
  currentMillis = millis();
}

while (client.connected())
{
  if ( client.available() )
  {
    char str=client.read();
   Serial.println(str);
  }      
}

}

Volé sans honte ni remords d'ici

L'icône du weather.btslimayrac.ovh sur la page web de ton arduino

et hop
client.print("<link href="data:image/x-icon;base64,AAABAAEAEBAAAAEAIABoBAAAFgAAACgAAAAQAAAAIAAAAAEAIAAAAAAAAAQAABILAAASCwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA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AAAAAAAAAAAAAAAAAAAAAAGpP8AB+V+hMblP0NKJf4FiuU9TAnlPUoKZf1OyeY9RonmPYSLJv2CwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAI5b2ACSW9gkklvUTH5X2ASKW9h4ml/UGKJn1AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA//8AAP4/AAD+HwAAwAcAAIADAACAAwAAgAAAAIAAAACAAAAA4AAAAOAAAADwAAAA/gAAAP4AAAD/gwAA//8AAA==" rel="icon" type="image/x-icon" />");

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.