[DEPRECATED] ST_Anything - Arduino/ESP8266/ESP32

Your sketch looks alright. It appears you left the definition of 1 button device, so you would set the number of buttons to 1 in the Parent Device’s settings.

If you can press the parent device’s REFRESH button, and see the corresponding ‘Refresh’ command received by the ESP8266 in the Arduino IDE Serial Monitor window, we at least have ST to ST_Anything communications.

Please show the output from the Arduino IDE Serial Monitor window, as well as the ST IDE Live Logs, from the time-frame when you click the refresh button.

Also, go back through the ST_Anything ReadMe and make sure you read and follow every step.

1 Like

thanks @ogiewon

heres the serial and log
20:44:22.858 -> Everything: init started
20:44:22.858 -> Everything: Free RAM = 50696
20:44:22.858 ->
20:44:22.858 -> Initializing ESP8266 WiFi network. Please be patient…
20:44:22.858 -> Attempting to connect to WPA SSID: Home
20:44:22.858 -> .
20:44:23.370 ->
20:44:23.370 -> Enter the following three lines of data into ST App on your phone!
20:44:23.370 -> localIP = 192.168.0.91
20:44:23.370 -> serverPort = 8090
20:44:23.370 -> MAC Address = CC50E3C704BC
20:44:23.370 ->
20:44:23.370 -> SSID =
20:44:23.370 -> PASSWORD =
20:44:23.370 -> hubIP = 192.168.0.101
20:44:23.370 -> hubPort = 39500
20:44:23.370 -> RSSI = -32
20:44:23.370 -> hostName = ESP8266_CC50E3C704BC
20:44:23.370 ->
20:44:23.370 -> SmartThingsESP8266WiFI: Intialized
20:44:23.370 ->
20:44:23.370 -> Disabling ESP8266 WiFi Access Point
20:44:23.370 ->
20:44:23.370 -> ArduinoOTA Ready
20:44:23.404 -> IP address: 192.168.0.91
20:44:23.404 -> ArduionOTA Host Name: ESP8266_CC50E3C704BC
20:44:23.404 ->
20:44:23.404 -> Everything: init ended
20:44:23.404 -> Everything: Free RAM = 49072
20:44:23.404 -> Everything: adding sensor named contact1
20:44:23.404 -> Everything: Free RAM = 49072
20:44:23.404 -> Everything: adding sensor named relaySwitch1
20:44:23.404 -> Everything: Free RAM = 49072
20:44:23.404 -> Everything: adding executor named alarm1
20:44:23.404 -> Everything: Free RAM = 49072
20:44:23.404 -> Everything: adding executor named switch1
20:44:23.404 -> Everything: Free RAM = 49072
20:44:23.439 -> Everything: initDevices started
20:44:23.439 -> Everything: Free RAM = 49072
20:44:23.439 -> Everything: Sending: contact1 open
20:44:31.497 -> ST_Anything Callback: Sniffed data = contact1 open
20:44:31.497 -> Everything: Sending: alarm1 off
20:44:40.005 -> ST_Anything Callback: Sniffed data = alarm1 off
20:44:40.005 -> Everything: Sending: switch1 off
20:44:48.503 -> ST_Anything Callback: Sniffed data = switch1 off
20:44:48.503 -> Everything: initDevices ended
20:44:48.503 -> Everything: Free RAM = 47728
20:45:20.599 -> Everything: Received: refresh
20:45:20.599 -> Everything: Sending: alarm1 off
20:45:28.606 -> ST_Anything Callback: Sniffed data = alarm1 off
20:45:28.606 -> Everything: Sending: switch1 off
20:45:37.102 -> ST_Anything Callback: Sniffed data = switch1 off
20:45:37.136 -> Everything: Sending: contact1 open

1 Like

Thanks for looking at it @ogiewon
I’m re reading the steps again now

steve

1 Like

I figured out the problem,
it appeared to only be communicating one way,
decided everything looked fine and couldn’t spot a problem, so I rebooted hub and everything magically started to work and all the controls just refreshed into the app.

Thank you @ogiewon for taking time to help look at my problem

1 Like

Sorry I wasn’t clear. I’ll go back and work through this from your earlier recommendations and see where I get.

Thanks again.

Is there anywhere i can look to understand what these adrino boards are capable of (temp, humidity, etc etc etc) as well as understand what it takes to wire them up. I have been looking for youtube videos or something but i just dont understand it yet.

