electrical-pro / SmartBoard

58 stars 27 forks source link

Compilation error #1

Closed OZ-786 closed 2 years ago

OZ-786 commented 2 years ago

Am trying to use your code but am getting an error during the compilation of the code,

The error message ~ "no matching function for call to LiquidCrystal_12C: begin()'"

Screenshot (1)

Your reply will be greatly appreciated.

electrical-pro commented 2 years ago

Hi, please download the necessary libraries: https://github.com/electrical-pro/SmartBoard/blob/main/libraries.zip copy them from the archive to: C:\Users\\Documents\Arduino\libraries

P.S. Please use the LiquidCrystal_I2C library from my archive I modified the library, I removed Wire.begin(5, 14);

electrical-pro commented 2 years ago

@OZ-786 Please tell me if it compiles now

OZ-786 commented 2 years ago

Thanks for the swift reply, I just downloaded the libraries and move them to the Arduino libraries location. Now it's showing a different error message

Error message ~ Error compiling for board ModeNCU 1.0 (ESP-17E Module).

Screenshot (5)

Screenshot (4)

electrical-pro commented 2 years ago

Annotation 2021-12-06 222932 It compiles on my side, so I think the problem may be with the version of the core that you use. Please try using 2.7.4

OZ-786 commented 2 years ago

wow it finally worked thank you. Screenshot (8)

OZ-786 commented 2 years ago

I have a question, the DATA FILE, PWSOURCE AND THE GZIP.rar. what location am I suppose to place them, Because now that have uploaded the codes this is what my UI looks like this

Screenshot (14)

Screenshot (10) Screenshot (11)

so how will I make it be like the UI in the YouTube video sir

Screenshot (15)

electrical-pro commented 2 years ago

'data' folder is in the right place next to the sketch, don't worry, you just need to use Arduino IDE to upload files to the ESP8266 file system, just click "ESP8266 Sketch Data Upload" Untitled-1 If you don't see this option install the plugin from here: https://github.com/esp8266/arduino-esp8266fs-plugin

electrical-pro commented 2 years ago

This is WI-Fi manager, it allows you to connect ESP8266 to your Wi-Fi router 144940057-4095f60b-25bf-4ec8-a426-14808ccec161 you can read about it here: https://github.com/tzapu/WiFiManager This WI-Fi manager only starts working when ESP8266 can't connect to your router. After you successfully connect ESP8266 to your router the network "PowerControlESP | Offline" will disappear, and WI-Fi manager will not be accessible.

electrical-pro commented 2 years ago

image http://192.168.4.1 is only for "WI-Fi manager" when you are offline. (if you really want to access the power monitoring webpage without a router then use 8089 port: http://192.168.4.1:8089, but I don't recommend it, better connect it to your Wi-Fi router) After you connect ESP8266 to the router using "WI-Fi manager" the router will give an IP address on its local network, in my case it is at 192.168.4.215, notice the port is 8089. So actual power monitoring page is at 192.168.x.x:8089 (depends on the router) You need to upload files from "data" folder for this to work as I previously told (just click ESP8266 Sketch Data Upload)

P.S. Just for fun: you can also try http://192.168.4.1:8089/Feed_JSON to see data in JSON format if you want, even if you did not upload files :) or try this: http://192.168.4.1:8089/smartData image image

electrical-pro commented 2 years ago

There are some local charts available when you click on the green 'MORE' button Annotation 2021-12-07 102623 image They don't have any history, they are live charts (updates every few seconds) image

electrical-pro commented 2 years ago

If you want to store the history of measurements you need to send them to https://thingspeak.com/ Change this line of the code in the sketch (add your Write API key for the ThingSpeak channel)

const String writeAPIKey = "XXXAPIKEYXXX"; // write API key for your ThingSpeak Channel`

It will send data to their server every 60 seconds, you can see data on their website (they have their charts, but they are not very good).

If you need cool history charts like in the video then use this HTMLs, for Power: https://github.com/electrical-pro/epro/blob/main/power.html for Votage: https://github.com/electrical-pro/epro/blob/main/volt.html change this line:

