Giter Club home page Giter Club logo

Comments (9)

darcoto avatar darcoto commented on June 1, 2024

You can find Sensor ID in HTTP Header of request. Look for X-Sensor

POST /data.php HTTP/1.1
Host: api.host.com
X-Sensor: esp8266-1335052

from sensors-software.

gregorwolf avatar gregorwolf commented on June 1, 2024

Good to know that the data is available in the HTTP header. But for the ease of consumption i.e. with Node-Red it would help to have it in the JSON directly.

from sensors-software.

sethiele avatar sethiele commented on June 1, 2024

+1

from sensors-software.

darcoto avatar darcoto commented on June 1, 2024

If @ricki-z confirm, I can add necessary code and make PR to project.
But in my opinion, this will add a few line of code witch will duplicate existing information (in header). As you may know, ESP has a limited memory and it is not a good idea to waste it.

from sensors-software.

ricki-z avatar ricki-z commented on June 1, 2024

I've added the ID to the JSON sent to custom api in the actual version. This will add 112 Byte to filesize. can someone test it?

from sensors-software.

rexfue avatar rexfue commented on June 1, 2024

I've tested it. It doesn't work as is.
You send 'data' but should send 'data_4_custom'.
So change line 2573 to:
sendData(data_4_custom,0,host_custom,port_custom,url_custom,basic_auth_custom.c_str(),FPSTR(TXT_CONTENT_TYPE_JSON));

Then it works as expected .

from sensors-software.

ricki-z avatar ricki-z commented on June 1, 2024

Is changed. Will be pushed to the sensors in the next days.

from sensors-software.

gregorwolf avatar gregorwolf commented on June 1, 2024

Excellent. Thank you all. Will check and then close the issue.

from sensors-software.

gregorwolf avatar gregorwolf commented on June 1, 2024

Got Firmware: NRZ-2017-086 on my sensors now and the JSON does now contain esp8266id

from sensors-software.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.