victor7376 / BTTF-World-Clock

Delorean clock - Back to the future style clock - with 3 Timezones
3 stars 1 forks source link

Can't Get Displays To Light Work (Tried Capacitor Fix) #1

Open BzowK opened 2 years ago

BzowK commented 2 years ago

Good Afternoon!

I've been trying to get your code working, but am having a couple of issues so thought I'd post to see if you had suggestions. After working for 2-3 hours, I cannot get the displays to work at all (except for LED on back turning on). I'm using a 38 pin ESP32 Dev Board as suggested plus the same TM1637 displays used by the original project.

Notes

Below is what I've tried without luck :(

Serial Output (Last 2 lines update every few seconds)

Ready
IP address: 192.168.0.129

Updating Time...
Getting Time Data for 35.946496,-86.6746368
GET /v2.1/get-time-zone?key=AXCCFDXHDQPO&format=json&by=position&lat=35.946496&lng=-86.6746368 HTTP/1.1
Waiting for data
{"endpoints":[{"url":"https:\/\/a.nel.cloudflare.com\/report\/v3?s=imeGvv22g9%2FxJpYYy%2Fg9Z3SjOFNHFzkdj2UIB0fCbaoa2mpCw1x0R9T74GP2TgKvsHEXeAksJxU1MIDCvX6VQWDnrLMS4bxTBYQ3X%2Fq8xO2%2B9YE3XFQGQzmQH1GqBPTAj9dH%2B7k%3D"}{"success_fraction":0,"report_to":"cf-nel","max_age":604800}{
    "status": "OK",
    "message": "",
    "countryCode": "US",
    "countryName": "United States of America",
    "regionName": "Tennessee",
    "cityName": "Nolensville",
    "zoneName": "America\/Chicago",
    "abbreviation": "CDT",
    "gmtOffset": -18000,
    "dst": "1",
    "zoneStart": 1647158400,
    "zoneEnd": 1667718000,
    "nextAbbreviation": "CST",
    "timestamp": 1647343584,
    "formatted": "2022-03-15 11:26:24"
}

firstEpoch is: 20

10:00:20 Thu 01 Jan 1970 AEST Sydney
22:28:36 Sat 06 Feb 2106 PST  Los Angeles
10:00:26 Thu 01 Jan 1970 AEST Sydney
22:28:42 Sat 06 Feb 2106 PST  Los Angeles

BTTFTestRig_bb

Any suggestions? Thanks!!

victor7376 commented 2 years ago

On your displays does it show the the date & time as 1970? If so I believe I know what the issue is as TimeDB changed their url to be behind cloudflare. I'll update the code to reflect that issue.

BzowK commented 2 years ago

Thanks, but unfortunately not. The displays don't show any digits whatsoever. WHen attached to the Nano and using the other projects code they do, so don't know what's up. Something with the ESP32 Dev Board library, perhaps? All 9 displays don't have to be connected in order for one of the rows to work, right?

Thanks

victor7376 commented 2 years ago

No you can test with just 1 chain of three. Just to confirm you are selecting the correct esp32 board right?

BzowK commented 2 years ago

Yep - at least I think I am... :)

Below's what I'm selecting and those are populated via the URL https://dl.espressif.com/dl/package_esp32_index.json in the Addtl boards manager ss1. Looks like it's 1.0.6

When flashing, it provides the following info which I assume it pulls from the hardware itself...

esptool.py v3.0-dev
Serial port COM9
Connecting....
Chip is ESP32-D0WDQ6 (revision 1)
Features: WiFi, BT, Dual Core, 240MHz, VRef calibration in efuse, Coding Scheme None
Crystal is 40MHz
MAC: 34:94:54:25:04:3c
Uploading stub...
Running stub...
Stub running...
Changing baud rate to 921600
Changed.
Configuring flash size...
Auto-detected Flash size: 4MB
Compressed 8192 bytes to 47...
Writing at 0x0000e000... (100 %)
Wrote 8192 bytes (47 compressed) at 0x0000e000 in 0.1 seconds (effective 993.0 kbit/s)...
Hash of data verified.
Compressed 18656 bytes to 12053...
Writing at 0x00001000... (100 %)
Wrote 18656 bytes (12053 compressed) at 0x00001000 in 0.2 seconds (effective 750.0 kbit/s)...
Hash of data verified.
Compressed 761136 bytes to 439291...
Writing at 0x00010000... (3 %)
Writing at 0x00014000... (7 %)
Writing at 0x00018000... (11 %)
Writing at 0x0001c000... (14 %)
Writing at 0x00020000... (18 %)
Writing at 0x00024000... (22 %)
Writing at 0x00028000... (25 %)
Writing at 0x0002c000... (29 %)
Writing at 0x00030000... (33 %)
Writing at 0x00034000... (37 %)
Writing at 0x00038000... (40 %)
Writing at 0x0003c000... (44 %)
Writing at 0x00040000... (48 %)
Writing at 0x00044000... (51 %)
Writing at 0x00048000... (55 %)
Writing at 0x0004c000... (59 %)
Writing at 0x00050000... (62 %)
Writing at 0x00054000... (66 %)
Writing at 0x00058000... (70 %)
Writing at 0x0005c000... (74 %)
Writing at 0x00060000... (77 %)
Writing at 0x00064000... (81 %)
Writing at 0x00068000... (85 %)
Writing at 0x0006c000... (88 %)
Writing at 0x00070000... (92 %)
Writing at 0x00074000... (96 %)
Writing at 0x00078000... (100 %)
Wrote 761136 bytes (439291 compressed) at 0x00010000 in 8.1 seconds (effective 751.1 kbit/s)...
Hash of data verified.
Compressed 3072 bytes to 128...
Writing at 0x00008000... (100 %)
Wrote 3072 bytes (128 compressed) at 0x00008000 in 0.1 seconds (effective 372.4 kbit/s)...
Hash of data verified.
victor7376 commented 2 years ago

Ok I’ll get mine updated tomorrow and let you know as I haven’t updated mine in a while. I’ll also double check all the connections.

BzowK commented 2 years ago

Cool - Really appreciate the help - Thanks again!

Hyperthread27 commented 2 years ago

It appears I am having the exact same issue based on the serial output and behavior. Thanks for looking into this, it's a very cool project!

victor7376 commented 2 years ago

At the moment I have misplaced my clock, so I’ve ordered some more displays for testing. Once I’ve tested everything I’ll let you both know what the solution is. For the moment the clock part for TimeDB should now retrieve the correct time as that has been fixed.

Working with the latest libraries there has been an issue with displaying the time on other projects, for example

hour() was showing up as some strange symbol, This was fixed in another project by changing that to String(hour())

Once I get the new displays through I hope to see if and what the issue is.

Hyperthread27 commented 2 years ago

Awesome, thank you again! Happy to send over any additional info/config if you want it.

victor7376 commented 2 years ago

Once everything is through or if I have found the clock lol, I'll install and see if having the most up to date libraries is the issue, if it is I'll try and figure out the solution. I'm pretty sure most will have the most up to date libraries.

But in the time being I would suggest checking any wiring from the ESP32 / ESP8266 that you will have connected up to the displays. If the power is definitely getting to the displays then it will be either the CLK or DIO that may need to be checked. If they are getting to the displays my next thought would be the coding within the clock that maybe the issue. as I've stated before.

BzowK commented 2 years ago

Really appreciate your help!

I know my wiring is good as I dropped in a Nano + code on Thingiverse and LCDs worked without issue. The 3 chained ones I am testing with ran fine via USB power & when externally powered /w 5V 2.4A on the Nano, but still nogo with ESP32 Dev Board. Will keep testing in meantime and let you know if I make progress.

Thanks Guys

victor7376 commented 2 years ago

Understandable, I was just thinking of the simple of solutions. If only I knew where my clock was lol.

victor7376 commented 2 years ago

Scratch that last comment, FOUND THE CLOCK lol.

I'll run some tests now.

victor7376 commented 2 years ago

Right, I've just installed all the latest libraries for ESP32. Installed the Timezone library from https://github.com/JChristensen/Timezone Installed the SevenSegmentDIsplay Library https://github.com/bremme/arduino-tm1637 Then removed just 3 sections from the Clock.ino (Which I will update)

Then found I needed to edit the SevenSegmentFun.cpp file from the installed Library - Look for "bouncingBall" on line 187 & change it to "bouchingBall" then save.

Compile and upload the code.

I've just updated my code and uploaded the code to the ESP32 (wouldnt upload via usb as my board must have an issue but was able to update via wifi)

Attached photo of the clock working with correct time. If you still have issues I can double check my wiring and confirm the pins if its required.

IMG_3912 .

BzowK commented 2 years ago

OK...

So I just tried the following, but get the same result unfortunately...

During research today, I found that many have had the same issue as me (different projects) when using ESP boards since they run on 3.3v instead of 5v. This would make since since as they worked great with the Nano. I've tried powering the displays off the 3.3v pin of the ESP instead of the 5V rail, but no change for me. You can see how I've powered them up until now via that diagram I posted a while back. How are you powering the LCDs?

Also, when flashing it says my chip is ESP32-D0WDQ6. Wonder if your ESP Dev Board is slightly different, perhaps?

To me, it seems to be one of those two...

victor7376 commented 2 years ago

The board I’m using is:

https://www.amazon.co.uk/gp/product/B08DXSMZSB/ref=ppx_yo_dt_b_asin_title_o04_s00?ie=UTF8&psc=1

I powered it from my laptop, but when not attached to the laptop I use a 5v power supply think it’s either 2a or 3amp.

I’ve attached two photos one of the main board and the 2nd is one of the green displays which I’ve removed the two chips as with all of the displays. 11E3CA59-A75B-45E9-A926-2C0FA8CDA07F 116850AA-B2E6-4658-A3B0-F753419E5AC2

BzowK commented 2 years ago

Well, I think (hope) I found a solution!

Turns out it seems to have something to do with the ESP's pins running at 3.3V. I had tried powering the LCDs via the 3.3V from the ESP, but nogo. Tonight, I tried another solution where I wired them from 5V, but added a 1N4007 diode in the mix and they started working. More on that here. With the diode added, the LCDs are fed ~3.6V instead which for whatever reason, works. Important note that not only does the diode need to be added, but the two 100 nF SMD capacitors on each LCD in chain needed to be removed. I tested without removing them from chained boards, and only worked once I removed them.

I'm trying now to implement some level shifters so I won't have to use diodes and be able to run the LCDs at full brightness. Not exactly sure how to do it and first test tonight failed, but will let you know once I figure something out.

Your board is definitely a bit different than the one I'm using. My displays must be Chinese knockoffs (of course I did get from AliExpress) as they don't have "RobotDyn" logo or mention. Everything else looks the same. Guess you get what you pay for :)

