Skip to content

Commit 024d6ef

Browse files
committed
Ethernet SoftSPI
Update ethernet sketch to give correct instructions when using W5100/SoftSPI.
1 parent 4783cac commit 024d6ef

File tree

1 file changed

+14
-23
lines changed

1 file changed

+14
-23
lines changed

libraries/MySensors/examples/EthernetGateway/EthernetGateway.ino

Lines changed: 14 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,17 @@
1414
*
1515
* The GW code is designed for Arduino 328p / 16MHz. ATmega168 does not have enough memory to run this program.
1616
*
17-
* COMPILING ENC28J60
17+
*
18+
* COMPILING WIZNET (W5100) ETHERNET MODULE
19+
* > Edit RF24_config.h in (libraries\MySensors\utility) to enable softspi (remove // before "#define SOFTSPI").
20+
*
21+
* COMPILING ENC28J60 ETHERNET MODULE
1822
* > Use Arduino IDE 1.5.7 (or later)
1923
* > Disable DEBUG in Sensor.h before compiling this sketch. Othervise the sketch will probably not fit in program space when downloading.
20-
* > Remove Ethernet.h include below and inlcude UIPEthernet.h
21-
* COMPILING WizNET (W5100)
22-
* > Remove UIPEthernet include below and include Ethernet.h.
24+
* > Remove Ethernet.h include below and include UIPEthernet.h
25+
* > Remove DigitalIO include
26+
* Note that I had to disable UDP and DHCP support in uipethernet-conf.h to reduce space. (which means you have to choose a static IP for that module)
2327
*
24-
* Note that I had to disable UDP and DHCP support in uipethernet-conf.h to reduce space. (which meas you ave to choose a static IP for that module)
25-
2628
* VERA CONFIGURATION:
2729
* Enter "ip-number:port" in the ip-field of the Arduino GW device. This will temporarily override any serial configuration for the Vera plugin.
2830
* E.g. If you want to use the defualt values in this sketch enter: 192.168.178.66:5003
@@ -32,32 +34,21 @@
3234
* - TX (yellow) - blink fast on radio message transmitted. In inclusion mode will blink slowly
3335
* - ERR (red) - fast blink on error during transmission error or recieve crc error
3436
*
35-
* ----------- Connection guide ---------------------------------------------------------------------------
36-
* 13 Radio & Ethernet SPI SCK
37-
* 12 Radio & Ethernet SPI MISO (SO)
38-
* 11 Radio & Ethernet SPI MOSI (SI)
39-
* 10 Ethernet SPI Slave Select (CS) Pin 10, the SS pin, must be an o/p to put SPI in master mode
40-
* 9 Radio TX LED using on board LED (optional) +5V -> LED -> 270-330 Ohm resistor -> pin 9.
41-
* 8 Radio RX LED (optional) +5V -> LED -> 270-330 Ohm resistor -> pin 8.
42-
* 7 Radio error LED (optional) +5V -> LED -> 270-330 Ohm resistor -> pin 7.
43-
* 6 Radio SPI Slave Select
44-
* 5 Radio Chip Enable
45-
* 3 Inclusion mode button (optional), 10K pull down to GND, button to VCC)
46-
* 2 Radio IRQ pin (optional), W5100 Int, if linked to pin 2)
47-
* -----------------------------------------------------------------------------------------------------------
48-
* Powering: both NRF24l01 radio and Ethernet(ENC28J60) uses 3.3V
37+
* See http://www.mysensors.org/build/ethernet_gateway for wiring instructions.
38+
*
4939
*/
5040

41+
#include <DigitalIO.h> // This include can be removed when using UIPEthernet module
5142
#include <SPI.h>
5243
#include <MySensor.h>
5344
#include <MyGateway.h>
5445
#include <stdarg.h>
5546

5647
// Use this if you have attached a Ethernet ENC28J60 shields
57-
#include <UIPEthernet.h>
48+
//#include <UIPEthernet.h>
5849

59-
// Use this fo WizNET module and Arduino Ethernet Shield
60-
//#include <Ethernet.h>
50+
// Use this fo WizNET W5100 module and Arduino Ethernet Shield
51+
#include <Ethernet.h>
6152

6253

6354
#define INCLUSION_MODE_TIME 1 // Number of minutes inclusion mode is enabled

0 commit comments

Comments
 (0)