Programmatic Configuration (over HTTP/Serial)?

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
jlmcgehee21
New user
Posts: 1
Joined: 05 Aug 2018, 15:23

Programmatic Configuration (over HTTP/Serial)?

#1 Post by jlmcgehee21 » 05 Aug 2018, 15:42

I'm new to the ESP Easy, and could not find any documentation on how (if possible) to set a device configuration programmatically. My use case is to build something like 10-15 devices for my home automation system (Home Assistant) and then be able to deploy identical configurations to all of them (with the exception of `Name`, etc).

I want to maintain a file in my home automation git repository with all the device names and IP addresses and write a script which automatically generates configuration files and pushes them to all devices.

I noticed that the `config.dat` file is some sort of non-string binary format, so I can't easily edit this file and deploy it to multiple devices. The device `JSON` output looks reasonable to work with, but I don't suspect that I can edit this and upload it to a new device.

Sooo... Before I start digging into the source code, any options for what I'm trying to do? If not, can anyone point the way to a reasonable implementation in the source code? I'm a professional web and firmware developer, and have a lot of experience working with platformio, so I'm comfortable building a customization of some sort, but am hoping for out of the box support for what I'm trying to do.

PS: I understand the security implications of this being possible, but there are secure ways to do this, such as cryptographic signing of the configuration file (which would allow a device to verify that a configuration is "friendly").

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

Re: Programmatic Configuration (over HTTP/Serial)?

#2 Post by grovkillen » 05 Aug 2018, 17:01

Not other that serial programming. The actual device settings is only possible to deploy with an upload of a config.dat file. But that file will also contain unit numbers and names so you would need to program those after the upload.

Anyway, we totally agree that we would want to do this more dynamic and we will be able to do more in for future releases but this is not yet in the pipe. Your feedback is greatly appreciated. Please feel free to add your ideas here.
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: 8739
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: Programmatic Configuration (over HTTP/Serial)?

#3 Post by TD-er » 05 Aug 2018, 17:17

You can already set a few things using commands.
Those commands can be entered at least via serial, but also via the webinterface.
For example "name,bladiebla" will set the name of the unit to "bladiebla"
See https://www.letscontrolit.com/wiki/inde ... _Reference

Post Reply

Who is online

Users browsing this forum: No registered users and 79 guests