added pritning messages for knonwing the state of the gateway on serial

This commit is contained in:
Flavien Haas 2018-05-26 15:21:10 +02:00
parent 78db623259
commit 9db7ae5493
2 changed files with 10 additions and 5 deletions

View File

@ -5,18 +5,22 @@
//#define Serial SerialUSB //#define Serial SerialUSB
// MAC address from Ethernet shield sticker under board // MAC address from Ethernet shield sticker under board
byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFF, 0xFD }; byte mac[] = { 0xFE, 0xFD, 0xBE, 0xEF, 0xFF, 0xFD };
IPAddress ip(10, 0, 0, 50); // IP address, may need to change depending on network IPAddress ip(192, 168, 1, 50); // IP address, may need to change depending on network
EthernetServer server(80); // create a server at port 80 EthernetServer server(80); // create a server at port 80
File webFile; File webFile;
void setup() void setup()
{ {
Ethernet.begin(mac); // initialize Ethernet device
server.begin(); // start to listen for clients
Serial.begin(9600); // for debugging Serial.begin(9600); // for debugging
Ethernet.begin(mac, ip); // initialize Ethernet device
Serial.println("hello");
server.begin(); // start to listen for clients
Serial.print("server is at "); // display on serial the IP you can find the webpage
Serial.println(Ethernet.localIP());
// initialize SD card // initialize SD card
Serial.println("Initializing SD card..."); Serial.println("Initializing SD card...");
if (!SD.begin(4)) { if (!SD.begin(4)) {

View File

@ -52,7 +52,7 @@ void loop() {
int packetSize = thisLoRa.parsePacket(); int packetSize = thisLoRa.parsePacket();
if (packetSize > 0) if (packetSize > 0)
{ {
SerialUSB.println("Nouveau paquet"); SerialUSB.println("Nouvelle trame reçue");
thisLoRa.read(&protocol); // objet thislora qui appele classe Lora.h et rempli la stucture de l'objet protocol, ser a allèger -5lignes thisLoRa.read(&protocol); // objet thislora qui appele classe Lora.h et rempli la stucture de l'objet protocol, ser a allèger -5lignes
@ -81,6 +81,7 @@ void loop() {
//postClient.println(postData.length()); //postClient.println(postData.length());
//postClient.println(postData); //postClient.println(postData);
} }
Serial.println("post envoye vers le serveur");
// WebServer // WebServer
EthernetClient serverGateway = server.available(); // try to get client EthernetClient serverGateway = server.available(); // try to get client