Welcome to the Cumulus Support forum.

Latest Cumulus MX V3 release 3.28.6 (build 3283) - 21 March 2024

Cumulus MX V4 beta test release 4.0.0 (build 4017) - 17 March 2024

Legacy Cumulus 1 release v1.9.4 (build 1099) - 28 November 2014 (a patch is available for 1.9.4 build 1099 that extends the date range of drop-down menus to 2030)

Download the Software (Cumulus MX / Cumulus 1 and other related items) from the Wiki

API changes in 3190?

From build 3044 the development baton passed to Mark Crossley. Mark has been responsible for all the Builds since. He has made the code available on GitHub. It is Mark's hope that others will join in this development, but at the very least he welcomes your ideas for future developments (see Cumulus MX Development suggestions).

Moderator: mcrossley

Post Reply
jbatchelor51
Posts: 4
Joined: Fri 24 Jun 2022 12:39 am
Weather Station: ECOWITT
Operating System: Windows10

API changes in 3190?

Post by jbatchelor51 »

I have not has any issues moving forward in builds until this last one from 3184 to 3190.

I am using API JSON calls to pull data into WebCore (for home automation) and a tiny display built on an ESP NodeMCU.

Something changed in how the JSON is being delivered? I went back to 3184 and all my code started working again.

It must be subtle since I dropped the URL into local browser and I see data.
any advice is welcomed!

thx
jim
User avatar
philpugh
Posts: 380
Joined: Tue 24 May 2011 8:34 am
Weather Station: See Signature
Operating System: Debian 11 (RPi4)
Location: Antrobus, Cheshire, UK
Contact:

Re: API changes in 3190?

Post by philpugh »

hi,

There have been some changes to the webtags. Why not set the list web tags (Program Settings/General Options) from the console display (e.g. http::/yourcmx address:8998)

This generates a text file with all the current webtags - check which ones are missing/changed!
Phil Pugh
GW1000 + WH65/WH57/WH31; HP2551 + WS68/WH40A; GW2001 WittBoy
cumulusutils generating website
http://goosegate.uk/
User avatar
mcrossley
Posts: 12685
Joined: Thu 07 Jan 2010 9:44 pm
Weather Station: Davis VP2/WLL
Operating System: Bullseye Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: API changes in 3190?

Post by mcrossley »

jbatchelor51 wrote: Fri 24 Jun 2022 12:48 am I have not has any issues moving forward in builds until this last one from 3184 to 3190.

I am using API JSON calls to pull data into WebCore (for home automation) and a tiny display built on an ESP NodeMCU.

Something changed in how the JSON is being delivered? I went back to 3184 and all my code started working again.

It must be subtle since I dropped the URL into local browser and I see data.
any advice is welcomed!

thx
jim
No intentional changes, but some of the libraries have changed. Which API calls are you using? And what platform are you running on?
jbatchelor51
Posts: 4
Joined: Fri 24 Jun 2022 12:39 am
Weather Station: ECOWITT
Operating System: Windows10

Re: API changes in 3190?

Post by jbatchelor51 »

nothing fancy
going to my ESP panel..
/api/tags/process.json?rc&temp&hum&dew&UV&press&rrate

been running on windows since Jan this year. Arduino library has JSON parse to extract the data from the pairs

The odd thing is when I go there in a browser window, I see the JSON pairs.

Webcore I am:

@HOME_IP+":"+@Cumulus_Port+"/"+"api/tags/process.json?rc&temp&hum&wchill&heatindex&SolarRad&press&UV"

It uses GET request and return response based on tag names.

ie response.temp

Has been working great until this last update. Started returning nulls to these 2 services as soon as I started up 3190.

So I rolled back and all worked again. got to be something subtle. as noted it works in a browser.

I'll keep digging as I get time.

thanks!
jim
User avatar
mcrossley
Posts: 12685
Joined: Thu 07 Jan 2010 9:44 pm
Weather Station: Davis VP2/WLL
Operating System: Bullseye Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: API changes in 3190?

Post by mcrossley »

It may be the mime type that is returned?
User avatar
mcrossley
Posts: 12685
Joined: Thu 07 Jan 2010 9:44 pm
Weather Station: Davis VP2/WLL
Operating System: Bullseye Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: API changes in 3190?

Post by mcrossley »

Forget that, I just checked and it still returns application/json, the JSON syntax is valid, so... :?

The dashboard interface also uses API calls and they seem to still be working OK.
jbatchelor51
Posts: 4
Joined: Fri 24 Jun 2022 12:39 am
Weather Station: ECOWITT
Operating System: Windows10

Re: API changes in 3190?

Post by jbatchelor51 »

I finally had time to sit and look at the JSON. On my ESP using Arduino IDE (using ArduinoJson.h) I debugged (with help of online JSON library) and found a character in front of the first brace. a ⸮ causing deserialization to fail. in my working rev 3184 the character is a {

so a 'space' character? not seen in HTML?

maybe expected with updated libraries?


james
User avatar
mcrossley
Posts: 12685
Joined: Thu 07 Jan 2010 9:44 pm
Weather Station: Davis VP2/WLL
Operating System: Bullseye Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: API changes in 3190?

Post by mcrossley »

It is adding a Unicode BOM to all output. It appears that is the default for MS when sending UTF-8 responses, even though they themselves say an BOM is not required for UTF-8! :bash:

v3.20.0 now explicitly disables the BOM on API responses.
jbatchelor51
Posts: 4
Joined: Fri 24 Jun 2022 12:39 am
Weather Station: ECOWITT
Operating System: Windows10

Re: API changes in 3190?

Post by jbatchelor51 »

3202
looking good! thx!
Post Reply