Newbie: Can't get SendToHTTP to work

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
Black_Knight
New user
Posts: 7
Joined: 30 Jun 2018, 00:02

Newbie: Can't get SendToHTTP to work

#1 Post by Black_Knight » 30 Jun 2018, 00:16

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.

papperone
Normal user
Posts: 497
Joined: 04 Oct 2016, 23:16

Re: Newbie: Can't get SendToHTTP to work

#2 Post by papperone » 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>]"
My TINDIE Store where you can find all ESP8266 boards I manufacture --> https://www.tindie.com/stores/GiovanniCas/
My Wiki Project page with self-made PCB/devices --> https://www.letscontrolit.com/wiki/inde ... :Papperone

User avatar
grovkillen
Core team member
Posts: 3621
Joined: 19 Jan 2017, 12:56
Location: Hudiksvall, Sweden
Contact:

Re: Newbie: Can't get SendToHTTP to work

#3 Post by grovkillen » 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
ESP Easy Flasher [flash tool and wifi setup at flash time]
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you :idea: :idea: :idea:

Black_Knight
New user
Posts: 7
Joined: 30 Jun 2018, 00:02

Re: Newbie: Can't get SendToHTTP to work

#4 Post by Black_Knight » 01 Jul 2018, 12:27

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?

Black_Knight
New user
Posts: 7
Joined: 30 Jun 2018, 00:02

Re: Newbie: Can't get SendToHTTP to work

#5 Post by Black_Knight » 01 Jul 2018, 12:40

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.

User avatar
grovkillen
Core team member
Posts: 3621
Joined: 19 Jan 2017, 12:56
Location: Hudiksvall, Sweden
Contact:

Re: Newbie: Can't get SendToHTTP to work

#6 Post by grovkillen » 01 Jul 2018, 12:57

Code: Select all

Clock#Time=All **:**
Should be

Code: Select all

Clock#Time=All,**:**
ESP Easy Flasher [flash tool and wifi setup at flash time]
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you :idea: :idea: :idea:

User avatar
grovkillen
Core team member
Posts: 3621
Joined: 19 Jan 2017, 12:56
Location: Hudiksvall, Sweden
Contact:

Re: Newbie: Can't get SendToHTTP to work

#7 Post by grovkillen » 01 Jul 2018, 12:59

But are you trying to send the value to a 7 segment display connected to the same unit?
ESP Easy Flasher [flash tool and wifi setup at flash time]
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you :idea: :idea: :idea:

Black_Knight
New user
Posts: 7
Joined: 30 Jun 2018, 00:02

Re: Newbie: Can't get SendToHTTP to work

#8 Post by Black_Knight » 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

papperone
Normal user
Posts: 497
Joined: 04 Oct 2016, 23:16

Re: Newbie: Can't get SendToHTTP to work

#9 Post by papperone » 01 Jul 2018, 19:22

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 :(
My TINDIE Store where you can find all ESP8266 boards I manufacture --> https://www.tindie.com/stores/GiovanniCas/
My Wiki Project page with self-made PCB/devices --> https://www.letscontrolit.com/wiki/inde ... :Papperone

User avatar
grovkillen
Core team member
Posts: 3621
Joined: 19 Jan 2017, 12:56
Location: Hudiksvall, Sweden
Contact:

Re: Newbie: Can't get SendToHTTP to work

#10 Post by grovkillen » 01 Jul 2018, 19:22

Enddo is wrong though, EndOn is correct
ESP Easy Flasher [flash tool and wifi setup at flash time]
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you :idea: :idea: :idea:

Black_Knight
New user
Posts: 7
Joined: 30 Jun 2018, 00:02

Re: Newbie: Can't get SendToHTTP to work

#11 Post by Black_Knight » 01 Jul 2018, 23:33

grovkillen wrote: 01 Jul 2018, 19:22 Enddo is wrong though, EndOn is correct
Nice catch. Odd it's working though.

Post Reply

Who is online

Users browsing this forum: No registered users and 31 guests