Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix HTML in web server example #9

Open
wants to merge 36 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
567c6fb
Add Leonardo define, simplify ifdefs
chrwei Nov 10, 2014
0507042
Add Leonardo support
chrwei Nov 10, 2014
b606f08
Add Leonardo comment, add proper wait loop
chrwei Nov 10, 2014
22d6f8c
Update wifiTest.ino
chrwei Nov 10, 2014
4b62609
Merge pull request #1 from chrwei/master
iteadsw Nov 13, 2014
7a62d98
make begin non-blocking when card is not present
chrwei Nov 14, 2014
64b3f42
make begin non-block when card is not present
chrwei Nov 14, 2014
9d49755
make begin non-blocking when card is not present
chrwei Nov 14, 2014
00d0639
make begin non-blocking when card is not present
chrwei Nov 14, 2014
bfeecd1
Update chatServer.ino
chrwei Nov 14, 2014
c77f67b
make begin non-blocking when card is not present
chrwei Nov 14, 2014
8f5e9f7
make begin non-blocking when card is not present
chrwei Nov 14, 2014
e8e1c41
make begin non-blocking when card is not present
chrwei Nov 14, 2014
9bc1252
Add Leonardo instructions
chrwei Nov 14, 2014
bcfbb62
Add Leonardo instructions
chrwei Nov 14, 2014
f84b3d3
Add Leonardo instructions
chrwei Nov 14, 2014
1becf4a
Add Leonardo instructions
chrwei Nov 14, 2014
c35a9f9
Add Leonardo instructions
chrwei Nov 14, 2014
43ea51d
Add Leonardo instructions
chrwei Nov 14, 2014
6ef573e
Added the Leonardo support message to README.
nuclearsubstation Nov 14, 2014
1e98a6e
Added socket server timeout feature support.
nuclearsubstation Nov 14, 2014
9daa3da
Merge pull request #5 from madprogrammi/master
Nov 17, 2014
83b12e3
Merge pull request #4 from chrwei/master
Nov 17, 2014
8fd2ee5
Merge pull request #2 from chrwei/being-non-block
Nov 17, 2014
fbb90f1
Merge pull request #1 from itead/master
chrwei Nov 17, 2014
ec31054
Update uartWIFI.h
chrwei Nov 17, 2014
9986db4
Update uartWIFI.h
chrwei Nov 17, 2014
5ae562e
Update uartWIFI.h
chrwei Nov 17, 2014
acc5503
Update uartWIFI.h
chrwei Nov 17, 2014
8afcf96
Update uartWIFI.cpp
chrwei Nov 17, 2014
dcdb509
Update uartWIFI.cpp
chrwei Nov 17, 2014
ca50b8e
Update uartWIFI.h
chrwei Nov 17, 2014
b7ad6c7
Merge pull request #6 from chrwei/debug-enhance
Nov 18, 2014
acbc795
Merge remote-tracking branch 'upstream/master'
chrwei Nov 18, 2014
5a4dc8d
Fix
chrwei Nov 18, 2014
cd8e1c6
Update webserver.ino
chrwei Dec 4, 2014
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,14 @@ When you use with UNO board, uncomment the follow line in uartWIFI.h.
When you use with MEGA board, uncomment the follow line in uartWIFI.h.

#define MEGA

When you use with LEONARDO board, uncomment the following line in uartWIFI.h:

#define LEO

When you use with Leonardo board, uncomment the follow line in uartWIFI.h.

#define LEO

## Connection: ##
When you use it with UNO board, the connection should be like these:
Expand Down Expand Up @@ -37,6 +45,18 @@ ESP8266_VCC->3.3V

ESP8266_GND->GND

When you use it with Leonardo board, the connection should be like these:

ESP8266_TX->RX1(D0)

ESP8266_RX->TX1(D1)

ESP8266_CH_PD->3.3V

ESP8266_VCC->3.3V

ESP8266_GND->GND