channelKeys.push({channelNumber:1288695, name:'AC Voltage',key:'KMPJJFINTMO4GWQK',

Replace with your channel number and read API key You can just click on the downloaded and modified HTML file and open it in the browser, it will request the date from https://thingspeak.com/ and will build the chart. image

You can host HTML files whenever you want, I host them here on GitHub: example: https://electrical-pro.github.io/epro/volt.html

electrical-pro commented 2 years ago

This is NOT important (ignore): "pwSource" and "Gzip" folders are only needed if you want to modify internal HTML pages for the ESP8266 (you can delete "pwSource" and "Gzip" if you want, it's okay) image P.S. I've used Gzip to compress HTML pages to save space on ESP8266. Compressed pages stored in the "data" folder and uncompressed in "pwSource" folder. To be honest they don't really need to be compressed there is enough space on ESP8266, but that is how I build it. If you ever need to use Gzip to compress you need to install nodeJS image

electrical-pro commented 2 years ago

Tell me about your results

OZ-786 commented 2 years ago

thank you for this information you are giving me it as been a true helper to this project am trying to build.

I can't find this line of code channelKeys.push({channelNumber:1288695, name:'AC Voltage',key:'KMPJJFINTMO4GWQK', I don't know if you can give me line number of the code

it's only this I could find const String writeAPIKey = "XXXAPIKEYXXX"; // write API key for your ThingSpeak Channel`

Screenshot (19)

OZ-786 commented 2 years ago

During the uploading of the sketch I got a error massage the logs are shown below:

[SPIFFS] data : C:\Users\muham\OneDrive\Desktop\SmartBoard-main\ESP8266_PowerControl\data [SPIFFS] size : 2024 [SPIFFS] page : 256 [SPIFFS] block : 8192 /cntrl.html

/Current_Live.html

/Errors_Live.html

/esp8266-3.0.2.zip

SPIFFS_write error(-10001): File system is full.

error adding file!

SPIFFS Create Failed!

Screenshot (17) Screenshot (16)

electrical-pro commented 2 years ago

@OZ-786 Did you accidentally put a file "esp8266-3.0.2.zip" inside "data" folder? remove "esp8266-3.0.2.zip" from "data" folder, it should NOT be there

electrical-pro commented 2 years ago

image This are the files that should be in data folder Upload all of them https://github.com/electrical-pro/SmartBoard/tree/main/data

OZ-786 commented 2 years ago

I'm getting an error when I click on the more icon

error massage - ''''FILE EXIST, BUT YOU ARE NOT AUTHORIZED'''''' on the web UI

I don't know if it's because have not completed the circuit , the PZEM module as not been delivered to me yet

Screenshot (25)

Screenshot (23)

electrical-pro commented 2 years ago

Okay, go to http://192.168.4.1:8089/me (authorization) and then try again http://192.168.4.1:8089 or http://192.168.4.1:8089/more.html and it should work

"The file exists, but you are not authorized!" - is a simple safety feature that I implemented so in order to access files, you need to go to a secret URL first http://192.168.4.1:8089/me (you can program another one) When you go to http://192.168.x.x:8089/me it puts a cookie in your browser and you become an authorized user

to make it work right set it to false in the sketch

// set it to false, and then get auth cookie by going to 192.168.x.x:8089/me
bool PublicAccess = true;  // authorization 

If it is true it only allows you to go to http://192.168.4.1:8089 if it is false nothing is allowed unless you go to http://192.168.4.1:8089/me first

electrical-pro commented 2 years ago

does this http://192.168.4.1:8089 address work for you? should be like this, you should see MORE button image

OZ-786 commented 2 years ago

it works now. I still can't find this line of code

"channelKeys.push({channelNumber:1288695, name:'AC Voltage',key:'KMPJJFINTMO4GWQK',""

I don't know if you can give me line number of the code (position)

electrical-pro commented 2 years ago

@OZ-786 at line 218

image

https://github.com/electrical-pro/epro/blob/main/volt.html (download this file and modify for your needs)

With this you can see data from any thingSpeak channel (just replace with your channel number and your read API key) epro-main.zip (download everything)

OZ-786 commented 2 years ago

@electrical-pro thanks once again, it seem have gotten all the necessary codes installed already, I just have to wait for the remaining hardware to be delivered. surely I will post a feedback of the project

electrical-pro commented 2 years ago

@OZ-786 Thank you too, I hope this will be useful for other people who try to build this too. Btw, I updated the sketch today, now it compiles with the latest core 3.0.2, so no need for core 2.7.4 anymore :) You can update to 3.0.2 if you want. Also, now when it gets connected to the router it will show the IP address for a few seconds on the display.

Ghassanfardan commented 1 year ago

Great work !! I really liked your project idea and I am very excited to implement the project, Can you write to me all elements of the project pls ? because there is some element u connect in the video isn't exist in the element list and circuit diagram .

Waiting for your reply as soon as possible..

Ghassanfardan commented 1 year ago

@electrical-pro

paktam21 commented 1 year ago

how about this error sir? what should i do?

IMG20221012012557 IMG-20221012-WA0006 IMG-20221012-WA0004 IMG-20221012-WA0005

munzoorf95 commented 1 year ago

Hello Mate, How are you? Can you please share the circut diagram and resistor value, which you made to handle 2000v volts?