Comments (12)
Hi Marco,
A color picker is already possible. Please refer to the documentation in this section:
https://github.com/maakbaas/esp8266-iot-framework/blob/master/docs/config-manager.md#code-generation
Any reason why sliders and combo boxes do not work on the configuration page for you? That should also be possible.
With regards to the callback. This is currently not part of the framework. I don't see another way than storing a copy and polling in your main loop for changes for a particular variable. That should be fairly easy to implement in your own application. I hope in that way you can still achieve what you are looking for.
from esp8266-iot-framework.
Hi,
i delete .pio folder, and after compiling again it worked.
Regards
Marco
from esp8266-iot-framework.
@marcolino7 Then please close the issue.
from esp8266-iot-framework.
@Eisbaeeer
yes, you are right and sorry for delay closing this
from esp8266-iot-framework.
Hi @maakbaas
I have an old version of docs on my disk, I just found colorepicker and slider in config documentation on line.
I have an issue with colorpicker I think.
I used this syntax in cofiguration.json
{ "name": "dispayColor", "label": "Display Color", "type": "uint16_t", "control" : "color", "value": [255, 0, 0] },
But when I compile I got this error in compiled config.cpp:
.pio\libdeps\esp12e\ESP8266 IoT Framework\src\generated\config.cpp:12:3: error: expected identifier before numeric constant 12 | [255, 0, 0], | ^~~ .pio\libdeps\esp12e\ESP8266 IoT Framework\src\generated\config.cpp:12:6: error: expected ']' before ',' token 12 | [255, 0, 0], | ^ | ] .pio\libdeps\esp12e\ESP8266 IoT Framework\src\generated\config.cpp: In lambda function: .pio\libdeps\esp12e\ESP8266 IoT Framework\src\generated\config.cpp:12:6: error: expected '{' before ',' token .pio\libdeps\esp12e\ESP8266 IoT Framework\src\generated\config.cpp: At global scope: .pio\libdeps\esp12e\ESP8266 IoT Framework\src\generated\config.cpp:12:12: error: expected '}' before ']' token 12 | [255, 0, 0], | ^ .pio\libdeps\esp12e\ESP8266 IoT Framework\src\generated\config.cpp:7:1: note: to match this '{' 7 | { | ^ .pio\libdeps\esp12e\ESP8266 IoT Framework\src\generated\config.cpp:12:12: error: too many initializers for 'const configData' 12 | [255, 0, 0], | ^ .pio\libdeps\esp12e\ESP8266 IoT Framework\src\generated\config.cpp:12:12: error: expected ',' or ';' before ']' token .pio\libdeps\esp12e\ESP8266 IoT Framework\src\generated\config.cpp:14:1: error: expected declaration before '}' token 14 | }; | ^ *** [.pio\build\esp12e\libc5e\ESP8266 IoT Framework\generated\config.cpp.o] Error 1
and opening file, spell checking show an error:
Do I miss something?
Thanks
from esp8266-iot-framework.
I am away from home, so will only be able to look at this further second half of March. Sorry about that.
If anybody else can test the same code in the meantime and report back that would be helpful.
from esp8266-iot-framework.
Hi @maakbaas ,
thanks for answer. Perhaps it could be better change subject of the issue or open a new one, with subject more related to the issue.
Let me know.
Marco
from esp8266-iot-framework.
Hi @marcolino7 You have to define the colorpicker in "configuration.json" like this:
{ "name": "colorGreen", "label": "Color green", "type": "color", "value": [0,255,0] },
and the folder of "configuration.json" in "platformio.ini" like this:
build_flags = -DCONFIG_PATH=src/configuration.json
Then put the configuration in your src path. See example in documentation.
Greets Lars
from esp8266-iot-framework.
Hi @Eisbaeeer ,
I defined configuration.json like this:
{
"name": "dispayColor",
"label": "Display Color",
"type": "color",
"value": [255, 0, 0]
},
And compiling i got this error:
.pio\libdeps\esp12e\ESP8266 IoT Framework\src\generated\config.cpp:12:4: error: expected identifier before ',' token
12 | {[,2,5},
| ^
.pio\libdeps\esp12e\ESP8266 IoT Framework\src\generated\config.cpp:12:4: error: expected ']' before ',' token
12 | {[,2,5},
| ^
| ]
.pio\libdeps\esp12e\ESP8266 IoT Framework\src\generated\config.cpp: In lambda function:
.pio\libdeps\esp12e\ESP8266 IoT Framework\src\generated\config.cpp:12:4: error: expected '{' before ',' token
.pio\libdeps\esp12e\ESP8266 IoT Framework\src\generated\config.cpp: At global scope:
.pio\libdeps\esp12e\ESP8266 IoT Framework\src\generated\config.cpp:14:1: error: invalid user-defined conversion from '<lambda()>' to 'uint8_t' {aka 'unsigned char'} [-fpermissive]
14 | };
| ^
.pio\libdeps\esp12e\ESP8266 IoT Framework\src\generated\config.cpp:12:3: note: candidate is: 'constexpr<lambda()>::operator void (*)()() const' (near match)
12 | {[,2,5},
| ^
.pio\libdeps\esp12e\ESP8266 IoT Framework\src\generated\config.cpp:12:3: note: no known conversion from 'void (*)()' to 'uint8_t' {aka 'unsigned char'}
Looking at generated config.cpp
there is some issue revealed bt spell checker.
Any ideas?
Thanks
from esp8266-iot-framework.
Can you paste the whole "configuration.json", plese?
I think there is a problem.
from esp8266-iot-framework.
Here it is:
[
{
"name": "projectName",
"label": "Project Name",
"type": "char",
"length": 32,
"value": "Big Clock by Pozzy"
},
{
"name": "autoBrig",
"label": "Automatic Brightness",
"type": "bool",
"value": true
},
{
"name": "minBrig",
"label": "Min Brightness",
"type": "uint16_t",
"control": "slider",
"min": 1,
"max": 250,
"step": 1,
"value": 10
},
{
"name": "maxBrig",
"label": "Max Brightness",
"type": "uint16_t",
"control": "slider",
"min": 10,
"max": 255,
"step": 1,
"value": 255
},
{
"name": "dispayColor",
"label": "Display Color",
"type": "color",
"value": [255,0,0]
},
{
"name": "showTemp",
"label": "Show Temperature",
"type": "bool",
"value": true
}
]
from esp8266-iot-framework.
Ok, the only difference I saw are the "values". I define value like this:
{ "name": "WS28_Intensity", "label": "LED Stripe brightness (0-255)", "type": "uint16_t", "control": "slider", "min": 0, "max": 255, "length": 5, "value": "128" },
from esp8266-iot-framework.
Related Issues (20)
- Holding connections open for long periods of time HOT 4
- 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.