Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding external sensors OTA #27

Open
LeSuedois opened this issue Mar 1, 2018 · 4 comments
Open

Adding external sensors OTA #27

LeSuedois opened this issue Mar 1, 2018 · 4 comments
Assignees
Labels
medium priority question Further information is requested
Milestone

Comments

@LeSuedois
Copy link

LeSuedois commented Mar 1, 2018

estimate: 5d

Steps to reproduce

  • COOL Board with plugged in external sensor
  • Do no configure external sensors when flashing SPIFFS
  • Prepare an MQTT message to add an external sensor with "state": { "desired": { ... }}

Actual

  • External sensor is not added or configuration messed up ❌

Expected

  • It works ✔️

Hints

  • Incremental update or full overwrite?

Background

@simon-lacool

I tried to add a external sensor (NDIR CO2 sensor) over the air and it failed... the I tried all kinds of figures, sending just the config for new sensor, sending everything.
The configuration is arriving partially in the configuration and the new sensor didn't work. after flashing the howl stuff tu the SPIFFS everything worked nice.

@LeSuedois LeSuedois self-assigned this Mar 1, 2018
@LeSuedois LeSuedois added medium priority bug Something isn't working labels Mar 1, 2018
@LeSuedois
Copy link
Author

In fact the problem is slightly more global than that. It has to do with the REST API and the fact that we only get the difference between reported and desired.
Example:
shadow state:
{"val1"=1, "val2"=2, "val3"=3}
json from user:
{"val1"=2, "val2"=2, "val3"=1}
json in desired channel
{"val1"=2, "val3"=1}
json in memory after update
{"val1"=2, "val3"=1}

the REST API acts as intended but the coolboard does not keep unchanged values. "that's all"...

@LeSuedois
Copy link
Author

merge acbb2c3 is related to this issue, I put in to needs testing...

@3rwww1 3rwww1 changed the title Can't add a external sensor OTA Adding external sensors OTA Jun 7, 2018
@3rwww1 3rwww1 added question Further information is requested and removed bug Something isn't working labels Jun 7, 2018
@3rwww1
Copy link
Contributor

3rwww1 commented Jun 7, 2018

To review / define

@3rwww1 3rwww1 added this to the sprint 2 milestone Jun 22, 2018
@3rwww1 3rwww1 assigned Axe-R and unassigned trap98 Jun 27, 2018
@LeSuedois
Copy link
Author

LeSuedois commented Jun 29, 2018

Just a other try to document this a little more..
let's change a parameter on Act5, the original configuration was
{ "state":{ "desired":{ "jetPack":{ "Act5":{ "actif":1, "inverted":0, "temporal":1, "low":[1500,0,0,0], "high":[1700,0,0,0], "type":["CO2",""] } } } } }
but the inverted flag was wrong... (the fan on Act5 goes on and CO2 falls)
After many trys I sent this:
{ "state":{ "desired":{ "jetPack":{ "Act5":{ "actif":null, "inverted":null, "temporal":null, "low":[null,null,null,null], "high":[null,null,null,null], "type":[null,null] } } } } }
but when I look at the shadow I am still not happy:
... "jetPack": { "Act5": { "low": [ null, null, null, null ], "high": [ null, null, null, null ], "type": [ null, null ], "actif": 1, "inverted": 1, "temporal": 0 } ...
so IMO the right way (but not very handy though) is to send null for all arrays and send something like (pseudocode) "active" = !active; "inverted" = !inverted; .... once received we send the real config.
in my case:
{ "state":{ "desired":{ "jetPack":{ "Act5":{ "actif":0, "inverted":0, "temporal":1, "low":[null,null,null,null], "high":[null,null,null,null], "type":[null,null] } } } } }
and then:
{ "state":{ "desired":{ "jetPack":{ "Act5":{ "actif":1, "inverted":1, "temporal":0, "low":[1500,0,0,0], "high":[1700,0,0,0], "type":["CO2",""] } } } } }
only then it works..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
medium priority question Further information is requested
Projects
None yet
Development

No branches or pull requests

4 participants