jd-update
Flavien Haas 6 years ago
parent a8f8fb0c55
commit 78db623259

@ -2,11 +2,11 @@
#include <Ethernet.h> #include <Ethernet.h>
#include <SD.h> #include <SD.h>
#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, 0xFE, 0xED }; byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFF, 0xFD };
IPAddress ip(10, 0, 0, 20); // IP address, may need to change depending on network IPAddress ip(10, 0, 0, 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;
@ -50,7 +50,7 @@ void loop()
client.println("Connection: close"); client.println("Connection: close");
client.println(); client.println();
// send web page // send web page
webFile = SD.open("index.html"); // open web page file webFile = SD.open("index.htm"); // open web page file
if (webFile) { if (webFile) {
while(webFile.available()) { while(webFile.available()) {
client.write(webFile.read()); // send web page to client client.write(webFile.read()); // send web page to client

@ -8,7 +8,6 @@
#include <CModemLoRa.h> // to use personalised LoRa class #include <CModemLoRa.h> // to use personalised LoRa class
#include <CProtocol12Bytes.h> // to use our protocol #include <CProtocol12Bytes.h> // to use our protocol
#define LENMAX 80 // maximum size for the LoRa frame #define LENMAX 80 // maximum size for the LoRa frame
#define Serial SerialUSB // serial out on the M0 use a different function #define Serial SerialUSB // serial out on the M0 use a different function
@ -19,9 +18,9 @@ File webFile; // variable for the
// void setSPIFrequency(uint32_t frequency); // set the SPI at 8MHz to use logic analyser // void setSPIFrequency(uint32_t frequency); // set the SPI at 8MHz to use logic analyser
byte mac[] = {0xDE, 0xAD, 0xBE, 0xEF, 0xFF, 0xED}; // set the mac address byte mac[] = {0xDE, 0xAD, 0xBE, 0xEF, 0xFF, 0xFD}; // 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(192, 1, 1, 150); // set the IP address for the ethernet shield, overwise the librairy use DHCP
EthernetServer server(80); // initialize the EthernetServer library, using port 80 (default fot HTTP) EthernetServer server(80); // initialize the EthernetServer library, using port 80 (default fot HTTP)

Loading…
Cancel
Save