Permalink
Browse files

Revert "RGBWebServer Chapter 5"

This reverts commit c1917f8.
  • Loading branch information...
tigoe committed Feb 5, 2016
1 parent 256bb59 commit 6937fd091df2147c1d476a2c9aba5adc11d758f2
@@ -91,3 +91,24 @@ void makeResponse(WiFiClient thisClient) {
// close the page:
thisClient.println("</body></html>\n");
}
void printWifiStatus() {
// print the SSID of the network you're attached to:
Serial.print("SSID: ");
Serial.println(WiFi.SSID());
// print your WiFi shield's IP address:
IPAddress ip = WiFi.localIP();
Serial.print("IP Address: ");
Serial.println(ip);
// print the received signal strength:
long rssi = WiFi.RSSI();
Serial.print("signal strength (RSSI):");
Serial.print(rssi);
Serial.println(" dBm");
// print where to go in a browser:
Serial.print("To see this page in action, open a browser to http://");
Serial.println(ip);
}
@@ -1,22 +1,3 @@
char ssid[] = "yourNetwork"; // your network SSID (name)
char pass[] = "password"; // your network password
void printWifiStatus() {
// print the SSID of the network you're attached to:
Serial.print("SSID: ");
Serial.println(WiFi.SSID());
// print your WiFi shield's IP address:
IPAddress ip = WiFi.localIP();
Serial.print("IP Address: ");
Serial.println(ip);
// print the received signal strength:
long rssi = WiFi.RSSI();
Serial.print("signal strength (RSSI):");
Serial.print(rssi);
Serial.println(" dBm");
// print where to go in a browser:
Serial.print("To see this page in action, open a browser to http://");
Serial.println(ip);
}
@@ -1,40 +1,37 @@
/*
Web Server
Context: Arduino
*/
*/
#include <SPI.h>
#include <WiFi101.h>
#include "config.h"
#include <Ethernet.h>
int status = WL_IDLE_STATUS;
WiFiServer server(80);
EthernetServer server(80);
byte mac[] = { 0x00, 0xAA, 0xBB, 0xCC, 0xDE, 0x01 };
IPAddress gateway(192,168,1,1);
IPAddress subnet(255,255,255,0);
IPAddress ip(192,168,1,20);
void setup()
{
// attempt to connect to Wifi network:
while ( status != WL_CONNECTED) {
Serial.print("Attempting to connect to Network named: ");
Serial.println(ssid); // print the network name (SSID);
// Connect to WPA/WPA2 network:
status = WiFi.begin(ssid, pass);
}
server.begin(); // start the web server on port 80
printWifiStatus(); // you're connected now, so print out the status
// start the Ethernet connection and the server:
Ethernet.begin(mac, ip, gateway, subnet);
server.begin();
Serial.begin(9600);
}
void loop()
{
// listen for incoming clients
WiFiClient client = server.available();
EthernetClient client = server.available();
if (client) {
while (client.connected()) {
if (client.available()) {
char thisChar = client.read();
Serial.write(thisChar);
}
}
}
// close the connection:
client.stop();

This file was deleted.

Oops, something went wrong.

0 comments on commit 6937fd0

Please sign in to comment.