Big wish - generall HTTP and MQTT Interfaces
Moderators: grovkillen, Stuntteam, TD-er
Big wish - generall HTTP and MQTT Interfaces
Is it maybe possible to have in future Versions a General HTTP Interface ?
There are many Units that could be controlled by smple http-requests like http://192.168.1.1/myswitch/on
This would make it easy to use the System for many applications, without needing interfacés for each
Regards
Klaus
There are many Units that could be controlled by smple http-requests like http://192.168.1.1/myswitch/on
This would make it easy to use the System for many applications, without needing interfacés for each
Regards
Klaus
Re: Big wish - generall HTTP and MQTT Interfaces
I will +1 this request here
As I say on my presentation, general HTTP will permit for exemple to have Jeedom working for receiving push and sending request to ESPeasy. That's all what is needed a general option with the URL for push to give (like many alarm, IPX and other hardware have)
For MQTT they are already general, just missing the topic schema somewhere will be good but that's working with any MQTT broker (at least if you want pure values and not json, don't take domoticz MQTT type)
As I say on my presentation, general HTTP will permit for exemple to have Jeedom working for receiving push and sending request to ESPeasy. That's all what is needed a general option with the URL for push to give (like many alarm, IPX and other hardware have)
For MQTT they are already general, just missing the topic schema somewhere will be good but that's working with any MQTT broker (at least if you want pure values and not json, don't take domoticz MQTT type)
Re: Big wish - generall HTTP and MQTT Interfaces
For MQTT just select OpenHAB and feed into mqttwarn - then it's easy to transform it to any other form of MQTT - even json. This approach should also work for HTTP, as there's a HTTP output module for mqttwarn. I use it to send MQTT data into influxdb and POST/GET to different URL'slunarok wrote:I will +1 this request here
As I say on my presentation, general HTTP will permit for exemple to have Jeedom working for receiving push and sending request to ESPeasy. That's all what is needed a general option with the URL for push to give (like many alarm, IPX and other hardware have)
For MQTT they are already general, just missing the topic schema somewhere will be good but that's working with any MQTT broker (at least if you want pure values and not json, don't take domoticz MQTT type)
- Jan
Jan Chrillesen, Denmark
Re: Big wish - generall HTTP and MQTT Interfaces
mqttwarn Looks interesting, but my Approach would be to the esp in another Network, like at friends, parents, work
is there an open mqttwarn Server ? it Looks like i have to have a Server then in the firnds house ?
is there an open mqttwarn Server ? it Looks like i have to have a Server then in the firnds house ?
Re: Big wish - generall HTTP and MQTT Interfaces
You can use a single mqttwarn instance for multiple locations, as long as the modules publishes to different topics. You can host a broker and a mqttwarn at home and your friends can connect to that, or you can use a public broker, that everyone connects to - including your mqttwarn instance.kr0815 wrote:mqttwarn Looks interesting, but my Approach would be to the esp in another Network, like at friends, parents, work
is there an open mqttwarn Server ? it Looks like i have to have a Server then in the firnds house ?
- Jan
Jan Chrillesen, Denmark
Re: Big wish - generall HTTP and MQTT Interfaces
Yeah, but if you already use MQTT, it's done you have it in your home automation software (at least for the ones with the right plugins)
General HTTP is simplier, no MQTT broker, no mqttwarn, direct to home automation platform
General HTTP is simplier, no MQTT broker, no mqttwarn, direct to home automation platform
Re: MySensors goes ESP!!
You are totally right about there is no real standart.
a few weeks ago, i wasn´t even thinking about MQTT, i have it installed now, funny to Play with, and it works.
But for simple things / beginners, it´s to complicated, starting already with the needed Broker....
I don´t know about domotics, i´m using Fhem,
FHEM supports many Hardware Interfaces, but it could also be controlled by Telnet or HTTP
A HTTP command, for example, Looks like:
http://<fhem>:8083/fhem?cmd.dummy=set%20dummy%20on&XHR=1
Are such things not possible in Domoticz?
My thinking / wish about a "generall" HTTP-Interface would be:
- possibilty to use Names instead of ip, so i could connect to http://example.com
- possibility to format the Output similar to the MQTT Publishing template already build in
example:
MQTT Publish Template: /fhem/Sensor1/%id%/%valname%
in my case that would be then
/fhem?cmd.dummy=set%id%value&XHR=1
I´m not a good programmer, hacking at the Moment the Thingspeak-Interface for my needs, but would be nice to have a generall solution ?
a few weeks ago, i wasn´t even thinking about MQTT, i have it installed now, funny to Play with, and it works.
But for simple things / beginners, it´s to complicated, starting already with the needed Broker....
I don´t know about domotics, i´m using Fhem,
FHEM supports many Hardware Interfaces, but it could also be controlled by Telnet or HTTP
A HTTP command, for example, Looks like:
http://<fhem>:8083/fhem?cmd.dummy=set%20dummy%20on&XHR=1
Are such things not possible in Domoticz?
My thinking / wish about a "generall" HTTP-Interface would be:
- possibilty to use Names instead of ip, so i could connect to http://example.com
- possibility to format the Output similar to the MQTT Publishing template already build in
example:
MQTT Publish Template: /fhem/Sensor1/%id%/%valname%
in my case that would be then
/fhem?cmd.dummy=set%id%value&XHR=1
I´m not a good programmer, hacking at the Moment the Thingspeak-Interface for my needs, but would be nice to have a generall solution ?
Re: Domoticz Native integration
Again this has already been asked, but if the http protocol was generic and configurable in ESPeasy, it will be usefull for other home automation software.
If Domoticz cannot use a dummy device like any other device it's not the case for alls. FHEM, Jeedom and a lot more will be happy to have it open.
Me for exemple, in Jeedom I will prefer just a general http configuration so the node can push to the home automation (whatever with a json body or full values in URL, I will take care of it) than just another way to have a network with a gateway. ESPeasy is different and nice to play without any need for a gateway and a web interface in addition to the home automation
If Domoticz cannot use a dummy device like any other device it's not the case for alls. FHEM, Jeedom and a lot more will be happy to have it open.
Me for exemple, in Jeedom I will prefer just a general http configuration so the node can push to the home automation (whatever with a json body or full values in URL, I will take care of it) than just another way to have a network with a gateway. ESPeasy is different and nice to play without any need for a gateway and a web interface in addition to the home automation
Re: MySensors goes ESP!!
Hacking the post, for +1 the request for general HTTP interface. We need exactly the same for Jeedom. I think with this, it will make ESPeasy compatible with almost all home automation softwares (and agree with the fact that working with MQTT is nice but when it's so near to work without it's just better for end user)kr0815 wrote:You are totally right about there is no real standart.
a few weeks ago, i wasn´t even thinking about MQTT, i have it installed now, funny to Play with, and it works.
But for simple things / beginners, it´s to complicated, starting already with the needed Broker....
I don´t know about domotics, i´m using Fhem,
FHEM supports many Hardware Interfaces, but it could also be controlled by Telnet or HTTP
A HTTP command, for example, Looks like:
http://<fhem>:8083/fhem?cmd.dummy=set%20dummy%20on&XHR=1
Are such things not possible in Domoticz?
My thinking / wish about a "generall" HTTP-Interface would be:
- possibilty to use Names instead of ip, so i could connect to http://example.com
- possibility to format the Output similar to the MQTT Publishing template already build in
example:
MQTT Publish Template: /fhem/Sensor1/%id%/%valname%
in my case that would be then
/fhem?cmd.dummy=set%id%value&XHR=1
I´m not a good programmer, hacking at the Moment the Thingspeak-Interface for my needs, but would be nice to have a generall solution ?
Re: Big wish - generall HTTP and MQTT Interfaces
[Moderated by Martinus: To keep discussion topics clean, I've moved some posts to this topic]
Re: Big wish - generall HTTP and MQTT Interfaces
Won't forget, but December may not be the best month for spare time. Wife and kids need attention toolunarok wrote:... Don't forget the generic HTTP please, will be easier and get a dedicated plugin inside Jeedom for this

Only just 'recovered' from our dutch "Sinterklaas" event

Re: Big wish - generall HTTP and MQTT Interfaces
But if we 'wrap' the ESP sketch around the MySensors library, there's no need anymore for http, since people can use the available MySensors plugin in Jeedom. True?lunarok wrote:... Don't forget the generic HTTP please, will be easier and get a dedicated plugin inside Jeedom for this
Re: Big wish - generall HTTP and MQTT Interfaces
Yes, completly true
Re: Big wish - generall HTTP and MQTT Interfaces
Sorry, i can´t agree
If you wrap it around mysensors, the esp could talk to the systems listed at at the Moment at the mysensors page
But ( i know only about FHEM) there is also a maintainer that wrote a Special script to get the values from mysensors into FHEM.All These Systems need code to Support mysensors
Me , for example, i have another System that has nothing to do with home Automation - i log values like temperature to a Server
there´s a german Project http://www.volkszaehler.org , another guy here also asked how to log values to that System.
I´m trying at the moment to "hack" your scripts for my needs, hopefully i´ll be successfull some day
(My idea is to use esp-easy to have sensors at the company, friends, relatives, they could easily integrate it in their home network, and it logs to my volkszaehler server)
my thinking is more, if we have a general http Interface, esp-easy could speak with so many systems, for example my home stereo system could be controlled like that, so why not take an ESP8266, a few Buttons, and have a remote ?
The ability to send somethink like "<URL>:<port>/ <text, whatever>value_from_esp_device<text, whatever>" would make a swiss army knife out of it.
But as it´s your Project, so your decission
Regards
Klaus
If you wrap it around mysensors, the esp could talk to the systems listed at at the Moment at the mysensors page
But ( i know only about FHEM) there is also a maintainer that wrote a Special script to get the values from mysensors into FHEM.All These Systems need code to Support mysensors
Me , for example, i have another System that has nothing to do with home Automation - i log values like temperature to a Server
there´s a german Project http://www.volkszaehler.org , another guy here also asked how to log values to that System.
I´m trying at the moment to "hack" your scripts for my needs, hopefully i´ll be successfull some day

(My idea is to use esp-easy to have sensors at the company, friends, relatives, they could easily integrate it in their home network, and it logs to my volkszaehler server)
my thinking is more, if we have a general http Interface, esp-easy could speak with so many systems, for example my home stereo system could be controlled like that, so why not take an ESP8266, a few Buttons, and have a remote ?
The ability to send somethink like "<URL>:<port>/ <text, whatever>value_from_esp_device<text, whatever>" would make a swiss army knife out of it.
But as it´s your Project, so your decission

Regards
Klaus
Re: Big wish - generall HTTP and MQTT Interfaces
You're certainly right here, but I'm not a bad guy I think.kr0815 wrote:But as it´s your Project, so your decission
Regards
Klaus

But just because we're exploring the MySensor adventure doesn't mean killing the ESP Easy project. And from the list of MySensor controller support, it is clear that not even all of them support the Ethernet gateway anyway.
I'm interested to see how far you're getting along with your own controller plugin development. If it's just a basic HTTP interface I will likely find some spare time to help you out. Maybe you can post it here and I will have a look at it?
regards,
Martinus
Re: Big wish - generall HTTP and MQTT Interfaces
My answer "totally agree" was to question of Martinus "so Jeedom users don't need HTTP support if ESP easy is supporting mySensors protocol"
Still my answer, Jeedom will be able to work with the mySensors plugin.
But I agree too that a general HTTP interface and same for the MQTT is a "need" too.
My vision of the perfection will be :
- a general HTTP interface that can be set like :
URL : http:/whateverserverIwant/withanapi?id=<ID>blabla
Body : can be none but also can be build like {'data':{....}}
- a general MQTT interface setable too :
topic format
body value
- a mySensors interface setable with just a controller URL maybe (I ask hek if for their project of mysensors going to ESP it was possible to have the gateway broadcast their presentation so like a node we can do autocreation)
With these 3 interface, you are the king of ESP for sensors
Still my answer, Jeedom will be able to work with the mySensors plugin.
But I agree too that a general HTTP interface and same for the MQTT is a "need" too.
My vision of the perfection will be :
- a general HTTP interface that can be set like :
URL : http:/whateverserverIwant/withanapi?id=<ID>blabla
Body : can be none but also can be build like {'data':{....}}
- a general MQTT interface setable too :
topic format
body value
- a mySensors interface setable with just a controller URL maybe (I ask hek if for their project of mysensors going to ESP it was possible to have the gateway broadcast their presentation so like a node we can do autocreation)
With these 3 interface, you are the king of ESP for sensors

Re: Big wish - generall HTTP and MQTT Interfaces
MQTT
=====
I think that a generic MQTT interface already exists in ESP Easy. OpenHAB has publish and subscribe templates and all topic naming components can be changed through the web interface like system name, device names, value names. So what if I would rename OpenHAB to Generic, or just make a copy ?
HTTP
=====
For HTTP let's start an experimental controller and see where we end up. I've committed R50 to github with a new controller plugin (008).
Now you can use the publish template in /tools/advanced menu to set the template used for the final HTTP get request using querystring.
You can use the following variables:
%sysname% = ESP Name
%tskname% = Task name
%id% = Task id
%valname% = Value name
%value% = The actual value
Sample:
data.asp?device=%tskname%¶m=%valname%&value=%value%
I've done a quick test on a basic asp page running on a Windows IIS server and it seemed to work as expected.
Please let me know if it works for your situation.
=====
I think that a generic MQTT interface already exists in ESP Easy. OpenHAB has publish and subscribe templates and all topic naming components can be changed through the web interface like system name, device names, value names. So what if I would rename OpenHAB to Generic, or just make a copy ?
HTTP
=====
For HTTP let's start an experimental controller and see where we end up. I've committed R50 to github with a new controller plugin (008).
Now you can use the publish template in /tools/advanced menu to set the template used for the final HTTP get request using querystring.
You can use the following variables:
%sysname% = ESP Name
%tskname% = Task name
%id% = Task id
%valname% = Value name
%value% = The actual value
Sample:
data.asp?device=%tskname%¶m=%valname%&value=%value%
I've done a quick test on a basic asp page running on a Windows IIS server and it seemed to work as expected.
Please let me know if it works for your situation.
Re: Big wish - generall HTTP and MQTT Interfaces
Right now, i wanted to come back to your offer upload my experimental code, when i saw you already wrote something.
I will try it immediately this evening.
What i saw so far:
- i need POST instead of GET, but easy to change
- my HTTP-Request looks like:
POST http://demo.volkszaehler.org/middleware ... d&value=12
550e8400-e29b-11d4-a716-446655441352 describes the channel to log to, so i had to change max length of Task id or Value name
Are you planning also to implement URLs instead of IP Address in the future ? Otherwise i will try to find another solution for that
Best regards
Klaus
I will try it immediately this evening.
What i saw so far:
- i need POST instead of GET, but easy to change
- my HTTP-Request looks like:
POST http://demo.volkszaehler.org/middleware ... d&value=12
550e8400-e29b-11d4-a716-446655441352 describes the channel to log to, so i had to change max length of Task id or Value name
Are you planning also to implement URLs instead of IP Address in the future ? Otherwise i will try to find another solution for that
Best regards
Klaus
Re: Big wish - generall HTTP and MQTT Interfaces
tried it now,
first problem, i try to enter
after hitting submit, it shows
the log says
any idea why %tskname% is not resolved ?
first problem, i try to enter
Code: Select all
/middleware.php/data/%tskname%.json?operation=add&value=%value%
Code: Select all
%2Fmiddleware.php%2Fdata%2F%25tskname%25.json%3Foperation%3Dadd%26value%3D%25val
Code: Select all
The requested URL //middleware.php/data/%tskname%.json?operation=add&val
Re: Big wish - generall HTTP and MQTT Interfaces
It looks like there's an issue with URLdecoding. The special characters like '/' and '%' are not converted back to normal characters.kr0815 wrote:after hitting submit, it showsCode: Select all
%2Fmiddleware.php%2Fdata%2F%25tskname%25.json%3Foperation%3Dadd%26value%3D%25val
It does work on my unit though, so this is a strange bug.
Because of the issue above, the % is replaced with %25 and the replace routine doesn't understand it anymore...kr0815 wrote:any idea why %tskname% is not resolved ?
Re: Big wish - generall HTTP and MQTT Interfaces
sorry, i think i mixed something up when copying the files, i´ll try it again
Re: Big wish - generall HTTP and MQTT Interfaces
First i thought i made a fault mixing up different versions
But i tried again now, downloaded everything again from GitHub, still same fault
I tried an older Version i still had on my PC (Something like 39 i guess) - no fault
So it can´t be the IDE (1.6.5) or other things like google chrome
The fault is not only with the HTTP-Interface, i also tried some others like MQTT- same problem
Did anybody download / flash the Version from yesterday and could use it without problems ?
But i tried again now, downloaded everything again from GitHub, still same fault
I tried an older Version i still had on my PC (Something like 39 i guess) - no fault
So it can´t be the IDE (1.6.5) or other things like google chrome
The fault is not only with the HTTP-Interface, i also tried some others like MQTT- same problem
Did anybody download / flash the Version from yesterday and could use it without problems ?
Re: Big wish - generall HTTP and MQTT Interfaces
The bug was introduced with a recent pull request on urlDecode changes. We could try to fix it, but if everyone moves over to ESP core 2.0.0. we could remove all the urlDecode stuff because this is now fixed within the webserver library. Because I use core 2.0.0, I didn't notice the bug.kr0815 wrote:First i thought i made a fault mixing up different versions
But i tried again now, downloaded everything again from GitHub, still same fault
I tried an older Version i still had on my PC (Something like 39 i guess) - no fault
So it can´t be the IDE (1.6.5) or other things like google chrome
The fault is not only with the HTTP-Interface, i also tried some others like MQTT- same problem
Did anybody download / flash the Version from yesterday and could use it without problems ?
Could you check the latest build on core 2.0.0. ?
Re: Big wish - generall HTTP and MQTT Interfaces
So do i have to just install core 2.0.0, or do i have to remove all this urldecode things ?
Re: Big wish - generall HTTP and MQTT Interfaces
Just get core 2.0.0. and it should be ok.kr0815 wrote:So do i have to just install core 2.0.0, or do i have to remove all this urldecode things ?
Re: Big wish - generall HTTP and MQTT Interfaces
installed it, it´s working now 
What i wonder, with core 2.0.0, the ESP always starts as a acces point / dhcp server ?
I have the right values for my wifi set
If i do a WifiDisConnect, then a WifiConnect, it connects to my Wifi ?
Next big Task is now, how to replace IP Adress by URL, does anybody know if this should even be possible at all with esp8266 ?

What i wonder, with core 2.0.0, the ESP always starts as a acces point / dhcp server ?
I have the right values for my wifi set
If i do a WifiDisConnect, then a WifiConnect, it connects to my Wifi ?
Next big Task is now, how to replace IP Adress by URL, does anybody know if this should even be possible at all with esp8266 ?
Re: Big wish - generall HTTP and MQTT Interfaces
Tried to connect to an URL, now i´m completely lost.
I replaced
with
no, the system crashes completely:
I replaced
Code: Select all
client.print(String("GET ") + url + " HTTP/1.1\r\n" +
"Host: " + host + "\r\n" +
"Connection: close\r\n\r\n");
with
Code: Select all
client.print(String("POST ") + url + " HTTP/1.1\r\n" +
"Host: test123.de/volkszaehler_neu\r\n" +
"Connection: close\r\n\r\n");
no, the system crashes completely:
>WIfiDisConnect
>WifiConnect
WIFI : Connecting...
f 0, scandone
state: 0 -> 2 (b0)
state: 2 -> 3 (0)
state: 3 -> 5 (10)
add 0
aid 5
cnt
connected with Power-LAN, channel 6
dhcp client start...
ip:192.168.178.80,mask:255.255.255.0,gw:192.168.178.1
DS : Temperature: 23.94 (28-ff-ec-4-82-15-3-61)
HTTP : connecting to 192.168.178.47
URL: //volkszaehler.org/htdocs/middleware.php/data/f5bd1a60-9c2e-11e5-af62-53e01bdf1cd4.json?operation=add&value=23.94
//volkszaehler.org/htdocs/middleware.php/data/f5bd1a60-9c2e-11e5-af62-53e01bdf1
output: POST //volkszaehler.org/htdocs/middleware.php/data/f5bd1a60-9c2e-11e5-af62-53e01bdf1cd4.json?operation=add&value=23.94 HTTP/1.1
Host: kr123.de/volkszaehler_neu
Connection: close
HTTP : closing connection
HTTP : Delay 1000 ms
DS : Temperature: 24.31 (28-ff-c6-b5-82-15-2-64)
HTTP : connecting to 192.168.178.47
URL: //volkszaehler.org/htdocs/middleware.php/data/c044e270-9c2e-11e5-91fb-55387e68c73e.json?operation=add&value=24.31
//volkszaehler.org/htdocs/middleware.php/data/c044e270-9c2e-11e5-91fb-55387e68c
output: POST //volkszaehler.org/htdocs/middleware.php/data/c044e270-9c2e-11e5-91fb-55387e68c73e.json?operation=add&value=24.31 HTTP/1.1
Host: kr123.de/volkszaehler_neu
Connection: close
HTTP/1.1 400 Bad Request
Date: Sat, 12 Dec 2015 21:25:00 GMT
Server: Apache/2.2.22 (Debian)
Vary: Accept-Encoding
Content-Length: 317
Connection: close
Content-Type: text/html; charset=iso-8859-1
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>400 Bad Request</title>
</head><0000, epc3=0x00000000, excvaddr=0x7373657e, depc=0x00000000
body>
<h1>Bad Request</h1>
<p>Your browser sent a request that this server could not understand.<br />
</p>
<hr>
<address>Apache/2.2.22 (Debian) Server at kr123.de/volkszaehler_neu Port 80</address>
Fatal exception (9):
epc1=0x4021d0d8, epc2=0x0000
Exception (9):
epc1=0x4021d0d8 epc2=0x00000000 epc3=0x00000000 excvaddr=0x7373657e depc=0x00000000
ctx: cont
sp: 3fff2ca0 end: 3fff30d0 offset: 01a0
>>>stack>>>
3fff2e40: 3ffe99bc 3fff0714 3fff2ec0 4021d0d4
3fff2e50: 40201c9e 00000001 3fff2ef8 4021d4d4
3fff2e60: 3fff3120 00000000 3fff0714 402113b9
3fff2e70: 6464613c 73736572 6170413e 2f656863
3fff2e80: 2e322e32 28203232 69626544 20296e61
3fff2e90: 76726553 61207265 726b2074 2e333231
3fff2ea0: 762f6564 736b6c6f 6865617a 5f72656c
3fff2eb0: 2075656e 74726f50 3c303820 6464612f
3fff2ec0: 73736572 0000003e 000003e8 0009c199
3fff2ed0: 3fff0068 3fff5950 2e323931 2e383631
3fff2ee0: 2e383731 00003734 b5c6ff28 3fff5278
3fff2ef0: 0000000f 0000000f 3fff5278 0000000f
3fff2f00: 00000000 3fff5c88 0000007f 00000071
3fff2f10: 41c28000 3fff5b98 00000001 000001b4
3fff2f20: 402076ac 3fff5b98 000001b4 3fff0c92
3fff2f30: 3fff0e24 3fff2fa0 3fff2fa0 4021159a
3fff2f40: 3ffe99bc 00000000 3fff2fc8 3fff0c92
3fff2f50: 3fff0e24 3fff2fa0 00000001 3fff0c92
3fff2f60: 3fff0e24 3fff2fa0 3fff0d78 4020a5b5
3fff2f70: 3ffe99bc 44203a20 79616c65 00000003
3fff2f80: 3fff0e24 00000001 3ffe99bc 3fff08f3
3fff2f90: 3fff0e24 00000010 00000001 4020a734
3fff2fa0: 40100401 000001c8 3fff3001 4021d65c
3fff2fb0: 3ffe99bc 00000000 000003e8 3fff4a50
3fff2fc0: 0000000f 00000000 3fff4ad0 0000000f
3fff2fd0: 00000000 00000005 41c30000 00000000
3fff2fe0: 00000000 00000000 4021a801 3fff20b0
3fff2ff0: 401015a2 00000000 00000000 40218de8
3fff3000: 3fff1f60 401016e3 3fff20b0 3fff1f60
3fff3010: 3fff0644 3fff0640 4021a8c0 3fff20b0
3fff3020: 3fff0658 0000000a 0000000a 40201c93
3fff3030: 3fff0644 3fff063c 3fff4e80 3fff0640
3fff3040: 3fff0644 3fff063c 3fff0d78 402103c2
3fff3050: 69747055 3120656d 6f432030 63656e6e
3fff3060: 69614674 6572756c 30322073 65724620
3fff3070: 6d654d65 39363220 3f003231 4020a578
3fff3080: 3f0055aa 3fff0e78 3fff1b98 3fff4a70
3fff3090: 00000000 00000000 00000016 40101e31
3fff30a0: 4021a8e1 0000001f 00000012 3fff209c
3fff30b0: 3fffdc20 00000000 3fff2094 4021a909
3fff30c0: 00000000 00000000 3fff20b0 40100114
<<<stack<<<
ets Jan 8 2013,rst cause:1, boot mode:(3,5)
load 0x4010f000, len 1264, room 16
tail 0
chksum 0x42
csum 0x42
~ld
ªU
INIT : Booting Build nr:50
bcn 0
del if1
mode : sta(18:fe:34:da:69:e2)
WIFI : Connecting...
Re: Big wish - generall HTTP and MQTT Interfaces
I'm not an HTML expert, but if you're using the POST verb, shouldn't you actually post something? Right now it looks like you're doing a POST request using a querystring and not posting anything. If the querystring already contains the operation and data, what's there to post in addition?
Or is it just my ignorance in HTML that makes me misunderstanding how things work

Or is it just my ignorance in HTML that makes me misunderstanding how things work


Re: Big wish - generall HTTP and MQTT Interfaces
I´m neither a HTML expert 
What i tried, i have a local copy of this volkszaehler logger on my home Server
Using the first example above, wiith local IP adress in the settings of the web Interface, it works
so i thought i replace just the variable "host" with the web adress, but i don´t know how Client.print thing has to be formated.
i found many examples in the web doing it the same way. (on some Forums, they are discussing whether it´s "\r\n" or just "\n"
maybe it has something to do with DNS / Gateway ?

What i tried, i have a local copy of this volkszaehler logger on my home Server
Using the first example above, wiith local IP adress in the settings of the web Interface, it works
so i thought i replace just the variable "host" with the web adress, but i don´t know how Client.print thing has to be formated.
i found many examples in the web doing it the same way. (on some Forums, they are discussing whether it´s "\r\n" or just "\n"
maybe it has something to do with DNS / Gateway ?
Re: Big wish - generall HTTP and MQTT Interfaces
Have it partly working now
i only replaced
with
now i get at least
i only replaced
Code: Select all
char host[20];
sprintf_P(host, PSTR("%u.%u.%u.%u"), Settings.Controller_IP[0], Settings.Controller_IP[1], Settings.Controller_IP[2], Settings.Controller_IP[3]);
Code: Select all
char host[40] = "esp.kr123.de/volkszaehler.org/htdocs";
// sprintf_P(host, PSTR("%u.%u.%u.%u"), Settings.Controller_IP[0], Settings.Controller_IP[1], Settings.Controller_IP[2], Settings.Controller_IP[3]);
HTTP : connecting to esp.kr123.de/volkszaehler.org/htdocs
HTTP : connection failed
Re: Big wish - generall HTTP and MQTT Interfaces
It´s working now, thanks a lot 
I made a demo set up, so if anybody is interested: http://www.esp.kr123.de , 2 Units logging at the Moment
I hardcoded the URL in the sketch, because i can´t use IPs to log to the server
My wish now, to follow your updates, could you please set max length of %valname% to 50 ?
Best regards
Klaus

I made a demo set up, so if anybody is interested: http://www.esp.kr123.de , 2 Units logging at the Moment
I hardcoded the URL in the sketch, because i can´t use IPs to log to the server
My wish now, to follow your updates, could you please set max length of %valname% to 50 ?
Best regards
Klaus
Re: Big wish - generall HTTP and MQTT Interfaces
I would surely want to change it if it did not bring some 'evil' issues. Changes to these settings structures corrupt the inner working of the ESP. To be safe we have to reset the unit with each update that changes these thing. It also renders previous configuration backups useless. And finally there are limitations on reserved flash storage for these structs. In this case it's only 512 bytes for each task of which already 360 are in use. This change would increase it to 460 leaving only 50 bytes left for future use.kr0815 wrote:My wish now, to follow your updates, could you please set max length of %valname% to 50 ?
So there's some hesitation to do this right now...
Re: Big wish - generall HTTP and MQTT Interfaces
I completely understand you, no problem, i could make the changes myself in the future versions, it´s just a few lines in espeasy.ino and the webserver
But what do you mean with:
Is it possible to erase the EEPROM ?
I know for arduino there exits some code/sketch to erase the internal eeprom
Is there something similar for the ESP8266 ?
But what do you mean with:
Maybe this solves my other problem that the unit gets no ip adressTo be safe we have to reset the unit with each update that changes these thing
Is it possible to erase the EEPROM ?
I know for arduino there exits some code/sketch to erase the internal eeprom
Is there something similar for the ESP8266 ?
Re: Big wish - generall HTTP and MQTT Interfaces
It's difficult to tell the exact issues you will get if you change the structs that are stored in flash without resetting the device. It's a situation that should be avoided unless you really understand the effects of the changes and know how to programmatically fix it.
So if you want to make this kind of customizations, reset the ESP after uploading the modified code. Then it should be fine in general. Don't load saved config files from non-customized versions, as the load/save mechanism is just a plain binary flash sector dump.
But remember that that are also limitations on the maximum structure size. If you exceed those, a reset won't help because data will be overlapping in flash memory and you will not get a warning about this.
There should not be a need to erase this specific flash area with a special tool, as this is done in case of the reset command.
(unless you want to erase the entire ESP flash chip, there seems to be "empty" bin files that could do that using generic ESP flash tools)
So if you want to make this kind of customizations, reset the ESP after uploading the modified code. Then it should be fine in general. Don't load saved config files from non-customized versions, as the load/save mechanism is just a plain binary flash sector dump.
But remember that that are also limitations on the maximum structure size. If you exceed those, a reset won't help because data will be overlapping in flash memory and you will not get a warning about this.
There should not be a need to erase this specific flash area with a special tool, as this is done in case of the reset command.
(unless you want to erase the entire ESP flash chip, there seems to be "empty" bin files that could do that using generic ESP flash tools)
Re: Big wish - generall HTTP and MQTT Interfaces
Do you know where to get such a file to erase it completely - for arduino IDE ?
I searched through Google, didn´t find anything
I still have the Problem with my one unit, as described in the other post, not getting an ip adress, so i have to manually do a WifiDisConnect, then a WifiConnect, very strange
I searched through Google, didn´t find anything
I still have the Problem with my one unit, as described in the other post, not getting an ip adress, so i have to manually do a WifiDisConnect, then a WifiConnect, very strange
Re: Big wish - generall HTTP and MQTT Interfaces
https://www.dropbox.com/s/hpw14exd42v3g ... r.ino?dl=0
Clear.ino
Use serial monitor to send E for erase.
Paco
Clear.ino
Use serial monitor to send E for erase.
Paco
Re: Big wish - generall HTTP and MQTT Interfaces
This ESP Easy tool only erases the flash area where normally SPIFFS is located. This area is used for all configuration settings. So it does not wipe the application program in flash.Backbone wrote:https://www.dropbox.com/s/hpw14exd42v3g ... r.ino?dl=0
Clear.ino
Use serial monitor to send E for erase.
Paco
If you want to fully erase the ESP flash chip, you should use a flash upload tool and upload a bin file with the same size as the flash chip, containing all 0xff values. I've seen these 512 kB empty bin files somewhere but never used it. I guess for ESP12E you would need a 4 MB bin file.
I've heard from Iggr that a program cannot wipe itself (and this of course would require the erase routine to be stored in RAM somehow)
That's why you need an external tool.
Re: Big wish - generall HTTP and MQTT Interfaces
Martinus wrote:MQTT
=====
I think that a generic MQTT interface already exists in ESP Easy. OpenHAB has publish and subscribe templates and all topic naming components can be changed through the web interface like system name, device names, value names. So what if I would rename OpenHAB to Generic, or just make a copy ?
HTTP
=====
For HTTP let's start an experimental controller and see where we end up. I've committed R50 to github with a new controller plugin (008).
Now you can use the publish template in /tools/advanced menu to set the template used for the final HTTP get request using querystring.
You can use the following variables:
%sysname% = ESP Name
%tskname% = Task name
%id% = Task id
%valname% = Value name
%value% = The actual value
Sample:
data.asp?device=%tskname%¶m=%valname%&value=%value%
I've done a quick test on a basic asp page running on a Windows IIS server and it seemed to work as expected.
Please let me know if it works for your situation.
I can confirm. It works with fhem (fhem.de)
You need to select generic http and port 8083.
for a temperature sensor si7021
On the mqtt publish template, type the following url
fhem?cmd=setreading%20%tskname%%20%valname%%20%value%
for a switch
fhem?cmd=set%20tskname%20%value%
Maybe on the advanced tab a different field for the http generic url?
Re: Big wish - generall HTTP and MQTT Interfaces
Sorry to ask again, but is there any chance to extend max value of %valname% ?
I´m using this great project to log to my Volkszaehler setup, but they use long UUIDs for security reasons, so i need at least 36 characters.
At the moment each time there´s an update, i change everything, but that´s not really confortable
Best regards
Klaus
I´m using this great project to log to my Volkszaehler setup, but they use long UUIDs for security reasons, so i need at least 36 characters.
At the moment each time there´s an update, i change everything, but that´s not really confortable
Best regards
Klaus
Re: Big wish - generall HTTP and MQTT Interfaces
Is this UUID unique for each sensorvalue or unique for each sensor? Can't you join the taskname and taskvalues together to get a max 50 character string?kr0815 wrote:Sorry to ask again, but is there any chance to extend max value of %valname% ?
I´m using this great project to log to my Volkszaehler setup, but they use long UUIDs for security reasons, so i need at least 36 characters.
At the moment each time there´s an update, i change everything, but that´s not really confortable
Best regards
Klaus
Suppose UUID for the sensor is:
a301d8d0-903b-1234-94bb-d943d061b6a8
You put the first part in taskname: a301d8d0-903b-1234-94bb-
and remaining part in valuename: d943d061b6a8
And join them in the template like this:
/data/%tskname%%valname%.json
Re: Big wish - generall HTTP and MQTT Interfaces
Unfortunately, the UUID is unique for each value
I was already thinking about combining taskname and taskvalue, but as i have some DHT22, this doesn´t work
It´s not that important, i changed the current release now, and saved it to build future sensors
I was already thinking about combining taskname and taskvalue, but as i have some DHT22, this doesn´t work
It´s not that important, i changed the current release now, and saved it to build future sensors
Re: Big wish - generall HTTP and MQTT Interfaces
With R88, the field size is increased from 25 to 40 characters. Internal flash data migration is needed, but handled using a special fix routine if a pre R88 build is detected. If all goes well, nobody will notice the underlying change.kr0815 wrote:Sorry to ask again, but is there any chance to extend max value of %valname% ?
I´m using this great project to log to my Volkszaehler setup, but they use long UUIDs for security reasons, so i need at least 36 characters.
At the moment each time there´s an update, i change everything, but that´s not really confortable
Best regards
Klaus
Re: Big wish - generall HTTP and MQTT Interfaces
Thanks a lot Mártinus,
i will try now the newer versions
i will try now the newer versions

Re: Big wish - generall HTTP and MQTT Interfaces
Hi,
Very happy to see this, I will implement a Jeedom plugin to make it easier again and generic also on Jeedom side.
@Martinus or anyone can you confirm me this :
%sysname% = ESP Name -> global for one ESP ?
%tskname% = Task name -> name of the task on ESP
%id% = Task id -> ID of the task on ESP
%valname% = Value name -> name of a value in ESP, could have more than one value on one task (for exemple humidity and temp)
%value% = The actual value -> value of the sensor
So the unicity for an equipement is IP/%sysname%
Unicity for an information on an equipement is %id%+%valname%
(I have load R97 on Wemos but I cannot have it connect to my Wifi, as I'm on professionnal travel, these answers will help me prepare the plugin before getting hand on ESP)
Very happy to see this, I will implement a Jeedom plugin to make it easier again and generic also on Jeedom side.
@Martinus or anyone can you confirm me this :
%sysname% = ESP Name -> global for one ESP ?
%tskname% = Task name -> name of the task on ESP
%id% = Task id -> ID of the task on ESP
%valname% = Value name -> name of a value in ESP, could have more than one value on one task (for exemple humidity and temp)
%value% = The actual value -> value of the sensor
So the unicity for an equipement is IP/%sysname%
Unicity for an information on an equipement is %id%+%valname%
(I have load R97 on Wemos but I cannot have it connect to my Wifi, as I'm on professionnal travel, these answers will help me prepare the plugin before getting hand on ESP)
Re: Big wish - generall HTTP and MQTT Interfaces
Ok, get my Wemos working back at home.
2 questions about Generic HTTP :
1 - is it working with HTTPS ? I can set the port, but not specify it will be https, maybe it will fail if espeasy is not expecting https
2 - the Publish Template field has a limit and it's short, that doesn't permit to put a classical Jeedom API URL for exemple (and I think many if there is an API key + name of param, it's already long). So can it be extend ? and it's almost double neede. If not, I will see for a dedicated service for ESPeasy (this way will solve also point 1, but not secure as no API key)
2 questions about Generic HTTP :
1 - is it working with HTTPS ? I can set the port, but not specify it will be https, maybe it will fail if espeasy is not expecting https
2 - the Publish Template field has a limit and it's short, that doesn't permit to put a classical Jeedom API URL for exemple (and I think many if there is an API key + name of param, it's already long). So can it be extend ? and it's almost double neede. If not, I will see for a dedicated service for ESPeasy (this way will solve also point 1, but not secure as no API key)
Who is online
Users browsing this forum: No registered users and 11 guests