# uploading an include file to an ESP8266

**URL:** <https://forum.arduino.cc/t/uploading-an-include-file-to-an-esp8266/570706>\
**Category:** Programming\
**Created:** [January 29, 2019, 12:18pm UTC](https://forum.arduino.cc/t/uploading-an-include-file-to-an-esp8266/570706 "2019-01-29T12:18:40Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![NextPirate](https://avatars.discourse-cdn.com/v4/letter/n/9e8a1a/32.png) [@NextPirate](https://forum.arduino.cc/u/NextPirate)\
**Post date:** [January 29, 2019, 12:18pm UTC](https://forum.arduino.cc/t/uploading-an-include-file-to-an-esp8266/570706/1 "2019-01-29T12:18:40Z")

</div>

I've been search for a way to upload "settings.h" to an ESP8266 with having to flash the chip.

I have found where we can Post files to SPIFF but have yet to find how I can POST a file to where it can be used as an "include" file in the Sketch.

I tried #include \</data/settings.h\> but that yields an error.

The idea is that in operation the chip will be physically installed in a place that is hard to get at. In order to update the chip with configuration settings for ht e application, I put all those settings in an Include file.

What I want to do is to replace the Include file (Setting.h) using a call to the ESP8266.

I was following this but I could not figure out how to get the file to anyplace but in /data inthe SPIFF:

[https://tttapa.github.io/ESP8266/Chap12%20-%20Uploading%20to%20Server.html](https://tttapa.github.io/ESP8266/Chap12%20-%20Uploading%20to%20Server.html)

---

<div class="post-metadata">

**Author:** ![PieterP](https://avatars.discourse-cdn.com/v4/letter/p/ecccb3/32.png) [@PieterP](https://forum.arduino.cc/u/PieterP)\
**Post date:** [January 29, 2019, 12:22pm UTC](https://forum.arduino.cc/t/uploading-an-include-file-to-an-esp8266/570706/2 "2019-01-29T12:22:58Z")

</div>

You can't.

Settings.h is added to your source code by the preprocessor, so the path is a path on your computer. Then it is compiled into an executable file.

You cannot possibly change it at runtime, you have to compile it again.

What you can do is adding a config file that you add to the SPIFFS and read it in the setup, setting some configuration variables.

Pieter

---

<div class="post-metadata">

**Author:** ![NextPirate](https://avatars.discourse-cdn.com/v4/letter/n/9e8a1a/32.png) [@NextPirate](https://forum.arduino.cc/u/NextPirate)\
**Post date:** [January 29, 2019, 2:11pm UTC](https://forum.arduino.cc/t/uploading-an-include-file-to-an-esp8266/570706/3 "2019-01-29T14:11:17Z")

</div>

Got it. Thanks. 🙂

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/system/32/1140315_2.png) [@system](https://forum.arduino.cc/u/system)\
**Post date:** [May 5, 2021, 11:36pm UTC](https://forum.arduino.cc/t/uploading-an-include-file-to-an-esp8266/570706/4 "2021-05-05T23:36:27Z")

</div>

Closed on May 5, 2021, 11:36pm UTC