When you want to output the debug information, please use DebugSerial. For example,

DebugSerial.println("hello");
Expand Down
18 changes: 15 additions & 3 deletions examples/chatServer/chatServer.ino
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ When you use with UNO board, uncomment the follow line in uartWIFI.h.
When you use with MEGA board, uncomment the follow line in uartWIFI.h.
#define MEGA

When you use with Leonardo board, uncomment the follow line in uartWIFI.h.
#define LEO

Connection:
When you use it with UNO board, the connection should be like these:
ESP8266_TX->D0
Expand All @@ -25,6 +28,13 @@ ESP8266_CH_PD->3.3V
ESP8266_VCC->3.3V
ESP8266_GND->GND

When you use it with Leonardo board, the connection should be like these:
ESP8266_TX->RX1(D0)
ESP8266_RX->TX1(D1)
ESP8266_CH_PD->3.3V
ESP8266_VCC->3.3V
ESP8266_GND->GND

When you want to output the debug information, please use DebugSerial. For example,

DebugSerial.println("hello");
Expand Down Expand Up @@ -60,8 +70,10 @@ extern int chlID; //client id(0-4)

void setup()
{

wifi.begin();
if(!wifi.begin())
{
DebugSerial.println("Begin error");
}
bool b = wifi.Initialize(STA, SSID, PASSWORD);
if(!b)
{
Expand Down Expand Up @@ -102,4 +114,4 @@ void loop()
}

}
}
}
17 changes: 15 additions & 2 deletions examples/udpSendReceivingString/udpSendReceivingString.ino
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ When you use with UNO board, uncomment the follow line in uartWIFI.h.
When you use with MEGA board, uncomment the follow line in uartWIFI.h.
#define MEGA

When you use with Leonardo board, uncomment the follow line in uartWIFI.h.
#define LEO

Connection:
When you use it with UNO board, the connection should be like these:
ESP8266_TX->D0
Expand All @@ -25,6 +28,13 @@ ESP8266_CH_PD->3.3V
ESP8266_VCC->3.3V
ESP8266_GND->GND

When you use it with Leonardo board, the connection should be like these:
ESP8266_TX->RX1(D0)
ESP8266_RX->TX1(D1)
ESP8266_CH_PD->3.3V
ESP8266_VCC->3.3V
ESP8266_GND->GND

When you want to output the debug information, please use DebugSerial. For example,

DebugSerial.println("hello");
Expand Down Expand Up @@ -60,7 +70,10 @@ WIFI wifi;
void setup()
{

wifi.begin();
if(!wifi.begin())
{
DebugSerial.println("Begin error");
}
bool b = wifi.Initialize(STA, SSID, PASSWORD);
if(!b)
{
Expand Down Expand Up @@ -94,4 +107,4 @@ void loop()
digitalWrite(13, LOW);
}
}
}
}
17 changes: 15 additions & 2 deletions examples/webclientRepeating/webclientRepeating.ino
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ When you use with UNO board, uncomment the follow line in uartWIFI.h.
When you use with MEGA board, uncomment the follow line in uartWIFI.h.
#define MEGA

When you use with Leonardo board, uncomment the follow line in uartWIFI.h.
#define LEO

Connection:
When you use it with UNO board, the connection should be like these:
ESP8266_TX->D0
Expand All @@ -25,6 +28,13 @@ ESP8266_CH_PD->3.3V
ESP8266_VCC->3.3V
ESP8266_GND->GND

When you use it with Leonardo board, the connection should be like these:
ESP8266_TX->RX1(D0)
ESP8266_RX->TX1(D1)
ESP8266_CH_PD->3.3V
ESP8266_VCC->3.3V
ESP8266_GND->GND

When you want to output the debug information, please use DebugSerial. For example,

