1 /*==============================================================================
2 * NETWORK CONFIGURATION
4 * You must configure your particular hardware. Follow the steps below.
6 * By default, StandardFirmataEthernet is configured as a TCP client.
7 * To configure as a TCP server, see STEP 2
8 *============================================================================*/
11 // Uncomment / comment the appropriate set of includes for your hardware (OPTION A or B)
12 // Option A is enabled by default.
15 * OPTION A: Configure for Arduino Ethernet board or Arduino Ethernet shield (or clone)
17 * To configure StandardFirmataEthernet to use the original WIZ5100-based
18 * ethernet shield or Arduino Ethernet uncomment the WIZ5100_ETHERNET define below
20 #define WIZ5100_ETHERNET
22 #ifdef WIZ5100_ETHERNET
25 EthernetClient client;
29 * OPTION B: Configure for Arduin Yun
31 * The Ethernet port on the Arduino Yun board can be used with Firmata in this configuration.
33 * To execute StandardFirmataEthernet on Yun uncomment the YUN_ETHERNET define below and make
34 * sure the WIZ5100_ETHERNET define (above) is commented out.
36 * On Yun there's no need to configure local_ip and mac address as this is automatically
37 * configured on the linux-side of Yun.
39 * Note that it may take several seconds to establish a connection with the Yun.
41 //#define YUN_ETHERNET
45 #include <YunClient.h>
49 // STEP 2 [REQUIRED for all boards and shields]
50 // TCP Client configuration:
51 // To configure your board as a TCP client, set the IP address of the server you want to connect to.
52 // TCP Server configuration:
53 // To configure your board as a TCP server, comment out the following line and also ensure that
54 // remote_host is also commented out.
55 #define remote_ip IPAddress(10, 0, 0, 3)
56 // *** REMOTE HOST IS NOT YET WORKING ***
57 // replace with hostname of server you want to connect to, comment out if using 'remote_ip'
58 // #define remote_host "server.local"
61 // Replace with the port that your client or server is listening on.
62 #define network_port 3030
64 // STEP 4 [REQUIRED unless using DHCP]
65 // Replace with your board or ethernet shield's IP address
66 // Comment out if you want to use DHCP
67 #define local_ip IPAddress(10, 0, 0, 15)
70 // replace with ethernet shield mac. Must be unique for your network
71 const byte mac[] = {0x90, 0xA2, 0xDA, 0x00, 0x53, 0xE5};
73 /*==============================================================================
74 * CONFIGURATION ERROR CHECK (don't change anything here)
75 *============================================================================*/
77 #if !defined WIZ5100_ETHERNET && !defined YUN_ETHERNET
78 #error "you must define either WIZ5100_ETHERNET or YUN_ETHERNET in ethernetConfig.h"
81 #if defined remote_ip && defined remote_host
82 #error "cannot define both remote_ip and remote_host at the same time in ethernetConfig.h"
85 /*==============================================================================
86 * PIN IGNORE MACROS (don't change anything here)
87 *============================================================================*/
89 #if defined(WIZ5100_ETHERNET)
91 // ignore SPI pins, pin 10 (Ethernet SS) and pin 4 (SS for SD-Card on Ethernet shield)
92 #define IS_IGNORE_PIN(p) ((IS_PIN_SPI(p) || (p) == 4) || (p) == 10)