Thanks

Hi,

I have a nodemcu esp12e working fine in ST showing temps on my app and controlling relays etc. I’d now like to add code to show the different temps on my OLED 128x64 display

I have 5 temperatures all on the same 3 connections to the node board, this is the standard multiples sketch modified only to give the 5 temperatures using this code:

static st::PS_DS18B20_Temperature sensor1(F(“temperature”), 15, 0, PIN_TEMPERATURE_1, true, 10, 5);

I see you mention that I need to uncomment the serial section, but what code should I change both to activate the OLED screen and also to make it display the information? (

I’m really after 5 columns and 2 rows with the top row titled temp1 to temp5 with the actual temperatures shown on the row below.

Thanks VERY much for any help anyone can give me on this!!

All the best,
Dan.

The boards themselves aren’t capable of sensing anything. They’re just, for lack of a better term, baby computers with input and output points.

Adafruit.com has a lot of products and documentation to read through. You can also go to the GitHub that is listed in the first post and then go to Arduino folder and then to the libraries folder. You’ll see there’s a bunch of libraries for the Adafruit sensors. You can use those model numbers on their website to see what they all do. There are temperature sensors, light sensors, Etc.

But it can also be as simple as a contact closure. This project is a great way to bridge the gap between physical devices and the SmartThings ecosystem, if it can be sensed or monitored with a physical device then chances are you can bring it into SmartThings through ST_Anything (hence the name, I assume).

I have never used an OLED or LCD screen with an ESP8266 board, so I can’t really be too much help in that department.

Hopefully another user will chime in.

I’m trying hard to get this thing running to do 3 DHT-22 sensors for my gecko habitat and I keep getting this compile error. I’m using multiples_esp8266 sketch.

Arduino: 1.8.9 (Windows Store 1.8.21.0) (Windows 10), Board: “NodeMCU 0.9 (ESP-12 Module), 80 MHz, 115200, 4M (3M SPIFFS)”

Build options changed, rebuilding all
C:\Users\theva\Documents\Arduino\libraries\SmartThingsESP8266WiFi\SmartThingsESP8266WiFi.cpp: In member function ‘virtual void st::SmartThingsESP8266WiFi::init()’:

C:\Users\theva\Documents\Arduino\libraries\SmartThingsESP8266WiFi\SmartThingsESP8266WiFi.cpp:166:29: error: ‘class ArduinoOTAClass’ has no member named ‘getHostname’

Serial.println(ArduinoOTA.getHostname());

                         ^

Multiple libraries were found for “Servo.h”
Used: C:\Users\theva\Documents\ArduinoData\packages\esp8266\hardware\esp8266\2.2.0\libraries\Servo
Not used: C:\Program Files\WindowsApps\ArduinoLLC.ArduinoIDE_1.8.21.0_x86__mdqgnx93n4wtt\libraries\Servo
exit status 1
Error compiling for board NodeMCU 0.9 (ESP-12 Module).

Am I supposed to uncomment some lines or am I just freaking out?

Please follow the ReadMe directions and use Arduino IDE v1.8.8 + ESP8266 v2.4.2. I have never tried the Windows Store version.

I’m downloading the IDE 1.8.8 and I’ll update 8266 to 2.4.2. The nodemcu runs arduino code samples just fine but break with st_anything.ino.

I typically use NodeMCU v1.0 for my boards.

I got it to load, all child devices propogated and show in classic app. I have a single sensor connected to D5/3.3v/GND, what do I need to do to get the dht22 to be seen? I believe it’s still looking for a DB temp sensor. I applied the dht fix from comment #823 and defined pin D5 PIN_TEMPERATUREHUMIDITY_1. Also using v1. 0.

Eventually, I would like to use a base to run 3 seperate sensors from a single ESP8266. I appreciate your awesome contribution to the community and your quick response. Thank you so much!

To add the DHT22’s, simply reserve pins, add the declaration of the three sensors, and add them to Everything.

Here are the sections of code…

#define PIN_TEMPERATUREHUMIDITY_1 D1  //SmartThings Capabilities "Temperature Measurement" and "Relative Humidity Measurement"
#define PIN_TEMPERATUREHUMIDITY_2 D2  //SmartThings Capabilities "Temperature Measurement" and "Relative Humidity Measurement"
#define PIN_TEMPERATUREHUMIDITY_3 D5  //SmartThings Capabilities "Temperature Measurement" and "Relative Humidity Measurement"

  static st::PS_TemperatureHumidity sensor1(F("temphumid1"), 60, 0, PIN_TEMPERATUREHUMIDITY_1, st::PS_TemperatureHumidity::DHT22,"temperature1","humidity1");
  static st::PS_TemperatureHumidity sensor2(F("temphumid2"), 60, 10, PIN_TEMPERATUREHUMIDITY_2, st::PS_TemperatureHumidity::DHT22,"temperature2","humidity2");
  static st::PS_TemperatureHumidity sensor3(F("temphumid3"), 60, 20, PIN_TEMPERATUREHUMIDITY_3, st::PS_TemperatureHumidity::DHT22,"temperature3","humidity3");
  st::Everything::addSensor(&sensor1);
  st::Everything::addSensor(&sensor2);
  st::Everything::addSensor(&sensor3);

This should get you going.

I’m going to jump on this as soon as I get home. Thank you again, sir!

@ogiewon
It’s alive and reporting properly! Thank you, thank you, thank you!

1 Like

Awesome! Have fun!

Can someone here please help me out and provide a basic tutorial or overview on what i would need to do to make a couple of simple motion detectors using a couple of wemos d1 mini’s , a PIR HC-SR501 and rcwl0516 radar sensor .

I have already setup the ST anything DTH automatically by liking to the git repo to my ST IDE
i have the proper arduino IDE and board manager versions installed and i have added all the libraries and example sketches from the repo to my arduino IDE
so now what do i do?
I am clueless on what to do next, which one of the example sketches should i use and which board am i supposed to select from the board manager in my Arduino IDE?
can someone make a basic step by step tutorial on how to just set up a simple sensor or smart button or something , anything so we know how this is all supposed to work?
like what you are supposed to do 1st and how you are supposed to get the board flashed and how you get it recognized in ST

Also looking over one of these example sketches i see it says to edit and enter the “device IP”
i assume this is supposed to be the ( static) IP for the board but how am i supposed to get the device IP when it has not even been connected to my wifi yet and i need to enter the device ip and upload it to the board to get it to connect in the 1st place?

And what if i were to use this multiples esp8266 examples sketch and just connect my sensor to the motion detector defined GPIO pin and then upload the sketch as is,
I mean with all the other code for al thel the sensors/pins that i am not using
and then do whatever i need to do get the board recognized by ST
i mean will i have all the other unused stuff in the sketch showing up in my ST or will i be able to just add the one sensor? or would i need to edit the sketch and delete all the other stuff am i not using to just get the one device to show up?

Well, coming here and asking for assistance is a good first step! :wink:

I would recommend you start with ST_Anything_Multiples_ESP8266WiFi.ino example sketch. Follow the directions in my ReadMe to edit the networking section of this sketch before uploading to your Wemos D1.

I’d recommend you choose the Wemos D1, since that is the board you’ve chosen for the project.

Perhaps as you work your way through this process you could document it along the way? I am sure other users like yourself would find it helpful. :wink: I just don’t have time to teach the basics of Arduino programming and electrical circuits to every new user. There are a ton of great tutorials online for exactly this. I really recommend you get some very simple basic Arduino sketches up and running with your desired sensors before even attempting to use ST_Anything. This will verify that the basic wiring and functionality is working before adding SmartThings to the equation. These “practice sketches” will be replaced completely by the ST_Anything sketches. ST_Anything is designed to remove the complexity of having to start from an empty sketch.

Again, there is an assumption that users developing Arduino solution are also somewhat familiar with basic TCP/IP networking. You should easily be able to determine what range of IP addresses your router’s DHCP server is assigning, and then simply pick a free address just outside that range. For example, if your router’s DHCP server is using 192.168.1.50 to 192.168.1.150, you can safely use 192.168.1.200 through 192.168.1.250 for your Wemos D1 boards.

Again, start with the EXAMPLE sketch I mentioned above, and just try to get it working. Once you know the 2-way communications are working correctly, you can start modifying the sketch to have just the devices defined that you have attached. At that point, just delete the Parent Device (NOT THE DEVICE HANDLERS!!!) and manually recreate it. When the Arduino board communicates to the new parent, only the child devices that are defined will be created in SmartThings.

Take it all one step at a time, and have fun! I know it seems daunting at first, but it really is fairly simple once you’ve done it successfully the first time.