Hi again @saif76 and @ogiewon
I’ve now been busy for a few hours and have made some headway. I’ve learned how and managed to program the ESP8266 (ESP-01 Standalone version) and I think I know how to compile the sketch.
I got so far as to get the On/Off LED ST device working. I messed this up however by writing @saif76’s sketch to the ESP8266, which made me realize that one can only write one sketch at a time. I suppose I have to add the libraries together and write them all at the same time as one sketch to the chip?
I noticed the following in the heading of your sketch:
- String &name - REQUIRED - the name of the object - must match the Groovy ST_Anything DeviceType tile name // - long interval - REQUIRED - the polling interval in seconds // - long offset - REQUIRED - the polling interval offset in seconds - used to prevent all polling sensors from executing at the same time // - byte digitalTriggerPin - REQUIRED - the Arduino Pin to be used as a digital output to trigger ultrasonic // - byte digitalEchoPin - REQUIRED - the Arduino Pin to be used as a digital input to read the echo //
Am I correct that I have to add this info here:
PS_Ultrasonic(const __FlashStringHelper *name, unsigned int interval, int offset, byte digitalTriggerPin, byte digitalEchoPin);
If I’m correct, could you help me with the Groovy ST_Anything name? Not sure which DH info I should add there. Should it be Child Ultrasonic Sensor?
Which brings me to another question - once the ESP8266 has been programmed, how did you hook-up the chip to power and the Ultrasonic Sensor? The Sensor came with its own board, but so far I’ve been unable to determine how that should be connected.
Sorry for the newbie questions and thanks again for your assistance.
Edit: I don’t know if I’ve been going at this for too long now, but I don’t think I have any idea of how to combine the sketches and which ones I have to use. My goal is (at this stage) to only use the Ultrasonic Sensor, connected to an ESP-01, to measure the water level in a tank. I managed to do the LED On/Off thing in @ogiewon’s example, but now I stuck. I don’t know which of his sketches I should use and how @Saif76’s sketch for the Ultrasonic sensor, should be added to that.
I made the changes to the parent-st-anything-ethernet DTH.