Wanted to also say thanks for taking the time to assist with this. You certainly didn't have to and very much appreciate it!

After 11pm here in Tennessee, but will update tomorrow hopefully. Thanks again!

victor7376 commented 2 years ago

The displays I bought were from Banggood

https://uk.banggood.com/3Pcs-0_56-Inch-Red-LED-Tube-4-Digit-7-segments-Display-Module-p-1144447.html?rmmds=myorder&cur_warehouse=CN

I’m hoping the new displays are similar to yours so I can test a little further. I can’t seem to find your esp within the uk. But I do remember that I may of programmed it via nodemcu, but I will confirm that today with my spare ESP32.

The displays are getting their 5v directly from the power socket normally (split with the Waco clips), but yesterday they were getting it from the ESP32.

I will leave this thread open for others to see, if they’re having the same issue.

victor7376 commented 2 years ago

Confirmed same chip (After changing the board to NodeMCU-32S):

esptool.py v3.1
Serial port COM4
Connecting........_____.....__
Chip is ESP32-D0WDQ6 (revision 1)
Features: WiFi, BT, Dual Core, 240MHz, VRef calibration in efuse, Coding Scheme None
Crystal is 40MHz
MAC: 3c:61:05:32:40:14
Uploading stub...
Running stub...
Stub running...
Changing baud rate to 921600
Changed.
victor7376 commented 2 years ago

