Announcing the "ST_Anything" Arduino/ThingShield Project

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.

  1. Of course, you’ll need a hard-wired Cat5 Ethernet connection for the W5100 shield.
  2. The Arduino sketch will need to include the new “SmartThingsEthernetW5100.h” header file instead of the old “SmartThings.h” header file.
  3. 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.
  4. 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.

2 Likes

Thanks again for the explanation. You are amazing.

1 Like

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. :wink:

I don’t think W5100 can handle HTTPS though.

1 Like

It is finally here… still a work in process, but thought you all might want to give it a try!

4 Likes

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! :wink: (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
OR
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.

great! lol ok, so let me purchase w5100 shield and start all over. so
other than the wifi module. I should be on the right path?

Yes, but please realize that a W5100 shield is a hard wired Cat5 Ethernet shield. No WiFi.

SOLD! I will gladly send you a ESP8266-01 WiFi module as I’m about to place an order for more toy’s from AliExpress anyway. This looks like a really good option for larger projects. I had been investigating the Arduino WiFi shield, but they are twice the price of the ESP-01. (The Arduino WiFi shields are ESP8266 based anyway.)

Garnet,

Thanks for the offer. I actually just placed an order on Amazon for some ESP-01 modules. They should be here on Sunday. Looks like they should be fairly easy to integrate with an Arduino UNO or MEGA as a WiFi shield device.

Dan

@Garnet, @Raymond_Lopez

I have added support for the Arduino MEGA/ESP-01 hardware combination. See below:

you the man!

Is it possible to have this trip the following siren (see attached image of security panel). the siren uses 2 wires ground and positive.

You should be able to do this with a Relay Sample Relay on Amazon. It looks like it’s only 12 Volts, so you may be able to use an Arduino directly, but I wouldn’t take the chance as the relays are cheap. I believe that Arduino would use 5V relay and ESP8266 would need 3.3 volt ones, but the one I linked handles both. I would personally recommend using an ESP-01, Relay, and Ogiewon new ESP code which would make this a $10 project at most.
Good Luck

© 2019 SmartThings, Inc. All Rights Reserved. Terms of Use | Privacy Policy

SmartThings; SmartApps®; Physical Graph; Hello, Home; and Hello, Smart Home are all trademarks of the SmartThings, Inc.