// to compile as on the diagrams, check that you have changed the SS port as indicated on the README
// before transfert, check that you have changed the SS port as indicated on the README or you will not be able to use the LoRa shield as the same time as the Ethernet shield
#include<SPI.h> // to communicate using spi (required for our shields)
#include<LoRa.h> // to use the LoRa shield
#include"Ethernet.h" // to use the ethernet shield
#include"util.h" // to have the display of the elapsed time
#define LENMAX 80 // maximum size for the LoRa frame
#define Serial SerialUSB // serial out on the M0 use a different function
@ -13,7 +12,7 @@
bytemac[]={0xDE,0xAD,0xBE,0xEF,0xFE,0xED};// set the mac address
//IPAddress ip(10, 0, 0, 49); //set the IP address for the ethernet shield, overwise the librairy use DHCP
//IPAddress ip(10, 0, 0, 49); //set the IP address for the ethernet shield, overwise the librairy use DHCP
EthernetServerserver(80);// initialize the EthernetServer library, using port 80 (default fot HTTP)
@ -28,61 +27,61 @@ void setup(){
//Ethernet.begin(mac, ip); // initialize Ethernet shield using the set mac adress and set IP
Ethernet.begin(mac);// initialize Ethernet shield uding the set mac and DHCP for the IP
server.begin();
Serial.print("server is at ");
server.begin();// initialize WebServer part of the librairy
Serial.print("server is at ");// display on serial the IP you can find the webpage
Serial.println(Ethernet.localIP());
}
voidSerialPrintElapsedTime(booleanespaceFinal=true){// to display the elapsed time