Skip to content
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 clocks - Model H401 and H402 #86

Open
wants to merge 54 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
54 commits
Select commit Hold shift + click to select a range
1db18af
Create cmake-multi-platform.yml
Martinius79 Jul 10, 2024
37eed9b
Update cmake-multi-platform.yml
Martinius79 Jul 10, 2024
20f95d8
Update cmake-multi-platform.yml
Martinius79 Jul 11, 2024
f449a7c
Update cmake-multi-platform.yml
Martinius79 Jul 11, 2024
fc782b2
Update cmake-multi-platform.yml
Martinius79 Jul 11, 2024
c55bc88
Update cmake-multi-platform.yml
Martinius79 Jul 11, 2024
b9fd466
edited and renamed github action workflow file
Martinius79 Jul 13, 2024
d5fff5a
Minimum changes to add support for IPSTUBE H401 clock
Martinius79 Jul 14, 2024
4037832
Minimum GitHub Action workflow file for PIO builds
Martinius79 Jul 14, 2024
f3ba36f
removed unneeded change
Martinius79 Jul 14, 2024
457ffbe
restored older .gitignore
Martinius79 Jul 15, 2024
e10fe45
Added support for the backlight LED stripe, bugfix: fixed a typo in t…
Martinius79 Jul 21, 2024
97460f7
updated build definition
Martinius79 Jul 21, 2024
ee12888
fixing build definition
Martinius79 Jul 21, 2024
5ad825b
Merge branch 'SmittyHalibut:main' into main
Martinius79 Jul 25, 2024
ee2ffd4
Modified partion tables for using newer EspressIF 32 def platform, mo…
Martinius79 Jul 25, 2024
5acbf18
Merge branch 'main' into AddedIPSTUBEH401-2
Martinius79 Jul 25, 2024
aed8aab
bugfix: missed some down_edge states for button, switched to up_edge …
Martinius79 Jul 25, 2024
395a938
Added pin numbers - Renamed pictures - Added 8MB firmware save cmd - …
Martinius79 Aug 3, 2024
c997beb
Modified the root README.MD file - Added images - Created new subfold…
Martinius79 Aug 3, 2024
59b56a9
Added and changed content in the README.MD
Martinius79 Aug 11, 2024
59a1e33
Merge branch 'main' into ModifiedReadMeFilesAndContentForIt
aly-fly Aug 30, 2024
abe3555
Merge branch 'main' of https://github.com/Martinius79/EleksTubeHAX
Martinius79 Sep 3, 2024
3a255b0
Merged changes for HA edition
Martinius79 Sep 3, 2024
d7389fc
Merged from main from base repo
Martinius79 Sep 4, 2024
e89d5ab
Merge branch 'main' of https://github.com/Martinius79/EleksTubeHAX in…
Martinius79 Sep 4, 2024
1f7ba87
Changed info about IPSTUBE boards (Q1 transsitor)
Martinius79 Sep 5, 2024
3ba3046
Merge branch 'main' into ModifiedReadMeFilesAndContentForIt
Martinius79 Sep 5, 2024
268ec08
fixed merge conflicts
Martinius79 Sep 5, 2024
f199e62
Merge branch 'main' into AddedIPSTUBEH401-2
Martinius79 Sep 5, 2024
dbed110
removed exact model name - general naming for IPSTUBE clocks
Martinius79 Sep 7, 2024
cac779b
Modifications for ITPSTUBE boards with transistor Q1 present - can no…
Martinius79 Sep 7, 2024
a44a4be
Merge branch 'SmittyHalibut:main' into main
Martinius79 Sep 7, 2024
1c0f2c2
Merge branch 'SmittyHalibut:main' into AddedIPSTUBEs
Martinius79 Sep 7, 2024
51fe0ec
fix for activate state selection
Martinius79 Sep 7, 2024
0ebc6b2
Merge branch 'SmittyHalibut:main' into ModifiedReadMeFilesAndContentF…
Martinius79 Sep 7, 2024
71ef937
Added pictures of H402 - Added components to list
Martinius79 Sep 9, 2024
2dc1d56
Merge branch 'SmittyHalibut:main' into main
Martinius79 Sep 11, 2024
8a0fd77
Merge branch 'main' into AddedIPSTUBEs
Martinius79 Sep 11, 2024
834738c
Update clock model information and firmware features, especially for …
Martinius79 Sep 13, 2024
a892cc4
Updated Home Assistant integration section - Added picture of EleksTu…
Martinius79 Sep 14, 2024
296b003
Merge branch 'ModifiedReadMeFilesAndContentForIt' into AddedIPSTUBEs
Martinius79 Sep 15, 2024
e346d60
Moved IPSTUBE folder to documentation folder after merge
Martinius79 Sep 15, 2024
221c13d
Merge branch 'SmittyHalibut:main' into AddedIPSTUBEs
Martinius79 Sep 19, 2024
7a8c8d0
Added filling with black after init the LCD class to avoid longer fli…
Martinius79 Oct 5, 2024
dc56c1e
fixed partition table(s) - reduced number of partitons like in the ma…
Martinius79 Oct 8, 2024
8dec82b
Added pics and info for PunkCyber clock - Modified existing pics - Mo…
Martinius79 Oct 10, 2024
8a14c80
Fixed some clock faces - bit depth was mixed, now all 8bit - some was…
Martinius79 Oct 10, 2024
b97027f
Added optional capability to use GPIO4 pin for PWM display dimming (#1)
Skydev0h Oct 14, 2024
f26ae08
Merge branch 'main' into AddedIPSTUBEs
Martinius79 Nov 8, 2024
5d5c360
Renamed folders for clock documentatiom
Martinius79 Nov 8, 2024
3a6b2bd
Merge branch 'main' into AddedIPSTUBEs
Martinius79 Nov 8, 2024
09abe2e
switchted back to default clock faces from actual main
Martinius79 Nov 8, 2024
3a4815f
fixed merging error
Martinius79 Nov 9, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 8 additions & 5 deletions .github/workflows/pio-build-multi-platform.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,10 @@ jobs:
# Set fail-fast to false to ensure that feedback is delivered for all matrix combinations. Consider changing this to true when your workflow is stable.
fail-fast: false

# Set up a matrix to run the following 3 configurations:
# 1. <Windows, Release, latest MSVC compiler toolchain on the default runner image, default generator>
# 2. <Linux, Release, latest GCC compiler toolchain on the default runner image, default generator>
# 3. <Linux, Release, latest Clang compiler toolchain on the default runner image, default generator>
#
# Set up a matrix to run the following 2 configurations:
# 1. <Windows, Release, toolchain on the default runner image, default generator>
# 2. <Linux, Release, toolchain on the default runner image, default generator>

# To add more build types (Release, Debug, RelWithDebInfo, etc.) customize the build_type list.
matrix:
os: [ubuntu-latest, windows-latest]
Expand Down Expand Up @@ -52,3 +51,7 @@ jobs:
- name: Build PlatformIO Project for 4MB flash
run: pio run --environment esp32dev
working-directory: ./EleksTubeHAX_pio

- name: Build PlatformIO Project for 8MB flash
run: pio run --environment esp32dev8MB
working-directory: ./EleksTubeHAX_pio
Empty file.
37 changes: 37 additions & 0 deletions EleksTubeHAX_pio/boards/esp32dev8MB.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{
"build": {
"arduino":{
"ldscript": "esp32_out.ld"
},
"core": "esp32",
"extra_flags": "-DARDUINO_ESP32_DEV",
"f_cpu": "240000000L",
"f_flash": "40000000L",
"flash_mode": "dio",
"mcu": "esp32",
"variant": "esp32"
},
"connectivity": [
"wifi",
"bluetooth",
"ethernet",
"can"
],
"debug": {
"openocd_board": "esp-wroom-32.cfg"
},
"frameworks": [
"arduino",
"espidf"
],
"name": "Espressif ESP32 Dev Module 8MB",
"upload": {
"flash_size": "8MB",
"maximum_ram_size": 327680,
"maximum_size": 8388608,
"require_upload_port": true,
"speed": 460800
},
"url": "https://en.wikipedia.org/wiki/ESP32",
"vendor": "Espressif"
}
8 changes: 4 additions & 4 deletions EleksTubeHAX_pio/partition_noOta_1Mapp_3Mspiffs.csv
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
#
# app0 must be aligned on 0x10000 (!)
#
# Name, Type, SubType, Offset, Size, Flags
# partition table 0x0000, 0x9000, <- automatically generated, do not un-comment.
nvs, data, nvs, 0x9000, 0x7000,
app0, app, factory, 0x10000, 0x120000,
# Name, Type, SubType, Offset, Size, Flags
# partition table 0x000000, 0x009000, <- automatically generated, do not un-comment.
nvs, data, nvs, 0x009000, 0x007000,
app0, app, factory, 0x010000, 0x120000,
spiffs, data, spiffs, 0x130000, 0x2D0000,
# end of 4 MB flash 0x400000
13 changes: 13 additions & 0 deletions EleksTubeHAX_pio/partition_noOta_1Mapp_7Mspiffs.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#
# manual: https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-guides/partition-tables.html
#
# examples: https://github.com/espressif/arduino-esp32/tree/master/tools/partitions
#
# app0 must be aligned on 0x10000 (!)
#
# Name, Type, SubType, Offset, Size, Flags
# partition table 0x000000, 0x009000, <- automatically generated, do not un-comment.
nvs, data, nvs, 0x009000, 0x007000,
app0, app, factory, 0x010000, 0x120000,
spiffs, data, spiffs, 0x130000, 0x6D0000,
# end of 8 MB flash 0x800000
60 changes: 35 additions & 25 deletions EleksTubeHAX_pio/platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,10 @@
; Please visit documentation for the other options and examples
; https://docs.platformio.org/page/projectconf.html

[env:esp32dev]
; common settings for all environments
[env]
platform = espressif32
board = esp32dev
framework = arduino

build_flags =
-DCORE_DEBUG_LEVEL=5 ; Set to 0 for no debug; saves flash memory
; Set to 5 for full debug

; https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-guides/partition-tables.html
board_build.partitions = partition_noOta_1Mapp_3Mspiffs.csv
upload_speed = 921600
monitor_speed = 115200
lib_deps =
Expand All @@ -38,22 +31,39 @@ lib_deps =
; These libraries and source files are causing boot-loop-crash. Do not use. TO-DO: replace with different libraries and source files.
;milesburton/DallasTemperature
;OneWire

; === Tested and working with following versions. If you have issues, revert to libraries listed below. ===
; arduino-libraries/NTPClient@^3.2.1
; adafruit/Adafruit NeoPixel@^1.12.0
; paulstoffregen/Time@^1.6.1
; paulstoffregen/DS1307RTC
; bodmer/TFT_eSPI@^2.5.43
; knolleary/PubSubClient@^2.8
; bblanchon/ArduinoJson@^7.0.3
; milesburton/DallasTemperature@^3.11.0
; sparkfun/SparkFun APDS9960 RGB and Gesture Sensor@^1.4.3
; makuna/RTC@^2.4.2

extra_scripts =

; === Tested and working with following versions. If you have issues, revert to libraries listed below. ===
; adafruit/Adafruit NeoPixel@^1.12.0
; paulstoffregen/Time@^1.6.1
; paulstoffregen/DS1307RTC
; bodmer/TFT_eSPI@^2.5.43
; knolleary/PubSubClient@^2.8
; bblanchon/ArduinoJson@^7.0.3
; sparkfun/SparkFun APDS9960 RGB and Gesture Sensor@^1.4.3
; makuna/RTC@^2.4.2
build_flags =
-DCORE_DEBUG_LEVEL=5 ; Set to 0 for no debug; saves flash memory or set to 5 for full debug
extra_scripts =
; copy configuration files into TFT_eSPI library folder
script_configure_tft_lib.py
; modify the library files from the APDS9660 gesture sensor library to match ID if the used sensor
script_adjust_gesture_sensor_lib.py

script_adjust_gesture_sensor_lib.py


; env for all clocks with 4MB flash on PCB!
[env:esp32dev]
board = esp32dev
lib_deps =
${env.lib_deps}
;add env specific libraries here
board_build.partitions = partition_noOta_1Mapp_3Mspiffs.csv ; https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-guides/partition-tables.html


; This is for all clocks with 8MB flash on PCB (like the IPSTUBE clocks)!
[env:esp32dev8MB]
board = esp32dev8MB
lib_deps =
${env.lib_deps}
;add env specific libraries here
board_build.partitions = partition_noOta_1Mapp_7Mspiffs.csv ; https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-guides/partition-tables.html

17 changes: 15 additions & 2 deletions EleksTubeHAX_pio/script_adjust_gesture_sensor_lib.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
# In pure Python environment, the script looks broken!
# Import from SCons.Script is already available, if the PlatformIO build environment is used to call it.
#from SCons.Script import Import

#To have access to the PIO build environment variables, we need to import the env modul
Import("env")

def inplace_change(filename, old_string, new_string):
# Safely read the input filename using 'with'
with open(filename) as f:
Expand All @@ -16,10 +23,15 @@ def inplace_change(filename, old_string, new_string):

print("===== adjusting APDS sensor libs ===== ")

# Get the board type from the used environment
board = env.GetProjectOption("board")

new_string_to_check = "#define APDS9960_ID_3"

filename1 = "./.pio/libdeps/esp32dev/SparkFun APDS9960 RGB and Gesture Sensor/src/SparkFun_APDS9960.h"
filename2 = "./.pio/libdeps/esp32dev/SparkFun APDS9960 RGB and Gesture Sensor/src/SparkFun_APDS9960.cpp"
# define target files with the name of the board in the path
filename1 = "./.pio/libdeps/" + board + "/SparkFun APDS9960 RGB and Gesture Sensor/src/SparkFun_APDS9960.h"
filename2 = "./.pio/libdeps/" + board + "/SparkFun APDS9960 RGB and Gesture Sensor/src/SparkFun_APDS9960.cpp"

with open(filename1) as f:
s = f.read()
if new_string_to_check not in s:
Expand All @@ -28,4 +40,5 @@ def inplace_change(filename, old_string, new_string):
inplace_change(filename2,"if( !(id == APDS9960_ID_1 || id == APDS9960_ID_2) ) {","if( !(id == APDS9960_ID_1 || id == APDS9960_ID_2 || id == APDS9960_ID_3) ) {")
else:
print("Lib files seems to be adjusted already! Doing nothing.")

print("Done adjusting APDS sensor libs!")
31 changes: 18 additions & 13 deletions EleksTubeHAX_pio/script_configure_tft_lib.py
Original file line number Diff line number Diff line change
@@ -1,27 +1,32 @@
# Import("env") # should not be required; un-comment if you have issues
import shutil
# In pure Python environment, the script looks broken!
# Import from SCons.Script is already available, if the PlatformIO build environment is used to call it.
#from SCons.Script import Import

#To have access to the PIO build environment variables, we need to import the env modul from SCons.Script
Import("env")

# print("Current CLI targets", COMMAND_LINE_TARGETS)
# print("Current Build targets", BUILD_TARGETS)
import shutil

print("===== copying TFT config files ===== ")

# https://stackoverflow.com/questions/123198/how-to-copy-files

# source file location: EleksTubeHAX_pio\src\GLOBAL_DEFINES.h & _USER_DEFINES.h
# target file location: EleksTubeHAX_pio\.pio\libdeps\esp32dev\TFT_eSPI\User_Setup.h
# target file location: EleksTubeHAX_pio\.pio\libdeps\esp32dev8MB\TFT_eSPI\User_Setup.h

# Get the board type from the used environment
board = env.GetProjectOption("board")

# define target file and directory with the name of the board in the path
targetDir = "./.pio/libdeps/" + board + "/TFT_eSPI"
targetFile = targetDir + "/User_Setup.h"

# copy using Python libraries
# "copy" changes file timestamp -> lib is always recompiled.
# "copy2" keeps file timestamp -> lib is compiled once
ret = shutil.copy2('./src/_USER_DEFINES.h', './.pio/libdeps/esp32dev/TFT_eSPI')
# "copy2" keeps file timestamp -> lib is compiled once (until changed define files)
ret = shutil.copy2('./src/_USER_DEFINES.h', targetDir)
print("Copied {ret}".format(**locals()))
ret2 = shutil.copy2('./src/GLOBAL_DEFINES.h', './.pio/libdeps/esp32dev/TFT_eSPI/User_Setup.h')
ret2 = shutil.copy2('./src/GLOBAL_DEFINES.h', targetFile)
print("Copied {ret2}".format(**locals()))

# copy using Windows command line
# native "copy" command keeps file timestamp -> lib is compiled once
# env.Execute("copy .\\src\\_USER_DEFINES.h .\\.pio\\libdeps\\esp32dev\\TFT_eSPI")
# env.Execute("copy .\\src\\GLOBAL_DEFINES.h .\\.pio\\libdeps\\esp32dev\\TFT_eSPI\\User_Setup.h")

print("Done copying TFT config files!")
4 changes: 2 additions & 2 deletions EleksTubeHAX_pio/src/Backlights.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ void Backlights::breathPattern() {

void Backlights::testPattern() {
const uint8_t num_colors = 4; // or 3 if you don't want black
uint8_t num_states = NUM_DIGITS * num_colors;
uint8_t num_states = NUM_BACKLIGHT_LEDS * num_colors;
uint8_t state = (millis()/test_ms_delay) % num_states;

uint8_t digit = state/num_colors;
Expand Down Expand Up @@ -191,7 +191,7 @@ float Backlights::phaseToHue(uint32_t phase) {
void Backlights::rainbowPattern() {
// Divide by 3 to spread it out some, so the whole rainbow isn't displayed at once.
// TODO Make this /3 a parameter
const uint16_t phase_per_digit = (max_phase/NUM_DIGITS)/3;
const uint16_t phase_per_digit = (max_phase/NUM_BACKLIGHT_LEDS)/3;

// Rainbow roatation speed now configurable
uint16_t duration = uint16_t(round(getRainbowDuration() * 1000));
Expand Down
2 changes: 1 addition & 1 deletion EleksTubeHAX_pio/src/Backlights.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
class Backlights: public Adafruit_NeoPixel {
public:
Backlights() : config(NULL), pattern_needs_init(true), off(true),
Adafruit_NeoPixel(NUM_DIGITS, BACKLIGHTS_PIN, NEO_GRB + NEO_KHZ800)
Adafruit_NeoPixel(NUM_BACKLIGHT_LEDS, BACKLIGHTS_PIN, NEO_GRB + NEO_KHZ800)
{}

enum patterns { dark, test, constant, rainbow, pulse, breath, num_patterns };
Expand Down
Loading