-
Notifications
You must be signed in to change notification settings - Fork 50
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added support for IPSTUBE H401 #74
Conversation
EDIT: on further investigation, it seems you have to change the casing in these path strings which are case-sensitive on linux and do not match atm: (found in EDIT2: compiled and updated the firmware. i see the wifi connection messages and i can navigate the menu by pressing the button on the back, but the screen stays black (no time is shown). The debug serial monitor shows these error messages repeated:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work!
Could you please add some documentation and a list of what works and what doesn't?
i prefer to use the cmdline directly:
now the error message is different :
Indeed there is no Switching clock theme via the menu made the numbers appear, i guess the default value Another suggestion: |
side question: is it possible to reduce the TFT brightness? I've noticed they run a bit hot after a while. |
If your version of the clock has backlight LED supply (signals LEDK or LEDA) routed to the connector, then it is possible. Add a fast MOSFET and wire it to the hardware PWM output of the ESP32. Connect the displays LED pins to the transistor. Do NOT modulate the Vdd of the complete display. Maybe the transistor is already on the main board. If your clock is compatible with this (Hardware SI HAI clock (chinese copy)), then it is a good candidate to have brightness modulation added. |
For the IPSTube hardware it is technically possible to do a brightness mod since the backlight LED power is a separate pin on the FPC connectors. There are a few complications with it though:
Pin 1 (LED backlight) and pin7 (3V3) are connected together: If adjustment through software is not required, after separating the LED pin from the 3V3 line, the LED backlight pins could also be fed with a lower voltage supplied by some kind of voltage regulator or power conversion chip of e.g. 2.5V. Some testing with a variable power buck converter is probably a good idea to see what is most suitable in the required situation. Going over 3V3 is probably a bad idea. Perhaps the simplest option could be is to add a resistor in-line with pin1 of the backlight LED for each display. Guess this again requires some testing and measurements to make sure the chosen resistor is capable of dissipating the required power for the desired voltage drop to power the white LED. |
Thank you for the tips, but i'd like to avoid any hardware mod if possible. |
...
I am not sure, where this 7 or 9.bmp without a prefix is coming from -> where do you see this default 0?
Done. I only left it inside, because I use the MQTT messages instead and for them four buttons are usefull. |
The IPSTUBE clock has 8MB flash, so no default board from PIO is fitting. I created a JSON file with the modified values (esp32dev8MB.json) under the subfolder "boards" so it can be used in the PIO project. I created a new "partition table file" (partition_noOta_1Mapp_7Mspiffs.csv) for the 8MB flash version. I added a new environment in the platform.ini file (env:esp32dev8MB), to use the new board configuration file and the new partition table file. Because each environment has its own target directory (PROJECTDIR.pio\build\ENVNAME), the helper scripts to copy and modify the libs files needs another target folder. So I created script_adjust_gesture_sensor_lib_8MB.py and script_configure_tft_lib_8MB.py and added it to the new env. I added/copied a section to define the IPSTUBE clock configs in the GLOBAL_DEFINES.H file. I modified the _USER_DEFINES - empty.h file Main work was to modify the chip_select logic for the IPSTUBE, because no shift register is used to have only one CS for the LCDs. Instead 6 pins from the ESP32 are directly connected. I modified the ChipSelect class. I modified the TFTs class. I renamed the Button.CPP file to Buttons.CPP and modified the header file as well to use the new file. I modified the Buttons class. I modified the Menu class. I modified the Clock class file. Modified the main.cpp file. I modified the Mqtt_client_ips.CPP I modified the Backlights class. Added a new file for saving 8MB firmware files (_ESP32 save flash 8MB.cmd) Minor changes to a lot of files, like formating, the way I like it or adding/modifing debug print outs. Don't know, what I missed. It is late now, so I am too tired to go on more detailed. Just ask, what you wanna know. And yes, working and not working tomorrow then.... |
this |
Actually, if the config load was not valid, like an initial start after a flash erase and flash, the "default" values should be loaded, and the default clock face index is set to 1. See: So I really don't understand, where this non 1X.bmp prefixed values coming from... |
Ok, found the problem. A bit of an edge case. |
i've managed to reduce the brightness via software by passing all the colors to this method. |
Dimming is already integrated. See Night mode section. This will reduce brightness of the displayed image, not the TFT backlight. If your concern is to reduce temperature of the TFTs, this method will not do anything. It has constant backlight; this is not an OLED screen. |
understood... PWM-ing the e.g. replace this line with
EDIT: found a discussion here, as alternative there may be a specific SPI command to set the brightness. |
TFT enable signal is present only on a few clock variants. Others have displays constantly powered.
As far as I can see on these displays, the BL LED is hardwired on the PCB and is not connected to the LCD driver chip (that talks over SPI). Maybe this register only varies LCD modulation and not the BL at all. p.s. I wouldn't care too much if displays are a bit warm, if this is the only concern. |
@@ -49,21 +48,24 @@ uint8_t yesterday = 0; | |||
// Helper function, defined below. | |||
void updateClockDisplay(TFTs::show_t show=TFTs::yes); | |||
void setupMenu(void); | |||
void EveryFullHour(bool loopUpdate=false); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know it's hard to resist, but please let's just make functional changes in the first step and not make the source code prettier yet. Only change as little as absolutely necessary.
Working and Not-Working list for IPSTUBE H401: Working: Can't tell if working: Limited working: Not working: |
…dateClockDisplay-> Redraws all TFTs always! (needs >1 sec everytime) - changed debug output for clock face counting in setup()
I created a "minimum" changes version now. See #77 |
Hi @Martinius79,
The button action takes getting a bit used to, but works non the less. Sometimes the button presses don't register well but I think that is due to the meager quality of the button. Perhaps the short button detection time could be a bit lower/sooner. Foamy |
Added support for IPSTUBE clock - Model H401
Added new configuration in platform.io, because H401 has 8MB flash.
Also partition file and copy scripts and the board config json file.
Added a "One Button" menu beside the "normal" menu, but implementation is not great (only right button emulation on long click).
Changed the checked state for buttons to "up_edge" instead of "down_edge".
Added different types of debug print outs (verbose, menu, buttons, tft).
Updated firmware to V1.0.1 and created single file firmware bins.
TODO:
LCD panel on the ground (if installed) not working (or only sometimes).
Implement a better "One Button" menu. Like single, double and triple click for menu choices.