[Release] HubDuino v1.1.9 - Hubitat to Arduino / ESP8266 / ESP32 / ThingShield Integration (ST_Anything)

Nope. Just load ANY of the ST_Anything ESP8266 sketches and BAM - OTA a support assuming you have Python 2.7 installed.

I haven’t used this in a while, and I am away from my main system right now, so I can’t test it to verify for a while.

WOW ....quite amazing ! I took out all the code i added and just like you said there was OTA support... a couple questions

  1. Could you describe that you support this in the documentation at the top of the thread...I'm sure I'll be corrected but I could not find any reference to the fact that this was built into Hubduino (which is amazing)... and worth making sure people are aware.
  2. I saw a change flag
    // 2018-12-10 Dan Ogorchock Add user selectable host name (repurposing the old shieldType variable)
    but I cannot see how to do that ... I know I should be able to go off of the IP address but a human readable host name would be really nice and it appears you support ..I just don't understand how to specify..
    Thanks again for the amazing work!

p.s. still can't get my laptop to sent OTA while my desktop can. I've turned off 5G, turned off the firewall but nothing seems to help... at least I have my desktop.

Ignore 2nd q, i found it

any chance of adding OTA to the ESP32 ? :upside_down_face:

I started with HubDuino today. I installed all the drivers for Hubitat, downloaded the v2.7.4 esp8266 board support package for the Arduino IDE, copied all the libraries and example sketches to the proper Arduino folders. I am trying to compile the ST_Anything_Buttons_ESP8266WiFi.ino example sketch. I am unable to compile it, and get the following error output:

Arduino: 1.8.19 (Windows Store 1.8.57.0) (Windows 10), Board: "Generic ESP8266 Module, 80 MHz, Flash, Disabled (new can abort), All SSL ciphers (most compatible), dtr (aka nodemcu), 26 MHz, 40MHz, DOUT (compatible), 1MB (FS:64KB OTA:~470KB), 2, nonos-sdk 2.2.1+100 (190703), v2 Lower Memory, Disabled, None, Only Sketch, 115200"

C:\Users\norbert\Documents\Arduino\ST_Anything_Buttons_ESP8266WiFi\ST_Anything_Buttons_ESP8266WiFi.ino: In function 'void setup()':

ST_Anything_Buttons_ESP8266WiFi:60:35: error: 'D1' was not declared in this scope; did you mean 'y1'?

60 | #define PIN_BUTTON_1 D1 //Hubitat Capabilities - Pushable Button/Holdable Button/Releasable Button (Normally Open!)

  |                                   ^~

C:\Users\norbert\Documents\Arduino\ST_Anything_Buttons_ESP8266WiFi\ST_Anything_Buttons_ESP8266WiFi.ino:128:59: note: in expansion of macro 'PIN_BUTTON_1'

128 | static st::IS_Button sensor1(F("button1"), PIN_BUTTON_1, 750, LOW, true, 500);

  |                                                           ^~~~~~~~~~~~

ST_Anything_Buttons_ESP8266WiFi:61:35: error: 'D2' was not declared in this scope

61 | #define PIN_BUTTON_2 D2 //Hubitat Capabilities - Pushable Button/Holdable Button/Releasable Button (Normally Open!)

  |                                   ^~

C:\Users\norbert\Documents\Arduino\ST_Anything_Buttons_ESP8266WiFi\ST_Anything_Buttons_ESP8266WiFi.ino:129:59: note: in expansion of macro 'PIN_BUTTON_2'

129 | static st::IS_Button sensor2(F("button2"), PIN_BUTTON_2, 750, LOW, true, 500);

  |                                                           ^~~~~~~~~~~~

ST_Anything_Buttons_ESP8266WiFi:62:35: error: 'D3' was not declared in this scope

62 | #define PIN_BUTTON_3 D3 //Hubitat Capabilities - Pushable Button/Holdable Button/Releasable Button (Normally Open!)

  |                                   ^~

