maakbaas / esp8266-iot-framework

Framework for IoT projects implementing HTTPS requests, a React web interface, WiFi manager, live dashboard, configuration manager, file manager and OTA updates.
GNU General Public License v3.0
416 stars 113 forks source link

web client is not showing the data structures #103

Closed kindredally closed 3 years ago

kindredally commented 3 years ago

Building the dashboard demo using instructions and code from latest github. The json data does not appear on the dashboard. It shows no data in json file... Is there some build option I am missing ...its like something is not getting generated. What can I check? Thank you.

; PlatformIO Project Configuration File ; ; Build options: build flags, source filter ; Upload options: custom upload port, speed and extra flags ; Library options: dependencies, extra library storages ; Advanced options: extra scripting ; ; Please visit documentation for the other options and examples ; https://docs.platformio.org/page/projectconf.html

[env:d1_mini] platform = espressif8266 board = d1_mini framework = arduino

monitor_speed = 115200

lib_deps = ESP Async WebServer, ArduinoJson

the script below regenerates

the HTML page using webpack

the config objects

the certificate store

extra_scripts = scripts/preBuild.py

build_flags = -DDASHBOARD_PATH=examples/dashboard/dashboard.json -DBOARDREBUILD_DASH -DREBUILD_HTML

available build flags:

-DREBUILD_HTML forces a rebuild of the html.h, this is needed if you make modifications to the GUI, or the configuration or dashboard JSON files

-DREBUILD_CERTS forces a rebuild of the root certificate store

-DOPENSSL="C:/Program Files/Git/usr/bin/openssl.exe" Path to openssl executable

-DREBUILD_CONFIG forces a rebuild of the configuration manager cpp files based on the JSON

-DBOARDREBUILD_DASH forces a rebuild of the dashboard cpp files based on the JSON

-DDOMAIN_LIST=google.com,maakbaas.com comma separated list of domain names to limit the certificates included

-DCONFIG_PATH=configuration.json defines a custom location for your JSON file

-DDASHBOARD_PATH=dashboard.json defines a custom location for your JSON file

and generated file#ifndef DASH_H

define DASH_H

struct dashboardData { char projectName[32]; char stringInput[32]; uint16_t dummyInt; bool dummyBool; float dummyFloat; uint16_t inputInt; bool inputBool; float inputFloat; };

endif

but...

on web page:

ESP8266 IoT Framework WiFi Settings Dashboard Configuration File Manager Firmware Update Dashboard CONNECTING There are no items defined in the JSON file

kindredally commented 3 years ago

It is okay to close this. But, I might suggest something be added to the scripts to check the environment is setup correctly, specifically for the project directory ci. I missed it. I have now installed all the latest packages and its building with no errors. I had to modify preBuild.py (removing the ../): elif isinstance(item, tuple) and item[0] == "CONFIG_PATH": copyfile(env.get("PROJECT_DIR") + '/' + item[1], 'gui/js/configuration.json') elif isinstance(item, tuple) and item[0] == "DASHBOARD_PATH": copyfile(env.get("PROJECT_DIR") + '/' + item[1], 'gui/js/dashboard.json') elif isinstance(item, tuple) and item[0] == "DOMAIN_LIST": domains = item[1] elif isinstance(item, tuple) and item[0].lower() == "openssl": openssl = item[1] and I added the empty subdirectory 'include'