xSnowHeadx / HollowClock

An analog clock with flying hands controlled from internet-time via ESP8266
GNU General Public License v3.0
13 stars 4 forks source link

re: use of WTAClient #2

Closed lang55 closed 1 year ago

lang55 commented 1 year ago

Your enhancements to this project are phenomenal. THANKS for sharing! I apologize for the question, but this is my first IOT / ESP8266 project - Everything is printed and assembled. I have the 8266 flashed and able to receive an uploaded script but I'm stumped on what's next. What script(s) are required to make the clock function? Is the WTAClient used in combination with the HollowCLock script? If so, what is the process for running the WTAClient?

xSnowHeadx commented 1 year ago

If you successfully built the project and flashed it to the ESP8266 no further scripts are necessary. The clock opens a not secured access point named "HollowClockAP". Connect to it via WiFi (no password necessary), open on the start page of the WiFiManager the page "Configure WiFi" as described in the WiFiManager-repository How It Works and enter and save your WiFi-Settings. Then the clock automatically will retrieve the internet time and adjust the hands (they must stay at 12 o' clock at startup).

lang55 commented 1 year ago

Snowhead, THANKS for your reply. I think I have a better understanding of the "WiFiManager" but I'm unable to compile the HollowClock.ino file. (when I previously referred to flashing the 8266 I should have specified firmware. I have successfully uploaded an example file from ArduinoIDE) I'm obviously doing something wrong during the compiling process of HollowClock. I've made numerous attempts modifying file locations, etc but continue to receive errors, the most recent are attached. These were received with the WiFiManager.h and WTAClient.h located in the same folder as HollowClock.ino. I really appreciate your patience and assistance! THANKS

Compile errors.txt

xSnowHeadx commented 1 year ago

I'm not so familiar with the Arduino-IDE because I'm using the sloeber-IDE from begin of programming for the ESP8266. But I installed and tried the new version of the Arduino-IDE (2.0.3) to reproduce your issue. But without making any special settings (except installing the necessary libraries) and with only open the ino-sketch in the checked out repository the build process finished successful. So I unfortunately can't say what's wrong with your IDE. I only can suggest to install the newest version of this IDE.

ide

jneilliii commented 1 year ago

wouldn't the .h and .cpp file go into libraries instead of being in the checkout folder?

xSnowHeadx commented 1 year ago

The WTAClient is not organized to act as a library. It's not an issue in my mind to have more than one source file within a project.

lang55 commented 1 year ago

is Wifimanager the only required library?

xSnowHeadx commented 1 year ago

No, all required additional libraries are listed in the README.md.

lang55 commented 1 year ago

OK, I'll install the newest ArdunoIDE, the necessary libraries and try again. One last question, I think, Do I place my Wifi credentials in the WTAClient.cpp file and copy it and the WTAClient.h files in the directory with HollowClock.ino? THANKS for your help!!

xSnowHeadx commented 1 year ago

It's not recommended to keep the WiFi-credentials somewhere in plain text. Let the credentials empty in the source and enter them later on runtime via the configuration portal of the WiFiManager as described above.

lang55 commented 1 year ago

SUCCESS, I think? The HollowClock.ino compiled and uploaded successfully. I now see HollowClockAP as an access point. Using the WiFi configuration I entered my wifi credentials and selected Save. The HollowClockAP is still visible. Does that sound like success?

xSnowHeadx commented 1 year ago

At least a first success. If the ESP successfully connected to your network the AP should disappear and the stepper should start to move. If this not occurs, open the serial console of the IDE with 115kBaud and watch the log of the connection process after pressing the reset button of the ESP. Keep in mind that depending on your project settings the previous saved credentials may be deleted when the firmware is flashed again.

lang55 commented 1 year ago

I finally got back to the clock project. I've tested as you suggested. Using the WiFi manager I entered my network access but the AP does not disappear from my WiFi. Using the serial monitor the results can be seen in one of the images below. After reviewing my libraries, I'm suspicious of a problem with a couple of files. I've not been able to find exact matches for DNSServer or ursADC in either ArduinoIDE or searching Github. I used files that I hoped would be compatible. Could you please provide links to the correct files for downloading? THANKS !

HollowClock Sketch folder Libraries folder Serial monitor

xSnowHeadx commented 1 year ago

Your Log looks weird. It should look like this:

SDK:2.2.2-dev(38a443e)/Core:unspecified=0/lwIP:STABLE-2_1_2_RELEASE/glue:1.2-48-g7421258/BearSSL:6105635
*wm:[1] AutoConnect 
*wm:[2] Connecting as wifi client... 
*wm:[2] setSTAConfig static ip not set, skipping 
*wm:[1] Connecting to SAVED AP: Network
scandone
*wm:[1] connectTimeout not set, ESP waitForConnectResult... 
scandone
state: 0 -> 2 (b0)
state: 2 -> 3 (0)
state: 3 -> 5 (10)
add 0
aid 9
cnt 

connected with Network, channel 6
dhcp client start...
ip:192.168.0.76,mask:255.255.255.0,gw:192.168.0.128
*wm:[2] Connection result: WL_CONNECTED
*wm:[1] AutoConnect: SUCCESS 
*wm:[1] STA IP Address: 192.168.0.76
connected...yeey :)

The UrsADC-library is not necessary for this project. I removed this line from README.md. The DSNServer I got from here.

lang55 commented 1 year ago

I finally got back to this project and with success, I think. One of my problems was I had the wrong USB driver for the board I was initially using. I've since changed to a different board using the CP210x chipset. The stepper motor now begins to spin and run after Wifi configuration! Now I need to assemble the clock. THANKS for your modifications, continued support and patience!!

xSnowHeadx commented 1 year ago

Thanks for your feedback. Have fun with your clock!