Page 1 of 1
Newbie: Can't get SendToHTTP to work
Posted: 30 Jun 2018, 00:16
by Black_Knight
New to EspEasy so go (esp)easy on me.
My setup
I've got my wemod1 mini running the latest release (
here).
I've got a BMP280 connected up and reporting back temperatures to me. Happy days.
I also have a TM1637 7 Segment display connected up and working with the built in features (clock, date etc.), so it's connected up and working fine.
My problem
My problem comes when I want to display the current temperature from the BMP280 on the 7seg display. Hitting the IP address with the control endpoint works a charm (eg.
http://192.168.0.93/control?cmd=7dt,25.0) but I cannot get the SendToHttp to work for me, for whatever reason. I enabled rules and here's my code:
Code: Select all
on Clock#Time=All **:** do
SendToHTTP 192.168.0.93,80,/control?cmd=7dt,25
enddo
I sit and wait, but nothing happens. I'd hope to adapt this to pull the value from the BMP280 sensor, but first things first I need to get something to display automatically.
I got this far by following the
7 seg unit wiki page , and I've checked out others usage of SendToHTTP but I don't see how or what im doing wrong. I'm hoping i'm doing something stupid here and simple to point me in the right direction.
Re: Newbie: Can't get SendToHTTP to work
Posted: 30 Jun 2018, 08:58
by papperone
not sure I understood...
do you want to have 2 devices communicate each other? or you have a single Wemos with both BMP280 and TM1637?
if it's the second setup then you don't need to sendhttp to the same module but you should be able to use directly the command "7dt,[<sensor>#<value>]"
Re: Newbie: Can't get SendToHTTP to work
Posted: 30 Jun 2018, 09:01
by grovkillen
The problem is that you try to use the command with an URL.
The wiki states:
Code: Select all
SendToHTTP <IP address>, <Portnumber>, <command>
//Or
SendToHTTP <domain>, <Portnumber>, </url>
So change your rule to:
Code: Select all
on Clock#Time=All **:** do
SendToHTTP 192.168.0.93,80,7dt,25
enddo
Re: Newbie: Can't get SendToHTTP to work
Posted: 01 Jul 2018, 12:27
by Black_Knight
papperone wrote: ↑30 Jun 2018, 08:58
not sure I understood...
do you want to have 2 devices communicate each other? or you have a single Wemos with both BMP280 and TM1637?
if it's the second setup then you don't need to sendhttp to the same module but you should be able to use directly the command "7dt,[<sensor>#<value>]"
Correct. The second setup. 1 Wemos, 2 devices.
When you said I should be able to use directly the command"7dt.[<sensor>#<value>], do you mean via the Tools Command field or via a rule?
A bit more detail here. My BMP280 device is called BMP280, and the value I want to use is "Temperature". Should I be able to enter the command "7dt,[BMP280#Temperature]" in the Tools Command input, or is this only for use in a Rule? What event do I use in that case?
Re: Newbie: Can't get SendToHTTP to work
Posted: 01 Jul 2018, 12:40
by Black_Knight
grovkillen wrote: ↑30 Jun 2018, 09:01
The problem is that you try to use the command with an URL.
The wiki states:
Code: Select all
SendToHTTP <IP address>, <Portnumber>, <command>
//Or
SendToHTTP <domain>, <Portnumber>, </url>
So change your rule to:
Code: Select all
on Clock#Time=All **:** do
SendToHTTP 192.168.0.93,80,7dt,25
enddo
I tried this before, but got the same result (nothing happening). I can see in the logs that it looks like it's trying to set the 7seg but then I guess it fails. On the clock event here's my logs:
Code: Select all
390865: EVENT: Clock#Time=Sun,10:33
390871: ACT : SendToHTTP 192.168.0.93,80,7dt,25
390886: Command: sendtohttp
395895: MQTT : Connection lost
395895: EVENT: MQTT#Disconnected
395929: MQTT : Connected to broker with client ID: ESPClient_68:C6:3A:D6:3D:0D
395932: Subscribed to: /ESPEasy_TempSensor/#
395933: EVENT: MQTT#Connected
Or, I dont see any clock events at all.
Re: Newbie: Can't get SendToHTTP to work
Posted: 01 Jul 2018, 12:57
by grovkillen
Re: Newbie: Can't get SendToHTTP to work
Posted: 01 Jul 2018, 12:59
by grovkillen
But are you trying to send the value to a 7 segment display connected to the same unit?
Re: Newbie: Can't get SendToHTTP to work
Posted: 01 Jul 2018, 18:55
by Black_Knight
Correct. 7seg s on the same display.
I must have been doing something stupid though. I got it working a few hours ago and it's been updating ever since.
This is my Rule:
Code: Select all
on Clock#Time=All **:** do
7dt,[BMP280#Temperature]
enddo
Re: Newbie: Can't get SendToHTTP to work
Posted: 01 Jul 2018, 19:22
by papperone
Black_Knight wrote: ↑01 Jul 2018, 18:55
Correct. 7seg s on the same display.
I must have been doing something stupid though. I got it working a few hours ago and it's been updating ever since.
This is my Rule:
Code: Select all
on Clock#Time=All **:** do
7dt,[BMP280#Temperature]
enddo
well, I thought you read as it was exactly my first suggestion right after you open this thread
Re: Newbie: Can't get SendToHTTP to work
Posted: 01 Jul 2018, 19:22
by grovkillen
Enddo is wrong though, EndOn is correct
Re: Newbie: Can't get SendToHTTP to work
Posted: 01 Jul 2018, 23:33
by Black_Knight
grovkillen wrote: ↑01 Jul 2018, 19:22
Enddo is wrong though, EndOn is correct
Nice catch. Odd it's working though.