Comments (10)
from esp8266-iot-framework.
Thanks for reporting, however I agree with clabnet, this is related to your local toolchain or PlatformIO, and not to this repository :).
from esp8266-iot-framework.
For completeness sake since this was also discussed in https://community.platformio.org/t/cannot-build-the-project-keyerror-value/17834/
KeyError: 'value':
File "C:\Users\shalk\Documents\PlatformIO\Projects\Test_Project_Framework.pio\libdeps\esp12e\ESP8266 IoT Framework\scripts\preBuildConfig.py", line 43:
cpp.write("\t" + str(item['value']).lower())
esp8266-iot-framework/scripts/preBuildConfig.py
Lines 14 to 47 in 4ef80a1
The extra script of the library in this repository is throwing that error (see stacktrace), but it seems to do so because a malformed .json file of the user, if it can't read the value
attribute of the object in the JSON file.
from esp8266-iot-framework.
Hi @maakbaas !
I'm getting this error for every single example that have tested.
File "/home/fernandogarcia/Downloads/ESP8266-Iot-framework-test-main/remote-esp-web/.pio/libdeps/esp12e/ESP8266 IoT Framework/scripts/preBuildConfig.py", line 61: cpp.write('\t"' + item["value"] + '"')
I think it doesn't look like an user error since the content of "/../gui/js/configuration.json"
is created automatically for your script.
Also I think there's no error in path since the file is opened correctly.
I have checked it using this piece of code before preBuildConfigFun()
function.
import sys
filename = inspect.getframeinfo(inspect.currentframe()).filename
dir_path = os.path.dirname(os.path.abspath(filename))
filename = "config"
h = open(dir_path + "/../src/generated/" + filename + ".h", "w", encoding="utf8")
cpp = open(dir_path + "/../src/generated/" + filename + ".cpp", "w", encoding="utf8")
configFile = open(dir_path + "/../gui/js/configuration.json")
if configFile:
print("Opened!")
for line in configFile:
print(line)
sys.exit()
Here you can see the output of this code.
Could you give some suggestion to fix this problem please?
Best regards.
from esp8266-iot-framework.
Are you sure you did not modify the code?
This line does not exist in the standard script:
cpp.write('\t"' + item["value"] + '"')
from esp8266-iot-framework.
Max has quoted the code above. Line 40.
from esp8266-iot-framework.
Full compiling output:
Click to expand
> [email protected] build > webpack --mode=productionHash: 30c32e37ec7c4bc7986f
Version: webpack 4.42.1
Time: 9014ms
Built at: 14/07/2021 17:04:50
Asset Size Chunks Chunk Names
./index.html 453 KiB [emitted] [big]
./index.html.gz 122 KiB [emitted]
bundle.js 450 KiB 0 [emitted] [big] main
bundle.js.gz 120 KiB [emitted]
main.css 3.52 KiB 0, 0 [emitted] main, main
main.css.gz 1.01 KiB [emitted]
Entrypoint main [big] = main.css main.css bundle.js
[0] ./node_modules/preact/compat/dist/compat.module.js + 2 modules 19.2 KiB {0} [built]
| 3 modules
[2] ./gui/js/configuration.json 1.63 KiB {0} [built]
[4] ./gui/js/lang/en.json 2.25 KiB {0} [built]
[7] ./gui/js/lang sync ^./.*.json$ 216 bytes {0} [built]
[10] ./gui/js/dashboard.json 10 bytes {0} [built]
[12] (webpack)/buildin/global.js 472 bytes {0} [built]
[29] ./node_modules/@emotion/is-prop-valid/dist/is-prop-valid.browser.esm.js + 1 modules 4.41 KiB {0} [built]
| 2 modules
[46] ./gui/js/lang/de.json 2.38 KiB {0} [optional] [built]
[47] ./gui/js/lang/nl.json 2.34 KiB {0} [optional] [built]
[48] ./gui/js/lang/zh.json 2.12 KiB {0} [optional] [built]
[74] ./gui/js/index.js + 335 modules 1000 KiB {0} [built]
| ./gui/js/index.js 7.28 KiB [built]
| ./gui/js/comp/UiComponents.js 10.7 KiB [built]
| ./gui/js/comp/WifiPage.js 8.22 KiB [built]
| ./gui/js/functions/configHelpers.js 5.25 KiB [built]
| ./gui/js/comp/ConfigPage.js 2.22 KiB [built]
| ./gui/js/comp/DashboardPage.js 4.45 KiB [built]
| ./gui/js/comp/FilePage.js 785 bytes [built]
| ./gui/js/comp/FirmwarePage.js 7.83 KiB [built]
| ./gui/js/comp/DashboardItems.js 9.06 KiB [built]
| ./gui/js/comp/FileListing.js 8.68 KiB [built]
| ./gui/js/comp/ControlItem.js 7.27 KiB [built]
| ./gui/js/comp/DisplayItem.js 2.41 KiB [built]
| + 324 hidden modules
+ 129 hidden modules
WARNING in asset size limit: The following asset(s) exceed the recommended size limit (244 KiB).
This can impact web performance.
Assets:
bundle.js (450 KiB)
./index.html (453 KiB)
WARNING in entrypoint size limit: The following entrypoint(s) combined asset size exceeds the recommended limit (244 KiB). This can impact web performance.
Entrypoints:
main (453 KiB)
main.css
bundle.js
WARNING in webpack performance recommendations:
You can limit the size of your bundles by using import() or require.ensure to lazy load some parts of your application.
For more info visit https://webpack.js.org/guides/code-splitting/
Child html-webpack-plugin for "index.html":
1 asset
Entrypoint undefined = ./index.html
[0] ./node_modules/html-webpack-plugin/lib/loader.js!./gui/index.html 277 bytes {0} [built]
Child mini-css-extract-plugin ../ESP8266 IoT Framework/node_modules/css-loader/dist/cjs.js!../ESP8266 IoT Framework/node_modules/react-vis/dist/style.css:
Entrypoint mini-css-extract-plugin = *
2 modules
KeyError: 'value':
File "/home/fernandogarcia/.platformio/penv/lib/python3.7/site-packages/platformio/builder/main.py", line 177:
env.SConscript("$BUILD_SCRIPT")
File "/home/fernandogarcia/.platformio/packages/tool-scons/scons-local-4.1.0/SCons/Script/SConscript.py", line 591:
return _SConscript(self.fs, *files, **subst_kw)
File "/home/fernandogarcia/.platformio/packages/tool-scons/scons-local-4.1.0/SCons/Script/SConscript.py", line 280:
exec(compile(scriptdata, scriptname, 'exec'), call_stack[-1].globals)
File "/home/fernandogarcia/.platformio/platforms/espressif8266/builder/main.py", line 238:
target_elf = env.BuildProgram()
File "/home/fernandogarcia/.platformio/packages/tool-scons/scons-local-4.1.0/SCons/Util.py", line 658:
return self.method(*nargs, **kwargs)
File "/home/fernandogarcia/.platformio/penv/lib/python3.7/site-packages/platformio/builder/tools/platformio.py", line 62:
env.ProcessProjectDeps()
File "/home/fernandogarcia/.platformio/packages/tool-scons/scons-local-4.1.0/SCons/Util.py", line 658:
return self.method(*nargs, **kwargs)
File "/home/fernandogarcia/.platformio/penv/lib/python3.7/site-packages/platformio/builder/tools/platformio.py", line 140:
project_lib_builder = env.ConfigureProjectLibBuilder()
File "/home/fernandogarcia/.platformio/packages/tool-scons/scons-local-4.1.0/SCons/Util.py", line 658:
return self.method(*nargs, **kwargs)
File "/home/fernandogarcia/.platformio/penv/lib/python3.7/site-packages/platformio/builder/tools/piolib.py", line 1062:
project.install_dependencies()
File "/home/fernandogarcia/.platformio/penv/lib/python3.7/site-packages/platformio/builder/tools/piolib.py", line 880:
if _is_builtin(spec):
File "/home/fernandogarcia/.platformio/penv/lib/python3.7/site-packages/platformio/builder/tools/piolib.py", line 872:
for lb in self.env.GetLibBuilders():
File "/home/fernandogarcia/.platformio/packages/tool-scons/scons-local-4.1.0/SCons/Util.py", line 658:
return self.method(*nargs, **kwargs)
File "/home/fernandogarcia/.platformio/penv/lib/python3.7/site-packages/platformio/builder/tools/piolib.py", line 993:
lb = LibBuilderFactory.new(env, lib_dir)
File "/home/fernandogarcia/.platformio/penv/lib/python3.7/site-packages/platformio/builder/tools/piolib.py", line 61:
obj = getattr(sys.modules[name], clsname)(env, path, verbose=verbose)
File "/home/fernandogarcia/.platformio/penv/lib/python3.7/site-packages/platformio/builder/tools/piolib.py", line 137:
self.process_extra_options()
File "/home/fernandogarcia/.platformio/penv/lib/python3.7/site-packages/platformio/builder/tools/piolib.py", line 282:
exports={"env": self.env, "pio_lib_builder": self},
File "/home/fernandogarcia/.platformio/packages/tool-scons/scons-local-4.1.0/SCons/Script/SConscript.py", line 591:
return _SConscript(self.fs, *files, **subst_kw)
File "/home/fernandogarcia/.platformio/packages/tool-scons/scons-local-4.1.0/SCons/Script/SConscript.py", line 280:
exec(compile(scriptdata, scriptname, 'exec'), call_stack[-1].globals)
File "/home/fernandogarcia/Downloads/ESP8266-Iot-framework-test-main/remote-esp-web/.pio/libdeps/esp12e/ESP8266 IoT Framework/scripts/preBuild.py", line 58:
preBuildConfigFun()
File "/home/fernandogarcia/Downloads/ESP8266-Iot-framework-test-main/remote-esp-web/.pio/libdeps/esp12e/ESP8266 IoT Framework/scripts/preBuildConfig.py", line 47:
cpp.write('\t"' + item["value"] + '"')
from esp8266-iot-framework.
If do you want try reproduce this error you can use this files.
from esp8266-iot-framework.
You used the example JSON file from the dashboard for the configuration manager. For the configuration manager, the field value
in the JSON file is mandatory, that is what you see in the error message. Fix this by changing your platformio.ini
to:
build_flags = -DDASHBOARD_PATH=webconfig.json -DREBUILD_HTML
from esp8266-iot-framework.
Hi!
Thanks for your help.
I think there's a gap in the documentation in this point.
I did a PR to try leave it more clear.
Best regards.
from esp8266-iot-framework.
Related Issues (20)
- Holding connections open for long periods of time HOT 4
- Event on Dashboard Change HOT 12
- Detect if captive portal is running and WiFi is in Ad-hoc mode HOT 3
- Separator and titol in config page HOT 1
- Enhancement: Adding "label" in dashboard HOT 4
- mDNS not working HOT 1
- Error when run "npm ci" HOT 7
- Failing at Step 9. HOT 3
- WiFi passwords including "+" not working HOT 3
- 403 Forbidden response to GET request HOT 1
- Dependency issues in library HOT 4
- Request: click button in dashboard HOT 1
- WIFI reconnect HOT 1
- The cipher AES128-SHA is not supported for TLSv1.2. HOT 5
- Import issue Arduino IDE 2.1.1 HOT 3
- html.h not being rebuild HOT 1
- ssl.wrap_socket() gots removed within python 3.12
- Json name with spaces HOT 1
- Missing dependancy HOT 1
- Upload empty file failes HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from esp8266-iot-framework.