Replies: 2 comments
-
|
Você pode usar a biblioteca WiFi.h + HTTPClient.h (para ESP32/ESP8266): #include <WiFi.h> const char* ssid = "SEU_WIFI"; void setup() { void loop() { |
Beta Was this translation helpful? Give feedback.
-
|
You're close! A couple of things to fix from the existing reply — it uses ESP32's <WiFi.h> (won't compile on ESP8266) and has a typo: m=udevice should be param=udevice, matching your working browser URL exactly. const char* ssid = "YOUR_WIFI_SSID"; const char* domoticzHost = "192.168.178.170"; void setup() { Serial.print("Connecting to WiFi"); void sendTemperature(float temperature) { WiFiClient client; String url = "http://" + String(domoticzHost) + ":" + String(domoticzPort) + http.begin(client, url); if (httpCode > 0) { http.end(); void loop() { ESP8266WiFi.h/ESP8266HTTPClient.h instead of ESP32's WiFi.h — this is the ESP8266 Arduino core repo, so the ESP32 headers won't even compile here. If your Domoticz instance requires HTTPS or basic auth instead of passcode=, that changes http.begin() slightly — happy to adjust if that's your setup. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I've searched the internet for a long time, but I can't find it. Is it already available somewhere, or can anyone help me?
The problem lies with the connection from Arduino to Domoticz. In an Arduino program, I want to send the following to a DummySensor in Domoticz:
http://192.168.178.170:8080/json.htm?type=command¶m=udevice&idx=335&nvalue=0&svalue=22&passcode=domoticz
This works perfectly when I enter it directly into the browser, but I have no idea how to do that in Arduino.
Can anyone help me with a hint on how to do that or where I can find it?
Thanx, Rien
Beta Was this translation helpful? Give feedback.
All reactions