C:\Users\norbert\Documents\Arduino\ST_Anything_Buttons_ESP8266WiFi\ST_Anything_Buttons_ESP8266WiFi.ino:130:59: note: in expansion of macro 'PIN_BUTTON_3'

130 | static st::IS_Button sensor3(F("button3"), PIN_BUTTON_3, 750, LOW, true, 500);

  |                                                           ^~~~~~~~~~~~

ST_Anything_Buttons_ESP8266WiFi:63:35: error: 'D4' was not declared in this scope

63 | #define PIN_BUTTON_4 D4 //Hubitat Capabilities - Pushable Button/Holdable Button/Releasable Button (Normally Open!)

  |                                   ^~

C:\Users\norbert\Documents\Arduino\ST_Anything_Buttons_ESP8266WiFi\ST_Anything_Buttons_ESP8266WiFi.ino:131:59: note: in expansion of macro 'PIN_BUTTON_4'

131 | static st::IS_Button sensor4(F("button4"), PIN_BUTTON_4, 750, LOW, true, 500);

  |                                                           ^~~~~~~~~~~~

ST_Anything_Buttons_ESP8266WiFi:64:35: error: 'D5' was not declared in this scope

64 | #define PIN_BUTTON_5 D5 //Hubitat Capabilities - Pushable Button/Holdable Button/Releasable Button (Normally Open!)

  |                                   ^~

C:\Users\norbert\Documents\Arduino\ST_Anything_Buttons_ESP8266WiFi\ST_Anything_Buttons_ESP8266WiFi.ino:132:59: note: in expansion of macro 'PIN_BUTTON_5'

132 | static st::IS_Button sensor5(F("button5"), PIN_BUTTON_5, 750, LOW, true, 500);

  |                                                           ^~~~~~~~~~~~

ST_Anything_Buttons_ESP8266WiFi:65:35: error: 'D6' was not declared in this scope

65 | #define PIN_BUTTON_6 D6 //Hubitat Capabilities - Pushable Button/Holdable Button/Releasable Button (Normally Open!)

  |                                   ^~

C:\Users\norbert\Documents\Arduino\ST_Anything_Buttons_ESP8266WiFi\ST_Anything_Buttons_ESP8266WiFi.ino:133:59: note: in expansion of macro 'PIN_BUTTON_6'

133 | static st::IS_Button sensor6(F("button6"), PIN_BUTTON_6, 750, LOW, true, 500);

  |                                                           ^~~~~~~~~~~~

ST_Anything_Buttons_ESP8266WiFi:66:35: error: 'D7' was not declared in this scope

66 | #define PIN_BUTTON_7 D7 //Hubitat Capabilities - Pushable Button/Holdable Button/Releasable Button (Normally Open!)

  |                                   ^~

C:\Users\norbert\Documents\Arduino\ST_Anything_Buttons_ESP8266WiFi\ST_Anything_Buttons_ESP8266WiFi.ino:134:59: note: in expansion of macro 'PIN_BUTTON_7'

134 | static st::IS_Button sensor7(F("button7"), PIN_BUTTON_7, 750, LOW, true, 500);

  |                                                           ^~~~~~~~~~~~

Multiple libraries were found for "Servo.h"

Used: C:\Users\norbert\Documents\ArduinoData\packages\esp8266\hardware\esp8266\3.0.2\libraries\Servo

Not used: C:\Program Files\WindowsApps\ArduinoLLC.ArduinoIDE_1.8.57.0_x86__mdqgnx93n4wtt\libraries\Servo

Not used: C:\Users\norbert\Documents\Arduino\libraries\Servo

exit status 1

'D1' was not declared in this scope; did you mean 'y1'?

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

What am I missing?

The example ESP8266 sketches all are written for the “NodeMCU” ESP8266 microcontroller boards. It sounds like you’ve chosen the Generic ESP8266 board from the Boards Manager. Select one of the NodeMCU ESP8266 boards and try compiling again.

