Copyright © https://mongoose-os.com

Mongoose OS Forum

frame
ATTENTION! This forum has moved to:

https://community.mongoose-os.com

Do not post any new messages.

Hex Values in conf_schema.yaml

CapsicumCapsicum Germany
edited April 2017 in Mongoose OS

Hello,

I try to implement the 1-Wire interface for DS18b20. To store the ROM ID (e.g. 28 FF DC DD 53 15 2 9B) in the conf_schema.yaml file, to assign the field of my data storage (e.g. ThingSpeak) to it.

My Line in conf_schema.yaml:
[
["hello", "o", {"title": "Hello app settings"}],
["hello.who", "s", "world", {"title": "Who to say hello to"}],
["hello.wo","s","ASDFAGSFAGSFSGA",{"title":"Wo bleibt das"}],
["Sensor","o",{"title": "sensor"}],
["Sensor.field1","s","\x28\xff\xdc\xdd\x53\x15\x02\x9b",{"title":"test"}]
]

It compiles without any error, but the ESP8266 direct reboots after start.
In the sys_config_default.json in build I find:
"conf_acl": "*",
"hello": {
"who": "world",
"wo": "ASDFAGSFAGSFSGA"
},
"Sensor": {
"field1": "(\u00ff\u00dc\u00ddS\u0015\u0002\u009b"
}
}

I would expect the same content like in the yaml file.

What is my mistake ?

Regards
Holger

Comments

  • rojerrojer Dublin, Ireland

    config is not designed to hold binary data. device reboot is probably the result of failing to parse the value.
    you should hex- or base64 encode the value and have your code decode it.
    there are helpers for base64 in common/base64.h.

  • Thanks for your fast and helpful response.
    I will encode the data like an IP Address.

Sign In or Register to comment.