My Ethernet shield was missing connectors… just FYI if you can’t get Ethernet to work, there are an extra set of at the end that need to connect to the Arduino board. It’s been a while so I forget the details now.
This is really awesome! Thank you for all your efforts - I can’t wait to dig into this and see if I can’t get my old home security system wired into a shield that can integrate with SmartThings!
Dan, you are awesome. I can’t wait to buy all the components and try. I’m very new to this. Thanks for your contribution.
This. Is. Awesome.
Just to be sure it is clear…
if you use a NodeMCU ESP8266, that is all you’ll need to buy. It can be programmed via the Arduino IDE and uses built in WiFi.
If you want to use an Arduino MEGA or UNO, you’ll need either a ThingShield or a W5100 Ethernet shield. I don’t have a Wifi solution for an Arduino as I don’t have a Wifi shield.
This evening I was successful in getting the ST_Anything library running on the NodeMCU ESP8266.
I’m glad you mention this. Which solution is better and easier? Thanks.
It really depends on what your project is and how you want to connect it.
The Arduino MEGA + W5100 Ethernet Shield requires a hardwired Cat5 Ethernet connection to your home network. It has the advantage of using one of the most ubiquitous platforms on the market (Arduino) and runs at 5V TTL logic levels, allowing it to be used with a plethora of devices on the market. There is a huge community that has developed code for this platform, so finding help is quite easy. Also, the Arduino MEGA has 54 Digital I/O and 16 Analog I/O pins. The total cost for this solution is somewhere around $30 to $50 USD. This is a somewhat large solution compared to the NodeMCU solution.
The NodeMCU ESP8266 board is a much newer, smaller, less expensive product. It runs all of its I/O at 3.3V logic levels. It has 1 Analog and 11 Digital I/O pins, along with built-in WiFi for network connectivity. It is a very small package as well, and only cost ~$8 to $12 USD. Because of these features at such a low price point, it is fast becoming the go-to board for many small DIY electronics projects. It can also be programmed via the Arduino IDE, making it very easy for Arduino developers to use it without having to learn a new platform.
If you’re just getting started, just grab a NodeMCU ESP8266 board. It takes a little work to set up the Arduino IDE to work with this board, but that’s a one-time configuration/download. There are tons of guides online to show you exactly how to get started.
Hope this helps!
So to confirm the Ethernet Shield option would work just the same as the Thingshield in the project below that calls for Thingshield + Arduino Mega + AD2Pi .
So, there are a few things to be aware of if you want to try to use my new “SmartThings” library with that particular project, along with a W5100 Ethernet Shield.
- Of course, you’ll need a hard-wired Cat5 Ethernet connection for the W5100 shield.
- The Arduino sketch will need to include the new “SmartThingsEthernetW5100.h” header file instead of the old “SmartThings.h” header file.
- The Arduino sketch will need to create a “st::SmartThingsEthernetW5100” object instead of the old “SmartThings” object. This also requires you to define numerous TCP/IP network objects to be passed into the new constructor. Also, the new “init()” routine will need to be called in the Arduino setup() function to establish the network communications.
- The ST IDE Groovy based Device Handler will need some tweaks make to its “parse()” routine to handle Ethernet packets, instead of Zigbee. Also, every call to send data to the Arduino will need to be tweaked to send an Ethernet packet, instead of Zigbee.
I will release examples showing exactly what I am describing above to make it easier for you to modify your old Arduino and ST Device Handler source code.
In the case of the project you referenced above, I believe you should work with the original developers to see if they are willing to incorporate these changes for you and the rest of the community.
Thanks again for the explanation. You are amazing.
Do you know what is the practical limit of Ethernet devices that ST hub can handle? There was a discussion in another thread that it can only handle 10-15 devices at most before it starts rebooting spontaneously.
That’s the first I have heard of the limitation. I’ll be on the lookout for that issue. Sounds like the firmware in the hub may have a memory management issue.
I am running two Ethernet clients for testing with no issues noticed. I only have one W5100 shield and one NodeMCU ESP8266 board to test with.
I suppose we could add another subclass to the new SmartThings library which could bypass the hub and connect directly to the ST cloud. I’m kind of hoping someone else gets creative and adds that type of capability in the future.
I don’t think W5100 can handle HTTPS though.
It is finally here… still a work in process, but thought you all might want to give it a try!
Thanks for your works, but I need your help because I’m very NOOB with Arduino.
I need connect Mega2560 with W5100 for connect 10 door/windows dry contact.
For device handler for my contact,
I use ST_Anything_Ethernet.device.groovy or ST_Anything_Doors_Windows_ThingShield.device.groovy
For Smartapps I use ST_Anything_Doors_Windows_Multiplexer.smartapp.groovy
For Sketches I understand procedures for IP, Mac adresss etc. but the only Sketches I see for W5100 is ST_Anything_EthernetW5100.ino but I think is ST_Anything_Doors_Windows_ThingShield.ino I’m need but he is not updated for W5100.
is it possible you explain more for me. Thank you
You are correct. I have not ported the “ST_Anything_Doors_Windows” sketch to work with the W5100 Shield yet.
I can help with this later tonight… Or you can use the “ST_Anything_EthernetW5100.ino” sketch as a reference for what changes are required to convert the “ST_Anything_Doors_Windows_ThingShield.ino” sketch into a W5100 compatible sketch.
Likewise, the ST_Anything_Doors_Windows_ThingShield.device.groovy Device Handler will need tweaks as well to work with Ethernet instead of the old ThingShield.
Ok. but I have abilities for use your project but not for modify files of your project.
The expectation is that users will need to customize the Arduino Sketch (.ino file) as well as the Device Handler groovy code. They are a matched set, and are usually custom to each user’s needs. The Multiplexer SmartApp, if needed, will also need to be customized by the end user.
The code is not hard to change, but you do need to have some basic understanding of how to write and debug code.
im having a tough time going through the setup of all this, if someone could shed a ton of light that would be great.
I bought the Arduino mega 2560 with the ESP8266 wifi Module and installed the component based off attached diagram. The red light stays steady on the ESP8266 wifi module once connected to computer via usb.
I installed the latest Arduino installer to upload the sketches.
I downloaded all the libraries and sketch folder and copied it to c:\program files x86\arduino
I opened up the Arduino software and opened the following file under the sketches menu : ST_Anything_ESP8266WiFi
I changed all the settings relating to wifi ssid, ip address etc…
I hit upload at the top and i get this error msg
exit status 1 ‘IPAddress’ does not name a type
am i doing all this correctly? Also once uploaded is there anything else that i need to do besides setting up device handlers, Im just not clear on the instructions.
You’re doing it wrong! (just kidding, sort of…)
I don’t think I ever said I added support for using an Arduino with an ESP8266 chip to add WiFi capability.
I added support for an Arduino with a W5100 shield
a NodeMCU V1.0 ESP8266-12E board
The NodeMCU v1.0 ESP8266-12E board is a standalone solution.
If someone wants to send me a ESP8266-01 WiFi module, I could look at including support for it as a WiFi shield for an Arduino. I just don’t have one to test with. I also do not have the USB to Serial adapter necessary to program the ESP-01 WiFi module, if that’s necessary.
Or, if you want to add support for the configuration shown above, you need to add a new Sub-Class under the st::Ethernet class within the SmartThings Library. You can’t really reuse the st::ESP8266WiFi class since that is designed specifically for running on the ESP8266 board. You’re trying to run on an Arduino, with an ESP-01 as a WiFi shield.