[RELEASE] ST_Anything - Arduino/ESP8266/ESP32

Yep, just a legacy error message.

1 Like

Phew, thanks for confirming :slight_smile:

Dan,

I just go an OLIMEX ESP32-POE, this boards has POE and wired ethernet as well as the ESP32 wifi. I would like to use the POE and wired ethernet. Can you help with what mods I need to make to the ESP32 sketch in order to make his all work?

Thanks

Usually, to make a new board work with ST_Anything, one will need to create a new “SmartThings…” communications library. These communication libraries are all that is different in the example sketches from one board type to another. The ST_Anything libraries usually do not need to be modified when adding support for a new microcontroller board.

Take a look at “SmartThingsESP32WiFi” and especially “SmartThingsEthernetW5x00” as example communications libraries. The latter is already Ethernet-based versus WiFi, but things will most likely need to be changed to support whatever Ethernet controller has been added to that specific ESP32 board.

Good luck and have fun!

1 Like

Hey everyone. Here’s a small contribution.

I have an ST_Anything-infested home with nine Arduino-family devices reading many sensors and controlling many relays. Two ESP8266s, One Arduino Uno, and the rest are megas. I’m an experienced, though non-expert ST_Anything user.

Despite the very stable platform, I have found that my five megas, running as multi-input ST_Anything digital input sensors, occasionally get lost and need a swift kick in the pants to return to their job. What I have done with great success is to cause a daily hardware reset. This pants-kick has helped me to spend less time noodling with a flashlight in the space above the basement suspended ceiling.

So what I have done across all of these ST_Anything devices is to connect the Arduino RESET pin to output Pin 7 of my Arduino. (You can pick any pin you like within the bounds of the reserved pins.)

Then in the software I define a couple of literals at the top of the ST_Anything file:

#define RESET_PIN                7       // will be used to reset the arduino daily
#define RESET_INTERVAL  86.4e6/1         //milliseconds between hard reset... 86.4e6 is 24 hours

Note that if you choose a different pin for resetting your arduino, you’ll need to change the 7 above to something else. Also you might wonder about the divide by 1. This allowed you to just change the 1 to some other number to force resets 2 times or 3 times or n times per day.

Then make sure that the pin is set to high most of the time. Put this in the setup section of the ST_Anything code.

// setup for reset pin to be pulsed daily
pinMode(RESET_PIN, OUTPUT);
digitalWrite(RESET_PIN, HIGH);    //when output pin goes low, it pulls the Arduino Reset Pin low and the system resets.

Then finally in the main loop() you have this:

 // hard reset daily
 if (millis() > RESET_INTERVAL) {
     digitalWrite(RESET_PIN, LOW);  // Will reset arduino... no execution past this point
 }

One Last Tip
Some Arduinos seem to object to having their reset pin fiddled with in this way. The symptom is that you cannot reprogram the Arduino from the IDE. Once you break the RESET-to-Pin-7 connection (or whatever pin you’re using), the Arduino will load just fine. To make this easy, I have soldered the connecting wire at the RESET pin, but left the Pin 7 end loose. With just a stripped bare wire at that end, I can push it into the pin 7 socket on my Arduino in run mode, and pull it out of the pin 7 socket in program mode.

I’ve received so much good help from this forum, I just want to give back the little I can.

1 Like

Just out of curiosity why not upgrade the megas to something newer like a esp32?

that fits into the “if it’s not broken, don’t fix it category.”. But someone starting out from scratch might get a nice improvement from that.

1 Like

Hi. Happy new year to all.
Hello Dan. I looked through the thread and didnt find any information about what im looking for. I’d like to add chlorine and ph monitoring to my swimming pool. I saw a couple of relatively low cost sensor probes on alibaba and i’d like to give them a try. Their output is 4-20 ma. I know i’d need to convert it to 1-3v . Is there a device handler already out there that I could use for these? thanks in advance.

here is a link to the ph sensor i am looking at. https://www.alibaba.com/product-detail/GEC-pH485-Sewage-water-4-20mA_62461289270.html?spm=a2700.galleryofferlist.normal_offer.d_title.97e86b91C3wcsh

I would start with the PS_Voltage device. You can scale the raw ‘count’ value from the AI Read command into the proper engineering units (see the comments at the top of the PS_Voltage.cpp file.)

Thanks. Ill check that out.

Hi all,
I am using an ESP01 with ST_Anything to drive 7m of LED strips via an N-MOS module. I use the EX_PWM_Dim library. Only TX and RX pins are available in my setup. I’m using the TX/GPIO1 pin (also tried RX/GPIO3) and it works fine except it always starts HIGH - strip at 100%. After a lot of research and trials, I found today that the serial.begin statement is the source of the problem. This is called in Everything.cpp. I moved it to if(Debug) a few lines lower and now the problem is solved: the LED strip starts OFF.
I wanted to share this case and also ask following questions @ogiewon and others : Is it necessary to activate serial in Everything.cpp? Could we move serial.begin into if(Debug) ?
Thanks

Glad to hear you found a fix. In general, the Serial pins are only used for the Arduino IDE Serial Monitor window. I am probably not going to change how it works after so many years, fearing that it might cause issues for the installed user base should they ever update there ST_Anything Arduino Libraries.

The ESP01 is a very nice, tiny, inexpensive module. However, it is severely limited in terms of GPIO pins. There are so many other low-cost, very capable ESP8266 based boards which expose many more GPIO pins. You could always simply upgrade your microcontroller to one of those to avoid this issue in the future. Your current workaround should be fine as well.

1 Like

All,

I have updated the Parent ST_Anything Ethernet DTH with some amazing changes by another user, Andy Alsup, to allow all of the functionality of the parent device to now work in the New ST Mobile App.

Thank you @aalsup!

In addition, Andy rewrote the Child Ultrasonic DTH to be more generic and to work with the New ST Mobile App. Since the old version was basically broken and unsupported, I simply accepted Andy’s new version even though it may contain breaking changes for anyone still using the old Child Utrasonic DTH.

Enjoy!

thanks for the feedback. Indeed not the most pins on ESP-01 and it was actually a downgrade from a nodemcu which I needed for another project :wink:.
No worries for the integration, the fix works fine and it’s a real cornercase anyway.

1 Like