Device Disconnects

I am now at the point where I have an ESP8266 device that I added to the Gateway and am able to communicate with it. However, after some minutes, the device disconnects. I can still see it on my router, I can get the JSON schema if it go to the IP address, but if I click on the device in the Gateway, it displays Disconnect. To get it back, I have to delete it, reboot the Gateway and re-add it.

Try adding your devices by IP address, rather than using the auto-detected ones. You can click “Add by URL…” on the add things page and type in http://<ip-address>/things/<id>.

1 Like

Hi I am having similar issue using ESP8266 and ESP32. Running two DS18B20 sensors. They read values ok, but after few minutes (3-5) it disconnects.
I am running gateway on a Raspberry Pi 3, all conected to local wifi wpa2 network.
Latest version gateway and libraries

Any ideas?

My arduino ide adpater:

WebThingAdapter *adapter;

const char *sensorTypes[] = {“TemperatureSensor”, nullptr};
ThingDevice weather(“ds18b20”, “ds18b20 Weather Sensor”, sensorTypes);
ThingProperty weatherTemp(“temperature”, “”, NUMBER, “TemperatureProperty”);
ThingProperty weatherTemp2(“temperature2”, “”, NUMBER, “TemperatureProperty”);

In my application, because I am going to be using seven ESP8266s to control planter irrigation, I modify the address away from the standard http://<ip-address>/things/<id> by substituting a device code in place of the ‘/things/’

Do you do anything like this Godzilla?

rwpaar thank you so much for the reply!
No I am just using autodetect. How do you obtain data for what you are doing: ip-address, id, device code? Please explain.
I am simply not able to get rid of these disconnects.
I tried to add device by URL but it did not work, I tried ip address:8080

ESP8266 is awesome! I just tried both and the esp32 has more analog inputs so I like that.

I suspect that you are fumbling around in the dark as much as I am. I am using the Arduino IDE to program the ESP and in that program is where I was building the IP address. I print the IP address to the IDE Serial Monitor following connection (see below)

I tried to build into the address a code for the planter - I was substituting things like “/BBW/” (Blueberry West) in place of the “/things/”. Now that I have pulled that code and began using “/things/”, added things seem to stay added - at least for the last half hour or so.

// Start mDNS and HTTP server
adapter->begin();
Serial.println("HTTP server started");
Serial.print("http://");
Serial.print(WiFi.localIP());
Serial.print("/things/");
Serial.println(MultiLevelSensor.id);

rwpaar, hmm I don’t think this is a problem in my case. I use the /things/ so that looks ok.
I have two sensors in my ESP, now after some research I am thinking there might be a problem in the JSON buffers as stated here at the bottom of the page