Sure, I can add something to the first post, as well as the ReadMe. How about typing up what you feel would be helpful to new users, and I’ll add it?

Possibly. My reluctance historically has been the fact that the Arduino team appeared to be adding some form of standard OTA update feature, that might replace the somewhat microcontroller-specific OTA update solutions… :thinking:

There is a ESP32 OTA facility. I've used it. Arduino libs used from VS Code/Platformio

Compiled, thank you!

Here is my suggested test : )

Hubuino for ESP8266 has built in OTA (Over the Air) support. (ESP32 not yet supported)
For this to work you must install Python 2.7 on your computer. Note its important that you have
that version of Python.
You must first download your "Hubduino" sketch via usb/serial port to get the code loaded.
Once that is running in the ESP8266, it will broadcast an OTA device which looks like
ESP8266-xxxxxxxxxxxx at yy.yy.yy.yy Example ESP8266-4417931186E6 at 192.168.1.144
which is visible in the Arduino IDE in the tools->ports menu
If you select that device in the ports menu, you can then upload to the device over the air.
In the messages area, it will say "Uploading ...................."
When complete, in the darker status area above the messages it will say "Done uploading"
If you want a more descript host name, (instead of ESP8266-xxxxxxxxxxxx at yy.yy.yy.yy ),
you can add the desired host name as the last parameter on the SmartThingsESP8266WiFi constructor
In the example below Fireplace_ESP will be the host name and under ports you will then see
Fireplace_ESP at 192.168.1.144

st::Everything::SmartThing = new st::SmartThingsESP8266WiFi(str_ssid, str_password, ip, gateway, subnet, dnsserver, serverPort, hubIp, hubPort, st::receiveSmartString,"Fireplace_ESP");

Note: If you have Python2.7 and you can see the device but are unable to upload, try a different computer

1 Like

Done. I have added a slightly abbreviated version of your ESP8266 OTA text to the first post.

1 Like

I was trying to track the max luminescence value and timestamp...seems simple ...but for some reason, my IF check in yellow is always evaluating to true ..so even when the value is going down I still think its the max and update it
I would sure appreciate an assist as to what I'm doing wrong...

Your variable “Max” only exists temporarily inside the “if statement”. Each time that statement is called it is being created temporarily. Try using “state.Max” instead, as that will persist the value from run to run of the driver code in a “state” variable. Or, reference your custom Atrribute named Max’s current value (which is what I guess you’re attempting to do.). Use device.getCurrentValue(“Max") to return that value. :sunglasses:

In any event (sorry for the pun), questions like this should be asked in their own thread, instead of the HubDuino thread. Let’s try to keep general HubItat driver programming questions out of this thread to keep things on topic.

oops..sorry. :grimacing:Thanks for the help.

1 Like

Any thoughts on whether or not a device like this would work with Hubduino?

Been there, done that. But you’re not going to get very precise/accurate results. If simply want to know if an AC powered device is on or off, it has worked for other users. If you want to accurately measure power/energy, please consider buying an IoTaWatt whole home energy monitoring device + CTs. I wrote an integration for it for Hubitat as well.

Here is an example sketch.

I've seen this and am interested. Just gonna need some time to talk myself into it... and decide if I'm going to keep my Sense monitor or ditch it.

1 Like

I have a question re a problem i'm seeing, a problem of my own making i think! I finished my project (an alarm interface) but somehow fried my mega at the installation stage. Got a new board, reprogrammed etc - the ethernet shield is lighting up and the rj45 socket has solid green and flashing amber lights, but it is not talking to the PC. The serial monitor is showing as per the picture, and checking my router shows sure enough it has not been assigned an IP. Can i assume i killed the shield too?

Quick edit: i pulled the ethernet cable and the serial monitor reports the same info, looping the Smarthings Etherent Initialised message.

Yep, it looks like either the Ethernet Shield, the Cat5 cable, or the Ethernet Port on your network switch must be dead.