SmittyHalibut / EleksTubeHAX

A custom firmware for the EleksTube IPS Clock
GNU General Public License v3.0
109 stars 44 forks source link

Error on compiling #34

Closed sheldonGordon closed 7 months ago

sheldonGordon commented 1 year ago

Hello guy,

I have that error on compiling.

In file included from D:\EleksTubeHAX-main\EleksTubeHAX\GLOBAL_DEFINES.h:14:0, from D:\EleksTubeHAX-main\EleksTubeHAX\ChipSelect.h:4, from D:\EleksTubeHAX-main\EleksTubeHAX\ChipSelect.cpp:1: C:\Users\aurelien\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.4\cores\esp32/Arduino.h:183:12: error: 'std::round' has not been declared using std::round; ^ In file included from D:\EleksTubeHAX-main\EleksTubeHAX\GLOBAL_DEFINES.h:14:0, from D:\EleksTubeHAX-main\EleksTubeHAX\Buttons.h:4, from D:\EleksTubeHAX-main\EleksTubeHAX\Button.cpp:1: C:\Users\aurelien\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.4\cores\esp32/Arduino.h:183:12: error: 'std::round' has not been declared using std::round; ^ In file included from D:\EleksTubeHAX-main\EleksTubeHAX\GLOBAL_DEFINES.h:14:0, from D:\EleksTubeHAX-main\EleksTubeHAX\Backlights.h:4, from D:\EleksTubeHAX-main\EleksTubeHAX\Backlights.cpp:1: C:\Users\aurelien\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.4\cores\esp32/Arduino.h:183:12: error: 'std::round' has not been declared using std::round; ^ In file included from D:\EleksTubeHAX-main\EleksTubeHAX\GLOBAL_DEFINES.h:14:0, from D:\EleksTubeHAX-main\EleksTubeHAX\Clock.h:5, from D:\EleksTubeHAX-main\EleksTubeHAX\Clock.cpp:1: C:\Users\aurelien\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.4\cores\esp32/Arduino.h:183:12: error: 'std::round' has not been declared using std::round; ^ In file included from C:\Users\aurelien\AppData\Local\Temp\arduino-sketch-A90A66D64D900CF2FECB49B5F6C4D1C7\sketch\EleksTubeHAX.ino.cpp:1:0: C:\Users\aurelien\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.4\cores\esp32/Arduino.h:183:12: error: 'std::round' has not been declared using std::round; ^

exit status 1

Compilation error: exit status 1

Can you give me?

SmittyHalibut commented 1 year ago

Hmm.. Last time I played with this was before Arduino 2.0 was released. Does that esp32/2.0.4/ in the paths mean you're using Arduino IDE 2.0?

It's saying it can't find std::round() which is being referenced in Arduino.h??!

It sounds like there's some incompatibility between the ESP32 support and your version of Arduino. Make sure you don't have any pending updates in your Boards or Libraries.

A quick grep confirms our code doesn't use std::round() anywhere.

aly-fly commented 1 year ago

This code is confirmed to work with Arduino 1.8. From my quick experience with some other project I can confirm that Arduino 1.8 and 2.0 are not fully compatible, also ESP32 libraries were updated. For me the I2C port stopped working on 2.0 while everything was fine on 1.8.

sheldonGordon commented 1 year ago

I deleted all files on 2.0, I have reinstall on 1.8.13 and its OK. Just i have a little other problem, my number display is horizontal instead of vertical. Where it is possible to change that its code? THX

aly-fly commented 1 year ago

Hm, so you have clock mounted vertically or you see rotated (and cropped) images?

sheldonGordon commented 1 year ago

IMG_20230110_093950172_HDR

sheldonGordon commented 1 year ago

I pushing the default images in data folder And i have compiled with HARDWARE_SI_HAI_CLOCK

aly-fly commented 1 year ago

Interesting. The person I made SI-HAI version for originally, didn't report any such issues. Probably there is a flag in the eTFT driver chip initialization function to set orientation. I am not too familiar with LCD driver chips. You can dig through eTFT libraries or Google and see if you can pinpoint how to rotate the screen.

sheldonGordon commented 1 year ago

IMG_20230110_114334498_HDR The image is now in the right direction, but I do not understand the problem there

aly-fly commented 1 year ago

The "noise" on display is part of the integrated image buffer in the LCDs, that is not updated with image data. There must be something wrong between the library and display configuration. Either buffer size, or display dimensions, or something like that.

Are the colors okay? I think this font should be dark blue on black background, if you didn't change the pictures. if true, this points also to incorrect color mapping.

What did you change to rotate the images?

sheldonGordon commented 1 year ago

in TFTs.h i have just added setRotation(3) in line 40 void enableAllDisplays() { digitalWrite(TFT_ENABLE_PIN, HIGH); enabled = true; setRotation(3);}

aly-fly commented 1 year ago

Try to exchange display Length and Width values...

sheldonGordon commented 1 year ago

doesn't work that reboot all 3 secondes. maybe the ST7789_DRIVER driver is not good for me?

aly-fly commented 1 year ago

Try to examine the LCD display, any text you can find on the display itself or orange flex cable is useful. If display driver is wrong, displays will be completely black. I don't have much experience with LCDs, try Arduino forums or Reddit...

SmittyHalibut commented 1 year ago

