Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
R
RF Multiplexer 8ch 1GHz
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
3
Issues
3
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
image/svg+xml
Discourse
Discourse
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Projects
RF Multiplexer 8ch 1GHz
Commits
d14bf741
Commit
d14bf741
authored
Nov 28, 2019
by
Anders Wallin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
define-option for fixed-IP or DHCP
parent
21b0f6f4
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
9 deletions
+17
-9
httpd.h
mux-sw_MKR_ZERO/httpd.h
+17
-9
No files found.
mux-sw_MKR_ZERO/httpd.h
View file @
d14bf741
...
...
@@ -21,13 +21,17 @@ requests.get("http://%s/SP6T%s:STATE:%d" % (ip, switch, state))
namespace
HTTPD
{
// 90:A2:DA:E7:F0:F3
// MAC address generated by https://ssl.crox.net/arduinomac/
// see http://blog.crox.net/archives/91-MAC-generator.html
byte
mac
[]
=
{
// 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED
0x90
,
0xA2
,
0xDA
,
0x0E
,
0xCE
,
0x76
byte
mac
[
6
]
=
{
0x90
,
0xA2
,
0xDA
,
0xE7
,
0xF0
,
0xF3
};
};
// #define FIXED_IP // define this to use a fixed IP
#define DHCP_IP // to use DHCP
// if FIXED_IP, use this address
IPAddress
ip
(
192
,
168
,
1
,
18
);
//IPAddress ip(192, 168, 3, 30);
//IPAddress ip(130, 188, 45, 253);
...
...
@@ -47,11 +51,15 @@ httpd(RF_MUX::RF_MUX* m1, RF_MUX::RF_MUX* m2){
void
init
()
{
// start the Ethernet connection and the server:
#ifdef FIXED_IP
Ethernet
.
begin
(
mac
,
ip
);
// fixed IP
//Serial.println("DHCP...");
//int dhcp_result = Ethernet.begin(mac); // DHCP result
//Serial.print("DHCP success? ");
//Serial.println(dhcp_result);
#endif
#ifdef DHCP_IP
Serial
.
println
(
"DHCP..."
);
int
dhcp_result
=
Ethernet
.
begin
(
mac
);
// DHCP result
Serial
.
print
(
"DHCP success? "
);
Serial
.
println
(
dhcp_result
);
#endif
server
->
begin
();
Serial
.
print
(
"MUX is at IP: "
);
Serial
.
println
(
Ethernet
.
localIP
());
...
...
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