ESPeasy and IDX on JSON string

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
pitrio
Normal user
Posts: 26
Joined: 23 Apr 2018, 16:49

ESPeasy and IDX on JSON string

#1 Post by pitrio » 14 May 2018, 12:33

dear all,
I would like add a IDX number (used to link with Domoticz) on ESPeasy JSON string, in particulary in the "sensors" position.
I saw that the JSON string are handled on webserver.ino at "void handle_json()" routine.

for example....

"Sensors":[
{
"TaskValues": [
{"ValueNumber":1,
"Name":"Analog",
"NrDecimals":2,
"Value":9.00
}],
"TaskNumber":1,
"TaskEnabled":"true",
"TaskInterval":1,
"Type":"Analog input - internal",
"TaskName":"ADC 1",
"IDX":"8"
},

It possible that someone add this facility on ESP version?
Eventually can someone help me to do?

thank you!

ricc

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

Re: ESPeasy and IDX on JSON string

#2 Post by grovkillen » 14 May 2018, 16:09

Sounds like a good idea. Please open a issue on GitHub.
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:

pitrio
Normal user
Posts: 26
Joined: 23 Apr 2018, 16:49

Re: ESPeasy and IDX on JSON string

#3 Post by pitrio » 14 May 2018, 18:05

I never do it... I have to register on GitHub and after? Can you help me?

thank you in advance

ricc

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

Re: ESPeasy and IDX on JSON string

#4 Post by grovkillen » 14 May 2018, 20:16

It's good for you so you can track the implementation and also lobby the request. So register on GitHub and issue the request.
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:

TD-er
Core team member
Posts: 8759
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: ESPeasy and IDX on JSON string

#5 Post by TD-er » 14 May 2018, 22:07

One could have multiple IDX values per task.
Should I add "IDX1" ... "IDX3"?
And what if it is not set? Leave it or add it with value 0?

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

Re: ESPeasy and IDX on JSON string

#6 Post by grovkillen » 14 May 2018, 22:17

You should not add a suffix number to the JSON path. Do what we did with sensors.
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:

TD-er
Core team member
Posts: 8759
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: ESPeasy and IDX on JSON string

#7 Post by TD-er » 15 May 2018, 00:03

grovkillen wrote: 14 May 2018, 22:17 You should not add a suffix number to the JSON path. Do what we did with sensors.
What did we do with the sensors?
And does this mean "DNS 1" is also not a good idea?

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

Re: ESPeasy and IDX on JSON string

#8 Post by grovkillen » 15 May 2018, 00:52

It's not parsable in that sense that we could have a dynamic number of JSON objects. I guess DNS 1 and 2 is pretty static compared to number of values and IDX. So not static values/IDX should never have static names.
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:

pitrio
Normal user
Posts: 26
Joined: 23 Apr 2018, 16:49

Re: ESPeasy and IDX on JSON string

#9 Post by pitrio » 15 May 2018, 12:58

I put the request on GitHub

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

Re: ESPeasy and IDX on JSON string

#10 Post by grovkillen » 15 May 2018, 14:04

Great! Thanks!
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:

pitrio
Normal user
Posts: 26
Joined: 23 Apr 2018, 16:49

Re: ESPeasy and IDX on JSON string

#11 Post by pitrio » 15 May 2018, 17:35

TD-er wrote: 15 May 2018, 00:03
grovkillen wrote: 14 May 2018, 22:17 You should not add a suffix number to the JSON path. Do what we did with sensors.
What did we do with the sensors?
And does this mean "DNS 1" is also not a good idea?
sorry... what is DNS 1?... what you mean?

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

Re: ESPeasy and IDX on JSON string

#12 Post by grovkillen » 15 May 2018, 18:49

He was talking to me :)
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:

pitrio
Normal user
Posts: 26
Joined: 23 Apr 2018, 16:49

Re: ESPeasy and IDX on JSON string

#13 Post by pitrio » 21 May 2018, 15:37

dear all,

I'm trying to install and test the version with implemented JSON "IDX".
I have a problem to compile the new version.

In particolulary I use Arduino IDE arduino-1.6.12.
Till now (up to ESPEasy_mega-20180516.zip) I have all time compiled and programme ESP using the method described on this link (https://www.letscontrolit.com/wiki/inde ... are_Upload).

Today I'm trying to compile ESPEasy_mega-20180517 - 18 and 19 but, I have all times error, like show below:

/opt/arduino-1.6.12P230/portable/sketchbook/ESPEasy_mega-0517/WebServer.ino: In function 'void WebServerInit()':
WebServer:407: error: no matching function for call to 'ESP8266WebServer::on(const __FlashStringHelper*, void (&)())'
WebServer.on(F("/"), handle_root);
^
I saw "old" webser.ino and in particular:

void WebServerInit()
{
// Prepare webserver pages
WebServer.on("/", handle_root);
....

and "new" webser.ino

void WebServerInit()
{
// Prepare webserver pages
WebServer.on(F("/"), handle_root);
...

Can someone help me to understand where is the problem?
thank you in advance!

ricc

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

Re: ESPeasy and IDX on JSON string

#14 Post by grovkillen » 21 May 2018, 17:21

We use PlatformIO as the official IDE so I cannot really help you. Sorry!
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:

pitrio
Normal user
Posts: 26
Joined: 23 Apr 2018, 16:49

Re: ESPeasy and IDX on JSON string

#15 Post by pitrio » 21 May 2018, 18:01

ciao!

I will try to install PlatformIO.

I saw 2 different things... PlatformIO IDE for Atom and PlatformIO IDE for VSCode.
I use linux... what you suggest me to use?

thank you

ricc

TD-er
Core team member
Posts: 8759
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: ESPeasy and IDX on JSON string

#16 Post by TD-er » 21 May 2018, 22:43

I use PlatformIO with Atom.

Just curious, what's the reason to build your own version?

pitrio
Normal user
Posts: 26
Joined: 23 Apr 2018, 16:49

Re: ESPeasy and IDX on JSON string

#17 Post by pitrio » 22 May 2018, 14:53

ciao,

but ...
first of all becouse I started to use the link where letcontrolit show how compile and program flash by using Arduino IDE.
Second becouse we need some small changes to adapt ESPEasy for our laboratory

I don't understand why with Arduino IDE doesn't compile more... i can't find error... mmmm

thank you again!

ricc

pitrio
Normal user
Posts: 26
Joined: 23 Apr 2018, 16:49

Re: ESPeasy and IDX on JSON string

#18 Post by pitrio » 23 May 2018, 11:40

dear all,

1)
I found the problem, we can still to compile and download the ESPEasy with arduino IDE (arduino-1.6.12), but we have to update the 8266 library, from original one to 2.4.1. With this we can do the same things explainded on main site (https://www.letscontrolit.com/wiki/inde ... are_Upload)

2)
I saw yours code to add IDX on JSON string... but I can't see IDX on JSON page... I can saw just this

"Sensors":[
{
"TaskValues": [
{"ValueNumber":1,
"Name":"Analog",
"NrDecimals":2,
"Value":7.00
}],
"TaskNumber":1,
"TaskEnabled":"true",
"TaskInterval":1,
"Type":"Analog input - internal",
"TaskName":"ADC 1"
},

In your code there is a variable to on/off this... (show Data Acquisition) what I have to do to activate the IDX implementation ?

3)
Still I saw the error on third IDX code: missing field to put the number
IDX.png
IDX.png (47.81 KiB) Viewed 9882 times
thank you a lot

ricc

Post Reply

Who is online

Users browsing this forum: No registered users and 19 guests