The Arduino IDE support for the ESP32 isn’t very mature, IMHO. I am not saying that is the cause of the problems you’re seeing, but it has caused issues in the past. It is hard to try to keep up with the ESP32 changes as I do not use one regularly.
You did grab the latest update (last night) from my Github repo that fixed a ESP32 WiFi lockup issue, right?
How are you powering the ESP32 when it is not connected to your computer? Some of these little boards with onboard WiFi need a decent power supply to run stably.
Yes, updated all my libraries as well… I honestly feel like I’m the problem though reading how everyone else is getting hung up in other places and I’m stuck just trying to connect to my SSID.
Ok, I’m an idiot. I knew the problem was me. So I was flashing to the wrong board type. I didn’t notice there are two versions of the ESP32 Dev kit. Everything works now.
I have revised every Parent and Child Device Handler in my GitHub repository. These changes are primarily to re-architect the communications between the Parent and Child devices, making it simpler to add new Child Devices in the future. It also helps to standardize the Child devices by replacing the custom ‘generateEvent()’ call with a traditional ‘parse()’ routine.
@vseven Allan - A special heads-up to you, as your contributions earlier have been tweaked by these changes. I do not believe I broke anything, however I wanted to caution you against jumping in and upgrading everything without doing some testing. I have no way of testing your RGB/RGBW child devices. If you take some time to do some testing, I’d love to hear your feedback.
I’ll double-check it this weekend but I doubt it should affect anything. The RGB DTH followed the same framework as all the other DTHs in regards to the generateEvent…it should just work.
Wanted to share what I’ve been doing and some advice. The esp32 boards wifi connection is unreliable at medium to far distances. So I picked up a few esp32 wifi/Lora boards. So the stations are sending packets thru RF only which should be good up to 1km+. I put these boards to sleep for a few minutes inbetween transmits to save battery/Solar. The stations aren’t using ST anything but just sending sensor data to a RF receiver board which also has wifi and close to the access point router. Its been very reliable. The receiver board picks up the RF packets and also parses the data to ST_Anything and ST via wifi. The problem, if considered so, is that I have several devices but the data is transmitted thru a single receiver board and MAC address. So all my stations show up under the same device name. So I need to incriment the object names so the stations dont overlap. Any way to make these stations show up as a stand alone devices but being sent from the same receiver board MAC id?
Here’s example of how I parse the received data. Each sender is sending a “Sender ID” so I know how to assign the ST object name.
//// Put value with ST Object name and send, ST objects Temperature1,2 & Voltage1,2 are reserved for the reciever board
if (millis() - STsendTimer > 240000) {
if (SensorReadings.SenderID == 1){ // Water Tank
String strTemp1("voltage3 " + (String)SensorReadings.bat_volt); st::Everything::sendSmartString(strTemp1); // voltage3 BBQ BatVolt
String strTemp2("voltage4 " + (String)SensorReadings.sol_volt); st::Everything::sendSmartString(strTemp2); //
String strTemp3("temperature3 " + (String)SensorReadings.temp1); st::Everything::sendSmartString(strTemp3);
String strTemp4("temperature4 " + (String)SensorReadings.temp2); st::Everything::sendSmartString(strTemp4);
String strTemp5("ultrasonic1 " + (String)SensorReadings.Ultrasonic1); st::Everything::sendSmartString(strTemp5);
}
else if (SensorReadings.SenderID == 2){ // Shooting Bench
String strTemp1("voltage5 " + (String)SensorReadings.bat_volt); st::Everything::sendSmartString(strTemp1); //
String strTemp2("voltage6 " + (String)SensorReadings.sol_volt); st::Everything::sendSmartString(strTemp2); //
String strTemp3("temperature5 " + (String)SensorReadings.temp1); st::Everything::sendSmartString(strTemp3);
String strTemp4("temperature6 " + (String)SensorReadings.temp2); st::Everything::sendSmartString(strTemp4);
}
STsendTimer = millis();
}
Only one Parent Device can exist per MAC address (device network id). That parent can have lots a child devices. Each child device can be renamed as you see fit, to have them sort together logically in the Things View if desired.
Both your temp sensor and the relay are ST_Anything devices? Which capability are you using for each? This is the code that I added to the ST_Anything sketch to get the relay to turn on when the contact is open and off when the contact is closed.
void callback(const String &msg)
void callback(const String &msg){
if (msg == "contact1 open") {st::receiveSmartString("switch1 on");}
if (msg == "contact1 closed") {st::receiveSmartString("switch1 off");}}
If you want to sniff out the messages you need to use, add these lines below the void callback:
Serial.print(F("ST_Anything Callback: Sniffed data = "));
Serial.println(msg);
Do any of the 2.9.1 changes affect our existing sketches or do those have to get updated as well? Don’t want to update and then have everything not work all of a sudden.