SendToHttp Raw-Message
Moderators: grovkillen, Stuntteam, TD-er
SendToHttp Raw-Message
Hello,
is it possible to send a RAW-Message from an ESPEasy-Device to another ESP-Device without ESPEasy, using SendToHttp?
"http://192.168.1.137/set_ist?IstTemp=21" for sending a value is working from a Browser.
But sending from ESPEasy it doesn't work.
Any ideas?
Greetings
is it possible to send a RAW-Message from an ESPEasy-Device to another ESP-Device without ESPEasy, using SendToHttp?
"http://192.168.1.137/set_ist?IstTemp=21" for sending a value is working from a Browser.
But sending from ESPEasy it doesn't work.
Any ideas?
Greetings
Re: SendToHttp Raw-Message
What syntax did you use?
Code: Select all
sendtohttp,192.168.1.137,80,/set_ist?IstTemp=21
Re: SendToHttp Raw-Message
Here is a Logging info:
5218580: ACT : sendtohttp,192.168.1.137,80,/set_ist?IstTemp=21
5218582: Command: sendtohttp
5218692: ACT : timerSet,1,30
5218693: Command: timerSet
but nothing received.
5218580: ACT : sendtohttp,192.168.1.137,80,/set_ist?IstTemp=21
5218582: Command: sendtohttp
5218692: ACT : timerSet,1,30
5218693: Command: timerSet
but nothing received.
Re: SendToHttp Raw-Message
Does the other end require login?
Can you also try to check "SendToHTTP wait for ack" on Tools->Advanced page?
Can you also try to check "SendToHTTP wait for ack" on Tools->Advanced page?
Re: SendToHttp Raw-Message
No login required.
I don't find "SendToHTTP wait for ack".
Is this Image to old? "ESP_Easy_mega-20191208_dev_ESP8266_4M1M.bin"
I don't find "SendToHTTP wait for ack".
Is this Image to old? "ESP_Easy_mega-20191208_dev_ESP8266_4M1M.bin"
Re: SendToHttp Raw-Message
I think it is less than 10 months ago that I added this feature.
Re: SendToHttp Raw-Message
Now i tried the newest release with the Option "SendToHTTP wait for ack" but it doesn't work.
By sending only the IP-Address the receiving Device had to answer, but no reaction.
The syntax above is ok?
By sending only the IP-Address the receiving Device had to answer, but no reaction.
The syntax above is ok?
Re: SendToHttp Raw-Message
Just a few checks you can do:
Is the IP you try to reach in the same subnet as your ESP?
Do you use DHCP or static IP on the ESP? If static, please check you have the correct configuration, like correct gateway (needed when you try to reach something not in your subnet), correct subnetmask (e.g. 255.255.255.0 )
As far as I can judge from your log, the syntax looks OK.
Is the IP you try to reach in the same subnet as your ESP?
Do you use DHCP or static IP on the ESP? If static, please check you have the correct configuration, like correct gateway (needed when you try to reach something not in your subnet), correct subnetmask (e.g. 255.255.255.0 )
As far as I can judge from your log, the syntax looks OK.
Re: SendToHttp Raw-Message
Additional the ESPEasy-Device is connected to Fhem, and is working. Can this be possibly the problem?
All is in the same subnet, DHCP is used.
All is in the same subnet, DHCP is used.
Re: SendToHttp Raw-Message
What other device is it where you want to connect to?
If you enable the debug log level you will see the actual request being sent. (given you have debug log level code included in the build, which isn't the case with "test" builds due to size restrictions)
This is only logged if the connection could be made to the other side.
As far as I can see in the code, there is (sadly) no other log indicating a failed connect.
So at least the command sendtohttp should also return a false state if it was not successful. (which it doesn't right now)
If you enable the debug log level you will see the actual request being sent. (given you have debug log level code included in the build, which isn't the case with "test" builds due to size restrictions)
This is only logged if the connection could be made to the other side.
As far as I can see in the code, there is (sadly) no other log indicating a failed connect.
So at least the command sendtohttp should also return a false state if it was not successful. (which it doesn't right now)
Re: SendToHttp Raw-Message
I just added an error log.
Can you test this test build?
https://www.dropbox.com/s/n1lyowdzksxww ... 4.zip?dl=0
https://www.dropbox.com/s/n1lyowdzksxww ... 4.zip?dl=0
Can you test this test build?
https://www.dropbox.com/s/n1lyowdzksxww ... 4.zip?dl=0
https://www.dropbox.com/s/n1lyowdzksxww ... 4.zip?dl=0
Re: SendToHttp Raw-Message
Unfortunately i have only esp8266 in use
I tested UDP, it dont work too. With the tool Packet Sender it works.
I tested UDP, it dont work too. With the tool Packet Sender it works.
Re: SendToHttp Raw-Message
Sorry, made a copy/paste error.
Here's the ESP8266 build: https://www.dropbox.com/s/92maswz93cww1 ... 4.zip?dl=0
Here's the ESP8266 build: https://www.dropbox.com/s/92maswz93cww1 ... 4.zip?dl=0
Re: SendToHttp Raw-Message
Here is the error:
801437: Webserver args: 0: 'cmd' length: 47
805550: SendToHTTP connection failed
801437: Webserver args: 0: 'cmd' length: 47
805550: SendToHTTP connection failed
Re: SendToHttp Raw-Message
So it cannot make a connection to the other host.
Just make sure the port is correct and the rest of the URL.
You only showed what was logged, but can you also show (verbatim in code tags) the exact command you give?
Just make sure the port is correct and the rest of the URL.
You only showed what was logged, but can you also show (verbatim in code tags) the exact command you give?
Re: SendToHttp Raw-Message
This is what i have in the rules Set:
On Rules#Timer=1 do
SendToHTTP 192.168.1.137,80,/set_ist?IstTemp=21
timerSet,1,30
endon
Port is the same in the other device, and the command is working from a Browser.
or only this line in Tools/Command:
" SendToHTTP 192.168.1.137,80,/set_ist?IstTemp=21"
On Rules#Timer=1 do
SendToHTTP 192.168.1.137,80,/set_ist?IstTemp=21
timerSet,1,30
endon
Port is the same in the other device, and the command is working from a Browser.
or only this line in Tools/Command:
" SendToHTTP 192.168.1.137,80,/set_ist?IstTemp=21"
Re: SendToHttp Raw-Message
Can you show the log (please include a line before and after, and any lines inbetween the cmd and sendtohttp lines) when sending it from the tools page (then it is working, as I read from your comment)?
Does it change if you copy the SendToHTTP command from the rules to your tools page and execute it?
/Ton (PayPal.me)
Re: SendToHttp Raw-Message
No, both don't work.
this is the logoutput:
5599211: Webserver args: 0: 'cmd' length: 54
5599220: Command: SendToHTTP
5599221: SendToHTTP: Host: http://192.168.1.137 port: 80
5603362: SendToHTTP connection failed
if i send this:
" SendToHTTP 192.168.1.137,80,/set_ist?IstTemp=21"
from the tools-page.
this is the logoutput:
5599211: Webserver args: 0: 'cmd' length: 54
5599220: Command: SendToHTTP
5599221: SendToHTTP: Host: http://192.168.1.137 port: 80
5603362: SendToHTTP connection failed
if i send this:
" SendToHTTP 192.168.1.137,80,/set_ist?IstTemp=21"
from the tools-page.
Re: SendToHttp Raw-Message
Does your receiving ESP use ip filtering, just like ESPEasy (see Hardware tab)? and if so, is the sending ESP in the allowed range?
It looks much like the ESP's can't or won't see each other on the network. That includes having the sending ESP on a separate 'IoT' or guest network, that your router may not allow to access other segments of your network.
It looks much like the ESP's can't or won't see each other on the network. That includes having the sending ESP on a separate 'IoT' or guest network, that your router may not allow to access other segments of your network.
/Ton (PayPal.me)
Re: SendToHttp Raw-Message
All ESPs are in the same network. Ping from PC is ok for all devices.
Re: SendToHttp Raw-Message
IP-filtering is only for access to the web interface.
Re: SendToHttp Raw-Message
Please show the network related part of the sysinfo page.
Just to be sure we're not missing something here.
Just to be sure we're not missing something here.
Re: SendToHttp Raw-Message
Here it is:
Wifi: 802.11N (RSSI -44 dB)
IP Config: DHCP
IP / Subnet: 192.168.1.132 / 255.255.255.0
Gateway: 192.168.1.5
Client IP: 192.168.1.2
DNS: 192.168.1.5 / (IP unset)
Allowed IP Range: 192.168.1.0 - 192.168.1.255
STA MAC: EC:FA:BC:9B:E8:4D
AP MAC: EE:FA:BC:9B:E8:4D
SSID: X-NET-X (38:10:D5:D5:B0:8F)
Channel: 11
Connected: 4h37m
Last Disconnect Reason: (1) Unspecified
Number Reconnects: 0
Wifi: 802.11N (RSSI -44 dB)
IP Config: DHCP
IP / Subnet: 192.168.1.132 / 255.255.255.0
Gateway: 192.168.1.5
Client IP: 192.168.1.2
DNS: 192.168.1.5 / (IP unset)
Allowed IP Range: 192.168.1.0 - 192.168.1.255
STA MAC: EC:FA:BC:9B:E8:4D
AP MAC: EE:FA:BC:9B:E8:4D
SSID: X-NET-X (38:10:D5:D5:B0:8F)
Channel: 11
Connected: 4h37m
Last Disconnect Reason: (1) Unspecified
Number Reconnects: 0
Re: SendToHttp Raw-Message
Meanwhile i tried to check the packets with Wireshark.
I didn't get packets from the sending device by using the SendToHttp-command as shown above, but packets to fhem are shown.
As i see, the device doesn't send the command.
Can anybody confirm that the command is working?
I didn't get packets from the sending device by using the SendToHttp-command as shown above, but packets to fhem are shown.
As i see, the device doesn't send the command.
Can anybody confirm that the command is working?
Re: SendToHttp Raw-Message
Is the receiving ESP by any chance using https as the protocol? Because your browser does connect, but most browsers nearly automatically use https.
ESPEasy doesn't support https (because of memory, flash-size and CPU restrictions), but a specific, maybe single function, ESP software can use https.
ESPEasy doesn't support https (because of memory, flash-size and CPU restrictions), but a specific, maybe single function, ESP software can use https.
/Ton (PayPal.me)
Re: SendToHttp Raw-Message
It's no https. Here are the most important parts from the WIFI-Settings of the receiving-device-sketch.
It should be all that i need:
#include <ESP8266WiFi.h>
#include <WiFiUDP.h>
#include <WiFiClient.h>
#include <ESP8266WebServer.h>
#include <ESP8266mDNS.h>
#include <ESP8266HTTPUpdateServer.h>
IPAddress ip(192, 168, 1, 137);
IPAddress gateway(192, 168, 1, 5);
IPAddress subnet(255, 255, 255, 0);
ESP8266WebServer httpServer(80);
ESP8266HTTPUpdateServer httpUpdater;
WiFiUDP UDP;
WiFi.mode(WIFI_STA);
WiFi.hostname("Test");
WiFi.config(ip, gateway, subnet);
WiFi.begin(ssid, password);
UDP.begin(UDP_PORT);
httpUpdater.setup(&httpServer);
httpServer.begin();
MDNS.addService("http", "tcp", 80);
httpServer.on("/", handleRoot);
It should be all that i need:
#include <ESP8266WiFi.h>
#include <WiFiUDP.h>
#include <WiFiClient.h>
#include <ESP8266WebServer.h>
#include <ESP8266mDNS.h>
#include <ESP8266HTTPUpdateServer.h>
IPAddress ip(192, 168, 1, 137);
IPAddress gateway(192, 168, 1, 5);
IPAddress subnet(255, 255, 255, 0);
ESP8266WebServer httpServer(80);
ESP8266HTTPUpdateServer httpUpdater;
WiFiUDP UDP;
WiFi.mode(WIFI_STA);
WiFi.hostname("Test");
WiFi.config(ip, gateway, subnet);
WiFi.begin(ssid, password);
UDP.begin(UDP_PORT);
httpUpdater.setup(&httpServer);
httpServer.begin();
MDNS.addService("http", "tcp", 80);
httpServer.on("/", handleRoot);
Re: SendToHttp Raw-Message
Problem is solved:
Checkbox in my Fritzbox: "Die unten angezeigten aktiven WLAN-Geräte dürfen untereinander kommunizieren" marked, then it works.
Checkbox in my Fritzbox: "Die unten angezeigten aktiven WLAN-Geräte dürfen untereinander kommunizieren" marked, then it works.
Re: SendToHttp Raw-Message
That's for the guest network?
I've not seen that option in the normal WiFi.. when I still had a Fritzbox router.
I've not seen that option in the normal WiFi.. when I still had a Fritzbox router.
Re: SendToHttp Raw-Message
It is widely known as a client-to-client-isolation at the AP level on most WiFi devices
But the http request shall return via the gateway so it should work anyways unless there is no other routing rule enabled at that level.
-D
-D
Re: SendToHttp Raw-Message
It's in WLAN/Sicherheit/Verschlüsselung FB7490 FW7.21
Who is online
Users browsing this forum: No registered users and 64 guests