You already tried all the things I was going to suggest. It does look like the rotation and resolution needs to be adjusted, but you already tried that. (I had that problem on a different display and library; still have an outstanding Pull Request for that change. )

But something else is going on with your images, because the area that's being drawn isn't square. If the rotation and resolutions are wrong/swapped, it'll CORRECTLY draw into the "upper left corner" area that's a square of the smaller dimension. And that's not happening for you.

Look at the "3" in both images you posted: they contain different amounts of the digit, and padding around the outside edges.

If I had to guess, your source files aren't the correct resolutions? Or aren't flagged as the correct bit-depth?

GHDESON commented 1 year ago

EleksTubeIPS_with_EleksTubeHAX I have a similar problem with: EleksTubeIPS Docker v6.1.11 Arduino 1.8.19 NTPClient by Fabrice Weinberg (v3.2.0) Adafruit NeoPixel by Adafruit (v1.8.0) DS1307RTC by Paul Stoffregen (v1.4.1) other developer? TFT_eSPI by Bodmer (v2.3.61) Time by Paul Stoffregen (v1.6.0) other developer? PubSubClient by Nick O'Leary (v2.8.0) ArduinoJson by Benoit Blanchon (6.19.4)

aly-fly commented 1 year ago

Please write down all the details and text you can find on the LCD panels, including on or below the orange flat cable (unplug the FFC connector on the backside).

GHDESON commented 1 year ago

EleksTube IPS NFP114H-03AF

aly-fly commented 1 year ago

nothing else? like starting with "ST"? This is the only reference I was able to find: IPS 1.14 Inch 135RGBX240 TFT ST7789 8 pin SPI HD 262k FP-114H01A LCD Looks like the defines for the build are okay. Maybe some small details are not correct for this display type... Or for the start you can try to lower the SPI clock frequency if it helps.

GHDESON commented 1 year ago

I also looked at another LCD. No, unfortunately nothing more.

GHDESON commented 1 year ago

When I press the keys, text appears in the lower area, this is only half-readable from the right, the orientation seems to be wrong.

sheldonGordon commented 1 year ago

i have a reference for LCD is "hd114001 XH" @GHDESON you create a backup of the original firmware?

GHDESON commented 1 year ago

Yes, I have made a backup of the firmware.

sheldonGordon commented 1 year ago

have you tried your backup? if it works i would like to get it back please

GHDESON commented 1 year ago

The original firmware is also available here https://github.com/SmittyHalibut/EleksTubeHAX/tree/main/original-firmware . However, the MAC address must be adapted, see https://github.com/SmittyHalibut/EleksTubeHAX/blob/main/original-firmware/README.md .

GHDESON commented 1 year ago

Is this page https://www.alibaba.com/product-detail/IPS-1-14-Inch-135RGBX240-TFT_1600462605851.html helpful?

In the bluish picture https://s.alicdn.com/@sc04/kf/Hddc955a8920546939237bd9769e86fa4v/230489091/Hddc955a8920546939237bd9769e86fa4v.jpg , I think it says exactly this type (NFP114H-03AF) designation on the cable.

GHDESON commented 1 year ago

Is the ST7789V2, 8Pin, 135x240 data helpful for troubleshooting the half and rotated display?

sheldonGordon commented 1 year ago

i think i will change the screens with those on alibaba

GHDESON commented 1 year ago

I wouldn't do that, it's exactly those that create the problem with the half and rotated displays for me.

GHDESON commented 1 year ago

I have a similar problem with: EleksTubeIPS Docker v6.1.11 Arduino 1.8.19 NTPClient by Fabrice Weinberg (v3.2.0) Adafruit NeoPixel by Adafruit (v1.8.0) DS1307RTC by Paul Stoffregen (v1.4.1) other developer? TFT_eSPI by Bodmer (v2.3.61) Time by Paul Stoffregen (v1.6.0) other developer? PubSubClient by Nick O'Leary (v2.8.0) ArduinoJson by Benoit Blanchon (6.19.4)

bitrot-alpha commented 1 year ago

I wasn't able to even get the code to compile on Arduino IDE 1.8.19 and the library versions in the readme. I've submitted a PR (#50) with updates to the code. These updates allow for compiling with ESP32 2.0.X, the latest available libraries, and IDE 1.8.19.

If you're still interested, you can try my fork and see if anything improves.

sheldonGordon commented 1 year ago

hi @bitrot-alpha, I just tried with your changes. unfortunately that doesn't work either. Thanks for your help though

shyne99 commented 10 months ago

For those still looking for a solution to this, I have the following clock EleksTubeIPS Docker v6.1.11 and also had the glitchy screen thing.

In order to fix it, I juste had to edit the library file User_Setup_Select.h of TFT_eSPI library and REMOVE the line #include <User_Setup.h>

The file should only have the include to GLOBAL_DEFINES.h inside the #ifndef USER_SETUP_LOADED ... #endif block.

I had a very hard time to have a working firmware on this, first because the actual master branch does not compile and I had to use @bitrot-alpha fork (thank you by the way), and second because SPIFFS upload tool is just not working on arduino 2.X and had to revert to arduino 1.8, then this....

To be honest the README says that you should add the include to the project Global defines, it says nothing about removing the previous one in place.

aly-fly commented 10 months ago

True, Arduino IDE 2 does not work correctly. Version 1.8 must be used.

aly-fly commented 7 months ago

Fixed in my fork. Will be merged into this repo a bit later.