Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
arduino-pico
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
xpstem
arduino-pico
Commits
815e17b3
Unverified
Commit
815e17b3
authored
Aug 22, 2024
by
Earle F. Philhower, III
Committed by
GitHub
Aug 22, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add WiFiClient example for w6100 for CI (#2348)
parent
32f03111
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
123 additions
and
0 deletions
+123
-0
libraries/lwIP_w6100/examples/WiFiClient-W6100/WiFiClient-W6100.ino
...lwIP_w6100/examples/WiFiClient-W6100/WiFiClient-W6100.ino
+95
-0
libraries/lwIP_w6100/keywords.txt
libraries/lwIP_w6100/keywords.txt
+18
-0
libraries/lwIP_w6100/library.properties
libraries/lwIP_w6100/library.properties
+10
-0
No files found.
libraries/lwIP_w6100/examples/WiFiClient-W6100/WiFiClient-W6100.ino
0 → 100644
View file @
815e17b3
/*
This sketch establishes a TCP connection to a "quote of the day" service.
It sends a "hello" message, and then prints received data.
*/
#include <W6100lwIP.h>
const
char
*
host
=
"djxmmx.net"
;
const
uint16_t
port
=
17
;
Wiznet6100lwIP
eth
(
1
/* chip select */
);
void
setup
()
{
// Set up SPI pinout to match your HW
SPI
.
setRX
(
0
);
SPI
.
setCS
(
1
);
SPI
.
setSCK
(
2
);
SPI
.
setTX
(
3
);
Serial
.
begin
(
115200
);
delay
(
5000
);
Serial
.
println
();
Serial
.
println
();
Serial
.
println
(
"Starting Ethernet port"
);
// Start the Ethernet port
if
(
!
eth
.
begin
())
{
Serial
.
println
(
"No wired Ethernet hardware detected. Check pinouts, wiring."
);
while
(
1
)
{
delay
(
1000
);
}
}
while
(
!
eth
.
connected
())
{
Serial
.
print
(
"."
);
delay
(
500
);
}
Serial
.
println
(
""
);
Serial
.
println
(
"Ethernet connected"
);
Serial
.
println
(
"IP address: "
);
Serial
.
println
(
eth
.
localIP
());
}
void
loop
()
{
static
bool
wait
=
false
;
Serial
.
print
(
"connecting to "
);
Serial
.
print
(
host
);
Serial
.
print
(
':'
);
Serial
.
println
(
port
);
// Use WiFiClient class to create TCP connections
WiFiClient
client
;
if
(
!
client
.
connect
(
host
,
port
))
{
Serial
.
println
(
"connection failed"
);
delay
(
5000
);
return
;
}
// This will send a string to the server
Serial
.
println
(
"sending data to server"
);
if
(
client
.
connected
())
{
client
.
println
(
"hello from RP2040"
);
}
// wait for data to be available
unsigned
long
timeout
=
millis
();
while
(
client
.
available
()
==
0
)
{
if
(
millis
()
-
timeout
>
5000
)
{
Serial
.
println
(
">>> Client Timeout !"
);
client
.
stop
();
delay
(
60000
);
return
;
}
}
// Read all the lines of the reply from server and print them to Serial
Serial
.
println
(
"receiving from remote server"
);
// not testing 'client.connected()' since we do not need to send data here
while
(
client
.
available
())
{
char
ch
=
static_cast
<
char
>
(
client
.
read
());
Serial
.
print
(
ch
);
}
// Close the connection
Serial
.
println
();
Serial
.
println
(
"closing connection"
);
client
.
stop
();
if
(
wait
)
{
delay
(
300000
);
// execute once every 5 minutes, don't flood remote service
}
wait
=
true
;
}
libraries/lwIP_w6100/keywords.txt
0 → 100644
View file @
815e17b3
#######################################
# Syntax Coloring Map
#######################################
#######################################
# Library (KEYWORD1)
#######################################
W6100lwIP KEYWORD1
Wiznet6100lwIP KEYWORD1
#######################################
# Methods and Functions (KEYWORD2)
#######################################
#######################################
# Constants (LITERAL1)
#######################################
libraries/lwIP_w6100/library.properties
0 → 100644
View file @
815e17b3
name
=
lwIP_w6100
version
=
1
author
=
Stefan Nuernberger
maintainer
=
esp8266/Arduino
sentence
=
Ethernet driver
paragraph
=
Wiznet6100 ethernet drivers for lwIP and esp8266 Arduino from https://github.com/njh/W5100MacRaw
category
=
Communication
url
=
https://github.com/esp8266/Arduino
architectures
=
rp2040
dot_a_linkage
=
true
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment