11
11
Copyright (C) 2006-2008 Hans-Christoph Steiner. All rights reserved.
12
12
Copyright (C) 2010-2011 Paul Stoffregen. All rights reserved.
13
13
Copyright (C) 2009 Shigeru Kobayashi. All rights reserved.
14
- Copyright (C) 2009-2016 Jeff Hoefs. All rights reserved.
14
+ Copyright (C) 2009-2017 Jeff Hoefs. All rights reserved.
15
15
16
16
This library is free software; you can redistribute it and/or
17
17
modify it under the terms of the GNU Lesser General Public
20
20
21
21
See file LICENSE.txt for further informations on licensing terms.
22
22
23
- Last updated October 16th, 2016
23
+ Last updated August 13th, 2017
24
24
*/
25
25
26
26
/*
@@ -832,6 +832,17 @@ void systemResetCallback()
832
832
isResetting = false ;
833
833
}
834
834
835
+ void printEthernetStatus ()
836
+ {
837
+ DEBUG_PRINT (" Local IP Address: " );
838
+ IPAddress ip = Ethernet.localIP ();
839
+ DEBUG_PRINTLN (ip);
840
+ #ifdef remote_ip
841
+ DEBUG_PRINT (" Connecting to server at: " );
842
+ DEBUG_PRINTLN (remote_ip);
843
+ #endif
844
+ }
845
+
835
846
/*
836
847
* StandardFirmataEthernet communicates with Ethernet shields over SPI. Therefore all
837
848
* SPI pins must be set to IGNORE. Otherwise Firmata would break SPI communication.
@@ -868,15 +879,14 @@ void initTransport()
868
879
#ifdef local_ip
869
880
Ethernet.begin ((uint8_t *)mac, local_ip); // start ethernet
870
881
#else
871
- Ethernet.begin ((uint8_t *)mac); // start ethernet using dhcp
882
+ DEBUG_PRINTLN (" Local IP will be requested from DHCP..." );
883
+ // start ethernet using dhcp
884
+ if (Ethernet.begin ((uint8_t *)mac) == 0 ) {
885
+ DEBUG_PRINTLN (" Failed to configure Ethernet using DHCP" );
886
+ }
872
887
#endif
873
888
#endif
874
-
875
- DEBUG_PRINTLN (" connecting..." );
876
-
877
- DEBUG_PRINT (" IP Address: " );
878
- IPAddress ip = Ethernet.localIP ();
879
- DEBUG_PRINTLN (ip);
889
+ printEthernetStatus ();
880
890
}
881
891
882
892
void initFirmata ()
@@ -895,7 +905,7 @@ void initFirmata()
895
905
896
906
// start up Network Firmata:
897
907
Firmata.begin (stream);
898
- systemResetCallback (); // reset to default config
908
+ systemResetCallback (); // Initialize default configuration
899
909
}
900
910
901
911
void setup ()
0 commit comments