File tree Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -47,7 +47,7 @@ void Influxdb::setBucket(String bucket) {
47
47
}
48
48
49
49
/* *
50
- * Set the influxDB port.
50
+ * Set the influxDB port.
51
51
* @param port v1.x uses 8086, v2 uses 9999
52
52
*/
53
53
void Influxdb::setPort (uint16_t port){
@@ -163,11 +163,21 @@ boolean Influxdb::write(String data) {
163
163
Serial.print (" <-- Response: " );
164
164
Serial.print (httpResponseCode);
165
165
166
+ #if defined(ESP32)
167
+ if (http.getSize () > 0 ) {
168
+ String response = http.getString ();
169
+ Serial.println (" \" " + response + " \" " );
170
+ }
171
+ else {
172
+ Serial.println ();
173
+ }
174
+ #else
166
175
String response = http.getString ();
167
176
Serial.println (" \" " + response + " \" " );
177
+ #endif
168
178
169
179
boolean success;
170
- if (httpResponseCode == 204 ) {
180
+ if (httpResponseCode == HTTP_CODE_NO_CONTENT ) {
171
181
success = true ;
172
182
} else {
173
183
Serial.println (" #####\n POST FAILED\n #####" );
You can’t perform that action at this time.
0 commit comments