DebugSerial.println("hello");
Expand Down Expand Up @@ -67,7 +77,10 @@ const unsigned long postingInterval = 8*1000; // delay between updates, in mill
void setup()
{

wifi.begin();
if(!wifi.begin())
{
DebugSerial.println("Begin error");
}
bool b = wifi.Initialize(STA, SSID, PASSWORD);
if(!b)
{
Expand Down Expand Up @@ -120,4 +133,4 @@ void httpRequest() {
DebugSerial.println("disconnecting.");
wifi.closeMux();
}
}
}
19 changes: 16 additions & 3 deletions examples/webserver/webserver.ino
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ When you use with UNO board, uncomment the follow line in uartWIFI.h.
When you use with MEGA board, uncomment the follow line in uartWIFI.h.
#define MEGA

When you use with Leonardo board, uncomment the follow line in uartWIFI.h.
#define LEO

Connection:
When you use it with UNO board, the connection should be like these:
ESP8266_TX->D0
Expand All @@ -25,6 +28,13 @@ ESP8266_CH_PD->3.3V
ESP8266_VCC->3.3V
ESP8266_GND->GND

When you use it with Leonardo board, the connection should be like these:
ESP8266_TX->RX1(D0)
ESP8266_RX->TX1(D1)
ESP8266_CH_PD->3.3V
ESP8266_VCC->3.3V
ESP8266_GND->GND

When you want to output the debug information, please use DebugSerial. For example,

DebugSerial.println("hello");
Expand Down Expand Up @@ -61,7 +71,10 @@ extern int chlID;
void setup()
{

wifi.begin();
if(!wifi.begin())
{
DebugSerial.println("Begin error");
}
bool b = wifi.Initialize(STA, SSID, PASSWORD);
if(!b)
{
Expand Down Expand Up @@ -108,7 +121,7 @@ void loop()
cmd += "<br />\r\n";

}
cmd += "<html>\r\n";
cmd += "</html>\r\n";

wifi.Send(chlID,cmd);
delay(300);
Expand All @@ -117,4 +130,4 @@ void loop()


}
}
}
39 changes: 30 additions & 9 deletions examples/wifiTest/wifiTest.ino
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ When you use with UNO board, uncomment the follow line in uartWIFI.h.
When you use with MEGA board, uncomment the follow line in uartWIFI.h.
#define MEGA

When you use with Leonardo board, uncomment the follow line in uartWIFI.h.
#define LEO

Connection:
When you use it with UNO board, the connection should be like these:
ESP8266_TX->D0
Expand All @@ -25,6 +28,13 @@ ESP8266_CH_PD->3.3V
ESP8266_VCC->3.3V
ESP8266_GND->GND

When you use it with Leonardo board, the connection should be like these:
ESP8266_TX->RX1(D0)
ESP8266_RX->TX1(D1)
ESP8266_CH_PD->3.3V
ESP8266_VCC->3.3V
ESP8266_GND->GND

When you want to output the debug information, please use DebugSerial. For example,

DebugSerial.println("hello");
Expand Down Expand Up @@ -59,23 +69,34 @@ WIFI wifi;
void setup()
{

wifi.begin();
if(!wifi.begin())
{
DebugSerial.println("Begin error");
}
bool b = wifi.Initialize(STA, SSID, PASSWORD);
if(!b)
{
DebugSerial.println("Init error");
}
delay(8000); //make sure the module can have enough time to get an IP address
String ipstring = wifi.showIP();
DebugSerial.println("My IP address:");
DebugSerial.println(ipstring); //show the ip address of module

DebugSerial.print("Connecting...");

String wifistring = wifi.showJAP();
DebugSerial.println(wifistring); //show the name of current wifi access port

while(wifistring == "") {
delay(200);
wifistring = wifi.showJAP();
}

String ipstring = wifi.showIP();
while(ipstring == "") {
delay(200);
ipstring = wifi.showIP();
}

DebugSerial.println(wifistring); //show the name of current wifi access port, "AP" label is included here
DebugSerial.print("IP Address:"); DebugSerial.println(ipstring); //show the ip address of module
}
void loop()
{


}
}
Loading