Got the new displays delivered today and tested with having the caps in place. They didn't turn on, but as soon as I removed the 2 caps the displays came to life & that is having the power directly from the ESP32 5v pin and powered through the usb port.

BzowK commented 2 years ago

Great info - thanks!

Started playing this morning during meetings, but sooner realized that I'd need to shift up 12 pins (9 data + 3 clock) which would require tons of parts so ordered some 4 channel logic level shifters as they should do the job. Should get in tomorrow and will let you know how it goes for others future reference if others have cheap displays.

Another note is that once I get it working, I plan to continue testing additional code to fetch my shared ICS link of my work Outlook calendar and parse it. Unfortunately, no good libraries for doing so and I'm no programmer, but working on it. The goal is for the clock to display the current time, next meeting time, and haven't decided on the 3rd - maybe the time the meeting ends, next meeting time, next holiday, etc. May fork and post if others are interested, but will let you know.

Thanks again

victor7376 commented 2 years ago

Nice little project !!

As long as you have json from a url then you can make a cpp and h file for processing the data ;) I've done a few of those for a marquee display.

BzowK commented 2 years ago

Thanks! - Will definitely keep you updated if interested :)

Got the shifters in today and they work great. Wanted to post with final notes for any having issues in the future...

The Issue Those like myself who purchased different (cheaper) displays, may find that they do not display anything regardless of removing capacitors, wiring, etc.

The Cause Without getting too technical (because I can't), it has to do with the displays not being able to properly get the signal from the 3.3v pins on ESP32 when running on 5v themselves.

The Solution

  1. Remove the capacitors from all 9 displays as discussed here.
  2. Purchase some 3.3v <-> 5v logic level converters / shifters. I choose these which are 4 channel therefore will need 3 for this project
  3. Connect each of the ESP32's data pins being used with displays (clock & data) to an LV pin on the shifter. Connect the corresponding HV pin on the shifter to where the data pin was to connect to (see below diagram)
  4. Connect HV / GND on shifter to 5V / ground on same power rail that lights the displays
  5. Connect LV / GND on shifter to 3.3V / ground pin on ESP32

DeloreanTimeAlt_bb

Big thanks to victor7376 for taking the time to assist with this issue!

victor7376 commented 2 years ago

I've added a folder for examples of the wiring guide.

Thank you for the example BzowK