Compare commits

..

917 Commits

Author SHA1 Message Date
fvanroie
71cefbee82 Remove Sunton 2.2" 2025-04-14 22:57:18 +02:00
fvanroie
36e86af846 Remove Sunton 2.2" 2025-04-14 22:36:29 +02:00
fvanroie
4bdd77956f Update ace.js to 1.39.1 2025-03-28 21:17:49 +01:00
fvanroie
4c04b93ea0 Merge branch 'master' of https://github.com/HASwitchPlate/openHASP 2025-03-17 19:59:15 +01:00
fvanroie
4c71062cf1
Merge pull request #879 from Szetya/master
TTGO T-Display S3 Touch
2025-03-14 12:16:28 +01:00
fvanroie
9dffb1ff22
Update build.yaml 2025-03-12 23:53:36 +01:00
fvanroie
8a17fbbf8a
Merge pull request #880 from yetanothercarbot/twatch
Update T-Watch support (add PMIC support)
2025-03-12 13:15:00 +01:00
yetanothercarbot
d5b8f83850 Update T-Watch support (add PMIC support) 2025-03-12 19:50:24 +10:00
Szetya
5ef28aad33
Update touch_driver_cst816.cpp 2025-03-10 18:51:05 +01:00
Szetya
2f7505debb
Add files via upload
CST816 library add
2025-03-10 18:31:02 +01:00
Szetya
5cc1fda908
Add files via upload
CST816 touch driver add
2025-03-10 18:29:51 +01:00
Szetya
cc50dbf59f
Add files via upload 2025-03-10 18:25:52 +01:00
Szetya
38bd749f98
Update platformio_override-template.ini
T-Display S3 touch added
2025-03-10 18:25:20 +01:00
fvanroie
945e06da9f
Merge pull request #869 from plord12/master
Tweak settings for ESP32-8048S050 so that display works.
2025-02-24 13:57:31 +01:00
Peter Lord
e3ae1e6abf Tweak settings for ESP32-8048S050 so that display works.
See https://github.com/HASwitchPlate/openHASP/issues/868 and https://github.com/HASwitchPlate/openHASP/discussions/861
2025-02-23 22:19:09 +00:00
fvanroie
1ffd94a6bd
Merge pull request #863 from HASwitchPlate/l10n_master
New Crowdin updates
2025-02-14 00:48:15 +01:00
fvanroie
4584e907f9 New translations en_us.h (Russian) 2025-02-14 00:46:37 +01:00
fvanroie
c25aa50cb2 New translations en.json (Russian) 2025-02-14 00:46:36 +01:00
fvanroie
e5794ab6e1 New translations en_us.h (Russian) 2025-02-14 00:12:15 +01:00
fvanroie
72e7fdcbed New translations en.json (Russian) 2025-02-14 00:12:14 +01:00
fvanroie
1a92656d3f
Merge pull request #862 from xek/tinloaf/master
Add support for sunton esp32-2432s024{r,c}
2025-02-13 23:57:49 +01:00
Grzegorz Grasza
1ebd9e29fe Working esp32-2432s024r_4MB support
The original configuration displayed only part
of the screen. The needed modification was to
switch width and height and integrate more
flags already used by the capacitive version of
this board.
2025-02-13 21:16:07 +01:00
Lukas Barth
7c7c65acc4 Add sunton esp32-2432s024{r,c} 2025-02-08 11:54:14 +01:00
fvanroie
74063e285f
Merge pull request #851 from Garag/fix_Sunton_ESP32-8048S043C_touch
Sunton ESP32-8048S043C touch size adapted to screen size
2025-01-13 23:21:51 +01:00
Garag
31ca81e274 touch size adapted to screen size 2025-01-13 21:00:50 +01:00
fvanroie
f663d16cb6 Update ace.js 1.37.3 2025-01-07 16:47:55 +01:00
fvanroie
48884ee986
Merge pull request #841 from vorbeiei/test
fix STMPE610 touchscreen ghost touches
2024-12-25 19:40:45 +01:00
alex
9a59ede939 Merge branch 'test' of https://github.com/vorbeiei/openHASP into test 2024-12-25 17:47:35 +01:00
alex
c3a3222e4a stmpe610 fix ghost touches 2024-12-25 17:45:17 +01:00
fvanroie
3eda5a4225 Fix for #839 2024-12-23 17:13:27 +01:00
fvanroie
bddbc3cb39 Add esp32-2432s022c_4MB 2024-12-23 15:21:22 +01:00
fvanroie
ad85ba63d9 Merge branch 'master' of https://github.com/HASwitchPlate/openHASP 2024-12-23 15:19:53 +01:00
fvanroie
001bc637df
Merge pull request #838 from bennydiamond/feature/esp32-2432s022c_support
Initial support for Guition ESP32-2432S022C
2024-12-22 13:53:42 +01:00
psyko_chewbacca
1e85b3cd46 Initial support for Guiton ESP32-2432S022C 2024-12-22 00:42:09 -05:00
fvanroie
1340ce19bb Update ace.js to 1.37.0 2024-12-17 21:51:41 +01:00
fvanroie
7e5762d2ef Better solution for #830 and #836 2024-12-14 22:47:49 +01:00
fvanroie
de60c0af49 Add missing SPI_FREQUENCY #836 2024-12-14 22:21:39 +01:00
fvanroie
154a8ff638 Check if SPI_FREQUENCY is defined #153 2024-12-14 22:02:22 +01:00
fvanroie
e815e31a5a Remove default SPI_FREQUENCY if not set #153 2024-12-14 21:58:22 +01:00
fvanroie
78a3b38829 Fix duplicate response headers #834 2024-12-14 16:55:41 +01:00
fvanroie
62154fb35b
Merge pull request #833 from vorbeiei/test
add config for huzza32 v2 with original featherwing
2024-12-14 00:21:17 +01:00
vorbeiei
70c262ebae
add config for huzza32 v2 with featherwing v1 2024-12-13 21:47:29 +01:00
fvanroie
f1c588c5a4 Update to rc15 2024-12-12 02:53:58 +01:00
fvanroie
36f9256162
Merge pull request #831 from marsman7/lovyangfx_tft_offset
add lovyangfx custom offset for tft
2024-12-08 01:28:49 +01:00
marsman7
b251756059 add ini file for waveshare ESP32-S3 1.69inch CTP 2024-12-07 23:34:19 +01:00
marsman7
7ced77a7a9 add lovyangfx custom offset for tft 2024-12-07 22:21:27 +01:00
fvanroie
0dce321aa5 Remove HASP_USE_HA #813 2024-12-07 03:43:15 +01:00
fvanroie
0c82612e8e Update toubuntu-24.04 2024-12-07 03:11:33 +01:00
fvanroie
fea7be0700 Add lanbon_l9 #830 2024-12-07 02:16:11 +01:00
fvanroie
a67bcc3fc0 Merge branch 'master' of https://github.com/HASwitchPlate/openHASP 2024-12-07 02:14:44 +01:00
fvanroie
12ec1a11b3
Merge pull request #830 from lylavoie/Lanbon_L9
merge Lanbon L9
2024-12-07 02:08:47 +01:00
Lincoln Lavoie
113b6838f2
Working setup for Lanbon L9
* Changed to Arduino_ESP32PAR8 bus driver.
* Fixed touch driver options, added missing port settings.
* Increased frequency of i2c to 400kHz.
2024-12-06 16:01:00 -05:00
Lincoln Lavoie
c89d10dd90
Updated settings for the Lanbon L9
* Fixed the TFT driver, bad reference to gfx object.
* Added setting for GFX parallel driver speed.
* Corrected touch drive to FT6336.
2024-12-05 23:08:22 -05:00
fvanroie
d8ee62ba7c
Merge pull request #829 from marsman7/fix-compiling_error_with_hasp_use_custom_0
Fix compiling errors when HASP_USE_CUSTOM set to zero
2024-12-04 13:25:40 +01:00
marsman7
932805d3bd Fix compiling errors when HASP_USE_CUSTOM set to zero 2024-12-03 21:37:06 +01:00
fvanroie
9a3e9c03b8
Merge pull request #826 from Llgok/master
The addition of support for T-Panel (verified)
2024-11-21 15:39:14 +01:00
fvanroie
81d35626ae
Update _esp32s3.ini 2024-11-21 15:38:45 +01:00
LILYGO_L
52861a6a5d The addition of support for T-Panel (verified). 2024-11-21 14:21:53 +08:00
fvanroie
5f29881e12 Update ace.js to 1.36.5 2024-11-14 21:59:12 +01:00
fvanroie
355e1dbdda Add ws_esp32_s3_touch_lcd_4p3 2024-11-07 20:50:42 +01:00
fvanroie
a771438a08 Add esp32-2432s028_v2 #396 2024-10-12 23:57:34 +02:00
fvanroie
a52ed04f1e Merge branch 'master' of https://github.com/HASwitchPlate/openHASP 2024-10-12 23:38:44 +02:00
fvanroie
769f283b3c Add esp32-2432s028_v2 #396 2024-10-12 23:38:41 +02:00
fvanroie
8b329dff77
Merge pull request #812 from LarsMichelsen/master
Fix support for Adafruit HUZZAH32 V2 ESP32 Featherwing 3.5 V2
2024-10-12 01:10:42 +02:00
Lars Michelsen
735b4a170b Fix support for Adafruit HUZZAH32 V2 ESP32 Featherwing 3.5 V2
* The board of "env:huzzah32-v2-featherwing-35-v2" was changed to
  adafruit_feather_esp32_v2

  Previously it was pointing to the v1 board. See also:

  V1: https://github.com/platformio/platform-espressif32/blob/develop/boards/featheresp32.json
  V2: https://github.com/platformio/platform-espressif32/blob/develop/boards/adafruit_feather_esp32_v2.json

* Fixed the port numbers
* hasp_gpio_type_t::BUTTON had to be renamed because adafruit_feather_esp32_v2/pins_arduino.h
  defines a macro named BUTTON.
2024-10-11 21:08:41 +02:00
fvanroie
e42b27f67a LV_MEM_CUSTOM default allocators use PSram when available #810 2024-10-08 22:35:01 +02:00
fvanroie
31a1272c5e Fix dropdown text when show_selected=0 2024-10-08 20:00:41 +02:00
fvanroie
22b9d894dc Merge branch 'master' of https://github.com/HASwitchPlate/openHASP 2024-10-05 00:55:23 +02:00
fvanroie
b55efe007d Add Lanbon L9 for testing 2024-10-05 00:51:03 +02:00
fvanroie
3047420676
Merge pull request #807 from shubham-vunet/driver-Approach2
Add Lilygo T-Panel v1.2 Pinmap and Drivers (WIP, Touchscreen not implemented)
2024-10-02 19:47:32 +02:00
Shubham Sharma
f61f0bdfa5
Fix code 2024-10-02 22:28:51 +05:30
Shubham Sharma
0f64a3b0f4 Add "Lilygo T-Panel v1.2" pinmap and touch screen 2024-10-02 21:17:45 +05:30
fvanroie
80a9ddb3ea Downgrade platform 2024-09-01 16:21:18 +02:00
fvanroie
ff83c7717c Test platform 5.4.0 for rc14 #643 2024-08-31 23:43:08 +02:00
fvanroie
53bd328178 Update ace.js to 1.36.2 2024-08-30 17:19:14 +02:00
fvanroie
52259a34a0 Update ace.js to 1.36.1 2024-08-29 23:07:19 +02:00
fvanroie
707078560d Disable useSoftTabs #788 2024-08-29 15:58:44 +02:00
fvanroie
b44e8e4951
Merge pull request #793 from HASwitchPlate/l10n_master
New Crowdin updates
2024-08-29 00:55:12 +02:00
fvanroie
1e0b85b3e4 New translations en.json (Swedish) 2024-08-29 00:32:09 +02:00
fvanroie
be3f934df0
Merge pull request #792 from HASwitchPlate/l10n_master
New Crowdin updates
2024-08-28 23:14:11 +02:00
fvanroie
24c39a4b71 New translations en_us.h (Swedish) 2024-08-28 23:04:50 +02:00
fvanroie
37758b1b26
Merge pull request #790 from HASwitchPlate/l10n_master
New Crowdin updates
2024-08-28 21:56:27 +02:00
fvanroie
be953b904a New translations en.json (Swedish) 2024-08-28 21:49:56 +02:00
fvanroie
b83276bca0 New translations en_us.h (Swedish) 2024-08-28 12:33:53 +02:00
fvanroie
f0506d185d New translations en.json (Swedish) 2024-08-28 12:33:52 +02:00
fvanroie
4809ac3915 New translations en.json (Swedish) 2024-08-28 09:53:27 +02:00
fvanroie
4d2aa8d8e0 New translations en_us.h (Swedish) 2024-08-28 01:45:50 +02:00
fvanroie
4b89d9ca52 New translations en.json (Swedish) 2024-08-28 01:45:49 +02:00
fvanroie
84ec6d125c
Merge pull request #789 from HASwitchPlate/l10n_master
New Crowdin updates
2024-08-27 23:58:06 +02:00
fvanroie
391401b3a3 New translations en.json (Spanish) 2024-08-27 23:55:05 +02:00
fvanroie
5cbb92d617 New translations en_us.h (Swedish) 2024-08-27 23:44:52 +02:00
fvanroie
e799a01bc5 New translations en.json (Swedish) 2024-08-27 23:44:51 +02:00
fvanroie
825f5c6da5 New translations en.json (Spanish) 2024-08-27 23:44:50 +02:00
fvanroie
08dd9c5004 Obsolete workflows 2024-08-26 02:47:24 +02:00
fvanroie
042fe05725 Update build.yaml zip step 2024-08-26 02:32:55 +02:00
fvanroie
7053024146 Upload assets only on release 2024-08-26 02:27:33 +02:00
fvanroie
4e16639794 Zip atrifacts before release upload 2024-08-26 02:22:51 +02:00
fvanroie
1f01ece609 Update release workflow 2024-08-26 02:12:32 +02:00
fvanroie
d6f3b52911 Update asset upload on release 2024-08-26 02:05:57 +02:00
fvanroie
962b01d91f Update build.yaml 2024-08-26 01:49:45 +02:00
fvanroie
401a134658 Add minifests to build step 2024-08-26 01:21:10 +02:00
fvanroie
ca346e868f Fix anti-burn when software rotation is enabled #764 2024-08-24 20:00:05 +02:00
fvanroie
e6eae8b391 Add retain flag to mqtt_send_state #781 2024-08-22 14:29:40 +02:00
fvanroie
73c1539fda Merge branch 'master' of https://github.com/HASwitchPlate/openHASP 2024-08-19 18:50:01 +02:00
fvanroie
be7eba0191 Downgrade acejs to 1.35.3 #783 2024-08-19 18:49:58 +02:00
fvanroie
472033446b
Merge pull request #780 from GiorgioAresu/devcontainer-configuration
Add devcontainer configuration
2024-08-12 11:20:36 +02:00
GiorgioAresu
8b173815c9 Add devcontainer configuration 2024-08-11 22:37:28 +02:00
fvanroie
dada05951c
Merge pull request #774 from yetanothercarbot/master
Add ESP32-S3-BOX-3 support.
2024-07-30 14:34:44 +02:00
yetanothercarbot
319e073e68
Merge branch 'HASwitchPlate:master' into master 2024-07-30 18:00:31 +10:00
yetanothercarbot
1ffa7b8636 ESP32-S3-BOX-3 support finalised 2024-07-30 17:56:00 +10:00
fvanroie
31572ef9d0 Add "event" key to discovery message for push button events 2024-07-23 22:44:50 +02:00
fvanroie
348852476d Use "event" group for pushbuttons in discovery { 2024-07-23 22:28:36 +02:00
fvanroie
2b083d376f Merge branch 'master' of https://github.com/HASwitchPlate/openHASP 2024-07-22 16:44:15 +02:00
fvanroie
734f11d3d8 Update ace?js to v1.35.4 2024-07-22 16:44:12 +02:00
fvanroie
4f8f01166c
Merge pull request #769 from FreeBear-nc/bugfixes
Move USB_TXD/RXD to is_system_pin()
2024-07-19 17:28:25 +02:00
FreeBear
0b30b075fa Move USB_TXD/RXD to is_system_pin() 2024-07-19 16:15:45 +01:00
fvanroie
c91b98ac30
Merge pull request #768 from FreeBear-nc/bugfixes
Hide TFT-G5 & USB GPIO pins in web page
2024-07-19 16:59:49 +02:00
FreeBear-nc
e1a063d8e1
Merge branch 'HASwitchPlate:master' into bugfixes 2024-07-19 15:25:41 +01:00
FreeBear
89ef57346a TFT_G5 was missing from the list of used GPIO pins.
Add the USB TX/RX pins to the list for the Guition ESP32-S3 4848S040 board.
2024-07-19 15:20:11 +01:00
fvanroie
20256b2953 Update ace.js to v1.35.3 2024-07-18 20:03:07 +02:00
fvanroie
bbd96b256a
Merge pull request #752 from FreeBear-nc/bugfixes
Was a mistake to hide TFT_BCKL gpio pin from the user. On some boards…
2024-06-14 14:29:57 +02:00
FreeBear
94ceaf2cf1 Was a mistake to hide TFT_BCKL gpio pin from the user. On some boards, it
can be reassigned by the user (on others, it is baked in to the hardware).
2024-06-14 00:03:26 +01:00
fvanroie
23c7727504
Merge pull request #746 from adampr1/patch-1
Add support for Waveshare ESP32-S3-Touch-LCD-4.3
2024-06-04 15:00:48 +02:00
adampr1
46956526b0
Merge branch 'HASwitchPlate:master' into patch-1 2024-06-04 09:49:54 +02:00
fvanroie
830bf702bd
Merge pull request #747 from adampr1/patch-2
Add support for Waveshare ESP32-S3-Touch-LCD-4.3
2024-05-30 19:25:59 +02:00
adampr1
9107474603
Add support for Waveshare ESP32-S3-Touch-LCD-4.3
Add support for Waveshare ESP32-S3-Touch-LCD-4.3 from https://github.com/HASwitchPlate/openHASP/discussions/602
2024-05-30 17:14:42 +02:00
adampr1
c4217a92e8
Add support for Waveshare ESP32-S3-Touch-LCD-4.3
Add suppor for ws_esp32_s3_touch_lcd_4p3 from post https://github.com/HASwitchPlate/openHASP/discussions/602
2024-05-30 17:12:30 +02:00
fvanroie
57207c7119 Update ace.js to 1.34.2 2024-05-27 17:11:00 +02:00
fvanroie
944f92e588 Add mqttEverySecond 2024-05-24 22:18:57 +02:00
fvanroie
b118e56245 Fix for lv_fs_if_pc_init 2024-05-24 22:06:17 +02:00
fvanroie
f175dc599a Prepare LVFS support for /sdcard 2024-05-24 21:58:15 +02:00
fvanroie
d903bc905f Add mqttEverySecond 2024-05-24 21:39:57 +02:00
fvanroie
8a341fd09c Update ace.js to 1.34.1 2024-05-24 13:50:15 +02:00
fvanroie
5c80f41fcf Add custom_state_subtopic 2024-05-24 05:14:49 +02:00
fvanroie
1f471ad308 Add custom_state_subtopic #611 2024-05-24 05:03:53 +02:00
fvanroie
a9d514b04c Flakey WiFi on Sunton #592 2024-05-24 04:12:41 +02:00
fvanroie
cd34d8994f Add elecrow-s3-8048c050_4MB 2024-05-24 00:09:52 +02:00
fvanroie
6f402cb42d Add guition-jc4827w543c_4MB 2024-05-23 16:17:50 +02:00
fvanroie
27a0e7ce73 Add jc4827w543c_4MB 2024-05-23 16:12:46 +02:00
fvanroie
13a211da4a Merge branch 'master' of https://github.com/HASwitchPlate/openHASP 2024-05-22 20:38:56 +02:00
fvanroie
cd3fa42fc0 Update ace.js to 1.34.0 2024-05-22 20:38:51 +02:00
fvanroie
e3bd3f6ac2
Merge pull request #740 from HASwitchPlate/l10n_master
New Crowdin updates
2024-05-22 20:17:50 +02:00
fvanroie
983cf13fd0 New translations en.json (Spanish) 2024-05-22 20:14:31 +02:00
fvanroie
92f682c6bd New translations en.json (French) 2024-05-22 20:14:30 +02:00
fvanroie
331c1d503d New translations en_us.h (Portuguese) 2024-05-22 20:14:28 +02:00
fvanroie
646f8d91fe New translations en_us.h (Spanish) 2024-05-22 20:14:25 +02:00
fvanroie
1ea0752004 New translations en_us.h (French) 2024-05-22 20:14:23 +02:00
fvanroie
83bdad83e5 New translations en_us.h (Portuguese, Brazilian) 2024-05-22 18:33:58 +02:00
fvanroie
fba1331c3b New translations en_us.h (Chinese Simplified) 2024-05-22 18:33:57 +02:00
fvanroie
ee5df54676 New translations en_us.h (Portuguese) 2024-05-22 18:33:56 +02:00
fvanroie
c088ddff8e New translations en_us.h (Dutch) 2024-05-22 18:33:55 +02:00
fvanroie
00df690a16 New translations en_us.h (Hungarian) 2024-05-22 18:33:54 +02:00
fvanroie
de4c1875c3 New translations en_us.h (German) 2024-05-22 18:33:53 +02:00
fvanroie
0e1d37c859 New translations en_us.h (Danish) 2024-05-22 18:33:52 +02:00
fvanroie
13095042dc New translations en_us.h (Spanish) 2024-05-22 18:33:51 +02:00
fvanroie
6d594e3d53 New translations en_us.h (French) 2024-05-22 18:33:50 +02:00
fvanroie
d2745abb44 New translations en_us.h (Romanian) 2024-05-22 18:33:49 +02:00
fvanroie
cc1d6d9458 Refactor format_bytes 2024-05-22 18:28:53 +02:00
fvanroie
4fbb2417fa Merge branch 'master' of https://github.com/HASwitchPlate/openHASP 2024-05-22 16:51:41 +02:00
fvanroie
07ecdcf1f2
Merge pull request #739 from FreeBear-nc/bugfixes
Using size_t limits max number to 2^32.
2024-05-22 16:54:21 +02:00
FreeBear
fcd99682b3 Forgot to roll back on a test. 2024-05-22 15:27:36 +01:00
FreeBear
e37ca4c318 Just in case file size in the TiB range gets passed, make sure we
don't index beyond the end of the array.
2024-05-22 15:21:44 +01:00
FreeBear
452c619e97 Use a const char* array for format_bytes suffixes at the expense of a little
more system memory.
2024-05-22 15:04:18 +01:00
FreeBear
b65bd46b41 2^60 is Exbi (Ei) not Zebi (Zi) 2024-05-22 12:18:03 +01:00
FreeBear
7dc3de34f8 One too many file system dividers used for megabyte comparison. 2024-05-22 11:59:56 +01:00
FreeBear
33f3c36915 Take onboard comment about loss of precision.
Using size_t would have overflowed at (approx) 2^28. But with a uint64_t
the limit is going to be up in the Exbi range (2^60).
2024-05-22 11:24:54 +01:00
FreeBear
aa09f4bfd4 Using size_t limits max number to 2^32. When dealing with SD cards
we could be asked to print a uint64 (for example, from SD.totalGytes()).
2024-05-22 00:51:02 +01:00
fvanroie
909afcf2ba UPdate ace.js to 1.33.3 2024-05-21 20:28:56 +02:00
fvanroie
3433efbb49 Update sensecap-indicator-d1 2024-05-21 15:50:57 +02:00
fvanroie
bfe590741a Merge branch 'master' of https://github.com/HASwitchPlate/openHASP 2024-05-21 15:48:25 +02:00
fvanroie
eff576efb8
Merge pull request #729 from kiwiz/master
Add support for Guition JC4827W543
2024-05-21 15:10:28 +02:00
fvanroie
9254fac675
Merge pull request #737 from FreeBear-nc/bugfixes
Missing the FILE_SIZE_DIVIDER for gigabits
2024-05-21 15:08:21 +02:00
FreeBear
ca6d521a0a Missing the FILE_SIZE_DIVIDER for gigabits - This results in the number
being printed with the decimal point in the wrong place.
2024-05-21 13:14:58 +01:00
K
86d4511940 Fix backlight freq and suffix build target 2024-05-20 12:18:33 -04:00
fvanroie
8fc9ec7e17
Merge pull request #733 from FreeBear-nc/spelling
Minor spelling mistake corrected
2024-05-20 17:17:37 +02:00
fvanroie
a6685c771f
Merge pull request #734 from FreeBear-nc/systemgpio
Add list of TFT gpio pins so that they can not be selected for IO.
2024-05-20 17:17:05 +02:00
FreeBear
7a3b8d0997 Add the touch gpio pins to the list so that they are hidden from
IO selection.
2024-05-20 15:30:15 +01:00
FreeBear
c70dfe6d42 Add list of TFT gpio pins so that they can not be selected for IO. 2024-05-20 15:03:19 +01:00
K
182c8c670b Add support for Guition JC4827W543 2024-05-18 19:32:04 -04:00
FreeBear
180cc84ea2 Minor spelling mistake corrected 2024-05-17 00:09:34 +01:00
fvanroie
660a8bb512 Update ace.js to 1.33.2 2024-05-13 13:44:00 +02:00
fvanroie
82e4095dd4
Merge pull request #714 from yetanothercarbot/master
Add support for 2424S012 (round display with ESP32-C3)
2024-04-25 17:51:14 +02:00
yetanothercarbot
78ac4d95b4 Boot without serial connected 2024-04-26 01:02:23 +10:00
yetanothercarbot
462491a5b2 Use SDK-provided define instead of own 2024-04-26 00:11:54 +10:00
yetanothercarbot
92bfd8a5cc Initial support (bootloops) 2024-04-25 23:48:34 +10:00
fvanroie
8b6cd9c058 Allow larger btnmap 2024-04-20 22:30:33 +02:00
fvanroie
3e48c23052
Merge pull request #711 from marsman7/feature-crowpanel-5inch
add crowpanel hmi 5inch 800x480
2024-04-20 17:35:54 +02:00
marsman7
63288601e7 add crowpanel hmi 5inch 800x480 2024-04-20 16:13:32 +02:00
fvanroie
c27c8b6d16 Update to rc12 2024-04-12 03:54:13 +02:00
fvanroie
e5b53ce6ae Merge branch 'master' of https://github.com/HASwitchPlate/openHASP 2024-04-12 03:46:12 +02:00
fvanroie
b49f82a425 mqtt_enqueue_message 2024-04-12 03:46:10 +02:00
fvanroie
75af4aed10 Add elecrow-s3-8048c070_4MB 2024-04-12 03:42:53 +02:00
fvanroie
577a7e7fb4
Merge pull request #705 from hb020/master
Allow overriding of LV_MEM_CUSTOM
2024-04-11 14:07:47 +02:00
hans boot
99d9a0668e Allow LV_MEM_CUSTOM override also in v8 2024-04-11 08:22:17 +02:00
hans boot
66fe185bfe Allow LV_MEM_CUSTOM override 2024-04-11 08:14:01 +02:00
fvanroie
2bbc2c53c1
Merge pull request #702 from marsman7/fix-mqtt_subscribe_group_topic
fix: Custom Group Topic name does not work
2024-04-08 01:03:59 +02:00
marsman7
482cda6898 fix: Custom Group Topic name does not work
issues #697

https://github.com/HASwitchPlate/openHASP/issues/697
2024-04-07 21:03:59 +02:00
fvanroie
4facdf0f54
Merge pull request #701 from HASwitchPlate/l10n_master
New Crowdin updates
2024-04-07 15:09:01 +02:00
fvanroie
a5b91a2e5a New translations en_us.h (German) 2024-04-07 15:08:35 +02:00
fvanroie
9458f6a66e
Merge pull request #699 from HASwitchPlate/l10n_master
New Crowdin updates
2024-04-07 15:08:15 +02:00
fvanroie
c6a6f54409 New translations en_us.h (German) 2024-04-07 15:04:11 +02:00
fvanroie
f15b27c143 Lower BACKLIGHT_FREQUENCY to 100 #691 2024-04-07 01:55:38 +02:00
fvanroie
2510a4304f New translations en_us.h (German) 2024-04-06 13:49:27 +02:00
fvanroie
f0eda5018a Update native platform version to 1.2.1 2024-04-04 03:15:48 +02:00
fvanroie
09dc8c947b Fix for Windows64_sdl 2024-04-04 02:45:16 +02:00
fvanroie
0c9151cf7a Fix Windows build 2024-04-04 02:34:27 +02:00
fvanroie
0bf0a02bdf Add #if HASP_USE_QRCODE 2024-04-04 01:36:25 +02:00
fvanroie
eff65ce02b Add #if HASP_USE_QRCODE 2024-04-04 01:33:52 +02:00
fvanroie
9ba255807e Add #if HASP_USE_QRCODE 2024-04-04 01:31:22 +02:00
fvanroie
9b57bf6feb Fix Linux build 2024-04-04 01:22:06 +02:00
fvanroie
1a08c2ca28 Disable HASP_USE_QRCODE on PC targets 2024-04-04 01:14:26 +02:00
fvanroie
4c61df0561 Add qrcode object 2024-04-04 01:07:52 +02:00
fvanroie
0293661bde Fix for Linux build 2024-04-04 01:07:11 +02:00
fvanroie
0cdf250d0c Merge branch 'master' of https://github.com/HASwitchPlate/openHASP 2024-04-04 01:04:07 +02:00
fvanroie
11e48603b6 Fix for linux build 2024-04-04 01:04:05 +02:00
fvanroie
e641a244c5
Merge pull request #695 from marsman7/feature-qrcode
fix: improve memory leaks on delete qrcode
2024-04-01 15:48:34 +02:00
fvanroie
3e2f0a8f8f
Merge pull request #694 from HASwitchPlate/l10n_master
New Crowdin updates
2024-04-01 15:47:53 +02:00
marsman7
3884b7b3f4 fix: improve memory leaks on delete 2024-04-01 15:28:08 +02:00
fvanroie
6eed344aac New translations en.json (Chinese Simplified) 2024-04-01 02:34:47 +02:00
fvanroie
5487edb3fe define 2024-04-01 01:00:34 +02:00
fvanroie
0c6afb21f1
Merge pull request #693 from HASwitchPlate/l10n_master
New Crowdin updates
2024-04-01 00:55:17 +02:00
fvanroie
c8ac856bfd New translations en_us.h (Dutch) 2024-04-01 00:53:18 +02:00
fvanroie
fa55cf4d04 New translations en.json (Dutch) 2024-04-01 00:53:14 +02:00
fvanroie
a5d1eb8d69 New translations en_us.h (German) 2024-04-01 00:53:12 +02:00
fvanroie
a6c5bed7e2
Merge pull request #692 from HASwitchPlate/l10n_master
New Crowdin updates
2024-03-31 23:53:22 +02:00
fvanroie
d3edd9ea1f New translations en_us.h (German) 2024-03-31 23:52:03 +02:00
fvanroie
796c365aff New translations en_us.h (German) 2024-03-31 23:28:40 +02:00
fvanroie
fcd86faa78 New translations en_us.h (German) 2024-03-31 22:08:43 +02:00
fvanroie
b4fc84b3b0 New translations en.json (German) 2024-03-31 20:47:01 +02:00
fvanroie
5c4ca1f609 New translations en_us.h (German) 2024-03-31 20:47:01 +02:00
fvanroie
ad657a0bbc New translations en_us.h (German) 2024-03-31 19:51:06 +02:00
fvanroie
8d0ba7e6f7 Merge branch 'master' of https://github.com/HASwitchPlate/openHASP 2024-03-24 14:08:52 +01:00
fvanroie
126113d1f0 Comment rootca_crt_bundle_start 2024-03-24 14:08:48 +01:00
fvanroie
7dbf52734a
Merge pull request #674 from marsman7/master
Add QR-code object
2024-03-24 14:01:45 +01:00
fvanroie
d09452e962 Add Elecrow ESP32-S3 TFT 7.0" 2024-03-23 15:10:11 +01:00
fvanroie
3b9c2f23b3 Add size comment 2024-03-23 14:56:31 +01:00
fvanroie
3168714bc3 Add WiFi All Channel Scan 2024-03-23 14:54:12 +01:00
fvanroie
60a6a3d1d6 Update ace.js to v1.32.8 2024-03-23 14:17:32 +01:00
fvanroie
4b6a00283a Better dimming on esp32-s3-4848s040 2024-03-22 01:25:15 +01:00
fvanroie
fe5b42694c Update esp32-s3-4848s040_16MB 2024-03-21 01:03:28 +01:00
marsman7
6a819f58c7 QR-Code extended by lv_qrcode_get_text 2024-03-17 14:33:50 +01:00
marsman_be
4d25e77ea6 QR code preventing crashes 2024-03-15 11:15:38 +01:00
marsman7
3f4e79a195 qrcode default version increased 2024-03-14 19:45:53 +01:00
marsman7
053f1f91c8 Add QR-code object 2024-03-13 23:03:01 +01:00
fvanroie
b9cff872f5 Fix platform 2024-03-11 20:59:37 +01:00
fvanroie
408ab7af85 ArduinoJson dependencies 2024-03-11 20:35:22 +01:00
fvanroie
80b21d46dd rduinoJson dependencies 2024-03-11 20:24:26 +01:00
fvanroie
5ad81ff774 Update to TFT_eSPI v2.5.43 2024-03-11 20:19:15 +01:00
fvanroie
b5e413e150 Update to Tasmota core 2023.10.03 2024-03-11 15:03:24 +01:00
fvanroie
6abf99fdcd Disable Wireguard in default firmware #585 2024-03-11 14:29:27 +01:00
fvanroie
916cae2b28 Merge branch 'master' of https://github.com/HASwitchPlate/openHASP 2024-03-10 21:22:43 +01:00
fvanroie
94207cc323 Lower BACKLIGHT_FREQUENCY to 2000 2024-03-10 21:22:39 +01:00
fvanroie
50f1068c7c
Merge pull request #581 from perexg/topic/black-screen
hasp dark theme - use black (no gradient) for the background
2024-03-10 14:27:43 +01:00
fvanroie
f27744b83b Remove Backlight fade 2024-03-10 14:19:16 +01:00
fvanroie
9d51e974de Remove Backlight fade 2024-03-10 14:15:48 +01:00
fvanroie
70738fb361 Add HASP_USE_ETHSPI guard 2024-03-02 19:57:52 +01:00
fvanroie
a51b3d820a
Merge pull request #659 from bensuffolk/network
Allow lanbon_eth to build
2024-03-02 19:37:17 +01:00
Ben Suffolk
fbc62ba97c
Merge branch 'HASwitchPlate:master' into network 2024-03-02 16:47:21 +00:00
fvanroie
ded1d3e4a4 Add esp32-2432s032c_4MB 2024-02-29 21:29:42 +01:00
fvanroie
006d4ffb3f Rotate screen for ili9342 build #544 2024-02-28 01:54:46 +01:00
fvanroie
50817f057e Add esp32-2432s028r-ili9342_4MB 2024-02-28 00:11:58 +01:00
fvanroie
5dc9d48c7e Add esp32-2432s028r-ili9342_4MB 2024-02-27 23:54:55 +01:00
fvanroie
e1e2ff3833 Add esp32-2432s028r-st7789_4MB 2024-02-27 00:06:46 +01:00
fvanroie
677e8cc1e7 Update Guition 2024-02-26 21:52:27 +01:00
fvanroie
82a382ad57 Fix Guition ESP32-S3-4848S040 2024-02-26 21:47:50 +01:00
fvanroie
ce99b815b9 Remove double quotes #637 2024-02-26 01:17:07 +01:00
fvanroie
ff6a8846ce Update copyright 2024-02-26 00:59:10 +01:00
fvanroie
4523f134ce Only serialize text, not tags 2024-02-26 00:47:49 +01:00
fvanroie
080b41e036 Fix FPSTR redefines 2024-02-25 23:59:57 +01:00
fvanroie
11f695aff7 Add MDNS discovery 2024-02-25 23:12:49 +01:00
fvanroie
510565ca51 Serialize event payloads properly #637 2024-02-25 21:28:38 +01:00
fvanroie
d9ee633c92 Merge branch 'master' of https://github.com/HASwitchPlate/openHASP 2024-02-25 20:38:12 +01:00
fvanroie
cf5c02d487 Add MDNS discovery 2024-02-25 20:38:09 +01:00
fvanroie
e37d38e399 Add MDNS discovery 2024-02-25 20:36:08 +01:00
fvanroie
02715644bb
Merge pull request #650 from dgomes/fix_macos
Fix to compile in MacOS 14
2024-02-23 13:25:56 +01:00
Diogo Gomes
d9d4d8d0c9 fix to compile in MacOS 14 2024-02-22 23:24:24 +00:00
fvanroie
ac6796b19d Update ArduinoJson to 6.21.5 2024-02-22 16:19:28 +01:00
fvanroie
837061b380
Merge pull request #631 from kuba2k2/feature/pc-port
Improve PC port feature support (Win32/Linux)
2024-02-22 16:02:30 +01:00
fvanroie
d3b5658385 Disable fade #641 2024-02-17 15:21:54 +01:00
fvanroie
25a73b4255 Update build script 2024-02-17 14:29:35 +01:00
fvanroie
a3c2e9723b Fix for Linux build #641 2024-02-17 14:21:46 +01:00
fvanroie
2fe7bcc1a2
Merge pull request #641 from presslab-us/backlight_fade_cb
Use callback for backlight fade
2024-02-17 14:06:02 +01:00
Kuba Szczodrzyński
6a8bbce6ec
Restore lv_fs_if_init() on Arduino build 2024-02-15 17:37:08 +01:00
Kuba Szczodrzyński
d71473a4e7
Reflect MQTT state with online/offline scripts 2024-02-12 19:30:05 +01:00
Ryan Press
baa125d4b6 enable backlight fade 2024-02-12 10:25:58 -08:00
Kuba Szczodrzyński
37e66cdf5b
Rename PC build envs 2024-02-12 18:33:04 +01:00
Kuba Szczodrzyński
55f39f02d0
Revert changes unrelated to PC build 2024-02-12 18:24:52 +01:00
Kuba Szczodrzyński
b0969892fd
Workaround "clearpage all" crashing on PC build 2024-02-12 18:20:00 +01:00
Kuba Szczodrzyński
9b3c88492c
Switch to tty7 on POSIX fbdev 2024-02-12 16:32:38 +01:00
Kuba Szczodrzyński
d77428db54
Allow publishing MQTT message even with action tag 2024-02-10 23:58:37 +01:00
Kuba Szczodrzyński
d0d2bc1940
Enable Paho Async MQTT client on PC build 2024-02-10 23:43:28 +01:00
fvanroie
e974a42d41
Merge pull request #633 from perexg/topic/wireguard-cleanup
Little wireguard cleanups
2024-02-10 22:25:53 +01:00
Jaroslav Kysela
e93597a881 Little wireguard cleanups
- accept the password mask as valid input string in web ui
- do not set the new configuration immediatelly (use manual restart like for wifi)
2024-02-10 21:50:11 +01:00
Kuba Szczodrzyński
32c21b9c52
Implement command scheduling 2024-02-10 20:30:12 +01:00
Kuba Szczodrzyński
3fcae65fad
Allow suppressing console output on PC build 2024-02-10 18:20:54 +01:00
Kuba Szczodrzyński
3cb5eb2d58
Support event data substitution in action commands 2024-02-10 18:04:18 +01:00
Kuba Szczodrzyński
603d38ae3c
Support executing shell commands on PC build 2024-02-10 16:22:36 +01:00
Kuba Szczodrzyński
4fff3d79c5
Enable command console on PC build 2024-02-10 15:05:01 +01:00
Kuba Szczodrzyński
2738bff96a
Allow changing LVGL refresh and animation period 2024-02-10 12:11:37 +01:00
presslab-us
f1f2f51ba4
Merge branch 'HASwitchPlate:master' into backlight_fade_cb 2024-02-09 19:29:39 -08:00
Ryan Press
c01e4a799e Use callback for backlight fade 2024-02-09 19:28:57 -08:00
Kuba Szczodrzyński
de0aeab435
Hide active tty cursor on POSIX fbdev 2024-02-09 23:47:18 +01:00
Kuba Szczodrzyński
6bfe89cac0
Implement LVGL task for POSIX fbdev 2024-02-09 22:55:11 +01:00
Kuba Szczodrzyński
4c20d6a4b9
Allow choosing fbdev and evdev names, load POSIX settings from config 2024-02-09 22:35:01 +01:00
Kuba Szczodrzyński
a0c8fd49d4
Fix millis() overflow on 32-bit Linux 2024-02-09 20:45:53 +01:00
fvanroie
226a88f3df Updated libraries and CHANGELOG 2024-02-09 02:15:55 +01:00
fvanroie
da9b034289 Fix broken scripts 2024-02-09 02:15:30 +01:00
Kuba Szczodrzyński
a7d900ed7b
Support brightness control on Linux fbdev 2024-02-08 22:44:39 +01:00
Kuba Szczodrzyński
f36dd66a05
Fix memory corruption with memcpy(), support musl libc 2024-02-08 22:07:59 +01:00
Kuba Szczodrzyński
ed6b17cfd7
Print evdev input device resolution, enable cursor on fbdev 2024-02-08 22:02:23 +01:00
fvanroie
f4f5ae0f0d Update Graphics Libraries 2024-02-08 20:13:09 +01:00
fvanroie
18a3f0bb7f Fix macro 2024-02-08 19:47:53 +01:00
Kuba Szczodrzyński
9693ef361a
Scan for input devices on Linux, show splashscreen 2024-02-08 19:44:23 +01:00
Kuba Szczodrzyński
fdc5f9170a
Support evdev on Linux 2024-02-08 18:57:08 +01:00
fvanroie
1a5921080f Update Timezones 2024-02-08 18:21:22 +01:00
fvanroie
109f00368e Remove root CA cert bundle 2024-02-08 17:55:45 +01:00
fvanroie
1043f5ddd7 Update Changelog 2024-02-08 17:55:28 +01:00
fvanroie
7d804f8eab Update hostnames to openhasp.com 2024-02-08 17:23:04 +01:00
fvanroie
2038cce050 Update build actions to Node.js 20 2024-02-08 16:57:23 +01:00
fvanroie
91b347c8d1 Bump RC version 2024-02-08 16:46:10 +01:00
fvanroie
b85542c9ad Update build actions to Node.js 20 2024-02-08 16:44:17 +01:00
Kuba Szczodrzyński
ac5fe4a424
Add POSIX fbdev port 2024-02-08 16:37:14 +01:00
fvanroie
ce11627308 Add root CA cert bundle to src 2024-02-08 16:35:44 +01:00
fvanroie
af6576b402 Merge branch 'master' of https://github.com/HASwitchPlate/openHASP 2024-02-08 16:28:15 +01:00
fvanroie
28152302b1 Update root CA certificates 2024-02-08 16:28:12 +01:00
fvanroie
775a269879
Merge pull request #632 from perexg/topic/wireguard-hostname
wireguard - allow to set hostname for the remote peer
2024-02-08 15:41:50 +01:00
Jaroslav Kysela
51f35e7d36 wireguard - allow to set hostname for the remote peer
WireGuard-ESP32 library uses lwip_getaddrinfo() call to resolve
IP/hostname string, so it should work.
2024-02-08 14:24:23 +01:00
Kuba Szczodrzyński
e922042a3d
Fix disk access path separator on Linux 2024-02-07 23:12:23 +01:00
Kuba Szczodrzyński
a884fbf705
Implement LVGL task for Windows GDI 2024-02-07 19:30:17 +01:00
Kuba Szczodrzyński
d0e383e398
Merge setup() and loop() of PC and Arduino 2024-02-07 17:19:45 +01:00
Kuba Szczodrzyński
cb1d860635
Cleanup PC entrypoint, remove MQTT CLI options 2024-02-07 16:33:52 +01:00
Kuba Szczodrzyński
0e87f52c1f
Support config file on PC build 2024-02-07 15:16:32 +01:00
fvanroie
b9a435f0a4 Update to ace?js 1.32.6 2024-02-07 14:29:13 +01:00
fvanroie
62f567773d Disable fade #626 2024-02-07 14:28:14 +01:00
Kuba Szczodrzyński
96bfbf397b
Add HASP_TARGET_ARDUINO and HASP_TARGET_PC macros 2024-02-07 11:11:15 +01:00
Kuba Szczodrzyński
b738c22c67
Disable app_hal.c if not using SDL2 2024-02-06 19:59:28 +01:00
Kuba Szczodrzyński
76b9be4d97
Add Win32Drv GDI port 2024-02-06 19:53:58 +01:00
Kuba Szczodrzyński
9b3bbcc107
Fix PC building with MQTT disabled 2024-02-06 19:52:57 +01:00
Kuba Szczodrzyński
a2d97204f8
Fix storage root path with LV_USE_FS_IF 2024-02-06 19:52:39 +01:00
Kuba Szczodrzyński
246f5e3ac2
Only enable SDL2 driver with USE_MONITOR 2024-02-06 19:52:23 +01:00
Kuba Szczodrzyński
a7b558eb33
Rename SDL2 port to PC 2024-02-06 19:52:00 +01:00
fvanroie
b1716fbca1 Prevent concurrently running scripts 2024-02-06 02:34:26 +01:00
fvanroie
1364795f98 Downgrade to Tasmota core 2023.10.02 2024-02-05 19:15:22 +01:00
fvanroie
71c20b88d6 Update to ace.js v1.32.5 2024-02-02 19:46:55 +01:00
fvanroie
9a97c35df1 Update Copyright to include 2024 2024-02-02 18:26:42 +01:00
fvanroie
fb2bebf14e Merge branch 'master' of https://github.com/HASwitchPlate/openHASP 2024-02-02 16:38:03 +01:00
fvanroie
e95b916157 Downgrade to Tasmota core 2023.10.02 2024-02-02 16:36:57 +01:00
fvanroie
71b1e5db40
Merge pull request #626 from presslab-us/backlight_fade
On ESP32 fade the backlight
2024-02-02 16:27:39 +01:00
Ryan Press
91faf61474 On ESP32 fade the backlight 2024-01-29 03:15:29 -08:00
fvanroie
54ca24405b
Merge pull request #625 from hb020/reenable-idle-scripts
re-enable idle scripts
2024-01-28 14:02:09 +01:00
hans boot
c190cf94b5 update to TAG_HASP, as requested 2024-01-27 15:51:33 +01:00
fvanroie
1cb1448e98
Merge pull request #624 from hb020/master
Allow more time for http get
2024-01-27 15:45:55 +01:00
hans boot
889682d49b re-enable idle scripts 2024-01-27 15:05:34 +01:00
hans boot
8436bb6493 revert
re-enable idle_* scripts
2024-01-27 14:45:49 +01:00
hans boot
03cd25edd2 re-enable idle_* scripts 2024-01-27 14:40:48 +01:00
hans boot
6bfdcd47a1 Allow more time for http get 2024-01-27 14:03:59 +01:00
fvanroie
2dce5da766
Merge pull request #622 from TheHexaMaster/master
Update sunton-esp32-s3-tft.ini
2024-01-25 00:29:26 +01:00
TheHexaMaster
db7c9ddf7b
Update sunton-esp32-s3-tft.ini
Fixed display flickering settings while using wifi for sunton-8048s070c_16MB display
2024-01-24 12:12:59 +01:00
fvanroie
c200edf823
Merge pull request #615 from amanaplan/TSC2007-correction
Corrected environment names for huzzah32-v2-* boards
2024-01-17 22:09:35 +01:00
Christian Stück
79f8ed0c33 Corrected environment names for huzzah32-v2-* boards 2024-01-17 10:11:52 -05:00
fvanroie
a57029c974
Merge pull request #605 from HASwitchPlate/revert-582-topic/idle-scripts
Revert "sleep state - run idle scripts and allow to control the backlight"
2024-01-17 14:33:39 +01:00
fvanroie
bc627f0d7b
Merge pull request #613 from amanaplan/TSC2007
Add support for updated Adafruit 2.4 and 3.5 TFT FeatherWings and HUZZAH32 board
2024-01-17 14:29:57 +01:00
fvanroie
0218736d1d
Update .gitmodules 2024-01-17 14:29:19 +01:00
fvanroie
cca34e65f8
Merge pull request #614 from tbxMb/gh-actions-esp32-s3-4848s040
Add esp32-s3-4848s040 to build.yaml
2024-01-17 14:28:32 +01:00
tbxMb
c411f2c3b0
Add esp32-s3-4848s040 to build.yaml 2024-01-17 14:21:18 +01:00
Christian Stück
a0ed65c4ce Add support for updated Adafruit 2.4 and 3.5 TFT FeatherWings and HUZZAH32 boards
Support added for the following displays:

- [Adafruit TFT FeatherWing - 2.4" 320x240 Touchscreen For All Feathers - V2](https://www.adafruit.com/product/3315)
- [Adafruit TFT FeatherWing - 3.5" 480x320 Touchscreen for Feathers - V2 with TSC2007](https://www.adafruit.com/product/3651)

Support added for the following board:

- [Adafruit HUZZAH32 ESP32 Feather V2 - 8MB Flash + 2 MB PSRAM - STEMMA QT](https://www.adafruit.com/product/5400)
2024-01-15 16:15:54 -05:00
Christian Stück
ab4664b4b8 Add support for TSC2007 touch controller 2024-01-15 15:59:42 -05:00
Christian Stück
a5e348e499 Add Adafruit TSC2007 library from https://github.com/adafruit/Adafruit_TSC2007 2024-01-15 15:52:11 -05:00
fvanroie
8d5ae794a1
Merge pull request #612 from tbxMb/esp32-s3-4848S040
Thank you very much, please test the build asset firmware when the Build Action is complete.
2024-01-15 06:42:56 +01:00
tbxMb
c5eedb9b18
Merge branch 'HASwitchPlate:master' into esp32-s3-4848S040 2024-01-14 21:02:36 +01:00
fvanroie
9864ae7a87
Revert "sleep state - run idle scripts and allow to control the backlight" 2024-01-04 03:09:40 +01:00
tbxmb
7af48cff37
Add modified init operations for esp32-s3-4848S040 #603 2024-01-03 03:28:36 +01:00
tbxmb
8b3451a134
Add: Pin configuration for esp32-s3-4848S040 #603 2024-01-02 19:33:56 +01:00
Alvaro Lobato
e756b4b4e2
Fix mac build:
- Change compiler version so it works with newer MacOS
- Fix library paths
- Exclude freetype which creates a build error
2024-01-02 19:32:05 +01:00
fvanroie
0ebfe7dcef
Merge pull request #597 from alvarolobato/fix_mac_build
Fix MacOS build
2023-12-24 23:30:39 +01:00
Alvaro Lobato
4de8f4953e Fix mac build:
- Change compiler version so it works with newer MacOS
- Fix library paths
- Exclude freetype which creates a build error
2023-12-22 00:02:05 +01:00
fvanroie
33d21e0675
Merge pull request #591 from TheHexaMaster/master
Added support for Wizee (Elecrow) 2.8 WZ2432R028 ESP32 Display
2023-12-08 21:38:50 +01:00
TheHexaMaster
62b858fc03
Update platformio_override-template.ini
Added wz2432r028
2023-12-08 21:20:12 +01:00
TheHexaMaster
982ec0bfa6
Create wz2432r028.ini
Support for Wizee 2,8" WZ2432R028 ESP32 Display
2023-12-08 21:19:23 +01:00
fvanroie
87e25de617 Update to ArduinoJson 6.21.4 2023-12-08 00:33:21 +01:00
fvanroie
6aac73484f Merge branches 'master' and 'master' of https://github.com/HASwitchPlate/openHASP 2023-12-06 22:26:01 +01:00
fvanroie
0e4fd945b2
Merge pull request #586 from HASwitchPlate/l10n_master
New Crowdin updates
2023-12-02 22:15:37 +01:00
fvanroie
20830101d2 Update to Ace JS v1.32.0 2023-12-02 22:12:47 +01:00
fvanroie
c7b7cd4f6a New translations en_us.h (Portuguese, Brazilian) 2023-12-01 23:55:06 +01:00
fvanroie
b994f41a07 New translations en.json (Portuguese, Brazilian) 2023-12-01 23:55:06 +01:00
fvanroie
a6ba5fdd7c New translations en_us.h (Chinese Simplified) 2023-12-01 23:55:05 +01:00
fvanroie
a6b660fb93 New translations en.json (Chinese Simplified) 2023-12-01 23:55:04 +01:00
fvanroie
d87f0f9eb2 New translations en_us.h (Portuguese) 2023-12-01 23:55:03 +01:00
fvanroie
3bb6b0b56c New translations en.json (Portuguese) 2023-12-01 23:55:02 +01:00
fvanroie
9a27448372 New translations en_us.h (Dutch) 2023-12-01 23:55:01 +01:00
fvanroie
9f661511e2 New translations en.json (Dutch) 2023-12-01 23:55:00 +01:00
fvanroie
132a074ea3 New translations en_us.h (Hungarian) 2023-12-01 23:54:59 +01:00
fvanroie
646f21e76e New translations en.json (Hungarian) 2023-12-01 23:54:58 +01:00
fvanroie
472a5629a2 New translations en_us.h (German) 2023-12-01 23:54:57 +01:00
fvanroie
a81a4879ca New translations en.json (German) 2023-12-01 23:54:56 +01:00
fvanroie
86c7190660 New translations en_us.h (Danish) 2023-12-01 23:54:55 +01:00
fvanroie
27ccdef806 New translations en.json (Danish) 2023-12-01 23:54:54 +01:00
fvanroie
b2d914f562 New translations en_us.h (Spanish) 2023-12-01 23:54:53 +01:00
fvanroie
a256ae4ca5 New translations en.json (Spanish) 2023-12-01 23:54:52 +01:00
fvanroie
745b415714 New translations en_us.h (French) 2023-12-01 23:54:51 +01:00
fvanroie
10f1ac0c91 New translations en.json (French) 2023-12-01 23:54:50 +01:00
fvanroie
099d75f7e0 New translations en_us.h (Romanian) 2023-12-01 23:54:49 +01:00
fvanroie
4714f2fe2e New translations en.json (Romanian) 2023-12-01 23:54:48 +01:00
fvanroie
ae58e7edf9
Merge pull request #585 from perexg/topic/wireguard
Implement WireGuard VPN
2023-12-01 23:04:15 +01:00
Jaroslav Kysela
2c94573edb add WireGuard implementation to increase security
WireGuard is really ideal for those IoT devices with limited resources.
2023-12-01 22:36:06 +01:00
Jaroslav Kysela
3789d446bd fix some warnings in the wireguard library 2023-12-01 22:05:02 +01:00
Jaroslav Kysela
45dd1ed438 Add wireguard library from https://github.com/ciniml/WireGuard-ESP32-Arduino 2023-12-01 22:05:02 +01:00
fvanroie
031c35d442
Merge pull request #584 from perexg/topic/config-jsondoc-alloc
use one allocation size for DynamicJsonDocument settings
2023-12-01 20:14:43 +01:00
Jaroslav Kysela
58970f485e use one allocation size for DynamicJsonDocument settings
The problem was detected in configSetup() - the configuration was read
only from EEPROM but not from SPI flash FS.

Cleanup things and use only one allocation size for both write and read
configuration operations.
2023-12-01 19:51:58 +01:00
fvanroie
894370b4cc
Merge pull request #582 from perexg/topic/idle-scripts
sleep state - run idle scripts and allow to control the backlight
2023-11-29 20:49:50 +01:00
Jaroslav Kysela
e092b72a6b always run idle scripts when sleep state changes 2023-11-29 18:11:20 +01:00
Jaroslav Kysela
e5e291c104 hasp dark theme - use black (no gradient) for the background
It does not so look really cool to have gradient and border in the dark screen background.
Use just plain dark, but keep background gradient for widgets.
2023-11-29 16:52:01 +01:00
fvanroie
b7283c9498 Revert Tasmota core 2023.07.00 on S2 2023-11-28 21:46:21 +01:00
fvanroie
8d8fc0e976 Revert esp_crt_bundle_set 2023-11-28 17:57:00 +01:00
fvanroie
2228ca04cd update Tasmota Core 2023.10.03 2023-11-28 17:56:36 +01:00
fvanroie
f32d78ee24 update Adafruit STMPE610, TFT_eSPI and Arduino_GFX 2023-11-28 16:17:38 +01:00
fvanroie
3fe34e17df Fix esp_crt_bundle_set 2023-11-28 16:17:09 +01:00
fvanroie
a6cbcadffb Update to Tasmota Core 2023.11.01 2023-11-28 16:09:15 +01:00
fvanroie
6cf4262f23 Update tools 2023-10-27 14:49:41 +02:00
fvanroie
9428da59e9
Merge pull request #561 from alranel/patch-1
Allow long WiFi passwords in the GUI
2023-10-27 13:24:46 +02:00
Alessandro Ranellucci
cfaf1496dd
Allow long WiFi passwords in the GUI 2023-10-27 10:48:06 +02:00
Ben Suffolk
0af0a775f5
Merge branch 'HASwitchPlate:master' into network 2023-10-08 11:25:26 +01:00
fvanroie
1b24478692
Merge pull request #553 from dfsx1/master
Fix #534 ILI9486 Failed to start: src/drv/tft/tft_driver_lovyangfx.cpp
2023-10-02 01:01:55 +02:00
dfsx1
ad0f69f68e Fix #534 ILI9486 Failed to start: src/drv/tft/tft_driver_lovyangfx.cpp 2023-10-01 18:44:01 +02:00
fvanroie
af9cf97a24
Merge pull request #539 from kinosang/mod/swipup
swip up to page back by default
2023-09-27 23:01:05 +02:00
fvanroie
4004188079
Merge pull request #543 from HASwitchPlate/l10n_master
New Crowdin updates
2023-09-27 23:00:09 +02:00
fvanroie
cabfce64c8 New translations en_US.h (Portuguese) 2023-09-13 20:02:59 +02:00
fvanroie
f28627c14d Fix invalid override 2023-09-13 17:29:08 +02:00
fvanroie
cedb130b75 Fix invalif override 2023-09-13 17:18:57 +02:00
fvanroie
da1305df76 Add panlee-zw3d95ce01s-tr 2023-09-13 17:02:04 +02:00
fvanroie
c053421d58 Merge branch 'master' of https://github.com/HASwitchPlate/openHASP 2023-09-13 16:45:06 +02:00
fvanroie
febd01043a
Merge pull request #542 from HASwitchPlate/l10n_master
New Crowdin updates
2023-09-13 16:43:00 +02:00
fvanroie
50308777cb New translations en.json (Hungarian) 2023-09-13 16:41:56 +02:00
fvanroie
9d15258e96
Merge pull request #541 from HASwitchPlate/l10n_master
New Crowdin updates
2023-09-13 16:19:01 +02:00
fvanroie
c3e9fe14a4 New translations en.json (Hungarian) 2023-09-13 16:08:10 +02:00
fvanroie
16ae10255c New translations en.json (Hungarian) 2023-09-13 16:00:15 +02:00
fvanroie
96d0732b68
Merge pull request #538 from kinosang/mod/86s
add panlee-zw3d95ce01s-tr-4848_16MB
2023-09-13 15:54:24 +02:00
7IN0SAN9
e1371899bf
add panlee-zw3d95ce01s-tr-4848_16MB ref #435 2023-09-12 23:00:00 +08:00
7IN0SAN9
b7578182e6
swip up to page back by default 2023-09-12 22:56:26 +08:00
fvanroie
f326f48cd0 Update to ace.js v1.24.2 2023-09-10 13:22:13 +02:00
fvanroie
e2910604a2 Update to rc8 with Tasmota Core 2023.08.01 #513 2023-08-30 01:38:03 +02:00
fvanroie
dcb167c07e
Merge pull request #532 from marsman7/master
Update CHANGELOG.md - idle level system scripts
2023-08-26 20:36:04 +02:00
marsman7
1e5a281b22 Update CHANGELOG.md - idle level system scripts 2023-08-26 11:09:41 +02:00
fvanroie
c5ce7c6a9f dispatch_run_script already checks if file exists 2023-08-26 02:21:22 +02:00
fvanroie
71237c2702
Merge pull request #531 from marsman7/master
Adding system scripts that are automatically executed when idle level is changed
2023-08-26 01:55:54 +02:00
marsman7
4ae1e665a1 Adding additional system scripts that are automatically executed when the idle level is changed.
* idle_off.cmd
* idle_short.cmd
* idle_long.cmd

In example this scripts can use to easy control the backlight or change page

* idle_off.cmd

```
backlight {"state": true, "brightness": 255}
moodlight {"state": false}
```

* idle_short.cmd

```
backlight {"state": "on", "brightness": 50}
```

* idle_long.cmd

```
backlight {"state": false, "brightness": 5}
moodlight {"state": true, "color":"green"}
```
2023-08-25 22:50:55 +02:00
fvanroie
5aceb04a26 Merge branch 'master' of https://github.com/HASwitchPlate/openHASP 2023-08-25 00:32:53 +02:00
fvanroie
47e9760500 Fix Makerfabs S3 tft35 spi display issues #528 2023-08-25 00:32:45 +02:00
fvanroie
0e0168487d
Merge pull request #527 from marsman7/master
fix compile error : 'lv_font_montserrat_14' was not declared in this scope
2023-08-22 23:28:24 +02:00
Martin
a4d6984797
Merge branch 'HASwitchPlate:master' into master 2023-08-22 23:00:59 +02:00
marsman7
fff79aabab fix compile error : 'lv_font_montserrat_14' was not declared in this scope 2023-08-22 22:56:27 +02:00
fvanroie
7cd9c9496c New translations en_US.h (Portuguese, Brazilian) 2023-08-22 17:59:28 +02:00
fvanroie
d7793049bd New translations en_US.h (Chinese Simplified) 2023-08-22 17:59:27 +02:00
fvanroie
0a2feee6ed New translations en_US.h (Portuguese) 2023-08-22 17:59:26 +02:00
fvanroie
80e29daa65 New translations en_US.h (Dutch) 2023-08-22 17:59:25 +02:00
fvanroie
49e1b83aae New translations en_US.h (Hungarian) 2023-08-22 17:59:24 +02:00
fvanroie
da39d2b37a New translations en_US.h (German) 2023-08-22 17:59:23 +02:00
fvanroie
06131f4171 New translations en_US.h (Danish) 2023-08-22 17:59:22 +02:00
fvanroie
a3e2f8dbbb New translations en_US.h (Spanish) 2023-08-22 17:59:21 +02:00
fvanroie
e7f57e2405 New translations en_US.h (French) 2023-08-22 17:59:20 +02:00
fvanroie
598bfb06ca New translations en_US.h (Romanian) 2023-08-22 17:59:19 +02:00
fvanroie
97c4f7550d Update translations en_US 2023-08-22 16:43:46 +02:00
fvanroie
c0edb143c3 Updatre translation en_US 2023-08-22 16:41:12 +02:00
fvanroie
a6719d0f35 Merge branch 'master' of https://github.com/HASwitchPlate/openHASP 2023-08-22 16:33:55 +02:00
fvanroie
9c7ab21f62
Merge pull request #523 from marsman7/master
change german language de_DE.h
2023-08-22 01:09:19 +02:00
marsman7
5869f88f75 change german language de_DE.h 2023-08-21 23:14:08 +02:00
fvanroie
5b436b6159 Update to ace.js v1.24.1 2023-08-16 01:36:38 +02:00
fvanroie
74d0f5b193 Merge branch 'master' of https://github.com/HASwitchPlate/openHASP 2023-08-13 20:02:01 +02:00
fvanroie
1b56f3de0b Update ace.js to v1.24.0 2023-08-09 13:32:09 +02:00
fvanroie
19ed33433e
Merge pull request #511 from yetanothercarbot/master
Add support for ESP-BOX and TT21100 touch driver
2023-08-05 19:56:52 +02:00
yetanothercarbot
964184d4c4 Support ESP-BOX 2023-08-05 20:47:44 +10:00
fvanroie
4142adafab Update to LovyanGFX 1.1.8 2023-08-03 16:25:25 +02:00
fvanroie
146c94063b Update to Tasmota Arduino Core 2.0.11 2023-07-24 18:53:33 +02:00
fvanroie
9c3e28f654 Update to ArduinoJson 6.21.3 2023-07-24 11:47:19 +02:00
fvanroie
4d6860ff43 Update Arduino_PCA9535SWSPI 2023-07-23 22:00:15 +02:00
fvanroie
37b3e488a4 Update defined(CONFIG_IDF_TARGET_ESP32S3) 2023-07-23 21:36:17 +02:00
fvanroie
7625d688be Add FT6336U 2023-07-23 20:10:01 +02:00
fvanroie
124a979569 Add sensecap-indicator-d1_8MB 2023-07-23 17:12:48 +02:00
fvanroie
7682eea7b0 Add sensecap-indicator-d1_8MB 2023-07-23 16:28:36 +02:00
fvanroie
4e5114a01b Add SenseCAP Indicator D1 2023-07-23 16:20:39 +02:00
fvanroie
2f4092b39e Rename to ESP32-Terminal 2023-07-18 17:35:30 +02:00
fvanroie
2e5324192b Rename to ESP32-Terminal 2023-07-18 17:35:16 +02:00
fvanroie
dbe3d7e5fb Revent Adafruit STMPE610 to v1.1.4 2023-07-18 16:14:48 +02:00
fvanroie
ed56d9ee42 Update CHANGELOG and libraries 2023-07-18 15:51:13 +02:00
fvanroie
a790679466 Add Elecrow ESP-Terminal SPI and RGB 2023-07-18 15:18:33 +02:00
fvanroie
8c8a7eb717
Merge pull request #487 from HASwitchPlate/l10n_master
New Crowdin updates
2023-07-16 16:54:08 +02:00
fvanroie
8c51550685
Merge pull request #505 from paravoid/makerfabs_4MB
Add 4MB variant for Makerfabs ESP32 TFT Touch
2023-07-16 16:49:32 +02:00
fvanroie
652d0e0223
Merge pull request #507 from paravoid/spelling-changelog
Spelling fixes (changelog)
2023-07-16 16:22:01 +02:00
fvanroie
46a8f6e3b9 New translations en_US.h (Portuguese, Brazilian) 2023-07-16 16:15:21 +02:00
fvanroie
5511d5864b New translations en_US.h (Chinese Simplified) 2023-07-16 16:15:20 +02:00
fvanroie
9b24d43aa3 New translations en_US.h (Portuguese) 2023-07-16 16:15:19 +02:00
fvanroie
1d35530cbe New translations en_US.h (Dutch) 2023-07-16 16:15:18 +02:00
fvanroie
b7be2adaba New translations en_US.h (Hungarian) 2023-07-16 16:15:17 +02:00
fvanroie
081cb69b60 New translations en_US.h (German) 2023-07-16 16:15:16 +02:00
fvanroie
608e2efe6a New translations en_US.h (Danish) 2023-07-16 16:15:15 +02:00
fvanroie
35068e39cb New translations en_US.h (Spanish) 2023-07-16 16:15:14 +02:00
fvanroie
5d9fecceaa New translations en_US.h (French) 2023-07-16 16:15:13 +02:00
fvanroie
b18b72b90d New translations en_US.h (Romanian) 2023-07-16 16:15:12 +02:00
Faidon Liambotis
76a0d54e96 Spelling fixes (changelog)
Fix some very minor issues with the changelog, the most important of
which is... the filename :)
2023-07-16 17:13:38 +03:00
Faidon Liambotis
c1fa5a8cb1 Add 4MB variant for Makerfabs ESP32 TFT Touch
My Makerfabs ESP32 TFT Touch, v1.1 on the silkscreen, purchased in
October 2020, has a 4MB flash as reported by esptool flash_id:
  Manufacturer: 20
  Device: 4016
  Detected flash size: 4MB

Add a makerfabs-tft35-cap_4MB variant, and rename makerfabs-tft35-cap to
makerfabs-tft35-cap_16MB.
2023-07-16 17:05:55 +03:00
fvanroie
ac3a385c04
Merge pull request #506 from paravoid/spelling
Thank you very much for fixing these spelling mistakes. Much appreciated!
2023-07-16 15:38:14 +02:00
Faidon Liambotis
5b3f9f0d8c Spelling fixes (comments & variables) 2023-07-16 16:19:42 +03:00
Faidon Liambotis
bc407b3613 Spelling fixes (user-visible)
While debugging a few WiFi issues, I got a bunch of "Unkown" errors. Fix
this, and an unrelated, but also user-visible s/propery/property/.
2023-07-16 16:19:40 +03:00
fvanroie
7c35ef778d Add ESP32C3 2023-07-12 16:44:27 +02:00
fvanroie
7b10553a5e Update ace.js to 1.23.4 2023-07-12 14:15:16 +02:00
fvanroie
012d6afa6c Update ace.js to 1.23.3 2023-07-11 00:38:50 +02:00
fvanroie
70b4672733 Merge branch 'master' of https://github.com/HASwitchPlate/openHASP 2023-07-07 17:17:08 +02:00
fvanroie
579d24361a Update ace.js to v1.23.2 2023-07-07 17:16:21 +02:00
fvanroie
6fd20bae3b Fix flash partition size 2023-07-06 22:22:41 +02:00
fvanroie
a1b514eac9
Update hasp_mqtt.h 2023-07-03 17:43:20 +02:00
fvanroie
f91e2b1d5c
Merge pull request #503 from bensuffolk/master
Comment out LV_FONT_DEFAULT to allow custom builds to compile
2023-07-03 17:32:53 +02:00
Ben Suffolk
a3bcd82a17 Updated ETHSPI to use the correct Ethernet mac address from the ESP fuses instead of reusing the WiFi mac address 2023-07-02 16:10:46 +01:00
Ben Suffolk
5d505a630c Fixed build for W5500 ethernet, adding missing files from esp-idf no longer included in the Arduino Framework 2023-07-02 16:09:49 +01:00
Ben Suffolk
14d5c7ace5 Make mqtt_esp honour the MQTT_GROUPNAME define 2023-07-02 13:54:54 +01:00
Ben Suffolk
2bf8ebfb56 Comment out LV_FONT_DEFAULT to allow custom builds to compile 2023-07-02 12:07:00 +01:00
fvanroie
5c08b2a567
Merge pull request #500 from aseanwatson/cpicker_improvements
Improve cpicker in two ways
2023-06-22 12:36:41 +02:00
Sean
17b13e35d5 Improve cpicker in two ways
\#1. Add support for `mode` as an enum of `hue`, `saturation`, and
`value`.

\#2. Add support for `mode_fixed` attribute. Enable to prevent a long
press from cycling through the modes.

\#3. Have MQTT status responses include `h`, `s`, and `v` attributes
from `cpicker`.
2023-06-22 01:41:29 -07:00
fvanroie
dcc33c5955 Add ESP Terminal SPI and RGB 2023-06-21 17:53:49 +02:00
fvanroie
9dfe882e61 Update to ace.js 1.23.0 2023-06-21 15:04:49 +02:00
fvanroie
fd6a689ec5 New translations en.json (Dutch) 2023-06-19 20:43:13 +02:00
fvanroie
96eb4f7e88 Make NTP servers optional 2023-06-14 14:48:21 +02:00
fvanroie
c9b6e2e67f Update Arduino core 2.0.10 with ESP IDF 4.4.5 2023-06-14 14:46:48 +02:00
fvanroie
c38f2467b0 Fix reserved pins on ESP32 2023-06-14 14:46:21 +02:00
fvanroie
c1d17825e4 Update to Tasmota Arduino 2.0.10 and ESP-IDF 4.4.5 2023-06-14 11:27:25 +02:00
fvanroie
e07958b631 Update to Tasmota Arduino Core 2.0.10 with IDF 4.4.5 2023-06-14 11:25:41 +02:00
fvanroie
f805b90b9d Merge branch 'master' of https://github.com/HASwitchPlate/openHASP 2023-06-11 19:13:11 +02:00
fvanroie
2b34d3d924 Update to LovyanGFX 1.1.7 and ace.js 1.22.1 2023-06-11 19:13:09 +02:00
fvanroie
65fdbdb738
Merge pull request #493 from d00616/Board_ESP32-2432S032C
Add Sunton ESP32-2432S032C
2023-06-09 17:53:51 +02:00
Frank Holtz
7a6e526aa5 Add Sunton ESP32-2432S032C 2023-06-09 09:58:15 +02:00
fvanroie
55152291d1 Add makerfabs-s3-tft40 and makerfabs-s3-tft43 2023-05-28 18:19:25 +02:00
fvanroie
dd0c862aad Add gpio_set_digital_value #464 2023-05-17 17:40:33 +02:00
fvanroie
c47a1b9b5d Update to Tasmota core 2.0.9.2023.05.17 IDF 4.4.4 2023-05-17 13:21:37 +02:00
fvanroie
83fe5474f4 New translations en.json (Danish) 2023-05-17 03:04:53 +02:00
fvanroie
15c9858d37 New translations en.json (Dutch) 2023-05-17 03:04:49 +02:00
fvanroie
23eadbb1eb New translations en_US.h (Chinese Simplified) 2023-05-17 02:47:59 +02:00
fvanroie
e8de162d8c New translations en.json (Chinese Simplified) 2023-05-17 02:47:59 +02:00
fvanroie
24e27ac3f3 New translations en_US.h (Danish) 2023-05-17 02:47:58 +02:00
fvanroie
38b316a375 New translations en.json (Danish) 2023-05-17 02:47:57 +02:00
fvanroie
37ea5da35b Merge branch 'master' of https://github.com/HASwitchPlate/openHASP 2023-05-17 01:40:01 +02:00
fvanroie
4cfd34a866 New translations en_US.h (Portuguese, Brazilian) 2023-05-17 01:36:27 +02:00
fvanroie
8be5599d88 New translations en_US.h (Portuguese) 2023-05-17 01:36:27 +02:00
fvanroie
38679100d5 New translations en_US.h (Dutch) 2023-05-17 01:36:26 +02:00
fvanroie
23cb1e03e5 New translations en_US.h (Hungarian) 2023-05-17 01:36:25 +02:00
fvanroie
1a5a3fc966 New translations en_US.h (German) 2023-05-17 01:36:25 +02:00
fvanroie
d8b5e4537c New translations en_US.h (Spanish) 2023-05-17 01:36:24 +02:00
fvanroie
8c5bd749f3 New translations en_US.h (French) 2023-05-17 01:36:23 +02:00
fvanroie
d3ab954f25 New translations en_US.h (Romanian) 2023-05-17 01:36:23 +02:00
fvanroie
346e4f93f9 New translations en.json (Portuguese, Brazilian) 2023-05-17 01:36:22 +02:00
fvanroie
dd076ec34a New translations en.json (Portuguese) 2023-05-17 01:36:21 +02:00
fvanroie
115f11da70 New translations en.json (Dutch) 2023-05-17 01:36:21 +02:00
fvanroie
6b9b66bc35 New translations en.json (Hungarian) 2023-05-17 01:36:20 +02:00
fvanroie
0ae9bd02f6 New translations en.json (German) 2023-05-17 01:36:20 +02:00
fvanroie
0f50710708 New translations en.json (Spanish) 2023-05-17 01:36:19 +02:00
fvanroie
57f03e1f34 New translations en.json (French) 2023-05-17 01:36:18 +02:00
fvanroie
4d4b9bd988 New translations en.json (Romanian) 2023-05-17 01:36:18 +02:00
fvanroie
2363732a77 Update Crowdin configuration file 2023-05-17 01:21:23 +02:00
fvanroie
6bb74b6321 Update Crowdin configuration file 2023-05-16 21:56:14 +02:00
fvanroie
28177bd846 Update Crowdin configuration file 2023-05-16 20:51:43 +02:00
fvanroie
958ff1b659 Ipdate acejs to v1.21.1 2023-05-16 17:21:51 +02:00
fvanroie
0e1241ccf9 Fix linux build 2023-05-15 20:42:17 +02:00
fvanroie
850bcd357d Update acejs to v1.21.0 2023-05-15 13:17:13 +02:00
fvanroie
6181837cb4 Update ini files 2023-05-12 16:38:13 +02:00
fvanroie
75f61affe3 Update to acejs v1.20.0 2023-05-12 15:30:03 +02:00
fvanroie
894a6657d7 Revert F() and move char* to FlashStringHelper 2023-05-12 14:11:05 +02:00
fvanroie
6ccd10dbe0 Revert F() and move char* to FlashStringHelper 2023-05-09 16:13:39 +02:00
fvanroie
af24bedf6d Fix ttgo-t7-v1_5_ili9341 environment name 2023-05-09 15:38:38 +02:00
fvanroie
86321beb5d Remove F() and move FlashStringHelper to char* 2023-05-09 15:05:32 +02:00
fvanroie
aee55907e4 Update to Tasmota Arduino Core 2.0.9 and IDF 4.4.4 2023-05-09 15:02:52 +02:00
fvanroie
baa37d0364 Update to acejs v1.19.0 2023-05-03 15:51:26 +02:00
fvanroie
aaf535c185 Update License 2023-05-02 13:31:40 +02:00
fvanroie
646ad3d8ca Add Lilygo T-HMI 2023-05-02 13:31:31 +02:00
fvanroie
82482c7c6e Fix page 0 title 2023-05-02 13:20:47 +02:00
fvanroie
f76dee8c88 Update to rc4 2023-04-15 20:52:23 +02:00
fvanroie
a99cc4ec53 Allow HASP_USE_GPIO37 and HASP_USE_GPIO38 to enable GPIO37 and 38 on some boards #453 2023-04-14 02:37:57 +02:00
fvanroie
8148bbc988 Allow HASP_USE_GPIO37 and HASP_USE_GPIO38 to enable GPIO37 and 38 on some boards #453 2023-04-14 02:36:41 +02:00
fvanroie
75997bcde8 Fix backlight state not sent on first touch event 2023-04-14 02:33:50 +02:00
fvanroie
3855d32713 Fix Linux compile error 2023-04-14 00:28:49 +02:00
fvanroie
fe29aafd5b Add timeout parameter to gui_acquire() 2023-04-14 00:09:52 +02:00
fvanroie
871a795210 Add timeout parameter to gui_acquire() 2023-04-14 00:09:26 +02:00
fvanroie
3436cb614d Tasmota Core 2.0.7 based on IDF 4.4.4 2023-04-14 00:08:40 +02:00
fvanroie
97025a0e57 Add HASP_USE_LVGL_TASK 2023-04-14 00:08:12 +02:00
fvanroie
08c465eee5 Update to ace.js v1.17.0 2023-04-13 19:19:27 +02:00
fvanroie
353d33a54d Add makerfabs-s3-tft40-rgb 2023-04-13 19:18:28 +02:00
fvanroie
66a7d1a394 Add M5Stack.hpp 2023-04-13 00:25:17 +02:00
fvanroie
6f4bde6556 Remove obsolete objid property 2023-04-13 00:17:54 +02:00
fvanroie
b74066253c Update to ArduinoJson 6.21.2 2023-04-13 00:08:25 +02:00
fvanroie
a154bb856f LovyanGFX driver update 2023-04-12 23:32:53 +02:00
fvanroie
04daca44d4 Add Makerfabs ESP32-S3 Parallel TFT With Touch 2023-04-12 23:32:06 +02:00
fvanroie
bba7eddd2b Remove obsolete commands and txt property 2023-04-12 23:31:30 +02:00
fvanroie
34149b875a Adjust Sunton timings 2023-04-12 04:22:24 +02:00
fvanroie
8460286641 Adjust Sunton timings 2023-04-12 03:52:06 +02:00
fvanroie
ed596fe72e RC3 and ArduinoJson v6.21.1 2023-04-11 02:51:50 +02:00
fvanroie
e1d78f7c1b TFT_PREFER_SPEED=12000000 2023-04-11 02:44:18 +02:00
fvanroie
d07f7cb83e TFT_PREFER_SPEED=12000000 2023-04-11 02:43:37 +02:00
fvanroie
516b42a7e8 Update wifiShowAP() 2023-04-11 00:23:34 +02:00
fvanroie
7f9dc100bd Update GS-T3E to PCB v2.3 2023-04-11 00:06:32 +02:00
fvanroie
538ca64209 Update Sunton TFT_PREFER_SPEED 2023-04-08 17:59:24 +02:00
fvanroie
3ab88a3485 Fix MQTT_PORT on Windows 2023-03-19 16:47:18 +01:00
fvanroie
c7b8b847ad
Merge pull request #447 from Eshmun/master
Fix custom topic when HASP_USE_CUSTOM is defined
2023-03-15 18:08:18 +01:00
Eshmun
93529509d6 Fix custom topic 2023-03-15 01:06:45 +01:00
fvanroie
3e6c9a67ce Merge branch 'master' of https://github.com/HASwitchPlate/openHASP 2023-03-14 20:54:03 +01:00
fvanroie
e20e9fe500 Remove template task when label is deleted #446 2023-03-14 20:53:58 +01:00
fvanroie
a5ef4c78b6
Update bug_report.md 2023-03-14 19:22:15 +01:00
fvanroie
e783544a9c Update to 0.7.0-rc1 2023-03-03 14:00:29 +01:00
fvanroie
50e06d23d3 Update lanbon_l8-hs.jsonl 2023-02-26 21:25:00 +01:00
fvanroie
eac43ff003 Make WiFi config optional in Web UI 2023-02-26 19:59:21 +01:00
fvanroie
ac17ec87ff Add pages.jsonl configuration option 2023-02-26 19:56:35 +01:00
fvanroie
df4714cfe5 Add default pages.jsonl config option 2023-02-26 19:55:41 +01:00
fvanroie
83d2ab0ad6 Fix for MQTT Port is not saved #434 2023-02-26 19:46:05 +01:00
fvanroie
0b6a2ff0de Set default gpios for Lanbon L8-HS 2023-02-25 21:40:44 +01:00
fvanroie
0e16eeb9e1 Fix typos 2023-02-25 21:39:49 +01:00
fvanroie
265f9c42a9 Fix Captive Portal 2023-02-25 17:30:36 +01:00
fvanroie
f58b1682be Set the default backlight pin 2023-02-25 03:51:56 +01:00
fvanroie
871716f72b Default ansi codes to off 2023-02-25 03:50:56 +01:00
fvanroie
31de835f4f Add HASP_DEBUG flag 2023-02-25 03:50:30 +01:00
fvanroie
d41d22024f Add ^C = Cancel (Quit) to telnet #291 2023-02-25 03:43:53 +01:00
fvanroie
3ad815cd5d Make console less chatty 2023-02-25 03:42:50 +01:00
fvanroie
92b360a7ad action backwards compatibility 2023-02-25 03:42:23 +01:00
fvanroie
f309e7cc25 Detect Ctrl-C and Ctrl-D in Putty #291 2023-02-24 21:21:44 +01:00
fvanroie
b2a3e7425a Probe for GT911 address if TOUCH_IRQ not set 2023-02-24 00:38:12 +01:00
fvanroie
6f089d9145 Probe for GT911 address if TOUCH_IRQ not set 2023-02-23 18:07:12 +01:00
fvanroie
6e21425fa8 Dont use GT911 touch driver with HASP_USE_LGFX_TOUCH 2023-02-23 14:33:05 +01:00
fvanroie
ed9ece22a4 Fix touch resolution for Sunton 8048S043C 2023-02-23 04:01:47 +01:00
fvanroie
de91d0d610 Update GT911 Touch driver 2023-02-23 02:00:10 +01:00
fvanroie
2800795207 Update GT911 Touch driver 2023-02-23 01:58:26 +01:00
fvanroie
87ce17aec7 Update GT911 Touch driver 2023-02-23 01:53:21 +01:00
fvanroie
db24ab0075 WT32 SC01 Plus configuration fix 2023-02-22 21:51:37 +01:00
fvanroie
425e134823 Fix OTA webform and reduce flickering of progressbar 2023-02-19 22:25:16 +01:00
fvanroie
4d93dbdabf Rework action, swipe and tag #432 2023-02-19 17:06:02 +01:00
fvanroie
43f36422d6 Backwards compatibility for swipe property #432 2023-02-19 15:20:31 +01:00
fvanroie
42cd5f91e2 Update assets 2023-02-18 22:45:24 +01:00
fvanroie
43e0ff9270 Fix CI/CD and update binary assets 2023-02-18 22:38:26 +01:00
fvanroie
95d50ff971 Update config files 2023-02-16 21:33:34 +01:00
fvanroie
dd1f7b290b Update to Tasmota Core 2023.01.01 2023-02-16 20:30:26 +01:00
fvanroie
53ae3e5fc8 Use Tasmota Core 2023.01.01 2023-02-16 16:58:32 +01:00
fvanroie
8e8c0c03a9 Update Changelog 2023-02-16 05:14:14 +01:00
fvanroie
93409caa69 Update to Tasmota Core 2.0.6 2023-02-16 05:13:57 +01:00
fvanroie
2f92ba4c59 Update to Tasmota Core 2.0.6 2023-02-16 05:11:24 +01:00
fvanroie
60088f7a77 Update to Tasmota Core 2.0.6 2023-02-16 05:11:07 +01:00
fvanroie
87768f3040 Use secondary color for Toggle buttons in HASP theme 2023-02-16 04:28:55 +01:00
fvanroie
46e9e97132 Allow any command in the swipe attribute (like action) 2023-02-16 04:27:48 +01:00
fvanroie
c296a5e568 Configurable MQTT Topic #428 2023-02-15 20:09:13 +01:00
fvanroie
59bc01be04 Default timezone Etc/Universal 2023-02-14 21:58:15 +01:00
fvanroie
912a69ad31 GT911 driver update 2023-02-14 06:07:12 +01:00
fvanroie
08367a06fa Add I2C_TOUCH_ADDRESS 2023-02-14 05:31:23 +01:00
fvanroie
94642560ed Update ESP32-S2 Environment 2023-02-14 04:53:53 +01:00
fvanroie
cf03790d42 Minor tweaks 2023-02-14 03:55:36 +01:00
fvanroie
303cd45a11 Minor tweaks 2023-02-14 03:55:07 +01:00
fvanroie
8bd001ccb0 Allow longer filenames in FTP #283 2023-02-14 03:40:56 +01:00
fvanroie
187ad58dc5 Update Web UI to petite-vue app 2023-02-14 03:40:15 +01:00
fvanroie
4e681edcaf Update to LovyanGFX 1.1.2 and ArduinoJson 6.20.1 2023-02-09 23:23:13 +01:00
fvanroie
62999284b2 Make Etc the default time region 2023-02-09 23:15:39 +01:00
fvanroie
634c89a386 Fix pressed color and use secondary color for Toggled 2023-02-08 23:42:30 +01:00
fvanroie
1b9135e355 Don't use console if Serial port is disabled 2023-02-08 17:03:01 +01:00
fvanroie
6745c38773 Add T-Display-S3 2023-02-08 00:36:19 +01:00
fvanroie
f372fa542c Set all objects to clickable 2023-02-06 14:18:38 +01:00
fvanroie
ff23d19f08 Allow line and block comments in pages.jsonl 2023-02-05 05:50:21 +01:00
fvanroie
aa1f4e7642 Fix wt32-sc01_4MB flash size 2023-02-04 23:56:04 +01:00
fvanroie
16c900d5e4 Improve antiburn speed on large displays 2023-02-02 04:16:43 +01:00
fvanroie
7934c47509 Add missing tag in configOutput 2023-01-31 03:35:25 +01:00
fvanroie
f842a744e4 Add timezone to possix format 2023-01-31 03:34:51 +01:00
fvanroie
aaa94d263d Add per mille and per ten thousand glyphs 2023-01-31 03:28:37 +01:00
fvanroie
bc53a6fab9 Update static files 2023-01-31 03:27:43 +01:00
fvanroie
321407238d Update to SimpleFTPServer 2.1.5 #283 2023-01-31 03:25:43 +01:00
fvanroie
7c0bc16629 Merge branch 'master' of https://github.com/HASwitchPlate/openHASP 2023-01-29 23:53:18 +01:00
fvanroie
ac67dc65a2 Update x509_crt_bundle 2023-01-29 23:53:14 +01:00
fvanroie
a585b969b8
Update CHANGLELOG.md 2023-01-29 21:23:53 +01:00
fvanroie
de4432ce20 Add glyps ‰ and ‱ 2023-01-29 15:01:47 +01:00
fvanroie
d664693407 Fix Button discovery payload #421 2023-01-28 23:10:18 +01:00
fvanroie
972ed6583f Clean-up ESP32-S3 ini files 2023-01-27 05:52:39 +01:00
fvanroie
e379d9276f Clean-up ESP32-S3 ini files 2023-01-26 18:24:09 +01:00
fvanroie
6b05d87b00 Clean-up ESP32 ini files 2023-01-26 18:13:14 +01:00
fvanroie
b6b3cb26da Clean-up ESP32 ini files 2023-01-26 16:52:27 +01:00
fvanroie
27f3de640c Clean-up ESP32 ini files 2023-01-26 16:14:55 +01:00
fvanroie
89753608d7 Clean-up ESP32 ini files 2023-01-26 15:59:37 +01:00
fvanroie
434563b5eb Correct arduino_esp32_v2 ini flags 2023-01-26 14:15:05 +01:00
fvanroie
eca33d0d84 Update freetouchdecj 2023-01-26 01:46:58 +01:00
fvanroie
0362cdc1ce Add nvs_user_begin 2023-01-26 01:11:49 +01:00
fvanroie
a6cf4060d6 Merge branch 'master' of https://github.com/HASwitchPlate/openHASP 2023-01-26 01:01:18 +01:00
fvanroie
e2670ab702 Move #include "hasp_config.h" to hasplib 2023-01-26 01:01:13 +01:00
fvanroie
29fbb358dd Bump version to 0.7.0-dev 2023-01-26 00:39:56 +01:00
fvanroie
81b20df787
Update CHANGLELOG.md 2023-01-26 00:19:59 +01:00
fvanroie
d4339cd1a4 Partition Schema change 2023-01-20 22:39:02 +01:00
fvanroie
fa61cfdaf1 Apply fonts 2023-01-20 20:11:44 +01:00
fvanroie
5f376e2344 Include bitmap fonts in 12, 16, 24 & 32pt sizes 2023-01-20 18:59:31 +01:00
fvanroie
445446111b Include bitmap fonts in 12, 16, 24 & 32pt sizes 2023-01-20 18:54:35 +01:00
fvanroie
e22d1e14a8 Update api/license endpoint 2023-01-20 18:52:06 +01:00
fvanroie
a4f1fdde83 Update fonts and static web files 2023-01-20 02:34:24 +01:00
fvanroie
7a83367ee5 Fix LVGL v7 bug #419 2023-01-18 23:06:57 +01:00
fvanroie
1e517c3b24 Bring back 2 bitmap fonts 2023-01-18 20:52:21 +01:00
fvanroie
b3a641db15 Add HASP_LOG_TASKS 2023-01-17 23:13:06 +01:00
fvanroie
d5337fe147 Add HASP_LOG_TASKS 2023-01-17 23:05:07 +01:00
fvanroie
f542195dd6 Fix jsonl NoMemory error 2023-01-17 19:55:19 +01:00
fvanroie
ec4b54f05f Update TFT_eSPI to 2.5.0 2023-01-17 17:11:51 +01:00
fvanroie
116877099b Use heap memory for large JsonDocuments 2023-01-17 16:45:26 +01:00
fvanroie
d6c5f64143 Omit bitmap fonts 2023-01-17 02:19:41 +01:00
fvanroie
38d308a07b Omit bitmap fonts 2023-01-17 01:42:04 +01:00
fvanroie
be7d8050b1 Allow any font size from internal TTF 2023-01-17 01:05:57 +01:00
fvanroie
7deb879ffd Use TTF font for theme fonts 2023-01-17 01:05:03 +01:00
fvanroie
6fba529ab5 Disable HASP_FONT_5 2023-01-17 00:22:09 +01:00
fvanroie
eaa9d34a1a Add filsystem_list 2023-01-16 23:51:24 +01:00
fvanroie
0dd8e3dc2b Exclude petite-vue and ace on 4MB flash devices 2023-01-16 23:44:36 +01:00
fvanroie
596c798f3a Improve WiFi reconnect check 2023-01-16 18:14:08 +01:00
fvanroie
6451c37d01 Update openhasp.ttf 2023-01-15 02:29:34 +01:00
fvanroie
78629de89b Add timeout and delay to http img src 2023-01-13 21:35:31 +01:00
fvanroie
b3230fcd4c Fix json command infinite loop 2023-01-13 21:26:43 +01:00
fvanroie
d4e8b7e6d0 Enable FreeType on all ESP32 chips 2023-01-11 20:22:32 +01:00
fvanroie
f4ffe49d14 Update ArduinoGFX driver 2023-01-11 19:36:25 +01:00
fvanroie
401a2b4af2 Update ArduinoGFX driver 2023-01-11 18:25:41 +01:00
fvanroie
2c62575d9c Add TTGO T7 S3 2023-01-11 18:23:18 +01:00
fvanroie
b26ea27108 Update ArduinoGFX driver 2023-01-11 18:18:21 +01:00
fvanroie
dd9c84fcc5 Add BSSID to info page 2023-01-11 13:49:06 +01:00
fvanroie
8209625f1e Redesign action property 2023-01-11 13:46:58 +01:00
fvanroie
b0ba6a7f2b Add rotation for RGB Panels 2023-01-05 23:03:40 +01:00
fvanroie
4c0e733827 Add rotation for RGB Panels 2023-01-05 22:44:06 +01:00
fvanroie
7c10f4a655 Merge branch 'master' of https://github.com/HASwitchPlate/openHASP 2023-01-05 22:37:30 +01:00
fvanroie
6e306ec396 Add rotation for RGB Panels 2023-01-05 22:37:27 +01:00
fvanroie
c52d69b4fa
Merge pull request #411 from marc-gist/tdisplay
Add configuration filr for TTGO T-Display v1 (esp32 version)
2023-01-01 16:43:25 +01:00
marc-gist
11f8d7a44f added compile template for TTGO T-Display v1 (esp32 version) 2022-12-31 08:56:34 -05:00
fvanroie
fd91ac5824
Update README.md 2022-12-31 00:46:55 +01:00
fvanroie
91ee270071 Revert platform 2022-12-29 21:36:58 +01:00
fvanroie
3a5190cf7b Revert platform on ESP32 2022-12-28 22:56:54 +01:00
fvanroie
9ca4f8a93f Revert platform on ESP32 2022-12-28 22:51:12 +01:00
fvanroie
e2d448fb46 Use platform espressif32 2022-12-28 22:37:59 +01:00
fvanroie
d93e9200c7 Use platform espressif32 2022-12-28 22:05:21 +01:00
fvanroie
b2f74d9780 Update to ArduinoJson 6.20.0 and Arduino 2.0.6 2022-12-26 23:08:57 +01:00
fvanroie
ca6a59ae2c Store passwords in NVS instead of config.json 2022-12-26 23:08:07 +01:00
fvanroie
da2c975d39 Merge branch 'master' of https://github.com/HASwitchPlate/openHASP 2022-12-26 21:51:12 +01:00
fvanroie
64e6b13a4f Fix misplaced semi-colons 2022-12-26 21:51:09 +01:00
fvanroie
30df6857b1
Merge pull request #404 from bensuffolk/master
Add option to auto create other standard files
2022-12-20 21:17:02 +01:00
Ben Suffolk
d0da272abb Add option to auto create other standard files 2022-12-20 19:32:03 +00:00
fvanroie
56aba9b986 Add Panlee ZX3D95CE01S 2022-12-18 17:15:16 +01:00
fvanroie
95b28eb222 Add HASP_START_DIM, HASP_START_PAGE and HASP_THEME_ID 2022-12-12 20:45:11 +01:00
fvanroie
867a4c338a
Merge pull request #402 from bensuffolk/master
Updated for new define HASP_USE_ETHSPI to allow ETHSPI to build
2022-12-12 12:42:30 +01:00
Ben Suffolk
ab93f3abf2 Updated for new define HASP_USE_ETHSPI to allow ETHSPI to build 2022-12-12 09:15:52 +00:00
fvanroie
7229ce27e7 Fix compile errors 2022-12-02 01:54:44 +01:00
fvanroie
81c595c80b Update tests 2022-12-02 01:28:47 +01:00
fvanroie
5b8a761d35 Embed default TTF in ESP32S3 binaries only 2022-12-02 01:28:04 +01:00
fvanroie
2870c09207 Update TFT_eSPI to 2.4.79 and exclude PubSubClient 2022-12-02 01:27:39 +01:00
fvanroie
93bc59882c
Delete config.yaml 2022-12-01 22:51:48 +01:00
fvanroie
5ea9e1c373 Fix gui semaphore and dynamic mqtt msg queue #174 2022-12-01 20:08:51 +01:00
fvanroie
8ec8de6980 Change dispatch_exec to dispatch_run_script 2022-12-01 19:46:35 +01:00
fvanroie
560d491f71 Remove Touch driver debug output 2022-12-01 02:57:47 +01:00
fvanroie
eff199ed38 Set default line_width for line object 2022-12-01 02:28:18 +01:00
fvanroie
ef23d054e0 Use buffered writes to syslogClient #285 2022-12-01 02:03:18 +01:00
fvanroie
ad28bbfc09 Default to USB Serial console on SC01 Plus #390 2022-12-01 01:38:21 +01:00
fvanroie
3bdf6b872d Fix attr_out_int bug HEX to DEC 2022-12-01 01:03:46 +01:00
fvanroie
08e1799219 Update tests 2022-11-30 20:38:02 +01:00
fvanroie
42d179c0be Use semaphore instead of queue #174 2022-11-28 17:30:54 +01:00
fvanroie
e30a572dcb Reinstate bitmap fonts for testing 2022-11-28 17:26:49 +01:00
fvanroie
e78abd362f Update MaterialDesignIcons 2022-11-28 17:24:27 +01:00
fvanroie
b401ae7dee Update MaterialDesignIcons 2022-11-28 16:58:21 +01:00
fvanroie
964c34e75d Re-add default fonts from flash TTF 2022-11-26 22:06:07 +01:00
fvanroie
fdf5053174 Update embedded TTF font 2022-11-26 20:50:56 +01:00
fvanroie
26092259cc Add openhasp.ttf 2022-11-26 00:53:37 +01:00
fvanroie
24b92322bc Add openhasp.ttf 2022-11-26 00:29:12 +01:00
fvanroie
50565fb349 Add openhasp.ttf 2022-11-26 00:24:13 +01:00
fvanroie
d2342377fb Use bigger VDB buffer and reduce flickering 2022-11-24 21:56:46 +01:00
fvanroie
3652655bcb Remove sunton-4827s043r_16MB 2022-11-24 18:35:24 +01:00
fvanroie
41ac2e1443 Add Sunton ESP32-S3 TFT 5.0" and 7.0" 2022-11-24 17:40:23 +01:00
fvanroie
bdceca3241 Revert platform for ESP32-S3 2022-11-24 14:15:51 +01:00
fvanroie
730517d68e Add Sunton ESP32-S3 TFT 5.0" and 7.0" 2022-11-24 13:57:36 +01:00
fvanroie
23ba8c8b3b Add Sunton ESP32-S3 TFT 5.0" and 7.0" 2022-11-24 13:51:51 +01:00
fvanroie
0d9fa57f39 Add esp32-3248s035r 2022-11-24 00:14:29 +01:00
fvanroie
2654ccc9d8 Don't set calibration for capacitive touch panels 2022-11-23 20:56:21 +01:00
fvanroie
a92860b4cd Fix recursion bug in networkEvery5Seconds #381 2022-11-23 20:42:19 +01:00
fvanroie
6dfe25a176 Don't set calibration for capacitive touch panels 2022-11-23 20:39:35 +01:00
fvanroie
bbf6432606 Add mqtt_on.cmd and mqtt_off.cmd #174 2022-11-21 02:18:53 +01:00
fvanroie
65ceea7062 Add font sizes 18px and 64px 2022-11-17 01:40:43 +01:00
fvanroie
18a76a0024 Add Sunton S3 4.3" 2022-11-17 01:19:00 +01:00
fvanroie
27207d337a Only define TOUCH_CS when not using TFT_eSPI 2022-11-15 16:53:46 +01:00
fvanroie
9409987c01 Fix TFT_eSPI setTouch 2022-11-15 15:24:22 +01:00
fvanroie
0b02653a31 Fix TFT_eSPI setTouch 2022-11-15 15:04:08 +01:00
fvanroie
b449186aba Add haspTouch.set_calibration() 2022-11-15 03:48:00 +01:00
fvanroie
ec0000039e Add esp32-3248s035c_4MB 2022-11-15 03:41:15 +01:00
fvanroie
63bec8f120 Add tft_defines 2022-11-15 00:42:17 +01:00
fvanroie
4bc2cd5e24 Lovyan Resistive Touch calibration #220 2022-11-14 23:30:29 +01:00
fvanroie
e9ef961ef8 Remove LittleFS_esp32 from lib_ignore 2022-11-14 22:38:17 +01:00
fvanroie
720b3cd81f Remove LittleFS_esp32 from lib_deps 2022-11-14 22:37:46 +01:00
fvanroie
ab28e00fb9 Add ESP32_2432S028R 2022-11-14 16:35:42 +01:00
fvanroie
9099a86882 Update ini files 2022-11-14 16:34:59 +01:00
fvanroie
8ee02425a3 Update esp32-3248s035c 2022-11-14 02:45:26 +01:00
fvanroie
4d513c2209 Add Lilygo Ttgo Lily Pi ESP32 2022-11-12 14:51:10 +01:00
fvanroie
78b8666787 Add ESP32-S3 board definitions 2022-11-12 14:31:19 +01:00
fvanroie
9e1742cb1a Add gs-t3e 2022-11-12 14:25:45 +01:00
fvanroie
988514970c Stability improvements 2022-11-08 20:40:25 +01:00
fvanroie
79303a450b Fix possible overflow bug 2022-11-08 20:37:17 +01:00
fvanroie
2ea173fa75 Add Arduino_GFX driver 2022-11-08 20:35:59 +01:00
fvanroie
1410aa382b Fix for first touch nog working properly #400 2022-11-07 14:48:58 +01:00
fvanroie
cb47cf8e59 Add Lilypi and Sunton 3.5" 2022-11-02 22:05:17 +01:00
fvanroie
97464c9969 Update Lilypi LovyanGFX drivers 2022-11-02 22:00:01 +01:00
fvanroie
3c55479f56 Add --use-pep517 to dulwich install 2022-11-01 14:36:00 +01:00
fvanroie
4935332235 remove Adafruit BusIO from lib_ignore 2022-11-01 13:30:11 +01:00
fvanroie
72224ebd79 Switch back to TFT_eSPI 2022-10-26 22:12:22 +02:00
fvanroie
2fd75af555 Rename wt-sc01-plus to wt32-sc01-plus 2022-10-26 14:41:27 +02:00
fvanroie
7aa7fbbbe8 Only release old img_src if a new img_src is about to be set 2022-10-25 23:39:47 +02:00
fvanroie
ac7e0d6c8d Fix startup page=0 bug 2022-10-25 22:46:35 +02:00
fvanroie
15b33e57b4 Add esp32s3 2022-10-25 19:41:36 +02:00
fvanroie
97308367bf Code cleanup 2022-10-25 19:37:28 +02:00
fvanroie
dae78c1996 Add Makerfabs S3 SPI and SC01 Plus 2022-10-25 19:36:57 +02:00
fvanroie
3ba3fedc66 Rename L8-HD (EU) and L8-HD (AU) 2022-10-25 18:34:43 +02:00
fvanroie
290b2da8b6 Update configurations 2022-10-25 18:34:07 +02:00
fvanroie
d54faed147 Fix duplicate publish of page change event 2022-10-25 12:17:50 +02:00
fvanroie
0afaf994f3 Update lovyanGFX version of wt-86-32-3zw1 2022-10-22 15:15:11 +02:00
fvanroie
e973fe2b16 Fix lovyan driver issue 2022-10-22 01:33:44 +02:00
fvanroie
0b5eb9bb41 Use bus_parallel16 only on ESP32S2 or ESP32S3 #220 #390 2022-10-22 01:17:04 +02:00
fvanroie
a664e5379e Update lovyan driver #220 #390 2022-10-22 01:05:06 +02:00
fvanroie
8454b137ac Set Bodmer/TFT_eSPI to master branch 2022-10-18 23:37:50 +02:00
fvanroie
47c45eb46c Add buttons to input array 2022-10-18 23:01:47 +02:00
fvanroie
f6eb92443a SC01 Plus configuration tweaks #390 2022-10-18 23:00:01 +02:00
fvanroie
8490240f7f Fix Captive Portal 2022-10-18 22:58:07 +02:00
fvanroie
b4a973dda5 Add ATTR_TEMPLATE for event_timer_clock 2022-10-18 02:11:50 +02:00
fvanroie
c02d039e18 Disable LV_MEM_CUSTOM by default 2022-10-18 01:10:10 +02:00
fvanroie
e28a1965e4 Add support for ESP32-S3 2022-10-18 01:09:47 +02:00
fvanroie
d0ab4d7e96 Update esptool to3.3.1 2022-10-18 01:08:02 +02:00
fvanroie
22d4360a2f Add HASP_SERIAL 2022-10-17 18:41:14 +02:00
fvanroie
7e1e04ec71 Update js and css 2022-10-17 18:37:53 +02:00
fvanroie
1e93d22833 Wifi Improvements #392 2022-10-17 16:14:01 +02:00
fvanroie
393195873b Add hwid to discovery response 2022-10-13 15:33:04 +02:00
fvanroie
5b19ede76e Add python-version 2022-10-12 17:49:01 +02:00
fvanroie
a81d8a6500 Update buildscripts 2022-10-12 17:34:42 +02:00
fvanroie
54b43a06cd Add auto-reconnect to Paho MQTT Client 2022-10-12 14:47:50 +02:00
fvanroie
56ae45dae2 Add auto-reconnect to Paho MQTT Client 2022-10-12 14:31:10 +02:00
fvanroie
b370733012 Allow LV_MEM_CUSTOM=1 to disable separate LVGL memory pool 2022-10-10 18:22:36 +02:00
fvanroie
180326f843 Prevent screen updates during antiburn #389 2022-10-10 15:33:48 +02:00
fvanroie
80bda2c78e Fix WiFi reconnect bug #385 2022-10-01 14:09:22 +02:00
fvanroie
2e13e55c68 Add "%" after fragmentation values 2022-09-29 20:59:30 +02:00
fvanroie
e0703d72aa Add "%" after fragmentation values 2022-09-29 20:54:45 +02:00
fvanroie
777b3d0734 Add new static files 2022-09-29 20:44:55 +02:00
fvanroie
42e9d2c2af Add no_ps_ram/ps_ram option 2022-09-29 20:38:12 +02:00
fvanroie
c63ea0a0db Include new embed_files 2022-09-29 20:37:09 +02:00
fvanroie
4f9656a8e2 Add esp32-3248s035c 2022-09-29 20:36:19 +02:00
fvanroie
2e23401d0e Update to Tasmota core 2.0.5.1 2022-09-29 20:35:36 +02:00
fvanroie
a7e75d8632 Add "%" after fragmentation values 2022-09-29 20:19:52 +02:00
fvanroie
0325954649 Add ESP32-S3 support 2022-09-29 20:19:08 +02:00
fvanroie
f8c54af706 Add apis, etag support and use static JSON documents 2022-09-29 20:18:10 +02:00
fvanroie
cb0f3850cf Disable old touch driver 2022-09-28 14:27:04 +02:00
fvanroie
f20814d418 Remove sstaub/Ticker lib from ini 2022-09-28 14:24:17 +02:00
fvanroie
14ba13eb02 Add HASP_USE_ETHSPI 2022-09-27 22:57:30 +02:00
fvanroie
ac2aa275c5 Minor driver tweaks 2022-09-27 22:57:17 +02:00
fvanroie
7c4537225b Add %mac% string template 2022-09-26 20:51:44 +02:00
fvanroie
f12a651443 Restart WiFi on Stop event 2022-09-26 20:50:16 +02:00
fvanroie
2f9b8f3e32 Allow longer font file names 2022-09-26 20:49:30 +02:00
fvanroie
7f4e07914a Fix configRead prototype 2022-09-13 15:06:32 +02:00
fvanroie
e97bebd87e Fix configRead prototype 2022-09-13 14:57:09 +02:00
fvanroie
cbbd2d9bba Fix configRead prototype 2022-09-12 01:19:15 +02:00
fvanroie
ba2ed35a85 Prefer stack to heap memory for JsonDocuments 2022-09-12 01:11:17 +02:00
fvanroie
eccfc6c7a2 Change USE_PAHE to HASP_USE_PAHO 2022-09-11 16:12:10 +02:00
fvanroie
cf6817304b Fix LVGL filesystem interface 2022-09-11 16:11:19 +02:00
fvanroie
dca38d199c Add esp32-3248s035 2022-09-11 14:13:21 +02:00
fvanroie
db322d096f Update to LovyanGFX 0.4.18 and TFT_eSPI 2.4.72 2022-09-07 11:46:53 +02:00
fvanroie
e6256886a0 Add LV_USE_FS_IF 2022-09-04 22:40:08 +02:00
fvanroie
2ac4265ca3 Add Freetype submodule 2022-09-03 19:47:42 +02:00
fvanroie
e7217d1f03 Add ftstdlib.h 2022-09-03 19:38:37 +02:00
fvanroie
c70702db9d Remove unneccessary includes 2022-09-03 18:44:12 +02:00
fvanroie
7805b40fd2 Enable Freetype in ini files 2022-09-03 18:17:03 +02:00
fvanroie
7a8abec978 Fix freetype dependencies 2022-09-03 17:40:43 +02:00
fvanroie
4852b6f4c4 Update discovery reply topic 2022-08-20 22:34:50 +02:00
fvanroie
9a17e70daf Replace strlcpy with strncpy 2022-08-20 13:52:21 +02:00
fvanroie
0dc6e58b86 Add HASP_RANDOM macro 2022-08-20 13:39:58 +02:00
fvanroie
df393d70f9 Ad HASP_RANDOM mcro 2022-08-20 13:37:10 +02:00
fvanroie
bdbceeb539 Add HWID to discovery reply 2022-08-20 12:04:44 +02:00
fvanroie
2f307c0a29 Add page names and transitions 2022-08-20 12:00:09 +02:00
fvanroie
89a1d9535f Add FP_OTA 2022-08-09 15:58:06 +02:00
fvanroie
1796ed2a81 Add /api/config/ #246 and fix file length limitation #366 2022-08-09 14:48:28 +02:00
fvanroie
e919db7f25 Update to tasmota core v2.0.4.1 2022-08-09 14:26:01 +02:00
fvanroie
f04b01ec1f Add Content-Security-Policy #246 2022-07-30 23:38:44 +02:00
fvanroie
3781ddcf52 Bugfix in selector_event_handler 2022-07-30 23:12:32 +02:00
fvanroie
756239d245 Improvements for esp_mqtt client #174 2022-07-30 23:12:13 +02:00
fvanroie
702143e5ee Add service start/stop mqtt #174 2022-07-26 23:12:09 +02:00
fvanroie
74092ce5be Use esp_mqtt client #174 2022-07-26 23:11:44 +02:00
fvanroie
b91efeaac3 Disable Freetype 2022-07-23 12:00:11 +02:00
fvanroie
cbeceaf209 Remove duplicate include 2022-07-21 01:06:43 +02:00
fvanroie
1aea5257df Remove unneeded include 2022-07-21 01:06:03 +02:00
fvanroie
3a72753275 Disable Freetype 2022-07-21 01:02:03 +02:00
fvanroie
3900838ccb Fix mqttClientId 2022-07-21 00:58:14 +02:00
fvanroie
7533a71bbb Fix antiburn on rotated display 2022-07-21 00:57:46 +02:00
fvanroie
f18403d9c3 Check for HASP_USE_WIFI or HASP_USE_ETHERNET 2022-07-21 00:56:46 +02:00
fvanroie
24254cc3a1 Remove lib/freetype 2022-07-21 00:53:23 +02:00
fvanroie
0f7caee05f Remove lib/freetype submodule 2022-07-21 00:52:36 +02:00
fvanroie
15853c789f Use MAX_SSID_LEN and MAX_PASSPHRASE_LEN defines 2022-07-21 00:49:18 +02:00
fvanroie
06b2865ba4 Use MAX_SSID_LEN and MAX_PASSPHRASE_LEN defines 2022-07-21 00:47:20 +02:00
fvanroie
66f05103a5 Check if LV_USE_FS_IF is already defined 2022-07-21 00:46:26 +02:00
fvanroie
18eb8137e5 Update mqtt and wifi input contraints 2022-07-21 00:44:02 +02:00
fvanroie
57e512da7b Fix hostname and save Password to NVS 2022-07-20 16:09:49 +02:00
fvanroie
f31a06cb0a #include "lv_fs_if.h" 2022-07-08 21:48:29 +02:00
fvanroie
9d245b5e78 Move ESP32 lip_deps 2022-07-08 21:19:00 +02:00
fvanroie
daa96491c5 Update to Tasmota Core 2.0.4 with ESP-IDF 4.4.2 2022-07-08 20:16:33 +02:00
fvanroie
73de02d026 Add HASP_USE_SYSLOG and HASP_USE_MDNS 2022-07-08 20:12:55 +02:00
fvanroie
645d2e851c Add esp_mqtt client to replace PubSubClient 2022-07-08 20:12:31 +02:00
fvanroie
74ab9647c1 Fix define for HTTP_USERNAME and HTTP_PASSWORD 2022-07-08 20:11:25 +02:00
fvanroie
13522244dc Add TAG_NVS 2022-07-08 20:10:46 +02:00
fvanroie
8fa7a43f2e Initialize network before HASP #342 2022-07-02 20:11:45 +02:00
fvanroie
1981b1f89e Add comment 2022-06-30 11:12:52 +02:00
arovak
82ec8f8b4b Merge branch 'master' of https://github.com/HASwitchPlate/openHASP into master 2022-06-26 21:19:26 +02:00
arovak
b85ca9c654 Fix rand for Windows 2022-06-26 21:19:15 +02:00
fvanroie
8164630a81 Code cleanup 2022-06-26 10:12:39 +02:00
fvanroie
43651ca2db
Merge pull request #345 from bensuffolk/master
Make MQTT work with Ethernet
2022-06-19 10:47:14 +02:00
Ben Suffolk
5f2ab5852a Call new network_connected & network_disconnected functions instead of networkStart & networkStop 2022-06-18 19:02:18 +01:00
fvanroie
94f36ba1b6 Fix NetworkStop for native builds 2022-06-11 21:08:21 +02:00
fvanroie
2c8037d1d0 Exclude ETHSPI from native builds 2022-06-11 19:54:27 +02:00
fvanroie
c35b322bfd Exclude ETHSPI from ESP32-S 2022-06-11 19:40:53 +02:00
fvanroie
213cc26060 Excluded ETHSPI for ESP32-S2 2022-06-11 19:40:17 +02:00
fvanroie
0f95052dc3 Merge ethernet_esp32 and esthernet_spi.cpp 2022-06-11 19:16:21 +02:00
fvanroie
2af1f4800e
Merge pull request #344 from HASwitchPlate/feature/w5500
Feature/w5500
2022-06-11 16:16:02 +02:00
fvanroie
bab26ff352
Merge pull request #343 from bensuffolk/master
Add W5500 SPI Ethernet
2022-06-11 16:05:23 +02:00
fvanroie
6804a49769 Add alarm 2022-06-11 16:03:08 +02:00
fvanroie
b41d6ee9f4 Update log message 2022-06-11 15:11:18 +02:00
fvanroie
d49e52b6f7 Switch to Arduino v2 2022-06-11 15:11:04 +02:00
Ben Suffolk
755450843c Added lanbon L8 with W5500 Ethernet build configuration 2022-06-11 10:22:42 +01:00
Ben Suffolk
bdafc3d45e Merge https://github.com/HASwitchPlate/openHASP 2022-06-11 10:10:29 +01:00
Ben Suffolk
ac93c70bc1 Removed extra debug lines, and fixed netwrks scripts running multiple times 2022-06-08 21:08:58 +01:00
Ben Suffolk
6643bf031f Fixed hasp_config for SPI Ethernet 2022-06-08 14:23:13 +01:00
Ben Suffolk
a5390eca1b Added SPI Ethernet for W5500 2022-06-08 14:21:17 +01:00
fvanroie
7357842b87 Fix workflow trigger 2022-06-04 14:14:18 +02:00
fvanroie
45daee85f4 Fix bug with id 7 when a tabview is present on the page 2022-06-04 14:12:50 +02:00
fvanroie
c583e1cbf9 Version bump 2022-05-30 16:39:02 +02:00
509 changed files with 346820 additions and 318885 deletions

View File

@ -0,0 +1,35 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
// README at: https://github.com/devcontainers/templates/tree/main/src/ubuntu
{
"name": "Ubuntu",
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
"image": "mcr.microsoft.com/devcontainers/base:jammy",
// Features to add to the dev container. More info: https://containers.dev/features.
"features": {
"ghcr.io/devcontainers/features/python:1": {}
},
// Use 'forwardPorts' to make a list of ports inside the container available locally.
// "forwardPorts": [],
// Use 'postCreateCommand' to run commands after the container is created.
// "postCreateCommand": "uname -a",
// Configure tool-specific properties.
"customizations": {
"vscode": {
"extensions": [
"ms-vscode.cpptools",
"platformio.platformio-ide"
]
}
},
// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
// "remoteUser": "root"
// Allow uploading to device
"mounts": ["type=bind,source=/dev/bus/usb,target=/dev/bus/usb"],
"runArgs": ["--privileged"]
}

View File

@ -16,7 +16,7 @@ or join the [#openHASP channel](https://discord.gg/VCWyuhF) on Discord.
-->
### Perform all steps below and tick them with [x]
- [ ] Check the related part of the [Documentation](https://haswitchplate.github.io/openHASP-docs/)
- [ ] Check the related part of the [Documentation](https://www.openhasp.com/)
- [ ] Update openHASP to the latest version
- [ ] Reproduce the issue and describe all steps

12
.github/dependabot.yml vendored Normal file
View File

@ -0,0 +1,12 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for more information:
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
# https://containers.dev/guide/dependabot
version: 2
updates:
- package-ecosystem: "devcontainers"
directory: "/"
schedule:
interval: weekly

View File

@ -2,81 +2,91 @@ name: Build branch
on:
release:
types: [created]
types: [published]
push:
branches:
- main
- master
paths-ignore:
- '**.md'
- '**.yml'
- '**.yaml'
- "**.md"
- "**.yml"
- "**.yaml"
workflow_dispatch:
jobs:
build_esp32:
runs-on: ubuntu-latest
#runs-on: ubuntu-24.04
strategy:
fail-fast: false
matrix:
environment:
- out: adafruit
env: "huzzah32-featherwing-24 -e huzzah32-featherwing-35 -e huzzah32-featherwing-24-v2 -e huzzah32-featherwing-35-v2 -e huzzah32-v2-featherwing-24-v2 -e huzzah32-v2-featherwing-35-v2"
- out: az-touch
env: "az-touch-mod-esp32_ili9341_4MB -e az-touch-mod-esp32_ili9341_8MB"
- env: d1-mini-esp32_ili9341
out: d1-mini-esp32
- env: d1-r32-waveshare_ili9486
out: d1-r32-espduino32
- env: d1-r32-unoshield_ili9341_adc
out: d1-r32-espduino32
- env: d1-r32-unoshield_ili9486_adc
out: d1-r32-espduino32
- env: esp32-one_st7796
out: waveshare
- env: esp32-one_ili9486
out: waveshare
- env: esp32-touchdown
out: esp32-touchdown
- out: freetouchdeck
env: "freetouchdeck_4MB -e freetouchdeck_8MB"
- out: featherwing
env: "huzzah32-featherwing-24 -e huzzah32-featherwing-35"
- env: lanbon_l8
out: lanbon_l8
- env: lolin-d32-pro_ili9341
out: lolin-d32-pro
- env: m5stack-core2
out: m5stack
- env: makerfabs-tft35-cap
out: makerfabs-tft
- out: ttgo
env: "ttgo-t7-v1.5_ili9341_4MB -e ttgo-t7-v1.5_ili9341_16MB"
- out: d1-r32-espduino32
env: "d1-r32-waveshare_ili9486 -e d1-r32-unoshield_ili9341_adc -e d1-r32-unoshield_ili9486_adc"
- out: dustinwatts
env: "freetouchdeck_4MB -e freetouchdeck_8MB -e esp32-touchdown"
- out: elecrow
env: "esp32-terminal-rgb_16MB -e esp32-terminal-spi_16MB -e elecrow-s3-8048c050_4MB -e elecrow-s3-8048c070_4MB"
- out: globalsecurity
env: gs-t3e_16MB
- out: guition
env: esp32-s3-4848s040_16MB -e guition-jc4827w543c_4MB
- out: lanbon
env: lanbon_l8 -e lanbon_l9
- out: lilygo-ttgo
env: "lilygo-lily-pi_st7796 -e lilygo-lily-pi_ili9481 -e ttgo-t7-v1_5_ili9341_4MB -e ttgo-t7-v1_5_ili9341_16MB"
- out: lolin
env: lolin-d32-pro_ili9341
- out: m5stack
env: m5stack-core2
- out: makerfabs
env: "makerfabs-tft35-cap_4MB -e makerfabs-tft35-cap_16MB -e makerfabs-s3-tft35-spi -e makerfabs-s3-tft40-rgb -e makerfabs-s3-tft43-rgb"
- out: panlee
env: "panlee-zw3d95ce01s-ar-4848_16MB -e panlee-zw3d95ce01s-ur-4848_16MB -e panlee-zw3d95ce01s-tr-4848_16MB"
- out: seeed-studios
env: "sensecap-indicator-d1_8MB"
- out: sunton
env: "esp32-2432s028r_4MB -e esp32-2432s028r-ili9342_4MB -e esp32-2432s028r_v2_4MB -e esp32-2432s032c_4MB -e esp32-3248s035c_4MB -e esp32-3248s035r_4MB -e sunton-4827s043c_16MB -e sunton-8048s043c_16MB -e sunton-8048s050c_16MB -e sunton-8048s070c_16MB"
- out: waveshare
env: "esp32-one_ili9486 -e esp32-one_st7796 -e ws_esp32_s3_touch_lcd_4p3"
- out: wireless-tag
env: "wt32-sc01_4MB -e wt32-sc01_16MB -e wt-86-32-3zw1"
- env: yeacreate-nscreen32
out: yeacreate
env: "wt32-sc01_4MB -e wt32-sc01_16MB -e wt-86-32-3zw1 -e wt32-sc01-plus_8MB -e wt32-sc01-plus_16MB"
- out: yeacreate
env: yeacreate-nscreen32
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
submodules: 'true'
submodules: "true"
- name: Cache pip
uses: actions/cache@v2
uses: actions/cache@v4
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Cache PlatformIO
uses: actions/cache@v2
uses: actions/cache@v4
with:
path: ~/.platformio
key: ${{ runner.os }}-${{ hashFiles('**/lockfiles') }}
- name: Set up Python
uses: actions/setup-python@v2
uses: actions/setup-python@v5
with:
python-version: "3.x"
- name: Install PlatformIO
run: |
python -m pip install --upgrade pip
pip install --upgrade platformio
- name: Install Setuptools
run: |
pip install --upgrade setuptools
- name: Enable ESP32 platforms from platformio_override-template.ini
run: |
sed 's/; user_setups\/esp32/user_setups\/esp32/g' platformio_override-template.ini > platformio_override.ini
@ -89,53 +99,45 @@ jobs:
- name: Run PlatformIO
run: pio run -e ${{ matrix.environment.env }}
- name: Upload output file
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.environment.out }}
path: build_output/firmware/*.bin
- name: Create release and upload firmware
path: build_output/firmware/*.*n
## Release only:
- name: Zip artifact for deployment
if: github.ref != 'refs/heads/master'
run: |
set -x
assets=()
for asset in build_output/firmware/*.bin; do
assets+=("-a" "$asset")
done
tag_name="${GITHUB_REF##*/}"
hub release edit "${assets[@]}" -m "$tag_name" "$tag_name"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
#- name: Create release and upload firmware
# run: |
# set -x
# assets=()
# for asset in build_output/firmware/*.bin; do
# assets+=("-a" "$asset")
# done
# tag_name="${GITHUB_REF##*/}"
# hub release create "${assets[@]}" -m "$tag_name" "$tag_name"
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
zip ${{ matrix.environment.out }}.zip build_output/firmware/*.bin -r
- name: On Release, upload assets to that Release
if: github.ref != 'refs/heads/master'
uses: AButler/upload-release-assets@v3.0
with:
files: ${{ matrix.environment.out }}.zip
repo-token: ${{ secrets.GITHUB_TOKEN }}
linux_build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
submodules: 'true'
submodules: "true"
- name: Cache pip
uses: actions/cache@v2
uses: actions/cache@v4
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Cache PlatformIO
uses: actions/cache@v2
uses: actions/cache@v4
with:
path: ~/.platformio
key: ${{ runner.os }}-${{ hashFiles('**/lockfiles') }}
- name: Set up Python
uses: actions/setup-python@v2
uses: actions/setup-python@v5
with:
python-version: "3.x"
- name: Install PlatformIO
run: |
python -m pip install --upgrade pip
@ -143,7 +145,7 @@ jobs:
- name: Enable Linux platform from platformio_override.ini
run: |
sed 's/; user_setups\/linux/user_setups\/linux/g' platformio_override-template.ini > platformio_override.ini
mkdir -p .pio/libdeps/linux_sdl_64bits/paho/src
mkdir -p .pio/libdeps/linux_sdl/paho/src
- name: Install SDL2 library
run: |
sudo apt-get update
@ -157,10 +159,10 @@ jobs:
- name: Enable Linux platform from platformio_override.ini
run: |
sed -i 's/; user_setups\/linux/user_setups\/linux/g' platformio_override.ini
mkdir -p .pio/libdeps/linux_sdl_64bits/paho/src
mkdir -p .pio/libdeps/linux_sdl/paho/src
- name: Install SDL2 library
run: |
sudo apt-get update
sudo apt-get install libsdl2-dev
- name: Run PlatformIO
run: pio run -e linux_sdl_64bits
run: pio run -e linux_sdl

View File

@ -1,4 +1,4 @@
name: Build branch
name: Build Linux (Obsolete)
on:
workflow_dispatch:
@ -11,26 +11,28 @@ jobs:
fail-fast: false
matrix:
environments:
- linux_sdl_64bits
- linux_sdl
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
submodules: 'true'
- name: Cache pip
uses: actions/cache@v2
uses: actions/cache@v4
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Cache PlatformIO
uses: actions/cache@v2
uses: actions/cache@v4
with:
path: ~/.platformio
key: ${{ runner.os }}-${{ hashFiles('**/lockfiles') }}
- name: Set up Python
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: '3.x'
- name: Install PlatformIO
run: |
python -m pip install --upgrade pip
@ -41,7 +43,7 @@ jobs:
- name: Enable Linux platform from platformio_override.ini
run: |
sed -i 's/; user_setups\/linux/user_setups\/linux/g' platformio_override.ini
mkdir -p .pio/libdeps/linux_sdl_64bits/paho/src
mkdir -p .pio/libdeps/linux_sdl/paho/src
- name: Install SDL2 library
run: |
sudo apt-get update

View File

@ -3,7 +3,7 @@ on:
# types: [created]
workflow_dispatch:
name: Create Release
name: Create Release (Obsolete)
jobs:
build:
@ -12,21 +12,23 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4
- name: Cache pip
uses: actions/cache@v2
uses: actions/cache@v4
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Cache PlatformIO
uses: actions/cache@v2
uses: actions/cache@v4
with:
path: ~/.platformio
key: ${{ runner.os }}-${{ hashFiles('**/lockfiles') }}
- name: Set up Python
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: '3.x'
- name: Install PlatformIO
run: |
python -m pip install --upgrade pip
@ -37,7 +39,7 @@ jobs:
- name: Enable Linux platform from platformio_override.ini
run: |
sed -i 's/; user_setups\/linux/user_setups\/linux/g' platformio_override.ini
mkdir -p .pio/libdeps/linux_sdl_64bits/paho/src
mkdir -p .pio/libdeps/linux_sdl/paho/src
- name: Install SDL2 library
run: |
sudo apt-get update
@ -53,7 +55,7 @@ jobs:
- name: Run PlatformIO
run: pio run -e az-touch-mod-esp32_ili9341_4MB -e az-touch-mod-esp32_ili9341_8MB
- name: Run PlatformIO
run: pio run -e makerfabs-tft35-cap
run: pio run -e makerfabs-tft35-cap_4MB -e makerfabs-tft35-cap_16MB
- name: Run PlatformIO
run: pio run -e yeacreate-nscreen32 -e
- name: Run PlatformIO
@ -61,7 +63,7 @@ jobs:
- name: Run PlatformIO
run: pio run -e esp32-touchdown -e freetouchdeck_4MB -e freetouchdeck_8MB
- name: Run PlatformIO
run: pio run -e huzzah32-featherwing-24 -e huzzah32-featherwing-35
run: pio run -e huzzah32-featherwing-24 -e huzzah32-featherwing-35 -e huzzah32-featherwing-24-v2 -e huzzah32-featherwing-35-v2 -e huzzah32-v2-featherwing-24-v2 -e huzzah32-v2-featherwing-35-v2
- name: Run PlatformIO
run: pio run -e lanbon_l8
- name: Run PlatformIO
@ -69,7 +71,7 @@ jobs:
- name: Run PlatformIO
run: pio run -e m5stack-core2
- name: Upload output file
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: openHASP firmware.zip
path: build_output/firmware/*.bin

27
.gitignore vendored
View File

@ -7,23 +7,35 @@
bin/*
data/*
!data/edit.htm
!data/edit.htm.gz
!data/vars.css
!data/en.json
!data/main.js
!data/openhasp.ttf
!data/style.css
!data/style.css.gz
!data/script.js
!data/script.js.gz
!data/vars.css
!data/cert/
!data/cert/x509_crt_bundle.bin
src/user_setups/active/*
!data/pages/
!data/pages/*.jsonl
!data/static/
!data/static/*.gz
data/static/edit.htm.gz
data/static/en.json.gz
data/static/main.js.gz
data/static/script.js.gz
data/static/style.css.gz
data/static/*.js
include/user_config_override.h
src/user_config_override.h
user_config_override.h
platformio_override.ini
user_setups/active/*
user_setups/custom/*
build_output/*
build_output/firmware/*.bin
build_output/firmware/*.exe
lib/SimpleFTPServer/examples/*
src/custom/*
!src/custom/README.md
!src/custom/bootlogo_template.h
@ -31,6 +43,11 @@ src/custom/*
!src/custom/my_custom_template.cpp
!src/custom/my_custom_fan_template.cpp
#npm filter
node_modules/*
package.json
package-lock.json
## Test result files
*.xml

2
.gitmodules vendored
View File

@ -1,4 +1,4 @@
[submodule "lib/freetype"]
path = lib/freetype
url = https://github.com/fvanroie/freetype

View File

@ -1,23 +1,69 @@
# openHASP Changelog
<!--
## v0.7.0
!!! THE PARTITION SCHEME OF THE INTERNAL FLASH HAS CHANGED, CHECK THE DOCS BEFORE UPGRADING !!!
### Commands
- Removed deprecated `dim`, `brightness` and `light` commands, use `backlight` instead
### Objects
- Support for State and Part properties
<!-- ? Support for State and Part properties -->
- `action` and `swipe` can now be set to any command
- Set default `line_width` of new `line` objects to 1
- Add `qrcode` object (thanks @marsman7)
- Allow line and block comments in pages.jsonl
- Removed deprecated `txt` property, use `text` instead
- Removed deprecated `objid` property, use `obj` instead
- HASP theme: Toggle objects now use the secondary color when they are in the toggled state.
### Fonts
- Firmware files include the bitmapped font sizes 12, 16, 24 and 32pt
- Use embedded TrueType font for other font sizes (PSram highly recommended)
- Add glyphs from Cyrillic, Latin-2, Greek and Viernamese character sets to default fonts
- Add 12 new MDI icons
### Web UI
- _Selectable dark/light theme?_
- Update Web UI to petite-vue app
- Redesigned the File Editor
<!-- - _Selectable dark/light theme?_ -->
### Services
- Add SimpleFTPServer to easily upload and download files to the plate *(one simultanious connection only)*
- Change MQTT client from _PubSubClient_ to asynchronic Espressif _esp_mqtt_ client
- Make the MQTT topics configurable
- MQTT discovery now uses a subtopic of `hasp/discovery`. Discovery requires version 0.7.x of the Custom Component.
- Add service start/stop mqtt
- Add SimpleFTPServer to easily upload and download files to the plate *(one simultaneous connection only)*
- Add service start/stop ftp
- Add configuration for NTP servers and timezone
- Add support system scripts executed when the idle level is changed
- Add support for WireGuard (thanks @perexg)
### Devices
- Add support for Wireless-Tag WT-86-32-3ZW1
- Add Elecrow ESP32-Terminal 3.5" SPI and RGB
- Add GS-T3E Smart Panel
- Add Lilygo Ttgo Lily Pi ESP32
- Add Makerfabs ESP32-S3 SPI
- Add Sunton ESP32-S3 TFT 4.3", 5.0" and 7.0"
- Add Sunton ESP32-2432S028R ESP32-3248S035C ESP32-3248S035R
- Add support for Wireless-Tag WT32-SC01 Plus and WT32S3-86V
- Deprecate support for WT-86-32-3ZW1 with ESP32-S2
- Fade backlight on ESP32 devices (thanks @presslab-us)
-->
## Bug fixes
- Fix for first touch not working properly
- Add button GPIOs to input discovery message
## v0.6.3-rc2
### Architecture
- Moved to Tasmota Arduino 2.0.11 and ESP-IDF 4.4.5 (thanks @Jason2866)
- Add Arduino-GFX display driver
- Add support for ESP32-S3 and ESP32-C3 devices
- Deprecation of support for ESP32-S2 devices due to lack of sRAM
Updated libraries to Arduino_GFX v1.4.0, ArduinoJson 6.21.5, ArduinoStreamUtils 1.8.0, AceButton 1.10.1, TFT_eSPI 2.5.43, LovyanGFX 1.1.12 and SimpleFTPServer 2.1.5
## v0.6.3
### Commands
- Additional `idle` parameters now accept `off`, `short` and `long`
@ -34,7 +80,7 @@
### Web UI
- Updated to modern responsive design *(requires JavaScript)*
- Add `/api/info/` and `/api/config/*/` endpoints
- Allow for a customizible `vars.css`, `style.css`, `script.js` and `edit.htm`
- Allow for a customizable `vars.css`, `style.css`, `script.js` and `edit.htm`
- Display a message when the configuration is changed and a reboot is needed
- Add checkbox for backlight inversion to Display settings (thanks @wolffman122)
- Add checkbox to toggle ANSI codes #261 (thanks @geiseri)
@ -100,7 +146,7 @@ Updated libraries to ArduinoJson 6.19.4, ArduinoStreamUtils 1.6.3, AceButton 1.9
- Add AZ-Touch MOD ESP32 with 2.4" or 2.8"
- Add Lilygo®Ttgo Pi ESP32 with TFT 3.5"
- Add Waveshare ESP32 One development board with Rpi MHS4001(B) or Waveshare RPi(C) LCD display
- Add D1-R32 ESP32 development board with with Waveshare ILI9486 Touch Shield
- Add D1-R32 ESP32 development board with Waveshare ILI9486 Touch Shield
### Bug fixes
- Fix bug that caused a crash when both `btnmatrix` and `msgbox` where used (thanks @AndreTeixeira1998)
@ -124,23 +170,23 @@ Updated libraries to AceButton 1.9.1 and ArduinoJson 6.18.5
- Run `/online.cmd` or `/offline.cmd` script when the wifi status changed
### Objects
- Add new *[line](https://openhasp.haswitchplate.com/0.6.1/design/objects/#line)* object
- Add `val` to *[btnmatrix](https://openhasp.haswitchplate.com/0.6.1/design/objects/#button-matrix)* when `one_select` is set
- Cache up to 20 *[images](https://openhasp.haswitchplate.com/0.6.1/design/objects/#image)* in PSram when available
- Improve precision on the *[linemeter](https://openhasp.haswitchplate.com/0.6.1/design/objects/#line-meter)* scales
- Fix *[dropdown](https://openhasp.haswitchplate.com/0.6.1/design/objects/#dropdown-list)* redraw bug
- Add new *[line](https://www.openhasp.com/0.6.1/design/objects/#line)* object
- Add `val` to *[btnmatrix](https://www.openhasp.com/0.6.1/design/objects/#button-matrix)* when `one_select` is set
- Cache up to 20 *[images](https://www.openhasp.com/0.6.1/design/objects/#image)* in PSram when available
- Improve precision on the *[linemeter](https://www.openhasp.com/0.6.1/design/objects/#line-meter)* scales
- Fix *[dropdown](https://www.openhasp.com/0.6.1/design/objects/#dropdown-list)* redraw bug
### Devices
- Fix [L8-HD dimmer](https://openhasp.haswitchplate.com/0.6.1/devices/lanbon-l8/) not responding correctly to mqtt after a reboot
- Add [M5Stack Core2](https://openhasp.haswitchplate.com/0.6.1/devices/m5stack-core2/) backlight dimming
- Add [Yeacreate Nscreen32](https://openhasp.haswitchplate.com/0.6.1/devices/yeacreate-nscreen32/)
- Add [Makerfabs ESP32 TFT Touch](https://openhasp.haswitchplate.com/0.6.1/devices/makerfabs-tft-touch/) Capacitive
- Fix [L8-HD dimmer](https://www.openhasp.com/0.6.1/devices/lanbon-l8/) not responding correctly to mqtt after a reboot
- Add [M5Stack Core2](https://www.openhasp.com/0.6.1/devices/m5stack-core2/) backlight dimming
- Add [Yeacreate Nscreen32](https://www.openhasp.com/0.6.1/devices/yeacreate-nscreen32/)
- Add [Makerfabs ESP32 TFT Touch](https://www.openhasp.com/0.6.1/devices/makerfabs-tft-touch/) Capacitive
### Fonts
- [Additional characters](https://openhasp.haswitchplate.com/0.6.1/design/fonts/#ascii): `²` (squared) and `³` (cubed)
- [Additional icons](https://openhasp.haswitchplate.com/0.6.1/design/fonts/#built-in-icons): recycle-variant and additional weather icons
- Use latin1 as default charset on [WT32-SC01](https://openhasp.haswitchplate.com/0.6.1/devices/wt32-sc01/)
- Add [Greek font](https://openhasp.haswitchplate.com/0.6.1/design/fonts/#greek)
- [Additional characters](https://www.openhasp.com/0.6.1/design/fonts/#ascii): `²` (squared) and `³` (cubed)
- [Additional icons](https://www.openhasp.com/0.6.1/design/fonts/#built-in-icons): recycle-variant and additional weather icons
- Use latin1 as default charset on [WT32-SC01](https://www.openhasp.com/0.6.1/devices/wt32-sc01/)
- Add [Greek font](https://www.openhasp.com/0.6.1/design/fonts/#greek)
### Compiling
- Allow custom bootlogo
@ -153,7 +199,7 @@ Updated libraries to AceButton 1.9.1 and ArduinoJson 6.18.5
### Commands:
- Obsolete `dim` and `light` commands, use `backlight` command instead
- Add `discovery` command to facilitate HA CC discovery
- Add `idle` command to retreive idle state, replaces `wakeup` command
- Add `idle` command to retrieve idle state, replaces `wakeup` command
- Updated `moodlight` command with brightness support
- Rewrite `outputX` and add `inputX` command
@ -208,7 +254,7 @@ Updated libraries to lvgl 7.11.0, ArduinoJson 6.18.0 and TFT_eSPI 2.3.70
## v0.5.0
Name changed to openHASP - https://openhasp.haswitchplate.com/
Name changed to openHASP - https://www.openhasp.com/
> When using HomeAssistant also update the [openHASP Custom Component](https://github.com/HASwitchPlate/openHASP-custom-component/releases/tag/0.5.0)
- Switch built-in icons from FontAwesome to MaterialDesign icons #139
@ -219,7 +265,7 @@ Name changed to openHASP - https://openhasp.haswitchplate.com/
- Add `back`, `prev`, `next` attributes to pages #114
- JSON Serialize text in payloads containing text attributes #140
- Add az-touch-mod-esp32_ili9341 config and allow for TFT_BACKLIGHT_ON set to LOW #131
- Add [FreeTouchDeck](https://openhasp.haswitchplate.com/0.5/#devices/freetouchdeck/) and [ESP32-Touchdown](https://openhasp.haswitchplate.com/0.5/#devices/esp32-touchdown/) configs
- Add [FreeTouchDeck](https://www.openhasp.com/0.5/#devices/freetouchdeck/) and [ESP32-Touchdown](https://www.openhasp.com/0.5/#devices/esp32-touchdown/) configs
- Add roller `mode` `infinite` attribute
- Add btnmatrix `toggle` and `one_check` attributes
- Rework all event handlers to reduce update events and prevent race condition #119 *(events have changed!)*
@ -247,7 +293,7 @@ Changes:
- Remove HA auto-discovery in favor of the HA Custom Component
- Add `clearpage all` command option
- Add local page navigation and transitions
- Add [scale properties](https://openhasp.haswitchplate.com/0.5/#styling/#scale)
- Add [scale properties](https://www.openhasp.com/0.5/#styling/#scale)
- Add `config/gpio` command
- Allow for timezone setting in user_config_override.h (thanks @arovak)
- Start localizations for NL, HU and RO (thanks @nagyrobi)

View File

@ -1,6 +1,6 @@
MIT License
Copyright (c) 2019-2022 Francis Van Roie
Copyright (c) 2019-2024 Francis Van Roie
Copyright (c) 2018-2019 Allen Derusha allen@derusha.org
Permission is hereby granted, free of charge, to any person obtaining a copy

View File

@ -1,6 +1,6 @@
# openHASP firmware
[![GitHub Workflow Status](https://img.shields.io/github/workflow/status/HASwitchPlate/openHASP/Build%20branch?label=build%20status&logo=github&logoColor=%23dddddd)](https://github.com/HASwitchPlate/openHASP/actions)
[![GitHub Workflow Status]( https://img.shields.io/github/actions/workflow/status/HASwitchPlate/openHASP/build.yaml?branch=master&label=build%20status&logo=github&logoColor=%23dddddd)](https://github.com/HASwitchPlate/openHASP/actions)
[![GitHub release](https://img.shields.io/github/v/release/HASwitchPlate/openHASP?include_prereleases)](https://github.com/HASwitchPlate/openHASP/releases)
[![GitHub issues](https://img.shields.io/github/issues/HASwitchPlate/openHASP.svg)](http://github.com/HASwitchPlate/openHASP/issues)
[![Discord](https://img.shields.io/discord/538814618106331137?color=%237289DA&label=discord&logo=discord&logoColor=white)][3]

View File

@ -7,7 +7,7 @@
"extra_flags": "-DBOARD_HAS_PSRAM",
"f_cpu": "240000000L",
"f_flash": "80000000L",
"flash_mode": "dout",
"flash_mode": "qio",
"mcu": "esp32s2",
"variant": "esp32s2",
"partitions": "esp32_partition_app1856k_spiffs320k.csv"

View File

@ -7,7 +7,7 @@
"extra_flags": "-DBOARD_HAS_PSRAM -DCORE32SOLO1",
"f_cpu": "240000000L",
"f_flash": "80000000L",
"flash_mode": "dout",
"flash_mode": "qoi",
"mcu": "esp32s2",
"variant": "esp32s2",
"partitions": "esp32_partition_app1856k_spiffs320k.csv"

View File

@ -0,0 +1,43 @@
{
"build": {
"arduino": {
"ldscript": "esp32s3_out.ld"
},
"core": "esp32",
"extra_flags": [
"-DARDUINO_ESP32S3_DEV",
"-DARDUINO_USB_MODE=1",
"-DARDUINO_RUNNING_CORE=1",
"-DARDUINO_EVENT_RUNNING_CORE=1"
],
"f_cpu": "240000000L",
"f_flash": "80000000L",
"flash_mode": "qio",
"mcu": "esp32s3",
"variant": "esp32s3"
},
"connectivity": [
"wifi"
],
"debug": {
"default_tool": "esp-builtin",
"onboard_tools": [
"esp-builtin"
],
"openocd_target": "esp32s3.cfg"
},
"frameworks": [
"arduino",
"espidf"
],
"name": "ESP32-S3-FLASH-16MB",
"upload": {
"flash_size": "16MB",
"maximum_ram_size": 327680,
"maximum_size": 16777216,
"require_upload_port": true,
"speed": 921600
},
"url": "null",
"vendor": "null"
}

View File

@ -1,13 +1,19 @@
{
"build": {
"arduino": {
"ldscript": "esp32s3_out.ld"
"ldscript": "esp32s3_out.ld",
"memory_type": "opi_opi"
},
"boot": "opi",
"psram_type": "opi",
"core": "esp32",
"extra_flags": "-DBOARD_HAS_PSRAM -DESP32_4M -DESP32S3",
"extra_flags": [
"-DARDUINO_RUNNING_CORE=1",
"-DARDUINO_EVENT_RUNNING_CORE=1"
],
"f_cpu": "240000000L",
"f_flash": "80000000L",
"flash_mode": "dio",
"flash_mode": "qio",
"mcu": "esp32s3",
"variant": "esp32s3",
"partitions": "esp32_partition_app1856k_spiffs320k.csv"
@ -28,7 +34,7 @@
"maximum_ram_size": 327680,
"maximum_size": 4194304,
"require_upload_port": true,
"speed": 460800
"speed": 921600
},
"url": "https://docs.espressif.com/projects/esp-idf/en/latest/esp32s3/hw-reference/esp32s3/",
"vendor": "Espressif"

View File

@ -0,0 +1,41 @@
{
"build": {
"arduino": {
"ldscript": "esp32s3_out.ld",
"memory_type": "opi_qspi"
},
"boot": "opi",
"psram_type": "qspi",
"core": "esp32",
"extra_flags": [
"-DARDUINO_RUNNING_CORE=1",
"-DARDUINO_EVENT_RUNNING_CORE=1"
],
"f_cpu": "240000000L",
"f_flash": "80000000L",
"flash_mode": "qio",
"mcu": "esp32s3",
"variant": "esp32s3",
"partitions": "esp32_partition_app1856k_spiffs320k.csv"
},
"connectivity": [
"wifi"
],
"debug": {
"openocd_target": "esp32s3.cfg"
},
"frameworks": [
"espidf",
"arduino"
],
"name": "Espressif Generic ESP32-S3 4M Flash, Tasmota 1856k Code/OTA, 320k FS",
"upload": {
"flash_size": "4MB",
"maximum_ram_size": 327680,
"maximum_size": 4194304,
"require_upload_port": true,
"speed": 921600
},
"url": "https://docs.espressif.com/projects/esp-idf/en/latest/esp32s3/hw-reference/esp32s3/",
"vendor": "Espressif"
}

View File

@ -0,0 +1,41 @@
{
"build": {
"arduino": {
"ldscript": "esp32s3_out.ld",
"memory_type": "qio_opi"
},
"boot": "qio",
"psram_type": "opi",
"core": "esp32",
"extra_flags": [
"-DARDUINO_RUNNING_CORE=1",
"-DARDUINO_EVENT_RUNNING_CORE=1"
],
"f_cpu": "240000000L",
"f_flash": "80000000L",
"flash_mode": "qio",
"mcu": "esp32s3",
"variant": "esp32s3",
"partitions": "esp32_partition_app1856k_spiffs320k.csv"
},
"connectivity": [
"wifi"
],
"debug": {
"openocd_target": "esp32s3.cfg"
},
"frameworks": [
"espidf",
"arduino"
],
"name": "Espressif Generic ESP32-S3 4M Flash, Tasmota 1856k Code/OTA, 320k FS",
"upload": {
"flash_size": "4MB",
"maximum_ram_size": 327680,
"maximum_size": 4194304,
"require_upload_port": true,
"speed": 921600
},
"url": "https://docs.espressif.com/projects/esp-idf/en/latest/esp32s3/hw-reference/esp32s3/",
"vendor": "Espressif"
}

View File

@ -0,0 +1,41 @@
{
"build": {
"arduino": {
"ldscript": "esp32s3_out.ld",
"memory_type": "qio_qspi"
},
"boot": "qio",
"psram_type": "qspi",
"core": "esp32",
"extra_flags": [
"-DARDUINO_RUNNING_CORE=1",
"-DARDUINO_EVENT_RUNNING_CORE=1"
],
"f_cpu": "240000000L",
"f_flash": "80000000L",
"flash_mode": "qio",
"mcu": "esp32s3",
"variant": "esp32s3",
"partitions": "esp32_partition_app1856k_spiffs320k.csv"
},
"connectivity": [
"wifi"
],
"debug": {
"openocd_target": "esp32s3.cfg"
},
"frameworks": [
"espidf",
"arduino"
],
"name": "Espressif Generic ESP32-S3 4M Flash, Tasmota 1856k Code/OTA, 320k FS",
"upload": {
"flash_size": "4MB",
"maximum_ram_size": 327680,
"maximum_size": 4194304,
"require_upload_port": true,
"speed": 921600
},
"url": "https://docs.espressif.com/projects/esp-idf/en/latest/esp32s3/hw-reference/esp32s3/",
"vendor": "Espressif"
}

5
crowdin.yml Normal file
View File

@ -0,0 +1,5 @@
files:
- source: data/en.json
translation: /data/%locale_with_underscore%.%file_extension%
- source: /src/lang/en_US.h
translation: /%original_path%/%locale_with_underscore%.%file_extension%

Binary file not shown.

162
data/da_DK.json Normal file
View File

@ -0,0 +1,162 @@
{
"en": {
"language": "Dansk",
"home": {
"title": "Hovedmenu",
"btn": "Hovedmenu",
"nav": "Forside"
},
"save": "Gem Indstillinger",
"user": "Brugernavn",
"pass": "Adgangskode",
"hasp": {
"title": "HASP Design",
"btn": "HASP Design",
"theme": "UI Tema",
"color1": "Primær farve",
"color2": "Sekundær farve",
"pages": "Start Layout",
"font": "Standardfont",
"startpage": "Opstarts side",
"startdim": "Opstartslysstyrke"
},
"screenshot": {
"title": "Skærmbillede",
"btn": "Skærmbillede",
"nav": "Skærmbillede",
"prev": "Forrige Side",
"next": "Næste Side",
"refresh": "Opdater"
},
"info": {
"title": "Information",
"btn": "Information",
"nav": "Information"
},
"config": {
"title": "Konfiguration",
"btn": "Konfiguration",
"nav": "Indstillinger"
},
"ota": {
"title": "Firmware Opdatering",
"btn": "Firmware Opdatering",
"nav": "Firmware",
"submit": "Opdater Firmware",
"file": "Firmware Fil",
"url": "Firmware URL",
"redirect": "Følg Omdirigeringer",
"never": "Aldrig",
"strict": "Streng",
"always": "Altid"
},
"editor": {
"title": "Fil Editor",
"btn": "Fil Editor",
"nav": "Fil Editor"
},
"reset": {
"title": "Gendan fabriksindstillinger",
"btn": "Gendan fabriksindstillinger",
"warning": "Advarsel",
"message": "Denne proces vil nulstille alle indstillinger til standardværdierne. Den interne flash vil blive slettet, og enheden genstartes. Du skal muligvis oprette forbindelse til WiFi AP vist på panelet for at omkonfigurere enheden, før du får adgang til den igen.",
"fileloss": "ALLE FILER VIL TABE!"
},
"reboot": {
"title": "Genstarter...",
"btn": "Genstart",
"nav": "Genstart",
"message": "Enheden er ved at genstarte."
},
"about": {
"credits": "Baseret på det tidligere arbejde fra følgende open source-udviklere:",
"copyright": "Ophavsret ",
"rights": "Alle rettigheder forbeholdes.",
"clause1": "Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files(the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and / or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:",
"clause2": "The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.",
"clause3": "THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.",
"mit": "MIT Licens",
"bsd": "Bsd Licens",
"freebsd": "FreeBSD Licens",
"apache2": "Apache2 Licens"
},
"wifi": {
"title": "WiFi Indstillinger",
"btn": "WiFi Indstillinger",
"ssid": "SSID"
},
"wg": {
"title": "WireGuard Settings",
"btn": "WireGuard Settings",
"vpnip": "VPN IP",
"privkey": "Private Key",
"host": "Remote IP",
"port": "Remote Port",
"pubkey": "Remote Public Key"
},
"mqtt": {
"title": "MQTT Indstillinger",
"btn": "MQTT Indstillinger",
"name": "Værtsnavn",
"group": "Gruppenavn",
"host": "Broker",
"port": "Port",
"node_t": "Node Emne",
"group_t": "Gruppe Emne",
"broadcast_t": "Broadcast Emne",
"hass_t": "HA LWT Emne"
},
"http": {
"title": "HTTP Indstillinger",
"btn": "HTTP Indstillinger"
},
"ftp": {
"title": "FTP Indstillinger",
"btn": "FTP Indstillinger",
"port": "FTP Port",
"pasv": "Passiv Port"
},
"gui": {
"title": "Skærm Indstillinger",
"btn": "Skærm Indstillinger",
"antiburn": "Antiforbrænding",
"calibrate": "Kalibrér"
},
"gpio": "GPIO Indstillinger",
"debug": {
"title": "Debug Indstillinger",
"btn": "Debug Indstillinger",
"baud": "Baudrate",
"tele": "Tele Periode",
"ansi": "Brug ANSI-koder",
"host": "Syslog Server",
"port": "Syslog Port",
"ietf": "IETF (RFC 5424)",
"bsd": "BSD (RFC 3164)",
"log": "Facilitet"
},
"time": {
"title": "Tids Indstillinger",
"btn": "Tids Indstillinger",
"region": "Region",
"zone": "Tidszone",
"tz": "Tidszone",
"ntp": "NTP-servere"
},
"region": {
"etc": "Etcetera ",
"continents": "Kontinenter ",
"af": "Afrika ",
"as": "Asien ",
"au": "Australien ",
"aq": "Antarktis ",
"eu": "Europa ",
"na": "Nordamerika ",
"sa": "Sydamerika ",
"islands": "Øer ",
"at": "Atlanterhavet ",
"in": "Indiske Ocean ",
"pa": "Stillehavet "
}
}
}

162
data/de_DE.json Normal file
View File

@ -0,0 +1,162 @@
{
"en": {
"language": "Deutsch",
"home": {
"title": "Hauptmenü",
"btn": "Hauptmenü",
"nav": "Startseite"
},
"save": "Einstellungen speichern",
"user": "Benutzername",
"pass": "Passwort",
"hasp": {
"title": "HASP-Design",
"btn": "HASP-Design",
"theme": "UI-Thema",
"color1": "Hauptfarbe",
"color2": "Sekundärfarbe",
"pages": "Start-Layout",
"font": "Standardschrift",
"startpage": "Startseite",
"startdim": "Starthelligkeit"
},
"screenshot": {
"title": "Bildschirmaufnahme",
"btn": "Bildschirmaufnahme",
"nav": "Bildschirmaufnahme",
"prev": "Vorherige Seite",
"next": "Nächste Seite",
"refresh": "Aktualisieren"
},
"info": {
"title": "Informationen",
"btn": "Informationen",
"nav": "Informationen"
},
"config": {
"title": "Konfiguration",
"btn": "Konfiguration",
"nav": "Konfiguration"
},
"ota": {
"title": "Firmware Update",
"btn": "Firmware Update",
"nav": "Firmware",
"submit": "Firmware aktualisieren",
"file": "Firmware-Datei",
"url": "Firmware-URL",
"redirect": "Umleitungen folgen",
"never": "Niemals",
"strict": "Strikt",
"always": "Immer"
},
"editor": {
"title": "Datei Editor",
"btn": "Datei Editor",
"nav": "Datei Editor"
},
"reset": {
"title": "Werkseinsetzung",
"btn": "Werkseinstellungen zurücksetzen",
"warning": "Warnung",
"message": "Dieser Prozess setzt alle Einstellungen auf die Standardwerte zurück. Der interne Blitz wird gelöscht und das Gerät wird neu gestartet. Möglicherweise müssen Sie eine Verbindung zu dem WiFi AP auf dem Panel herstellen, um das Gerät neu zu konfigurieren, bevor Sie auf es erneut zugreifen.",
"fileloss": "ALLE DATEIEN WERDEN GELÖSCHT!"
},
"reboot": {
"title": "Neustarten...",
"btn": "Neustarten",
"nav": "Neustart",
"message": "Das Gerät wird neu gestartet."
},
"about": {
"credits": "Basierend auf der bisherigen Arbeit der folgenden Open-Source-Entwickler:",
"copyright": "Urheberrechte ",
"rights": "Alle Rechte vorbehalten.",
"clause1": "Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files(the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and / or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:",
"clause2": "The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.",
"clause3": "THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.",
"mit": "MIT-Lizenz",
"bsd": "BSD-Lizenz",
"freebsd": "FreeBSD-Lizenz",
"apache2": "Apache2-Lizenz"
},
"wifi": {
"title": "WiFi-Einstellungen",
"btn": "WiFi-Einstellungen",
"ssid": "SSID"
},
"wg": {
"title": "WireGuard Einstellungen",
"btn": "WireGuard Einstellungen",
"vpnip": "VPN IP",
"privkey": "Privater Schlüssel",
"host": "Entfernte IP",
"port": "Entfernter Port",
"pubkey": "Öffentlicher Remote-Schlüssel"
},
"mqtt": {
"title": "MQTT-Einstellungen",
"btn": "MQTT-Einstellungen",
"name": "Hostname",
"group": "Gruppenname",
"host": "Broker",
"port": "Port",
"node_t": "Knoten-Thema",
"group_t": "Gruppen-Thema",
"broadcast_t": "Broadcast-Thema",
"hass_t": "HA LWT-Thema"
},
"http": {
"title": "HTTP-Einstellungen",
"btn": "HTTP-Einstellungen"
},
"ftp": {
"title": "FTP-Einstellungen",
"btn": "FTP-Einstellungen",
"port": "FTP-Port",
"pasv": "Passiver Port"
},
"gui": {
"title": "Bildschirmeinstellungen",
"btn": "Bildschirmeinstellungen",
"antiburn": "Anti-Burn",
"calibrate": "Kalibrieren"
},
"gpio": "GPIO-Einstellungen",
"debug": {
"title": "Debug-Einstellungen",
"btn": "Debug-Einstellungen",
"baud": "Baudrate",
"tele": "Tele-Periode",
"ansi": "ANSI-Codes verwenden",
"host": "Syslog-Server",
"port": "Syslog-Port",
"ietf": "IETF (RFC 5424)",
"bsd": "BSD (RFC 3164)",
"log": "Facility"
},
"time": {
"title": "Zeit Einstellungen",
"btn": "Zeit Einstellungen",
"region": "Region",
"zone": "Zeitzone",
"tz": "Zeitzone",
"ntp": "NTP-Server"
},
"region": {
"etc": "Etcetera ",
"continents": "Kontinenten ",
"af": "Afrika ",
"as": "Asien ",
"au": "Australien ",
"aq": "Antarctica ",
"eu": "Europa ",
"na": "Nordamerika ",
"sa": "Südamerika ",
"islands": "Inseln ",
"at": "Atlantischer Ozean ",
"in": "Indischer Ozean ",
"pa": "Pazifischer Ozean "
}
}
}

File diff suppressed because one or more lines are too long

Binary file not shown.

1
data/en.json Normal file
View File

@ -0,0 +1 @@
{"en":{"language":"English","home":{"title":"Main Menu","btn":"Main Menu","nav":"Home"},"save":"Save Settings","user":"Username","pass":"Password","hasp":{"title":"HASP Design","btn":"HASP Design","theme":"UI Theme","color1":"Primary color","color2":"Secondary color","pages":"Start Layout","font":"Default Font","startpage":"Startup Page","startdim":"Startup Dim"},"screenshot":{"title":"Screenshot","btn":"Screenshot","nav":"Screenshot","prev":"Prev Page","next":"Next Page","refresh":"Refresh"},"info":{"title":"Information","btn":"Information","nav":"Information"},"config":{"title":"Configuration","btn":"Configuration","nav":"Settings"},"ota":{"title":"Firmware Update","btn":"Firmware Update","nav":"Firmware","submit":"Update Firmware","file":"Firmware File","url":"Firmware URL","redirect":"Follow Redirects","never":"Never","strict":"Strict","always":"Always"},"editor":{"title":"File Editor","btn":"File Editor","nav":"File Editor"},"reset":{"title":"Factory Reset","btn":"Factory Reset","warning":"Warning","message":"This process will reset all settings to the default values. The internal flash will be erased and the device is restarted. You may need to connect to the WiFi AP displayed on the panel to reconfigure the device before accessing it again.","fileloss":"ALL FILES WILL BE LOST!"},"reboot":{"title":"Rebooting...","btn":"Restart","nav":"Reboot","message":"The device is rebooting."},"about":{"credits":"Based on the previous work of the following open source developers:","copyright":"Copyright ","rights":"All rights reserved.","clause1":"Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files(the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and / or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:","clause2":"The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.","clause3":"THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.","mit":"MIT License","bsd":"BSD License","freebsd":"FreeBSD License","apache2":"Apache2 License"},"wifi":{"title":"Wifi Settings","btn":"Wifi Settings","ssid":"SSID"},"wg":{"title":"WireGuard Settings","btn":"WireGuard Settings","vpnip":"VPN IP","privkey":"Private Key","host":"Remote IP","port":"Remote Port","pubkey":"Remote Public Key"},"mqtt":{"title":"MQTT Settings","btn":"MQTT Settings","name":"Hostname","group":"Groupname","host":"Broker","port":"Port","node_t":"Node Topic","group_t":"Group Topic","broadcast_t":"Broadcast Topic","hass_t":"HA LWT Topic"},"http":{"title":"HTTP Settings","btn":"HTTP Settings"},"ftp":{"title":"FTP Settings","btn":"FTP Settings","port":"FTP Port","pasv":"Passive Port"},"gui":{"title":"Display Settings","btn":"Display Settings","antiburn":"Antiburn","calibrate":"Calibrate"},"gpio":"GPIO Settings","debug":{"title":"Debug Settings","btn":"Debug Settings","baud":"Baudrate","tele":"Tele Period","ansi":"Use ANSI codes","host":"Syslog Server","port":"Syslog Port","ietf":"IETF (RFC 5424)","bsd":"BSD (RFC 3164)","log":"Facility"},"time":{"title":"Time Settings","btn":"Time Settings","region":"Region","zone":"Timezone","tz":"Timezone","ntp":"NTP Servers"},"region":{"etc":"Etcetera ","continents":"Continents ","af":"Africa ","as":"Asia ","au":"Australia ","aq":"Antarctica ","eu":"Europe ","na":"North America ","sa":"South America ","islands":"Islands ","at":"Atlantic Ocean ","in":"Indian Ocean ","pa":"Pacific Ocean "}}}

162
data/es_ES.json Normal file
View File

@ -0,0 +1,162 @@
{
"en": {
"language": "Español",
"home": {
"title": "Menu Principal",
"btn": "Menu Principal",
"nav": "Inicio"
},
"save": "Guardar Configuración",
"user": "Usuario",
"pass": "Contraseña",
"hasp": {
"title": "Diseño de HASP",
"btn": "Diseño de HASP",
"theme": "Tema de IU",
"color1": "Color Primario",
"color2": "Color Secundario",
"pages": "Diseño Inicial",
"font": "Fuente por Defecto",
"startpage": "Página de Inicio",
"startdim": "Brillo Inicial"
},
"screenshot": {
"title": "Captura de Pantalla",
"btn": "Captura de Pantalla",
"nav": "Captura de Pantalla",
"prev": "Prev Página",
"next": "Siguiente Página",
"refresh": "Actualizar"
},
"info": {
"title": "Información",
"btn": "Información",
"nav": "Información"
},
"config": {
"title": "Configuración",
"btn": "Configuración",
"nav": "Configuraciones"
},
"ota": {
"title": "Actualización de Firmware",
"btn": "Actualización de Firmware",
"nav": "Firmware",
"submit": "Actualizar Firmware",
"file": "Archivo Firmware",
"url": "URL del Firmware",
"redirect": "Sigue Redirecciones",
"never": "Nunca",
"strict": "Estricto",
"always": "Siempre"
},
"editor": {
"title": "Editor de Archivos",
"btn": "Editor de Archivos",
"nav": "Editor de Archivos"
},
"reset": {
"title": "Reconfiguración de Fábrica",
"btn": "Restaurar conf de Fábrica",
"warning": "Aviso",
"message": "Este proceso restablecerá todos los ajustes a los valores predeterminados. El flash interno se borrará y el dispositivo se reiniciará. Es posible que necesite conectarse al AP WiFi mostrado en el panel para reconfigurar el dispositivo antes de volver a acceder a él.",
"fileloss": "¡TODOS LOS ARCHIVOS SERÁN PERDIDOS!"
},
"reboot": {
"title": "Reiniciando...",
"btn": "Reiniciar",
"nav": "Reiniciar",
"message": "El dispositivo se está reiniciando."
},
"about": {
"credits": "Basado en el trabajo anterior de los siguientes desarrolladores de código abierto:",
"copyright": "Copyright ",
"rights": "Todos los derechos reservados.",
"clause1": "Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files(the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and / or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:",
"clause2": "The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.",
"clause3": "THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.",
"mit": "Licencia MIT",
"bsd": "Licencia BSD",
"freebsd": "Licencia FreeBSD",
"apache2": "Licencia Apache2"
},
"wifi": {
"title": "Ajustes WiFi",
"btn": "Ajustes WiFi",
"ssid": "SSID"
},
"wg": {
"title": "Ajustes de WireGuard",
"btn": "Ajustes de WireGuard",
"vpnip": "IP VPN",
"privkey": "Clave Privada",
"host": "IP Remota",
"port": "Puerto Remoto",
"pubkey": "Clave Pública Remota"
},
"mqtt": {
"title": "Ajustes MQTT",
"btn": "Ajustes MQTT",
"name": "Nombre del Host",
"group": "Nombre del Grupo",
"host": "Broker",
"port": "Puerto",
"node_t": "Tema del Nodo",
"group_t": "Tema del Grupo",
"broadcast_t": "Tema de Broadcast",
"hass_t": "Tema HA LWT"
},
"http": {
"title": "Ajustes HTTP",
"btn": "Ajustes HTTP"
},
"ftp": {
"title": "Ajustes FTP",
"btn": "Ajustes FTP",
"port": "Puerto FTP",
"pasv": "Puerto Pasivo"
},
"gui": {
"title": "Ajustes de Pantalla",
"btn": "Ajustes de Pantalla",
"antiburn": "Anti-quemaduras",
"calibrate": "Calibrar"
},
"gpio": "Ajustes GPIO",
"debug": {
"title": "Ajustes de Depuración",
"btn": "Ajustes de Depuración",
"baud": "Tasa Baudios",
"tele": "Periodo de Tele",
"ansi": "Usar códigos ANSI",
"host": "Servidor Syslog",
"port": "Puerto Syslog",
"ietf": "IETF (RFC 5424)",
"bsd": "BSD (RFC 3164)",
"log": "Facility"
},
"time": {
"title": "Ajustes de Tiempo",
"btn": "Ajustes de Tiempo",
"region": "Región",
"zone": "Zona Horaria",
"tz": "Zona Horaria",
"ntp": "Servidor NTP"
},
"region": {
"etc": "Etcetera ",
"continents": "Continentes ",
"af": "Africa ",
"as": "Asia ",
"au": "Australia ",
"aq": "Antártida ",
"eu": "Europa ",
"na": "América del Norte ",
"sa": "América del Sur ",
"islands": "Islas ",
"at": "Océano Atlántico ",
"in": "Océano Índico ",
"pa": "Océano Pacífico "
}
}
}

162
data/fr_FR.json Normal file
View File

@ -0,0 +1,162 @@
{
"en": {
"language": "Français",
"home": {
"title": "Menu Principal",
"btn": "Menu Principal",
"nav": "Page d'accueil"
},
"save": "Enregistrer les Paramètres",
"user": "Nom d'utilisateur",
"pass": "Mot de Passe",
"hasp": {
"title": "Design HASP",
"btn": "Design HASP",
"theme": "Thème UI",
"color1": "Couleur Primaire",
"color2": "Couleur Secondaire",
"pages": "Mise en page",
"font": "Police par défaut",
"startpage": "Page de départ",
"startdim": "Luminosité"
},
"screenshot": {
"title": "Capture d'écran",
"btn": "Capture d'écran",
"nav": "Capture d'écran",
"prev": "Page Précédente",
"next": "Page Suivante",
"refresh": "Actualiser"
},
"info": {
"title": "Information",
"btn": "Information",
"nav": "Information"
},
"config": {
"title": "Configuration",
"btn": "Configuration",
"nav": "Paramètres"
},
"ota": {
"title": "Mise à jour du micrologiciel",
"btn": "Mise à jour du micrologiciel",
"nav": "Micrologiciel",
"submit": "Mettre à jour le firmware",
"file": "Fichier du Firmware",
"url": "URL du Firmware",
"redirect": "Suivre les redirections",
"never": "Jamais",
"strict": "Stricte",
"always": "Toujours"
},
"editor": {
"title": "Éditeur de fichiers",
"btn": "Éditeur de fichiers",
"nav": "Éditeur de fichiers"
},
"reset": {
"title": "Paramètres d'usine",
"btn": "Retour aux paramètres d'usine",
"warning": "Attention",
"message": "Ce processus va réinitialiser tous les paramètres aux valeurs par défaut. Le flash interne sera effacé et l'appareil sera redémarré. Il se peut que vous deviez vous connecter à l'AP WiFi affiché sur le panneau pour reconfigurer l'appareil avant d'y accéder.",
"fileloss": "TOUS LES FICHIERS SERONT PERDUS !"
},
"reboot": {
"title": "Redémarrage en cours...",
"btn": "Redémarrer",
"nav": "Redémarrer",
"message": "L'appareil est en cours de redémarrage."
},
"about": {
"credits": "Basé sur le travail précédent des développeurs Open Source suivants :",
"copyright": "Droits dauteur ",
"rights": "Tous les droits sont réservés.",
"clause1": "Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files(the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and / or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:",
"clause2": "The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.",
"clause3": "THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.",
"mit": "Licence MIT",
"bsd": "Licence BSD",
"freebsd": "Licence FreeBSD",
"apache2": "Licence Apache2"
},
"wifi": {
"title": "Paramètres WiFi",
"btn": "Paramètres WiFi",
"ssid": "SSID"
},
"wg": {
"title": "Paramètres WireGuard",
"btn": "Paramètres WireGuard",
"vpnip": "IP du VPN",
"privkey": "Clé Privée",
"host": "Adresse IP distante",
"port": "Port Distant",
"pubkey": "Clé publique distante"
},
"mqtt": {
"title": "Paramètres MQTT",
"btn": "Paramètres MQTT",
"name": "Nom d'hôte",
"group": "Groupe",
"host": "Broker",
"port": "Port",
"node_t": "Sujet du Node",
"group_t": "Sujet de Groupe",
"broadcast_t": "Sujet Broadcast",
"hass_t": "Sujet HA LWT"
},
"http": {
"title": "Paramètres HTTP",
"btn": "Paramètres HTTP"
},
"ftp": {
"title": "Paramètres FTP",
"btn": "Paramètres FTP",
"port": "Port FTP",
"pasv": "Port Passif"
},
"gui": {
"title": "Paramètres d'affichage",
"btn": "Paramètres d'affichage",
"antiburn": "Anti-brûlure",
"calibrate": "Calibrer"
},
"gpio": "Paramètres GPIO",
"debug": {
"title": "Paramètres de Débogage",
"btn": "Paramètres de Débogage",
"baud": "Baudrate",
"tele": "Période de Tele",
"ansi": "Utiliser les codes ANSI",
"host": "Serveur Syslog",
"port": "Port Syslog",
"ietf": "IETF (RFC 5424)",
"bsd": "BSD (RFC 3164)",
"log": "Facility"
},
"time": {
"title": "Paramètres de l'heure",
"btn": "Paramètres de l'heure",
"region": "Région",
"zone": "Fuseau horaire",
"tz": "Fuseau horaire",
"ntp": "Serveurs NTP"
},
"region": {
"etc": "Etcetera ",
"continents": "Continents ",
"af": "L'Afrique ",
"as": "L'Asie ",
"au": "L'Australie ",
"aq": "Antarctique ",
"eu": "LEurope ",
"na": "L'Amérique du Nord ",
"sa": "L'Amérique du Sud ",
"islands": "Îles ",
"at": "L'océan Atlantique ",
"in": "L'océan Indien ",
"pa": "L'océan Pacifique "
}
}
}

162
data/hu_HU.json Normal file
View File

@ -0,0 +1,162 @@
{
"en": {
"language": "Magyar",
"home": {
"title": "Főmenü",
"btn": "Főmenü",
"nav": "Főoldal"
},
"save": "Beállítások mentése",
"user": "Felhasználónév",
"pass": "Jelszó",
"hasp": {
"title": "Képernyő dizájn",
"btn": "Képernyő dizájn",
"theme": "UI téma",
"color1": "Elsődleges szín",
"color2": "Másodlagos szín",
"pages": "Betöltendő oldalak",
"font": "Alapértelmezett font",
"startpage": "Kezdő oldal",
"startdim": "Kezdeti fényerő"
},
"screenshot": {
"title": "Képernyőkép",
"btn": "Képernyőkép",
"nav": "Képernyőkép",
"prev": "Előző oldal",
"next": "Következő oldal",
"refresh": "Frissítés"
},
"info": {
"title": "Információk",
"btn": "Információk",
"nav": "Információk"
},
"config": {
"title": "Beállítások",
"btn": "Beállítások",
"nav": "Beállítások"
},
"ota": {
"title": "Firmware frissítés",
"btn": "Firmware frissítés",
"nav": "Firmware",
"submit": "Firmware frissítése",
"file": "Firmware fájl",
"url": "Firmware URL",
"redirect": "Átirányítások",
"never": "Soha",
"strict": "Szigorú",
"always": "Mindig"
},
"editor": {
"title": "Fájlkezelő",
"btn": "Fájlkezelő",
"nav": "Fájlkezelő"
},
"reset": {
"title": "Gyári beállítások visszaállítása",
"btn": "Gyári beállítások visszaállítása",
"warning": "Képernyőkép",
"message": "Ez a folyamat az összes beállítást visszaállítja az alapértelmezett értékekre. A belső memória törlődik, majd a készülék újraindul. Előfordulhat, hogy csatlakoznia kell a panelen megjelenő WiFi hozzáférési ponthoz az eszköz újrakonfigurálásához, mielőtt ismét hozzá tudna férni.",
"fileloss": "AZ ÖSSZES FÁJL TÖRLŐDIK!"
},
"reboot": {
"title": "Újraindítás...",
"btn": "Újraindítás",
"nav": "Újraindítás",
"message": "Az eszköz újraindul."
},
"about": {
"credits": "Az alábbi nyílt forráskódú fejlesztők korábbi munkája alapján:",
"copyright": "Copyright ",
"rights": "Minden jog fenntartva.",
"clause1": "Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files(the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and / or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:",
"clause2": "The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.",
"clause3": "THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.",
"mit": "MIT licenc",
"bsd": "BSD licenc",
"freebsd": "FreeBSD licenc",
"apache2": "Apache2 licenc"
},
"wifi": {
"title": "WiFi beállítások",
"btn": "WiFi beállítások",
"ssid": "SSID"
},
"wg": {
"title": "WireGuard Settings",
"btn": "WireGuard Settings",
"vpnip": "VPN IP",
"privkey": "Private Key",
"host": "Remote IP",
"port": "Remote Port",
"pubkey": "Remote Public Key"
},
"mqtt": {
"title": "MQTT beállítások",
"btn": "MQTT beállítások",
"name": "Név",
"group": "Csoport",
"host": "Szerver",
"port": "Port",
"node_t": "Eszköz topik",
"group_t": "Csoport topik",
"broadcast_t": "Mindenki topik",
"hass_t": "HA LWT topik"
},
"http": {
"title": "HTTP beállítások",
"btn": "HTTP beállítások"
},
"ftp": {
"title": "FTP beállítások",
"btn": "FTP beállítások",
"port": "FTP Port",
"pasv": "Passzív Port"
},
"gui": {
"title": "Képernyő beállítások",
"btn": "Képernyő beállítások",
"antiburn": "Beégésvédelem futtatása",
"calibrate": "Kalibrálás"
},
"gpio": "GPIO beállítások",
"debug": {
"title": "Hibakeresési beállítások",
"btn": "Hibakeresési beállítások",
"baud": "Baud ráta",
"tele": "Tele- periódus",
"ansi": "ANSI kódolás",
"host": "Syslog szerver",
"port": "Syslog port",
"ietf": "IETF (RFC 5424)",
"bsd": "BSD (RFC 3164)",
"log": "Facility"
},
"time": {
"title": "Idő beállítások",
"btn": "Idő beállítások",
"region": "Régió",
"zone": "Időzóna",
"tz": "Időzóna",
"ntp": "NTP szerverek"
},
"region": {
"etc": "Etcetera ",
"continents": "Kontinensek ",
"af": "Afrika ",
"as": "Ázsia ",
"au": "Ausztrália ",
"aq": "Antarktika ",
"eu": "Európa ",
"na": "Észak-Amerika ",
"sa": "Dél-Amerika ",
"islands": "Szigetek ",
"at": "Atlanti-óceán ",
"in": "Indiai-óceán ",
"pa": "Csendes-óceán "
}
}
}

1
data/main.js Normal file

File diff suppressed because one or more lines are too long

162
data/nl_NL.json Normal file
View File

@ -0,0 +1,162 @@
{
"en": {
"language": "Nederlands",
"home": {
"title": "Hoofdmenu",
"btn": "Hoofdmenu",
"nav": "Hoofdpagina"
},
"save": "Instellingen Opslaan",
"user": "Gebruikersnaam",
"pass": "Wachtwoord",
"hasp": {
"title": "HASP Design",
"btn": "HASP Design",
"theme": "UI Thema",
"color1": "Primaire Kleur",
"color2": "Secundaire Kleur",
"pages": "Start Lay-out",
"font": "Standaard Lettertype",
"startpage": "Startpagina",
"startdim": "Start Helderheid"
},
"screenshot": {
"title": "Schermafdruk",
"btn": "Schermafdruk",
"nav": "Schermafdruk",
"prev": "Vorige Pagina",
"next": "Volgende Pagina",
"refresh": "Vernieuwen"
},
"info": {
"title": "Informatie",
"btn": "Informatie",
"nav": "Informatie"
},
"config": {
"title": "Instellingen",
"btn": "Instellingen",
"nav": "Instellingen"
},
"ota": {
"title": "Firmware Bijwerken",
"btn": "Firmware Bijwerken",
"nav": "Firmware",
"submit": "Firmware Bijwerken",
"file": "Firmware Bestand",
"url": "Firmware URL",
"redirect": "Volg Redirects",
"never": "Nooit",
"strict": "Strikt",
"always": "Altijd"
},
"editor": {
"title": "Bestandseditor",
"btn": "Bestandseditor",
"nav": "Bestandseditor"
},
"reset": {
"title": "Fabrieksinstellingen",
"btn": "Fabrieksinstellingen",
"warning": "Waarschuwing",
"message": "Dit proces zal alle instellingen terugzetten naar de standaardwaarden. De interne flash zal worden gewist en het apparaat wordt opnieuw gestart. U moet mogelijk verbinding maken met het Wifi AP die wordt weergegeven op het paneel om het apparaat opnieuw te configureren voordat u weer toegang krijgt.",
"fileloss": "ALLE BESTANDEN WORDEN VERWIJDERD!"
},
"reboot": {
"title": "Herstarten...",
"btn": "Herstarten",
"nav": "Herstart",
"message": "Het apparaat wordt herstart."
},
"about": {
"credits": "Gebaseerd op het eerdere werk van de volgende Open Source ontwikkelaars:",
"copyright": "Copyright ",
"rights": "Alle rechten voorbehouden.",
"clause1": "Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files(the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and / or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:",
"clause2": "The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.",
"clause3": "THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.",
"mit": "MIT Licentie",
"bsd": "BSD Licentie",
"freebsd": "FreeBSD Licentie",
"apache2": "Apache2 Licentie"
},
"wifi": {
"title": "Wifi Instellingen",
"btn": "Wifi Instellingen",
"ssid": "SSID"
},
"wg": {
"title": "WireGuard Instellingen",
"btn": "WireGuard Instellingen",
"vpnip": "VPN IP",
"privkey": "Private Sleutel",
"host": "Extern IP",
"port": "Externe Poort",
"pubkey": "Externe Openbare Sleutel"
},
"mqtt": {
"title": "MQTT Instellingen",
"btn": "MQTT Instellingen",
"name": "Hostnaam",
"group": "Groepsnaam",
"host": "Broker",
"port": "Poort",
"node_t": "Node Onderwerp",
"group_t": "Groep Onderwerp",
"broadcast_t": "Broadcast Onderwerp",
"hass_t": "HA LWT Onderwerp"
},
"http": {
"title": "HTTP Instellingen",
"btn": "HTTP Instellingen"
},
"ftp": {
"title": "FTP Instellingen",
"btn": "FTP Instellingen",
"port": "FTP Poort",
"pasv": "Passieve Poort"
},
"gui": {
"title": "Scherminstellingen",
"btn": "Scherminstellingen",
"antiburn": "Inbranden Voorkomen",
"calibrate": "Kalibreer"
},
"gpio": "GPIO Instellingen",
"debug": {
"title": "Debug Instellingen",
"btn": "Debug Instellingen",
"baud": "Baudrate",
"tele": "Tele Periode",
"ansi": "Gebruik ANSI codes",
"host": "Syslog Server",
"port": "Syslog Poort",
"ietf": "IETF (RFC 5424)",
"bsd": "BSD (RFC 3164)",
"log": "Faciliteit"
},
"time": {
"title": "Tijdsinstellingen",
"btn": "Tijdsinstellingen",
"region": "Regio",
"zone": "Tijdzone",
"tz": "Tijdzone",
"ntp": "NTP Servers"
},
"region": {
"etc": "Etcetera ",
"continents": "Continenten ",
"af": "Afrika ",
"as": "Azië ",
"au": "Australië ",
"aq": "Antarctica ",
"eu": "Europa ",
"na": "Noord-Amerika ",
"sa": "Zuid-Amerika ",
"islands": "Eilanden ",
"at": "Atlantische Oceaan ",
"in": "Indische Oceaan ",
"pa": "Stille Oceaan "
}
}
}

BIN
data/openhasp.ttf Normal file

Binary file not shown.

View File

@ -0,0 +1,73 @@
{"page":1,"comment":"Connected Relay Buttons"}
{"id":1,"obj":"switch","x":30,"y":40,"w":180,"h":75,"radius":40,"radius20":40,"groupid":1}
{"id":2,"obj":"switch","x":30,"y":122,"w":180,"h":75,"radius":40,"radius20":40,"groupid":2}
{"id":3,"obj":"switch","x":30,"y":205,"w":180,"h":75,"radius":40,"radius20":40,"groupid":3}
{"page":2,"comment":"WLED Control Panel"}
{"id":103,"obj":"switch","x":12,"y":29,"w":60,"h":20,"radius":15}
{"id":104,"obj":"label","x":10,"y":5,"w":180,"h":32,"text":"Night Light","text_color":"#FFFFFF"}
{"id":105,"obj":"label","x":5,"y":57,"w":180,"h":32,"text":"Brightness","text_color":"#FFFFFF"}
{"id":106,"obj":"slider","x":34,"y":82,"w":14,"h":90,"min":0,"max":255}
{"id":107,"obj":"cpicker","x":85,"y":10,"w":150,"h":150}
{"id":108,"obj":"dropdown","x":10,"y":200,"w":115,"h":30,"options":""}
{"id":110,"obj":"btn","x":10,"y":255,"w":115,"h":30}
{"id":111,"obj":"label","x":15,"y":180,"w":180,"h":32,"text":"Preset","text_color":"#FFFFFF"}
{"id":112,"obj":"label","x":15,"y":260,"w":180,"h":32,"text":"","text_color":"#FFFFFF"}
{"id":113,"obj":"label","x":160,"y":180,"w":180,"h":32,"text":"Intensity","text_color":"#FFFFFF"}
{"id":114,"obj":"label","x":160,"y":233,"w":180,"h":32,"text":"Speed","text_color":"#FFFFFF"}
{"id":115,"obj":"slider","x":145,"y":205,"w":90,"h":14,"min":0,"max":255}
{"id":116,"obj":"slider","x":145,"y":260,"w":90,"h":14,"min":0,"max":255}
{"id":117,"obj":"label","x":15,"y":233,"w":180,"h":32,"text":"Random Effect","text_color":"#FFFFFF"}
{"page":3,"comment":"Media Player"}
{"id":10,"obj":"obj","x":5,"y":35,"w":230,"h":250,"click":0,"bg_opa":0,"shadow_opa":140,"shadow_color":"black","shadow_width":20,"shadow_spread":0}
{"id":13,"obj":"label","x":0,"y":5,"w":117,"h":30,"text":"-","mode":"scroll","align":1}
{"id":12,"obj":"label","x":120,"y":5,"w":120,"h":30,"text":"-","mode":"scroll","align":1}
{"id":14,"obj":"bar","x":8,"y":278,"w":200,"h":5,"min":0,"max":100,"border_opa":0,"pad_top":0,"pad_bottom":0,"pad_left":0,"pad_right":0}
{"id":21,"obj":"obj","x":8,"y":35,"w":200,"h":200,"radius":6,"clip_corner":1,"hidden":1}
{"id":22,"obj":"img","x":0,"y":0,"w":200,"h":200,"parentid":21,"src":"","auto_size":1}
{"id":17,"obj":"btn","x":8,"y":226,"w":50,"h":50,"toggle":false,"text":"\uE4AE","text_font":32}
{"id":18,"obj":"btn","x":66,"y":226,"w":83,"h":50,"toggle":false,"text":"\uE40A","text_font":32}
{"id":19,"obj":"btn","x":157,"y":226,"w":51,"h":50,"toggle":false,"text":"\uE4AD","text_font":32}
{"id":20,"obj":"slider","x":212,"y":38,"w":20,"h":244,"min":0,"max":100,"val":85}
{"page":4,"comment":"Thermostat"}
{"id":1,"obj":"label","x":5,"y":5,"w":230,"h":25,"text":"Master Bedroom","align":"center"}
{"id":10,"obj":"obj","x":5,"y":35,"w":230,"h":250,"click":0}
{"id":20,"obj":"arc","x":5,"y":37,"w":230,"h":230,"min":170,"max":300,"val":250,"border_side":0,"type":0,"rotation":0,"start_angle":135,"end_angle":45,"adjustable":"true","line_width":21,"line_width10":21,"line_color10":"#34bdeb","bg_opa":0,"pad_top20":5,"pad_bottom20":5,"pad_left20":5,"pad_right20":5,"pad_top":5,"pad_bottom":5,"pad_left":5,"pad_right":5}
{"id":21,"obj":"gauge","x":28,"y":28,"w":175,"h":175,"parentid":20,"min":170,"max":300,"val":224,"format":1,"critical_value":301,"label_count":14,"line_count":27,"border_width":0,"pad_top":2,"pad_bottom":2,"pad_left":2,"pad_right":2,"value_str":"°C","value_ofs_y":55,"value_font":16,"bg_opa":0,"line_width10":3,"line_rounded10":1,"line_color":"#348feb","line_color60":"#348feb","scale_grad_color":"#eb4934","scale_grad_color60":"#eb4934","scale_end_color60":"#eb4934"}
{"id":22,"obj":"obj","x":85,"y":85,"w":60,"h":60,"parentid":20,"click":0,"radius":30,"border_width":2,"border_opa":200}
{"id":23,"obj":"label","x":80,"y":100,"w":70,"h":30,"parentid":20,"text":"22.4","text_font":24,"align":"center"}
{"id":24,"obj":"obj","x":145,"y":245,"w":60,"h":30,"click":0,"radius":5}
{"id":25,"obj":"label","x":145,"y":245,"w":60,"h":30,"text":"25","text_font":24,"align":"center"}
{"id":26,"obj":"label","x":90,"y":220,"w":60,"h":30,"text":"#909090 \u2022# #000000 \u2022# #909090 \u2022#","text_font":24,"align":"center","text_color":"grey","border_width":0}
{"id":30,"obj":"tabview","x":0,"y":235,"w":240,"h":80,"btn_pos":0,"bg_opa":0,"border_width":0,"radius":0}
{"id":31,"obj":"tab","parentid":30}
{"id":32,"obj":"tab","parentid":30}
{"id":33,"obj":"tab","parentid":30}
{"id":41,"obj":"switch","x":35,"y":10,"w":60,"h":30,"parentid":31,"radius":25,"radius20":25}
{"id":42,"obj":"dropdown","x":15,"y":10,"w":110,"h":30,"parentid":32,"options":"fan_modes","direction":"1","radius":5}
{"id":43,"obj":"dropdown","x":15,"y":10,"w":110,"h":30,"parentid":33,"options":"hvac_modes","direction":"1","radius":5}
{"page":5,"comment":"Backlight"}
{"id":1,"obj":"label","x":5,"y":5,"w":230,"h":25,"text":"Backlight","align":"center"}
{"id":10,"obj":"btn","x":20,"y":40,"w":90,"h":75,"text":"10%","action":{"up":"backlight {'state':'on','brightness':26}"}}
{"id":11,"obj":"btn","x":130,"y":40,"w":90,"h":75,"text":"40%","action":{"up":"backlight {'state':'on','brightness':103}"}}
{"id":12,"obj":"btn","x":20,"y":122,"w":90,"h":75,"text":"70%","action":{"up":"backlight {'state':'on','brightness':179}"}}
{"id":13,"obj":"btn","x":130,"y":122,"w":90,"h":75,"text":"100%","action":{"up":"backlight {'state':'on','brightness':255}"}}
{"id":14,"obj":"btn","x":20,"y":205,"w":200,"h":75,"text":"Off","action":{"up":"backlight {'state':'off'}"}}
{"page":6,"comment":"Moodlight"}
{"id":1,"obj":"label","x":5,"y":5,"w":230,"h":25,"text":"Moodlight","align":"center"}
{"id":10,"obj":"btn","x":20,"y":40,"w":90,"h":75,"text":"Red","action":{"up":"moodlight {'state':'on','brightness':255,'color':'red'}","hold":"moodlight {'state':'on','brightness':255,'color':'maroon'}"}}
{"id":11,"obj":"btn","x":20,"y":122,"w":90,"h":75,"text":"Green","action":{"up":"moodlight {'state':'on','brightness':255,'color':'green'}","hold":"moodlight {'state':'on','brightness':255,'color':'lime'}"}}
{"id":12,"obj":"btn","x":20,"y":205,"w":90,"h":75,"text":"Blue","action":{"up":"moodlight {'state':'on','brightness':255,'color':'blue'}","hold":"moodlight {'state':'on','brightness':255,'color':'cyan'}"}}
{"id":13,"obj":"btn","x":130,"y":40,"w":90,"h":75,"text":"Yellow","action":{"up":"moodlight {'state':'on','brightness':255,'color':'yellow'}","hold":"moodlight {'state':'on','brightness':255,'color':'orange'}"}}
{"id":14,"obj":"btn","x":130,"y":122,"w":90,"h":75,"text":"Purple","action":{"up":"moodlight {'state':'on','brightness':255,'color':'purple'}","hold":"moodlight {'state':'on','brightness':255,'color':'magenta'}"}}
{"id":15,"obj":"btn","x":130,"y":205,"w":90,"h":75,"text":"Off","action":{"up":"moodlight {'state':'off'}","hold":"moodlight {'state':'on','brightness':255,'color':'white'}"}}
{"page":0,"comment":"Page Navigation"}
{"id":1,"obj":"btn","action":"prev","x":0,"y":290,"w":79,"h":32,"bg_color":"#2C3E50","text":"\uE141","text_color":"#FFFFFF","radius":0,"border_side":0,"text_font":28}
{"id":2,"obj":"btn","action":"p1","x":80,"y":290,"w":80,"h":32,"bg_color":"#2C3E50","text":"\uE2DC","text_color":"#FFFFFF","radius":0,"border_side":0,"text_font":22}
{"id":3,"obj":"btn","action":"next","x":161,"y":290,"w":79,"h":32,"bg_color":"#2C3E50","text":"\uE142","text_color":"#FFFFFF","radius":0,"border_side":0,"text_font":28}
{"id":6,"obj":"obj","swipe":1,"x":0,"y":0,"h":30,"w":240,"opacity":0,"comment":"swipe-area-at-top"}

1
data/pages/pages.jsonl Normal file
View File

@ -0,0 +1 @@
{"page":1,"id":10,"w":240,"obj":"label","text":"%hostname%"}

162
data/pt_BR.json Normal file
View File

@ -0,0 +1,162 @@
{
"en": {
"language": "Portuguese-Brazil",
"home": {
"title": "Menu Principal",
"btn": "Menu Principal",
"nav": "Início"
},
"save": "Guardar Configuração",
"user": "Usuário",
"pass": "Senha",
"hasp": {
"title": "Design do HASP",
"btn": "Design do HASP",
"theme": "Tema da IU",
"color1": "Cor principal",
"color2": "Cor secundária",
"pages": "Layout inicial",
"font": "Fonte padrão",
"startpage": "Startup Page",
"startdim": "Startup Dim"
},
"screenshot": {
"title": "Screenshot",
"btn": "Screenshot",
"nav": "Screenshot",
"prev": "Página Anterior",
"next": "Página Seguinte",
"refresh": "Atualizar"
},
"info": {
"title": "Informação",
"btn": "Informação",
"nav": "Informação"
},
"config": {
"title": "Configuração",
"btn": "Configuração",
"nav": "Configuração"
},
"ota": {
"title": "Atualização do firmware",
"btn": "Atualização do firmware",
"nav": "Firmware",
"submit": "Atualizar o firmware",
"file": "Arquivo de Firmware",
"url": "URL de Firmware",
"redirect": "Seguir redirecionamentos",
"never": "Nunca",
"strict": "Estrito",
"always": "Sempre"
},
"editor": {
"title": "Editor de ficheiros",
"btn": "Editor de ficheiros",
"nav": "Editor de ficheiros"
},
"reset": {
"title": "Repor configuração de fábrica",
"btn": "Repor configuração de fábrica",
"warning": "Aviso",
"message": "Este processo irá redefinir todas as configurações para os valores padrão. O flash interno será apagado e o dispositivo será reiniciado. Talvez seja necessário conectar-se ao WiFi AP exibido no painel para reconfigurar o dispositivo antes de acessá-lo novamente.",
"fileloss": "TODOS OS ARQUIVOS SERÃO PERDIDOS!"
},
"reboot": {
"title": "Reiniciando...",
"btn": "Reiniciar",
"nav": "Reiniciar",
"message": "Este dispositivo está reiniciando."
},
"about": {
"credits": "Com base no trabalho anterior dos seguintes desenvolvedores de código aberto:",
"copyright": "Direitos autorais ",
"rights": "Todos os direitos reservados.",
"clause1": "Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files(the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and / or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:",
"clause2": "The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.",
"clause3": "THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.",
"mit": "Licença MIT",
"bsd": "Licença BSD",
"freebsd": "Licença FreeBSD",
"apache2": "Licença Apache2"
},
"wifi": {
"title": "Configurar Wifi",
"btn": "Configurar Wifi",
"ssid": "SSID"
},
"wg": {
"title": "WireGuard Settings",
"btn": "WireGuard Settings",
"vpnip": "VPN IP",
"privkey": "Private Key",
"host": "Remote IP",
"port": "Remote Port",
"pubkey": "Remote Public Key"
},
"mqtt": {
"title": "Configurar MQTT",
"btn": "Configurar MQTT",
"name": "Nome do host",
"group": "Nome do Grupo",
"host": "Broker",
"port": "Porta",
"node_t": "Tópico do Node",
"group_t": "Tópico do Grupo",
"broadcast_t": "Tópico do Broadcast",
"hass_t": "Tópico HA LWT"
},
"http": {
"title": "Configurar HTTP",
"btn": "Configurar HTTP"
},
"ftp": {
"title": "Configurar FTP",
"btn": "Configurar FTP",
"port": "Porta FTP",
"pasv": "Porta Passiva"
},
"gui": {
"title": "Configurar Tela",
"btn": "Configurar Tela",
"antiburn": "Anti-queimadura",
"calibrate": "Calibrar"
},
"gpio": "Configurar GPIO",
"debug": {
"title": "Configurar debug",
"btn": "Configurar debug",
"baud": "Baudrate",
"tele": "Período Tele",
"ansi": "Usar códigos ANSI",
"host": "Servidor Syslog",
"port": "Porta Syslog",
"ietf": "IETF (RFC 5424)",
"bsd": "BSD (RFC 3164)",
"log": "Facility"
},
"time": {
"title": "Configurar hora",
"btn": "Configurar hora",
"region": "Região",
"zone": "Fuso horário",
"tz": "Fuso horário",
"ntp": "Servidores NTP"
},
"region": {
"etc": "Etcetera ",
"continents": "Continentes ",
"af": "África ",
"as": "Ásia ",
"au": "Austrália ",
"aq": "Antarctica ",
"eu": "Europa ",
"na": "América do Norte ",
"sa": "América do Sul ",
"islands": "Ilhas ",
"at": "Oceano Atlântico ",
"in": "Oceano Índico ",
"pa": "Oceano Pacífico "
}
}
}

162
data/pt_PT.json Normal file
View File

@ -0,0 +1,162 @@
{
"en": {
"language": "Português",
"home": {
"title": "Menu Principal",
"btn": "Menu Principal",
"nav": "Início"
},
"save": "Guardar Configuração",
"user": "Utilizador",
"pass": "Palavra-passe",
"hasp": {
"title": "Design do HASP",
"btn": "Design do HASP",
"theme": "Tema da IU",
"color1": "Cor Principal",
"color2": "Cor secundária",
"pages": "Layout inicial",
"font": "Fonte padrão",
"startpage": "Startup Page",
"startdim": "Startup Dim"
},
"screenshot": {
"title": "Screenshot",
"btn": "Screenshot",
"nav": "Screenshot",
"prev": "Página Anterior",
"next": "Página Seguinte",
"refresh": "Atualizar"
},
"info": {
"title": "Informação",
"btn": "Informação",
"nav": "Informação"
},
"config": {
"title": "Configuração",
"btn": "Configuração",
"nav": "Configuração"
},
"ota": {
"title": "Atualização do firmware",
"btn": "Atualização do firmware",
"nav": "Firmware",
"submit": "Atualizar o firmware",
"file": "Arquivo de Firmware",
"url": "URL do Firmware",
"redirect": "Seguir Redirecionamentos",
"never": "Nunca",
"strict": "Estrito",
"always": "Sempre"
},
"editor": {
"title": "Editor de ficheiros",
"btn": "Editor de ficheiros",
"nav": "Editor de ficheiros"
},
"reset": {
"title": "Repor configuração de fábrica",
"btn": "Repor configuração de fábrica",
"warning": "Aviso",
"message": "Este processo irá redefinir todas as configurações para os valores padrão. O flash interno será apagado e o dispositivo será reiniciado. Talvez seja necessário conectar-se ao WiFi AP exibido no painel para reconfigurar o dispositivo antes de acessá-lo novamente.",
"fileloss": "TODOS OS ARQUIVOS SERÃO PERDIDOS!"
},
"reboot": {
"title": "Reiniciando...",
"btn": "Reiniciar",
"nav": "Reiniciar",
"message": "O dispositivo está reiniciando."
},
"about": {
"credits": "Baseado no trabalho anterior dos seguintes desenvolvedores de código aberto:",
"copyright": "Copyright ",
"rights": "Todos os direitos reservados.",
"clause1": "Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files(the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and / or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:",
"clause2": "The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.",
"clause3": "THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.",
"mit": "Licença MIT",
"bsd": "Licença BSD",
"freebsd": "Licença FreeBSD",
"apache2": "Licença Apache2"
},
"wifi": {
"title": "Configurar Wifi",
"btn": "Configurar Wifi",
"ssid": "SSID"
},
"wg": {
"title": "WireGuard Settings",
"btn": "WireGuard Settings",
"vpnip": "VPN IP",
"privkey": "Private Key",
"host": "Remote IP",
"port": "Remote Port",
"pubkey": "Remote Public Key"
},
"mqtt": {
"title": "Configurar MQTT",
"btn": "Configurar MQTT",
"name": "Nome do host",
"group": "Nome do Grupo",
"host": "Broker",
"port": "Porta",
"node_t": "Tópico do Node",
"group_t": "Tópico de Grupo",
"broadcast_t": "Tópico do Broadcast",
"hass_t": "Tópico HA LWT"
},
"http": {
"title": "Configurar HTTP",
"btn": "Configurar HTTP"
},
"ftp": {
"title": "Configurar FTP",
"btn": "Configurar FTP",
"port": "Porta de FTP",
"pasv": "Porta Passiva"
},
"gui": {
"title": "Configurar tela",
"btn": "Configurar tela",
"antiburn": "Anti-queimaduras",
"calibrate": "Calibrar"
},
"gpio": "Configurar MQTT",
"debug": {
"title": "Configurar debug",
"btn": "Configurar debug",
"baud": "Baudrate",
"tele": "Período Tele",
"ansi": "Usar códigos ANSI",
"host": "Servidor Syslog",
"port": "Porta Syslog",
"ietf": "IETF (RFC 5424)",
"bsd": "BSD (RFC 3164)",
"log": "Facility"
},
"time": {
"title": "Configurar Hora",
"btn": "Configurar Hora",
"region": "Região",
"zone": "Fuso horário",
"tz": "Fuso horário",
"ntp": "Servidores NTP"
},
"region": {
"etc": "Etcetera ",
"continents": "Continentes ",
"af": "África ",
"as": "Ásia ",
"au": "Austrália ",
"aq": "Antarctica ",
"eu": "Europa ",
"na": "América do Norte ",
"sa": "América do Sul ",
"islands": "Ilhas ",
"at": "Oceano Atlântico ",
"in": "Oceano Índico ",
"pa": "Oceano Pacífico "
}
}
}

162
data/ro_RO.json Normal file
View File

@ -0,0 +1,162 @@
{
"en": {
"language": "Română",
"home": {
"title": "Meniu principal",
"btn": "Meniu principal",
"nav": "Acasă"
},
"save": "Salvarea setărilor",
"user": "Nume utilizator",
"pass": "Parola",
"hasp": {
"title": "Desenul ecranului",
"btn": "Desenul ecranului",
"theme": "Tema UI",
"color1": "Culoare primară",
"color2": "Culoare secundară",
"pages": "Layout inițial",
"font": "Font implicit",
"startpage": "Pagină inițială",
"startdim": "Luminozitatea"
},
"screenshot": {
"title": "Captură de ecran",
"btn": "Captură de ecran",
"nav": "Captură de ecran",
"prev": "Pagina anterioară",
"next": "Pagina următoare",
"refresh": "Reîmprospătare"
},
"info": {
"title": "Informații",
"btn": "Informații",
"nav": "Informații"
},
"config": {
"title": "Setări",
"btn": "Setări",
"nav": "Setări"
},
"ota": {
"title": "Actualizare Firmware",
"btn": "Actualizare Firmware",
"nav": "Firmware",
"submit": "Actualizarea firmware-ului",
"file": "Fișier firmware",
"url": "URL firmware",
"redirect": "Redirecționări",
"never": "Niciodată",
"strict": "Strict",
"always": "Mereu"
},
"editor": {
"title": "Browser de fișiere",
"btn": "Browser de fișiere",
"nav": "Browser de fișiere"
},
"reset": {
"title": "Resetare la parametri de fabrică",
"btn": "Resetare la parametri de fabrică",
"warning": "Avertizare",
"message": "Acest proces va reseta toate setările la valorile implicite. Flash intern va fi șters și dispozitivul este repornit. Este posibil să fie necesar să vă conectați la WiFi AP afișat pe panou pentru a reconfigura dispozitivul înainte de a-l accesa din nou.",
"fileloss": "TOATE FIȘIERELE VOR FI PIERDE!"
},
"reboot": {
"title": "Repornire...",
"btn": "Repornire",
"nav": "Repornire",
"message": "Dispozitivul se repornire."
},
"about": {
"credits": "Pe baza lucrărilor anterioare ale următorilor dezvoltatori open source:",
"copyright": "Drepturi de autor ",
"rights": "Toate drepturile rezervate.",
"clause1": "Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files(the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and / or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:",
"clause2": "The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.",
"clause3": "THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.",
"mit": "Licență MIT",
"bsd": "Licență BSD",
"freebsd": "Licență FreeBSD",
"apache2": "Licență Apache2"
},
"wifi": {
"title": "Setări WiFi",
"btn": "Setări WiFi",
"ssid": "SSID"
},
"wg": {
"title": "WireGuard Settings",
"btn": "WireGuard Settings",
"vpnip": "VPN IP",
"privkey": "Private Key",
"host": "Remote IP",
"port": "Remote Port",
"pubkey": "Remote Public Key"
},
"mqtt": {
"title": "Setări MQTT",
"btn": "Setări MQTT",
"name": "Nume gazdă",
"group": "Nume grup",
"host": "Broker",
"port": "Poartă",
"node_t": "Subiect nod",
"group_t": "Subiect Grup",
"broadcast_t": "Subiect difuzare",
"hass_t": "Subiect HA LWT"
},
"http": {
"title": "Setări HTTP",
"btn": "Setări HTTP"
},
"ftp": {
"title": "Setări FTP",
"btn": "Setări FTP",
"port": "Port FTP",
"pasv": "Port Pasiv"
},
"gui": {
"title": "Setări ecran",
"btn": "Setări ecran",
"antiburn": "Anti-arsuri",
"calibrate": "Calibrare"
},
"gpio": "Setări GPIO",
"debug": {
"title": "Setări Depanare",
"btn": "Setări Depanare",
"baud": "Baudrate",
"tele": "Perioada Tele",
"ansi": "Utilizează codurile ANSI",
"host": "Server Syslog",
"port": "Poartă Syslog",
"ietf": "IETF (RFC 5424)",
"bsd": "BSD (RFC 3164)",
"log": "Facilitate"
},
"time": {
"title": "Setări de timp",
"btn": "Setări de timp",
"region": "Regiune",
"zone": "Fus orar",
"tz": "Fus orar",
"ntp": "Servere NTP"
},
"region": {
"etc": "Etcetera ",
"continents": "Continente ",
"af": "Africa ",
"as": "Asia ",
"au": "Australia ",
"aq": "Antarctica ",
"eu": "Europa ",
"na": "America de Nord ",
"sa": "America de Sud ",
"islands": "Insulele ",
"at": "Oceanul Atlantic ",
"in": "Oceanul Indian ",
"pa": "Oceanul Pacific "
}
}
}

162
data/ru_RU.json Normal file
View File

@ -0,0 +1,162 @@
{
"en": {
"language": "Русский",
"home": {
"title": "Главное меню",
"btn": "Главное меню",
"nav": "Домой"
},
"save": "Сохранить настройки",
"user": "Имя пользователя",
"pass": "Пароль",
"hasp": {
"title": "Оформление",
"btn": "Настройка оформления",
"theme": "Тема интерфейса",
"color1": "Основной цвет",
"color2": "Вторичный цвет",
"pages": "Начальный макет",
"font": "Шрифт по умолчанию",
"startpage": "Стартовая страница",
"startdim": "Ярокость при запуске"
},
"screenshot": {
"title": "Скриншот",
"btn": "Скриншот",
"nav": "Скиншот",
"prev": "Предыдущая страница",
"next": "Следующая страница",
"refresh": "Обновить"
},
"info": {
"title": "Информация",
"btn": "Информация",
"nav": "Информация"
},
"config": {
"title": "Настройки",
"btn": "Настройки",
"nav": "Настройки"
},
"ota": {
"title": "Обновление прошивки",
"btn": "Обновление прошивки",
"nav": "Прошивка",
"submit": "Обновление прошивки",
"file": "Файл прошивки",
"url": "URL прошивки",
"redirect": "Разрешить редиректы",
"never": "Никогда",
"strict": "Строго",
"always": "Всегда"
},
"editor": {
"title": "Редактор файлов",
"btn": "Редактор файлов",
"nav": "Редактор файлов"
},
"reset": {
"title": "Сброс на заводские настройки",
"btn": "Сброс на заводские настройки",
"warning": "Предупреждение",
"message": "Этот процесс вернет все настройки к значениям по умолчанию. Внутренняя флэш-память будет очищена и устройство перезапустится. Возможно, вам придется подключиться к точке доступа Wi-Fi, отображаемой на панели, чтобы перенастроить устройство перед повторным доступом к нему.",
"fileloss": "ВСЕ ФАЙЛЫ БУДУТ ПОТЕРЯНЫ!"
},
"reboot": {
"title": "Перезагрузка...",
"btn": "Перезагрузка",
"nav": "Перезагрузка",
"message": "Устройство перезагружается."
},
"about": {
"credits": "Based on the previous work of the following open source developers:",
"copyright": "Copyright ",
"rights": "All rights reserved.",
"clause1": "Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files(the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and / or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:",
"clause2": "The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.",
"clause3": "THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.",
"mit": "Лицензия MIT",
"bsd": "Лицезия BSD",
"freebsd": "Лицензия FreeBSD",
"apache2": "Лицензия Apache2"
},
"wifi": {
"title": "Настройка WiFi",
"btn": "Настройка WiFi",
"ssid": "SSID"
},
"wg": {
"title": "Настройки WireGuard",
"btn": "Настройки WireGuard",
"vpnip": "VPN IP",
"privkey": "Private Key",
"host": "Remote IP",
"port": "Remote Port",
"pubkey": "Remote Public Key"
},
"mqtt": {
"title": "Настройки MQTT",
"btn": "Настройки MQTT",
"name": "Имя хоста",
"group": "Имя группы",
"host": "Брокер",
"port": "Порт",
"node_t": "Node Topic",
"group_t": "Group Topic",
"broadcast_t": "Broadcast Topic",
"hass_t": "HA LWT Topic"
},
"http": {
"title": "Настройки HTTP",
"btn": "Настройки HTTP"
},
"ftp": {
"title": "Настройки FTP",
"btn": "Настройкаи FTP",
"port": "FTP порт",
"pasv": "Пароль"
},
"gui": {
"title": "Настройки экрана",
"btn": "Настройки экрана",
"antiburn": "Прдеотвращение выгорания",
"calibrate": "Калибровка"
},
"gpio": "Настройки GPIO",
"debug": {
"title": "Настройки отладки",
"btn": "Настройки отладки",
"baud": "Baudrate",
"tele": "Tele период",
"ansi": "Использовать кодировку ANSI",
"host": "Сервер Syslog",
"port": "Порт Syslog",
"ietf": "IETF (RFC 5424)",
"bsd": "BSD (RFC 3164)",
"log": "Объект"
},
"time": {
"title": "Настройки времени",
"btn": "Настройки времени",
"region": "Регион",
"zone": "Часовой пояс",
"tz": "Часовой пояс",
"ntp": "Сервер NTP"
},
"region": {
"etc": "Прочие ",
"continents": "Континент ",
"af": "Африка ",
"as": "Азия ",
"au": "Австралия ",
"aq": "Антарктика ",
"eu": "Европа ",
"na": "Северная Америка ",
"sa": "Южна Америка ",
"islands": "Острова ",
"at": "Атлантический океан ",
"in": "Индийский океан ",
"pa": "Тихий океан "
}
}
}

File diff suppressed because one or more lines are too long

Binary file not shown.

Binary file not shown.

BIN
data/static/hasp.htm.gz Normal file

Binary file not shown.

BIN
data/static/logo.svg.gz Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -1 +1,607 @@
:root{--star: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="-10 -6 16 16"><line y1="-3" y2="3" stroke="red" transform="rotate(15)"></line><line y1="-3" y2="3" stroke="red" transform="rotate(75)"></line><line y1="-3" y2="3" stroke="red" transform="rotate(-45)"></line></svg>');--trash: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" id="mdi-trash-can-outline" width="24" height="24" viewBox="0 0 24 24"><path d="M9,3V4H4V6H5V19A2,2 0 0,0 7,21H17A2,2 0 0,0 19,19V6H20V4H15V3H9M7,6H17V19H7V6M9,8V17H11V8H9M13,8V17H15V8H13Z" /></svg>')}a.foot:link,a.foot:visited{color: var(--footfg)}input:not([type=file]){background-color: var(--fldbg);color: var(--fldfg)}input[type=checkbox],input[type=radio]{width: 1em}input[type=color]{width: 30%;padding: 5px}select{background-color: var(--fldbg);color: var(--fldfg)}input:invalid{border: 1px solid var(--fldred)}body{font-family: verdana;margin: auto;background: var(--bg);color: var(--txt)}.c,body{text-align: center}.clear{clear: both}.foot{background-color: transparent!important;all: revert;float: right;margin: 0;font-size: .6em}#doc>a.red,button.red{background-color: var(--btnred)}#doc>a.red:focus,#doc>a.red:hover,button.red:focus,button.red:hover{background-color: var(--btnredhi)}#doc{text-align: left;margin: 0 auto;display: inline-block;color: var(--txt);width: 80%;min-width: 300px;max-width: 600px;display: table}td{font-size: .87rem;padding-bottom: 0;padding-top: 0}th{padding-top: .5em}*{box-sizing: border-box}input,select,textarea{width: 100%;padding: 12px;border: 1px solid #ccc;border-radius: .6rem;resize: vertical}label{padding: 12px 18px 12px 0;display: inline-block}.required{background-image: var(--star);background-size: 1.5em 1.5em;background-position: right;background-repeat: no-repeat}.edit:before{content: "\0000a0"}.edit{background-image: var(--edit);background-size: 1.5em 1.5em;background-position: left;background-repeat: no-repeat;width: 1.5em;display: inline-block;text-decoration: none}.trash:before{content: "\0000a0"}.trash{background-image: var(--trash);background-size: 1.5em 1.5em;background-position: left;background-repeat: no-repeat;width: 1.5em;display: inline-block;text-decoration: none}#doc>a,.dist>a,button,input[type=submit]{padding: 12px;border: 1px solid var(--btnbrd);border-radius: .6rem;background-color: var(--btnbg);color: var(--btnfg);font-size: 1rem;width: 100%;margin: 12px 0;display: flex;align-items: center;justify-content: center;text-align: center;text-decoration: none}#doc>a:hover,.dist>a:hover,button:hover,input[type=submit]:hover{background-color: var(--btnbghi)}.container{background-color: var(--grpbg);color: var(--grpfg);border-radius: .6rem;padding: 10px;margin: 20px 0}.dist{display: flex;justify-content: space-between;width: 100%}.dist>a{flex-grow: 1;margin: 0 6px}.dist>a:first-child{margin-left: 0}.dist>a:last-child{margin-right: 0}.col-25{float: left;width: 25%;text-align: right;margin: 0}.col-75{margin: 0;float: left;width: 75%}.row:after{content: "";display: table;clear: both}.row{font-size: .833rem;margin: 5px}.gap,.row:last-of-type{margin: 5px 5px 20px}.error,.info,.success,.validation,.warning{border: 1px solid;margin: 10px auto;padding: 15px 10px 15px 50px;background-repeat: no-repeat;background-position: 10px center;max-width: 500px}.info{color: #00529B;background-color: #BDE5F8}.success{color: #4F8A10;background-color: #DFF2BF}.warning{color: #9F6000;background-color: #FEEFB3}.error{color: #D8000C;background-color: #FFD2D2}@media screen and (max-width:800px){.col-25,.col-75,input[type=submit]{width: 100%;margin-top: 0}.col-25{text-align: left}label{padding: 5px 18px 5px 0}}
/* Icons SVG files */
:root {
--info: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" id="mdi-information-outline" viewBox="0 0 24 24"><path d="M11,9H13V7H11M12,20C7.59,20 4,16.41 4,12C4,7.59 7.59,4 12,4C16.41,4 20,7.59 20,12C20,16.41 16.41,20 12,20M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2M11,17H13V11H11V17Z" /></svg>');
--home: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" id="mdi-home-outline" viewBox="0 0 24 24"><path d="M12 5.69L17 10.19V18H15V12H9V18H7V10.19L12 5.69M12 3L2 12H5V20H11V14H13V20H19V12H22" /></svg>');
--shot: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" id="mdi-camera-outline" viewBox="0 0 24 24"><path d="M20,4H16.83L15,2H9L7.17,4H4A2,2 0 0,0 2,6V18A2,2 0 0,0 4,20H20A2,2 0 0,0 22,18V6A2,2 0 0,0 20,4M20,18H4V6H8.05L9.88,4H14.12L15.95,6H20V18M12,7A5,5 0 0,0 7,12A5,5 0 0,0 12,17A5,5 0 0,0 17,12A5,5 0 0,0 12,7M12,15A3,3 0 0,1 9,12A3,3 0 0,1 12,9A3,3 0 0,1 15,12A3,3 0 0,1 12,15Z" /></svg>');
--ota: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" id="mdi-cpu-32-bit" viewBox="0 0 24 24"><path d="M9,3V5H7A2,2 0 0,0 5,7V9H3V11H5V13H3V15H5V17A2,2 0 0,0 7,19H9V21H11V19H13V21H15V19H17A2,2 0 0,0 19,17V15H21V13H19V11H21V9H19V7A2,2 0 0,0 17,5H15V3H13V5H11V3M7,9H10.5A1,1 0 0,1 11.5,10V14A1,1 0 0,1 10.5,15H7V13.5H10V12.75H8.5V11.25H10V10.5H7M12.5,9H16A1,1 0 0,1 17,10V11.75A1,1 0 0,1 16,12.75H14V13.5H17V15H12.5V12.25A1,1 0 0,1 13.5,11.25H15.5V10.5H12.5" /></svg>');
--browse: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" id="mdi-file-edit-outline" viewBox="0 0 24 24"><path d="M10 20H6V4H13V9H18V12.1L20 10.1V8L14 2H6C4.9 2 4 2.9 4 4V20C4 21.1 4.9 22 6 22H10V20M20.2 13C20.3 13 20.5 13.1 20.6 13.2L21.9 14.5C22.1 14.7 22.1 15.1 21.9 15.3L20.9 16.3L18.8 14.2L19.8 13.2C19.9 13.1 20 13 20.2 13M20.2 16.9L14.1 23H12V20.9L18.1 14.8L20.2 16.9Z" /></svg>');
--cog: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" id="mdi-cog-outline" viewBox="0 0 24 24"><path d="M12,8A4,4 0 0,1 16,12A4,4 0 0,1 12,16A4,4 0 0,1 8,12A4,4 0 0,1 12,8M12,10A2,2 0 0,0 10,12A2,2 0 0,0 12,14A2,2 0 0,0 14,12A2,2 0 0,0 12,10M10,22C9.75,22 9.54,21.82 9.5,21.58L9.13,18.93C8.5,18.68 7.96,18.34 7.44,17.94L4.95,18.95C4.73,19.03 4.46,18.95 4.34,18.73L2.34,15.27C2.21,15.05 2.27,14.78 2.46,14.63L4.57,12.97L4.5,12L4.57,11L2.46,9.37C2.27,9.22 2.21,8.95 2.34,8.73L4.34,5.27C4.46,5.05 4.73,4.96 4.95,5.05L7.44,6.05C7.96,5.66 8.5,5.32 9.13,5.07L9.5,2.42C9.54,2.18 9.75,2 10,2H14C14.25,2 14.46,2.18 14.5,2.42L14.87,5.07C15.5,5.32 16.04,5.66 16.56,6.05L19.05,5.05C19.27,4.96 19.54,5.05 19.66,5.27L21.66,8.73C21.79,8.95 21.73,9.22 21.54,9.37L19.43,11L19.5,12L19.43,13L21.54,14.63C21.73,14.78 21.79,15.05 21.66,15.27L19.66,18.73C19.54,18.95 19.27,19.04 19.05,18.95L16.56,17.95C16.04,18.34 15.5,18.68 14.87,18.93L14.5,21.58C14.46,21.82 14.25,22 14,22H10M11.25,4L10.88,6.61C9.68,6.86 8.62,7.5 7.85,8.39L5.44,7.35L4.69,8.65L6.8,10.2C6.4,11.37 6.4,12.64 6.8,13.8L4.68,15.36L5.43,16.66L7.86,15.62C8.63,16.5 9.68,17.14 10.87,17.38L11.24,20H12.76L13.13,17.39C14.32,17.14 15.37,16.5 16.14,15.62L18.57,16.66L19.32,15.36L17.2,13.81C17.6,12.64 17.6,11.37 17.2,10.2L19.31,8.65L18.56,7.35L16.15,8.39C15.38,7.5 14.32,6.86 13.12,6.62L12.75,4H11.25Z" /></svg>');
--star: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="-10 -6 16 16"><line y1="-3" y2="3" stroke="red" transform="rotate(15)"></line><line y1="-3" y2="3" stroke="red" transform="rotate(75)"></line><line y1="-3" y2="3" stroke="red" transform="rotate(-45)"></line></svg>');
--trash: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" id="mdi-trash-can-outline" width="24" height="24" viewBox="0 0 24 24"><path d="M9,3V4H4V6H5V19A2,2 0 0,0 7,21H17A2,2 0 0,0 19,19V6H20V4H15V3H9M7,6H17V19H7V6M9,8V17H11V8H9M13,8V17H15V8H13Z" /></svg>');
--download: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" id="mdi-download" width="24" height="24" viewBox="0 0 24 24"><path d="M5,20H19V18H5M19,9H15V3H9V9H5L12,16L19,9Z" /></svg>');
--upload: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" id="mdi-file-upload-outline" viewBox="0 0 24 24"><path d="M14,2L20,8V20A2,2 0 0,1 18,22H6A2,2 0 0,1 4,20V4A2,2 0 0,1 6,2H14M18,20V9H13V4H6V20H18M12,12L16,16H13.5V19H10.5V16H8L12,12Z" /></svg>');
--flash: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" id="mdi-chip" viewBox="0 0 24 24"><path d="M6,4H18V5H21V7H18V9H21V11H18V13H21V15H18V17H21V19H18V20H6V19H3V17H6V15H3V13H6V11H3V9H6V7H3V5H6V4M11,15V18H12V15H11M13,15V18H14V15H13M15,15V18H16V15H15Z" /></svg>');
--file: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" id="mdi-file-outline" viewBox="0 0 24 24"><path d="M14,2H6A2,2 0 0,0 4,4V20A2,2 0 0,0 6,22H18A2,2 0 0,0 20,20V8L14,2M18,20H6V4H13V9H18V20Z" /></svg>');
--dir: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" id="mdi-folder-outline" viewBox="0 0 24 24"><path d="M20,18H4V8H20M20,6H12L10,4H4C2.89,4 2,4.89 2,6V18A2,2 0 0,0 4,20H20A2,2 0 0,0 22,18V8C22,6.89 21.1,6 20,6Z" /></svg>');
--diropen: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" id="mdi-folder-open-outline" viewBox="0 0 24 24"><path d="M6.1,10L4,18V8H21A2,2 0 0,0 19,6H12L10,4H4A2,2 0 0,0 2,6V18A2,2 0 0,0 4,20H19C19.9,20 20.7,19.4 20.9,18.5L23.2,10H6.1M19,18H6L7.6,12H20.6L19,18Z" /></svg>');
--html: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" id="mdi-code-tags" viewBox="0 0 24 24"><path d="M14.6,16.6L19.2,12L14.6,7.4L16,6L22,12L16,18L14.6,16.6M9.4,16.6L4.8,12L9.4,7.4L8,6L2,12L8,18L9.4,16.6Z" /></svg>');
--image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" id="mdi-file-image-outline" viewBox="0 0 24 24"><path d="M14,2L20,8V20A2,2 0 0,1 18,22H6A2,2 0 0,1 4,20V4A2,2 0 0,1 6,2H14M18,20V9H13V4H6V20H18M17,13V19H7L12,14L14,16M10,10.5A1.5,1.5 0 0,1 8.5,12A1.5,1.5 0 0,1 7,10.5A1.5,1.5 0 0,1 8.5,9A1.5,1.5 0 0,1 10,10.5Z" /></svg>');
--zip: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" id="mdi-file-cabinet" viewBox="0 0 24 24"><path d="M14,8H10V6H14V8M20,4V20C20,21.11 19.11,22 18,22H6C4.89,22 4,21.11 4,20V4A2,2 0 0,1 6,2H18C19.11,2 20,2.9 20,4M18,13H6V20H18V13M18,4H6V11H18V4M14,15H10V17H14V15Z" /></svg>');
--cmd: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" id="mdi-application-outline" viewBox="0 0 24 24"><path d="M21 2H3C1.9 2 1 2.9 1 4V20C1 21.1 1.9 22 3 22H21C22.1 22 23 21.1 23 20V4C23 2.9 22.1 2 21 2M21 20H3V6H21V20Z" /></svg>');
--css: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" id="mdi-script-outline" viewBox="0 0 24 24"><path d="M15,20A1,1 0 0,0 16,19V4H8A1,1 0 0,0 7,5V16H5V5A3,3 0 0,1 8,2H19A3,3 0 0,1 22,5V6H20V5A1,1 0 0,0 19,4A1,1 0 0,0 18,5V9L18,19A3,3 0 0,1 15,22H5A3,3 0 0,1 2,19V18H13A2,2 0 0,0 15,20Z" /></svg>');
--ttf: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" id="mdi-format-text" viewBox="0 0 24 24"><path d="M18.5,4L19.66,8.35L18.7,8.61C18.25,7.74 17.79,6.87 17.26,6.43C16.73,6 16.11,6 15.5,6H13V16.5C13,17 13,17.5 13.33,17.75C13.67,18 14.33,18 15,18V19H9V18C9.67,18 10.33,18 10.67,17.75C11,17.5 11,17 11,16.5V6H8.5C7.89,6 7.27,6 6.74,6.43C6.21,6.87 5.75,7.74 5.3,8.61L4.34,8.35L5.5,4H18.5Z" /></svg>');
--eye: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" id="mdi-eye-outline" viewBox="0 0 24 24"><path d="M12,9A3,3 0 0,1 15,12A3,3 0 0,1 12,15A3,3 0 0,1 9,12A3,3 0 0,1 12,9M12,4.5C17,4.5 21.27,7.61 23,12C21.27,16.39 17,19.5 12,19.5C7,19.5 2.73,16.39 1,12C2.73,7.61 7,4.5 12,4.5M3.18,12C4.83,15.36 8.24,17.5 12,17.5C15.76,17.5 19.17,15.36 20.82,12C19.17,8.64 15.76,6.5 12,6.5C8.24,6.5 4.83,8.64 3.18,12Z" /></svg>');
--json: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" id="mdi-code-braces" viewBox="0 0 24 24"><path d="M8,3A2,2 0 0,0 6,5V9A2,2 0 0,1 4,11H3V13H4A2,2 0 0,1 6,15V19A2,2 0 0,0 8,21H10V19H8V14A2,2 0 0,0 6,12A2,2 0 0,0 8,10V5H10V3M16,3A2,2 0 0,1 18,5V9A2,2 0 0,0 20,11H21V13H20A2,2 0 0,0 18,15V19A2,2 0 0,1 16,21H14V19H16V14A2,2 0 0,1 18,12A2,2 0 0,1 16,10V5H14V3H16Z" /></svg>');
--audio: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" id="mdi-file-music-outline" viewBox="0 0 24 24"><path d="M14,2L20,8V20A2,2 0 0,1 18,22H6A2,2 0 0,1 4,20V4A2,2 0 0,1 6,2H14M18,20V9H13V4H6V20H18M13,10V12H11V17A2,2 0 0,1 9,19A2,2 0 0,1 7,17A2,2 0 0,1 9,15C9.4,15 9.7,15.1 10,15.3V10H13Z" /></svg>');
}
.fn:hover {
text-decoration: underline;
}
.fi {
display: inline-block;
vertical-align: middle;
width: 1.1rem;
height: 1.25rem;
mask-size: auto;
mask-repeat: no-repeat;
mask-position: center;
-webkit-mask-size: auto;
-webkit-mask-repeat: no-repeat;
-webkit-mask-position: center;
background-color: var(--txt);
}
.fa {
display: block;
text-indent: -9999px;
width: clamp(2rem, 7.5vw, 5rem);
height: 2rem;
mask-size: auto;
mask-repeat: no-repeat;
mask-position: center;
-webkit-mask-size: auto;
-webkit-mask-repeat: no-repeat;
-webkit-mask-position: center;
background-color: var(--clr-primary-400);
transition: 0.5s;
padding: 1rem;
margin-top: 0.5rem;
margin-bottom: 0.5rem;
}
.fa-browse { mask-image: var(--browse); -webkit-mask-image: var(--browse)}
.fa-cog { mask-image: var(--cog); -webkit-mask-image: var(--cog)}
.fa-download{ mask-image: var(--download); -webkit-mask-image: var(--download)}
.fa-upload { mask-image: var(--upload); -webkit-mask-image: var(--upload)}
.fa-home { mask-image: var(--home); -webkit-mask-image: var(--home)}
.fa-info { mask-image: var(--info); -webkit-mask-image: var(--info)}
.fa-ota { mask-image: var(--ota); -webkit-mask-image: var(--ota)}
.fa-shot { mask-image: var(--shot); -webkit-mask-image: var(--shot)}
.fa-star { mask-image: var(--star); -webkit-mask-image: var(--star)}
.fa-trash { mask-image: var(--trash); -webkit-mask-image: var(--trask)}
.fa-flash { mask-image: var(--flash); -webkit-mask-image: var(--flash)}
.fa-file { mask-image: var(--file); -webkit-mask-image: var(--file)}
.fa-dir { mask-image: var(--dir); -webkit-mask-image: var(--dir)}
.fa-diropen { mask-image: var(--diropen); -webkit-mask-image: var(--diropen)}
.fa-eye { mask-image: var(--eye); -webkit-mask-image: var(--eye)}
.fa-zip { mask-image: var(--zip); -webkit-mask-image: var(--zip)}
.fa-css { mask-image: var(--css); -webkit-mask-image: var(--css)}
.fa-cmd { mask-image: var(--cmd); -webkit-mask-image: var(--cmd)}
.fa-json { mask-image: var(--json); -webkit-mask-image: var(--json)}
.fa-jsonl { mask-image: var(--json); -webkit-mask-image: var(--json)}
.fa-image { mask-image: var(--image); -webkit-mask-image: var(--image)}
.fa-audio { mask-image: var(--audio); -webkit-mask-image: var(--audio)}
.fa-html { mask-image: var(--html); -webkit-mask-image: var(--html)}
.fa-ttf { mask-image: var(--ttf); -webkit-mask-image: var(--ttf)}
.nav-list {
font-size: var(--fs-nav);
padding: 0;
display: flex;
justify-content: space-evenly;
gap: clamp(1.5rem, 10vw, var(--size-500));
width: clamp(275px, 80vw, 600px);
}
.nav-list a {
position: relative;
display: flex;
justify-content: space-evenly;
align-items: center;
flex-direction: column;
text-decoration: none;
color: var(--clr-primary-400);
}
.nav-list a:hover,
.nav-list a:focus-visible {
color: var(--clr-accent-400);
}
.nav-list a .text {
position: absolute;
letter-spacing: -0.05rem;
font-size: var(--fs-500);
font-weight: var(--fw-semi-bold);
white-space: nowrap;
opacity: 0;
transition: 0.5s;
transform: translateY(0.5rem);
}
.nav-list a:hover .text,
.nav-list a:focus-visible .text {
opacity: 1;
transform: translateY(1rem);
}
.nav-list a:hover .fa,
.nav-list a:focus-visible .fa {
background-color: var(--clr-accent-400);
transform: translateY(-0.5rem);
}
/* Box sizing rules */
*,
*::before,
*::after {
box-sizing: border-box;
}
/* Set default margin */
* {
margin: 0px;
padding: 0px;
}
p {
margin: 1em 0px;
}
/* Main Style */
body {
font-family: 'Inter', sans-serif;
line-height: 1.5;
height: 100%;
background: var(--bg);
color: var(--txt)
}
a {
text-decoration: none;
}
a[href],
input[type='submit'],
label[for],
select,
button,
.pointer {
cursor: pointer;
}
/* Message Fields */
.error,
.info,
.success,
.validation,
.warning {
border: 1px solid;
margin: 1rem auto;
padding: 2rem 1rem 1rem 3rem;
background-repeat: no-repeat;
background-position: 10px center;
max-width: 500px
}
.info { color: #00529B; background-color: #BDE5F8 }
.success{ color: #4F8A10; background-color: #DFF2BF }
.warning{ color: #9F6000; background-color: #FEEFB3 }
.error { color: #D8000C; background-color: #FFD2D2 }
.left { float: left }
.right { float: right }
.bold { font-weight: bold }
/* Main Page */
#doc {
text-align: left;
margin: 0 auto;
/* display: inline-block;
display: table; */
color: var(--txt);
width: 80%;
min-width: 300px;
max-width: 600px;
}
#doc>a,
.dist>a,
#doc button,
#doc input[type=submit] {
/* padding: 12px; */
height: 3rem;
border: 1px solid var(--btnbrd);
border-radius: .6rem;
background-color: var(--btnbg);
color: var(--btnfg);
font-size: 1rem;
width: 100%;
margin: 12px 0;
display: flex;
align-items: center;
justify-content: center;
text-align: center;
text-decoration: none
}
#doc>a:hover,
.dist>a:hover,
#doc button:hover,
#doc input[type=submit]:hover {
background-color: var(--btnbghi)
}
#doc input:not([type=file]) {
background-color: var(--fldbg);
color: var(--fldfg)
}
#doc input[type=checkbox],
#doc input[type=radio] {
width: 1rem;
height: 1rem;
margin: 0.25rem
}
#doc input[type=color] {
width: 30%;
padding: 5px
}
#doc input:invalid {
border: 1px solid var(--fldred)
}
#doc select {
background-color: var(--fldbg);
color: var(--fldfg)
}
.c {
text-align: center
}
#doc>a.red,
#doc button.red {
background-color: var(--btnred)
}
#doc>a.red:focus,
#doc>a.red:hover,
#doc button.red:focus,
#doc button.red:hover {
background-color: var(--btnredhi)
}
#doc td {
padding-bottom: 0;
padding-top: 0
}
#doc th {
padding-top: .5rem
}
#doc input,
#doc select,
#doc textarea {
width: 100%;
padding: 1rem;
border: 1px solid #ccc;
border-radius: .6rem;
resize: vertical
}
#doc select {
appearance: none;
background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2.7' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
background-repeat: no-repeat;
background-position: right .8rem center;
background-size: 1rem
}
#doc label {
padding-right: 18px;
padding-left: .25rem;
display: inline-block
}
#bmp {
max-width: 100%;
height: auto;
}
.required {
background-image: var(--star);
background-position: right;
background-repeat: no-repeat;
background-size: 1.5rem 1.5rem;
}
.icon {
background-size: 1.25rem 1.25rem;
background-position: left;
background-repeat: no-repeat;
width: 1.5rem;
display: inline-block;
text-decoration: none
}
.icon:before{content: "\0000a0"}
.edit{background-image: var(--browse)}
.trash{background-image: var(--trash)}
/* Forms */
.container {
background-color: var(--grpbg);
color: var(--grpfg);
border-radius: .6rem;
padding: 10px;
margin: 20px 0
}
.dist {
display: flex;
justify-content: space-between;
width: 100%;
margin: 1rem 0
}
.dist>a {
flex-grow: 1;
margin: 0 6px
}
.dist>a:first-child {
margin-left: 0
}
.dist>a:last-child {
margin-right: 0
}
.row:after {
content: "";
display: table;
clear: both
}
.row {
/* font-size: .833rem; */
margin: 5px
}
.gap,
.row:last-of-type {
margin-bottom: 1rem
}
.col-25 {
/* float: left;
width: 25%; */
text-align: left;
}
/* .col-75 {
float: left;
width: 75%
} */
#doc label,
#doc legend {
padding: 5px 18px 5px 0;
}
#doc fieldset {
display: contents
}
[v-cloak] > * { display:none }
/* [v-cloak]::before { content: "Loading…"; margin: auto; } */
@media screen and (min-width:800px) {
.row {
display:flex;
align-items:center
}
.col-25,
.col-75
{
float: left;
width: 75%;
margin-top: 0
}
.col-25 {
width: 25%;
text-align: right
}
}
/*
@media screen and (max-width:800px) {
// #doc input[type=submit],
.col-25,
.col-75
{
width: 100%;
margin-top: 0
}
.col-25 {
text-align: left
}
#doc label {
padding: 5px 18px 5px 0
}
}
*/
/* ********** Page Footer ********** */
.foot {
background-color: transparent !important;
all: revert;
float: right;
margin: 0;
font-size: .6rem
}
a.foot:link,
a.foot:visited {
color: var(--footfg)
}
.clear {
clear: both
}
/* ********** File Editor ********** */
.container__editor {
/* display: none; */
display: flex;
/* Misc */
border: 0;
width: 100vw;
height: 100vh;
background-color: var(--bg);
}
.container__left {
/* Initially, the left takes 3/4 width */
width: 10rem;
min-width: 6rem;
max-width: 20rem;
/* Misc */
/* align-items: center; */
display: flex;
justify-content: left;
overflow-x: clip;
overflow-y: scroll;
background-color: var(--treebg);
/* Popout */
top: 0;
bottom: 0;
left: 0;
right: clamp(10rem, 15vw, 80rem);
z-index: 10;
/* position: absolute; */
/* visibility: hidden; */
}
.resizer {
background-color: #d5dbe2;
cursor: ew-resize;
height: 100%;
width: 5px;
}
.container__right {
/* Take the remaining width */
flex: 1;
flex-direction: column;
/* Misc */
align-items: center;
display: flex;
background-color: #888;
}
.toolbar {
text-align: center;
width: 100%;
padding: 0.5rem;
color: var(--btnfg);
background-color: var(--toolbg)
}
.container__bottom {
/* Take the remaining width */
flex: 1;
/* Misc */
align-items: center;
display: flex;
justify-content: center;
top: 0;
bottom: 0;
width: 100%;
/* background-color: bisque; */
}
#sizeList {
width: 4rem;
}
#ctx {
display: none;
top: 10px;
left: 50px;
position: absolute;
background: #fff;
z-index: 10;
padding: 0.75rem;
border-radius: 0.5rem;
box-shadow: 0 0.5rem 0.75rem rgba(0,0,0,0.25);
}
#ctx > ul {
padding-left: 0px;
}
#ctx > ul > li {
white-space: nowrap
}
#ctx > ul > li:hover {
background: #ccc;
}
#fontsize, #page {
width: 3rem
}
#preview {
padding: 0.3rem;
overflow: scroll;
}
#preview > img {
max-width:100%;
max-height:100%;
height: 100%;
margin: auto;
display: block
}
#download-frame,
#preview {
display:none;
}
#tree {
width: 100%;
line-height: 1.3rem;
font-size: 0.95rem;
}
.download{background-image: var(--download)}
.upload{background-image: var(--upload)}
.eye{background-image: var(--eye)}
.flash{background-image: var(--flash)}
.file{background-image: var(--file)}
.zip{background-image: var(--zip)}
.css{background-image: var(--css)}
.cmd{background-image: var(--cmd)}
.json{background-image: var(--json)}
.jsonl{background-image: var(--json)}
.image{background-image: var(--image)}
.audio{background-image: var(--audio)}
.html{background-image: var(--html)}
.dir{background-image: var(--dir)}
.diropen{background-image: var(--diropen)}
#toast {
position: fixed;
bottom: 1rem;
right: 1.5rem;
display: grid;
align-items: end;
align-content: end;
gap: 1rem;
}
.toast {
font-size: 1rem;
margin: 0;
font-weight: bold;
line-height: 1;
padding: 0.5em 1em;
background-color: lightblue;
animation: toastIt 3000ms cubic-bezier(0.785, 0.135, 0.15, 0.86) forwards;
}
@keyframes toastIt {
0%,
100% {
transform: translateY(150%);
opacity: 0;
}
10%,
90% {
transform: translateY(0);
opacity: 1;
}
}

Binary file not shown.

162
data/sv_SE.json Normal file
View File

@ -0,0 +1,162 @@
{
"en": {
"language": "Svenska",
"home": {
"title": "Huvudmeny",
"btn": "Huvudmeny",
"nav": "Hem"
},
"save": "Spara Inställningar",
"user": "Användarnamn",
"pass": "Lösenord",
"hasp": {
"title": "HASP Design",
"btn": "HASP Design",
"theme": "UI Tema",
"color1": "Primärfärg",
"color2": "Sekundärfärg",
"pages": "Starta Layout",
"font": "Standardtypsnitt",
"startpage": "Startsida",
"startdim": "Startljusstyrka"
},
"screenshot": {
"title": "Skärmbild",
"btn": "Skärmbild",
"nav": "Skärmbild",
"prev": "Föregående Sida",
"next": "Nästa Sida",
"refresh": "Uppdatera"
},
"info": {
"title": "Information",
"btn": "Information",
"nav": "Information"
},
"config": {
"title": "Inställningar",
"btn": "Konfiguration",
"nav": "Inställningar"
},
"ota": {
"title": "Firmware-uppdatering",
"btn": "Firmware-uppdatering",
"nav": "Firmware",
"submit": "Uppdatera Firmware",
"file": "Firmware-fil",
"url": "Firmware URL",
"redirect": "Följ omdirigeringar",
"never": "Aldrig",
"strict": "Strikt",
"always": "Alltid"
},
"editor": {
"title": "Filredigerare",
"btn": "Filredigerare",
"nav": "Filredigerare"
},
"reset": {
"title": "Fabriksåterställning",
"btn": "Fabriksåterställning",
"warning": "Varning",
"message": "Denna process kommer att återställa alla inställningar till standardvärden. Det interna minnet kommer att raderas och enheten startas om. Du kan behöva ansluta till WiFi AP som visas på panelen för att konfigurera om enheten innan du öppnar den igen.",
"fileloss": "ALLA FILLER KOMMER ATT FÖRLORAS!"
},
"reboot": {
"title": "Startar om...",
"btn": "Omstart",
"nav": "Omstart",
"message": "Enheten startar om."
},
"about": {
"credits": "Baserat på det tidigare arbetet av följande utvecklare av öppen källkod:",
"copyright": "Copyright ",
"rights": "Alla rättigheter förbehållna.",
"clause1": "Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files(the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and / or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:",
"clause2": "The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.",
"clause3": "THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.",
"mit": "MIT Licens",
"bsd": "BSD Licens",
"freebsd": "FreeBSD Licens",
"apache2": "Apache2 Licens"
},
"wifi": {
"title": "Inställningar för WiFi",
"btn": "Inställningar för WiFi",
"ssid": "SSID"
},
"wg": {
"title": "Inställningar för WireGuard",
"btn": "Inställningar för WireGuard",
"vpnip": "VPN IP-adress",
"privkey": "Privat nyckel",
"host": "Fjärr-IP",
"port": "Fjärrport",
"pubkey": "Publik fjärrnyckel"
},
"mqtt": {
"title": "MQTT Inställningar",
"btn": "MQTT Inställningar",
"name": "Servernamn",
"group": "Gruppnamn",
"host": "Broker",
"port": "Port",
"node_t": "Nod topic",
"group_t": "Grupp topic",
"broadcast_t": "Broadcast topic",
"hass_t": "HA LWT topic"
},
"http": {
"title": "HTTP Inställningar",
"btn": "HTTP Inställningar"
},
"ftp": {
"title": "FTP Inställningar",
"btn": "FTP Inställningar",
"port": "FTP Port",
"pasv": "Passiv port"
},
"gui": {
"title": "Bildskärmsinställningar",
"btn": "Bildskärmsinställningar",
"antiburn": "Antiburn",
"calibrate": "Kalibrera"
},
"gpio": "GPIO Inställningar",
"debug": {
"title": "Debug Inställningar",
"btn": "Debug Inställningar",
"baud": "Datahastighet",
"tele": "Telemetri period",
"ansi": "Använd ANSI-kod",
"host": "Syslog server",
"port": "Syslog port",
"ietf": "IETF (RFC 5424)",
"bsd": "BSD (RFC 3164)",
"log": "Facilitet"
},
"time": {
"title": "Tidsinställningar",
"btn": "Tidsinställningar",
"region": "Region",
"zone": "Tidszon",
"tz": "Tidszon",
"ntp": "NTP-servrar"
},
"region": {
"etc": "Etcetera ",
"continents": "Kontinenter ",
"af": "Afrika ",
"as": "Asien ",
"au": "Australien ",
"aq": "Antarktis",
"eu": "Europa ",
"na": "Nordamerika ",
"sa": "Sydamerika ",
"islands": "Öar ",
"at": "Atlanten ",
"in": "Indiska oceanen ",
"pa": "Stilla havet "
}
}
}

162
data/zh_CN.json Normal file
View File

@ -0,0 +1,162 @@
{
"en": {
"language": "中文(简体)",
"home": {
"title": "主菜单",
"btn": "主菜单",
"nav": "首页"
},
"save": "保存设置",
"user": "用户名",
"pass": "密码",
"hasp": {
"title": "HASP 设计",
"btn": "HASP 设计",
"theme": "界面主题",
"color1": "主颜色",
"color2": "副颜色",
"pages": "开始布局",
"font": "默认字体",
"startpage": "开机页面",
"startdim": "开机亮度"
},
"screenshot": {
"title": "截屏",
"btn": "截屏",
"nav": "截屏",
"prev": "上一页",
"next": "下一页",
"refresh": "刷新页面"
},
"info": {
"title": "信息",
"btn": "信息",
"nav": "信息"
},
"config": {
"title": "配置",
"btn": "配置",
"nav": "配置"
},
"ota": {
"title": "固件更新",
"btn": "固件更新",
"nav": "固件",
"submit": "更新固件",
"file": "固件文件",
"url": "固件网址",
"redirect": "跟随重定向",
"never": "从不",
"strict": "严格",
"always": "总是"
},
"editor": {
"title": "文件编辑器",
"btn": "文件编辑器",
"nav": "文件编辑器"
},
"reset": {
"title": "出厂重置",
"btn": "出厂重置",
"warning": "警告",
"message": "此过程会将所有设置重置为默认值。 内部闪存将被擦除,设备将重新启动。 您可能需要连接到面板上显示的 WiFi AP 以重新配置设备,然后才能再次访问它。",
"fileloss": "所有文件都会被删除!"
},
"reboot": {
"title": "重启中...",
"btn": "重启",
"nav": "重启",
"message": "设备正在重启。"
},
"about": {
"credits": "基于以下开源开发者的先前工作:",
"copyright": "版权 ",
"rights": "版权所有。",
"clause1": "Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files(the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and / or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:",
"clause2": "The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.",
"clause3": "THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.",
"mit": "MIT 许可证",
"bsd": "BSD 许可证",
"freebsd": "FreeBSD 许可证",
"apache2": "Apache2 许可证"
},
"wifi": {
"title": "Wifi 设置",
"btn": "Wifi 设置",
"ssid": "SSID"
},
"wg": {
"title": "WireGuard 设置",
"btn": "WireGuard 设置",
"vpnip": "VPN IP",
"privkey": "专用密钥",
"host": "远程IP",
"port": "删除",
"pubkey": "远程公钥"
},
"mqtt": {
"title": "MQTT 设置",
"btn": "MQTT 设置",
"name": "主机名",
"group": "组名",
"host": "MQTT 经纪人",
"port": "端口",
"node_t": "设备主题",
"group_t": "群组主题",
"broadcast_t": "广播主题",
"hass_t": "HA LWT 主题"
},
"http": {
"title": "HTTP 设置",
"btn": "HTTP 设置"
},
"ftp": {
"title": "FTP设置",
"btn": "FTP设置",
"port": "FTP 端口",
"pasv": "被动端口"
},
"gui": {
"title": "屏幕设置",
"btn": "屏幕设置",
"antiburn": "防烧",
"calibrate": "校准"
},
"gpio": "GPIO 设置",
"debug": {
"title": "调试设置",
"btn": "调试设置",
"baud": "波特率",
"tele": "远程时期",
"ansi": "使用 ANSI 代码",
"host": "Syslog 服务器",
"port": "Syslog端口",
"ietf": "IETF (RFC 5424)",
"bsd": "BSD (RFC 3164)",
"log": "Facility"
},
"time": {
"title": "时间设置",
"btn": "时间设置",
"region": "区域",
"zone": "时区",
"tz": "时区",
"ntp": "NTP 服务器"
},
"region": {
"etc": "等等 ",
"continents": "大洲数 ",
"af": "非洲 ",
"as": "亚洲 ",
"au": "澳大利亚 ",
"aq": "南极洲 ",
"eu": "欧洲 ",
"na": "北美洲 ",
"sa": "南美洲 ",
"islands": "群岛 ",
"at": "大西洋 ",
"in": "印度洋 ",
"pa": "太平洋 "
}
}
}

View File

@ -1,3 +1,4 @@
#if USE_MONITOR
#include <unistd.h>
#define SDL_MAIN_HANDLED /*To fix SDL's "undefined reference to WinMain" issue*/
#include <SDL2/SDL.h>
@ -53,3 +54,4 @@ void hal_loop(void)
// lv_task_handler();
// }
}
#endif

View File

@ -1,4 +1,4 @@
/* MIT License - Copyright (c) 2019-2022 Francis Van Roie
/* MIT License - Copyright (c) 2019-2024 Francis Van Roie
For full license information read the LICENSE file in the project folder */
/* This file is used during the build of the paho library */

View File

@ -1,4 +1,4 @@
/* MIT License - Copyright (c) 2019-2022 Francis Van Roie
/* MIT License - Copyright (c) 2019-2024 Francis Van Roie
For full license information read the LICENSE file in the project folder */
#ifndef WIFISPI_H

183
include/ftstdlib.h Normal file
View File

@ -0,0 +1,183 @@
/****************************************************************************
*
* ftstdlib.h
*
* ANSI-specific library and header configuration file (specification
* only).
*
* Copyright (C) 2002-2020 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
* modified, and distributed under the terms of the FreeType project
* license, LICENSE.TXT. By continuing to use, modify, or distribute
* this file you indicate that you have read the license and
* understand and accept it fully.
*
*/
/**************************************************************************
*
* This file is used to group all `#includes` to the ANSI~C library that
* FreeType normally requires. It also defines macros to rename the
* standard functions within the FreeType source code.
*
* Load a file which defines `FTSTDLIB_H_` before this one to override it.
*
*/
#ifndef FTSTDLIB_H_
#define FTSTDLIB_H_
#include <stddef.h>
#include "hasp_mem.h"
typedef void hasp_FILE;
extern hasp_FILE * lv_ft_fopen(const char * filename, const char * mode );
extern int lv_ft_fclose(hasp_FILE * stream);
extern size_t lv_ft_fread(void * ptr, size_t size, size_t count, hasp_FILE * stream);
extern int lv_ft_fseek(hasp_FILE * stream, long int offset, int origin );
extern int lv_ft_ftell(hasp_FILE * stream);
#define ft_ptrdiff_t ptrdiff_t
/**************************************************************************
*
* integer limits
*
* `UINT_MAX` and `ULONG_MAX` are used to automatically compute the size of
* `int` and `long` in bytes at compile-time. So far, this works for all
* platforms the library has been tested on.
*
* Note that on the extremely rare platforms that do not provide integer
* types that are _exactly_ 16 and 32~bits wide (e.g., some old Crays where
* `int` is 36~bits), we do not make any guarantee about the correct
* behaviour of FreeType~2 with all fonts.
*
* In these cases, `ftconfig.h` will refuse to compile anyway with a
* message like 'couldn't find 32-bit type' or something similar.
*
*/
#include <limits.h>
#define FT_CHAR_BIT CHAR_BIT
#define FT_USHORT_MAX USHRT_MAX
#define FT_INT_MAX INT_MAX
#define FT_INT_MIN INT_MIN
#define FT_UINT_MAX UINT_MAX
#define FT_LONG_MIN LONG_MIN
#define FT_LONG_MAX LONG_MAX
#define FT_ULONG_MAX ULONG_MAX
/**************************************************************************
*
* character and string processing
*
*/
#include <string.h>
#define ft_memchr memchr
#define ft_memcmp memcmp
#define ft_memcpy memcpy
#define ft_memmove memmove
#define ft_memset memset
#define ft_strcat strcat
#define ft_strcmp strcmp
#define ft_strcpy strcpy
#define ft_strlen strlen
#define ft_strncmp strncmp
#define ft_strncpy strncpy
#define ft_strrchr strrchr
#define ft_strstr strstr
/**************************************************************************
*
* file handling
*
*/
#include <stdio.h>
#define FT_FILE hasp_FILE
#define ft_fclose lv_ft_fclose
#define ft_fopen lv_ft_fopen
#define ft_fread lv_ft_fread
#define ft_fseek lv_ft_fseek
#define ft_ftell lv_ft_ftell
#define ft_sprintf sprintf
/**************************************************************************
*
* sorting
*
*/
#include <stdlib.h>
#define ft_qsort qsort
/**************************************************************************
*
* memory allocation
*
*/
#define ft_scalloc hasp_calloc
#define ft_sfree hasp_free
#define ft_smalloc hasp_malloc
#define ft_srealloc hasp_realloc
/**************************************************************************
*
* miscellaneous
*
*/
#define ft_strtol strtol
#define ft_getenv getenv
/**************************************************************************
*
* execution control
*
*/
#include <setjmp.h>
#define ft_jmp_buf jmp_buf /* note: this cannot be a typedef since */
/* `jmp_buf` is defined as a macro */
/* on certain platforms */
#define ft_longjmp longjmp
#define ft_setjmp( b ) setjmp( *(ft_jmp_buf*) &(b) ) /* same thing here */
/* The following is only used for debugging purposes, i.e., if */
/* `FT_DEBUG_LEVEL_ERROR` or `FT_DEBUG_LEVEL_TRACE` are defined. */
#include <stdarg.h>
#endif /* FTSTDLIB_H_ */
/* END */

View File

@ -1,9 +1,13 @@
/* MIT License - Copyright (c) 2019-2022 Francis Van Roie
/* MIT License - Copyright (c) 2019-2024 Francis Van Roie
For full license information read the LICENSE file in the project folder */
#ifndef HASP_CONF_H
#define HASP_CONF_H
#if HASP_TARGET_ARDUINO
#include "Arduino.h"
#endif
#ifdef USE_CONFIG_OVERRIDE
#include "user_config_override.h"
#endif
@ -33,6 +37,11 @@
#define HASP_USE_APP 1
/* Validate that build target was specified */
#if HASP_TARGET_ARDUINO + HASP_TARGET_PC != 1
#error "Build target invalid! Set *one* of: HASP_TARGET_ARDUINO, HASP_TARGET_PC"
#endif
#ifndef HASP_USE_DEBUG
#define HASP_USE_DEBUG 1
#endif
@ -58,13 +67,21 @@
#endif
#ifndef HASP_USE_HTTP_UPDATE
#define HASP_USE_HTTP_UPDATE (HASP_HAS_NETWORK)
#define HASP_USE_HTTP_UPDATE (HASP_HAS_NETWORK) // Adds 10kB
#endif
#ifndef HASP_USE_MQTT
#define HASP_USE_MQTT (HASP_HAS_NETWORK)
#endif
#ifndef HASP_USE_MQTT_ASYNC
#define HASP_USE_MQTT_ASYNC (HASP_TARGET_PC)
#endif
#ifndef HASP_USE_WIREGUARD
#define HASP_USE_WIREGUARD 0
#endif
#ifndef HASP_USE_BROADCAST
#define HASP_USE_BROADCAST 1
#endif
@ -186,6 +203,46 @@
#define HASP_OBJECT_NOTATION "p%ub%u"
#ifndef HASP_ATTRIBUTE_FAST_MEM
#define HASP_ATTRIBUTE_FAST_MEM
#endif
#ifndef IRAM_ATTR
#define IRAM_ATTR
#endif
#if !defined(FPSTR)
#define FPSTR(pstr_pointer) (reinterpret_cast<const __FlashStringHelper*>(pstr_pointer))
#endif
#if !defined(PGM_P)
#define PGM_P const char*
#endif
/* Workarounds for PC build */
#if HASP_TARGET_PC
#ifndef __FlashStringHelper
typedef char __FlashStringHelper;
#endif
#if defined(__cplusplus) && !defined(String)
#include <iostream>
using String = std::string;
#endif
#ifndef F
#define F(x) (x)
#endif
#ifndef PSTR
#define PSTR(x) x
#endif
#ifndef PROGMEM
#define PROGMEM
#endif
#endif
/* Includes */
#ifdef WINDOWS
#include "winsock2.h"
@ -232,10 +289,19 @@ static WiFiSpiClass WiFi;
#endif
#endif // HASP_USE_WIFI
#if HASP_USE_WIREGUARD > 0
#include "sys/net/hasp_wireguard.h"
#endif
#if HASP_USE_ETHERNET > 0
#if defined(ARDUINO_ARCH_ESP32)
#include <ETH.h>
#include "sys/net/hasp_ethernet_esp32.h"
#if HASP_USE_ETHSPI > 0
#include <ETHSPI.h>
#warning Using ESP32 Ethernet SPI W5500
#define HASP_ETHERNET ETHSPI
#else
#define ETH_ADDR 0
#define ETH_POWER_PIN -1
#define ETH_MDC_PIN 23
@ -243,9 +309,10 @@ static WiFiSpiClass WiFi;
#define NRST 5
#define ETH_TYPE ETH_PHY_LAN8720
#define ETH_CLKMODE ETH_CLOCK_GPIO17_OUT
#include "sys/net/hasp_ethernet_esp32.h"
#include <ETH.h>
#warning Using ESP32 Ethernet LAN8720
#define HASP_ETHERNET ETH
#endif // HASP_USE_ETHSPI
#else
#if USE_BUILTIN_ETHERNET > 0
@ -267,10 +334,11 @@ static WiFiSpiClass WiFi;
#if HASP_USE_MQTT > 0
#include "mqtt/hasp_mqtt.h"
#if defined(WINDOWS) || defined(POSIX)
#define USE_PAHO
#if HASP_TARGET_PC
#define HASP_USE_PAHO
#else
#define USE_PUBSUBCLIENT
#define HASP_USE_ESP_MQTT
//#define HASP_USE_PUBSUBCLIENT
#endif
#endif
@ -311,52 +379,27 @@ static WiFiSpiClass WiFi;
#include "sys/svc/hasp_slave.h"
#endif
#ifndef HASP_ATTRIBUTE_FAST_MEM
#define HASP_ATTRIBUTE_FAST_MEM
#endif
#ifndef IRAM_ATTR
#define IRAM_ATTR
#endif
#ifndef FPSTR
#define FPSTR(pstr_pointer) (reinterpret_cast<const __FlashStringHelper*>(pstr_pointer))
#endif
#ifndef PGM_P
#define PGM_P const char*
#endif
#if defined(WINDOWS) || defined(POSIX)
#ifndef __FlashStringHelper
#define __FlashStringHelper char
#endif
#ifndef F
#define F(x) (x)
#endif
#ifndef PSTR
#define PSTR(x) x
#endif
#ifndef PROGMEM
#define PROGMEM
#endif
#endif
#if defined(WINDOWS)
#include <Windows.h>
#define delay Sleep
#endif
#if defined(POSIX)
#ifdef USE_MONITOR
#define delay SDL_Delay
#else
#define delay msleep
#endif
#if defined(WINDOWS) || defined(POSIX)
#endif
#if HASP_TARGET_PC
#include <string.h>
#include <strings.h>
#include <stdio.h>
#if USE_MONITOR
#include <SDL2/SDL.h>
#endif
#define snprintf_P snprintf
#define memcpy_P memcpy
@ -365,7 +408,13 @@ static WiFiSpiClass WiFi;
#define strcpy_P strcpy
#define strstr_P strstr
#define halRestartMcu()
#if USE_MONITOR
#define millis SDL_GetTicks
#elif defined(WINDOWS)
#define millis Win32Millis
#elif defined(POSIX)
#define millis PosixMillis
#endif
#define DEC 10
#define HEX 16

View File

@ -1,4 +1,4 @@
/* MIT License - Copyright (c) 2019-2022 Francis Van Roie
/* MIT License - Copyright (c) 2019-2024 Francis Van Roie
For full license information read the LICENSE file in the project folder */
#ifndef HASP_MACRO_H
@ -12,7 +12,15 @@
#include "user_config_override.h"
#endif
#if defined(WINDOWS) || defined(POSIX)
#if HASP_TARGET_PC
#define HASP_RANDOM(x) rand() % x
#elif HASP_TARGET_ARDUINO
#define HASP_RANDOM(x) random(x)
#else
#define HASP_RANDOM(x) random() % x
#endif
#if HASP_TARGET_PC
#define LOG_OUTPUT(x, ...) printf(__VA_ARGS__)
#else

View File

@ -1,4 +1,4 @@
/* MIT License - Copyright (c) 2019-2022 Francis Van Roie
/* MIT License - Copyright (c) 2019-2024 Francis Van Roie
For full license information read the LICENSE file in the project folder */
#ifndef HASP_MEM_H

View File

@ -59,7 +59,7 @@
/* Default display refresh period.
* Can be changed in the display driver (`lv_disp_drv_t`).*/
#define LV_DISP_DEF_REFR_PERIOD 30 /*[ms]*/
#define LV_DISP_DEF_REFR_PERIOD 50 /*[ms]*/
/* Dot Per Inch: used to initialize default sizes.
* E.g. a button with width = LV_DPI / 2 -> half inch wide
@ -80,8 +80,10 @@ typedef int16_t lv_coord_t;
#define LV_FS_SEEK(x, y) lv_fs_seek(x, y)
#define _lv_img_decoder_t _lv_img_decoder
#ifndef LV_MEM_CUSTOM
/* 1: use custom malloc/free, 0: use the built-in `lv_mem_alloc` and `lv_mem_free` */
#define LV_MEM_CUSTOM 0
#endif
#if LV_MEM_CUSTOM == 0
/* Size of the memory used by `lv_mem_alloc` in bytes (>= 2kB)*/
@ -101,19 +103,6 @@ typedef int16_t lv_coord_t;
#endif
#endif // LV_MEM_SIZE
#ifndef LV_VDB_SIZE
#if defined(ARDUINO_ARCH_ESP8266)
# define LV_VDB_SIZE (8 * 1024U) // Minimum 8 Kb
#elif defined(ESP32S2)
# define LV_VDB_SIZE (16 * 1024U) // 16kB draw buffer
#elif defined(ARDUINO_ARCH_ESP32)
# define LV_VDB_SIZE (32 * 1024U) // 32kB draw buffer
#else
# define LV_VDB_SIZE (128 * 1024U) // native app
#endif
#endif // LV_VDB_SIZE
/* Complier prefix for a big array declaration */
# define LV_MEM_ATTR
@ -126,11 +115,25 @@ typedef int16_t lv_coord_t;
/* Automatically defrag. on free. Defrag. means joining the adjacent free cells. */
# define LV_MEM_AUTO_DEFRAG 1
#else /*LV_MEM_CUSTOM*/
# define LV_MEM_CUSTOM_INCLUDE <stdlib.h> /*Header for the dynamic memory function*/
# define LV_MEM_CUSTOM_ALLOC malloc /*Wrapper to malloc*/
# define LV_MEM_CUSTOM_FREE free /*Wrapper to free*/
#define LV_MEM_CUSTOM_INCLUDE <stdlib.h> /*Header for the dynamic memory function*/
#define LV_MEM_CUSTOM_ALLOC hasp_malloc /*Wrapper to malloc*/
#define LV_MEM_CUSTOM_FREE hasp_free /*Wrapper to free*/
#endif /*LV_MEM_CUSTOM*/
#ifndef LV_VDB_SIZE
#if defined(ARDUINO_ARCH_ESP8266)
# define LV_VDB_SIZE (8 * 1024U) // Minimum 8 Kb
#elif defined(CONFIG_IDF_TARGET_ESP32S2)
# define LV_VDB_SIZE (16 * 1024U) // 16kB draw buffer
#elif defined(CONFIG_IDF_TARGET_ESP32S3)
# define LV_VDB_SIZE (48 * 1024U) // 16kB draw buffer
#elif defined(ARDUINO_ARCH_ESP32)
# define LV_VDB_SIZE (32 * 1024U) // 32kB draw buffer
#else
# define LV_VDB_SIZE (128 * 1024U) // native app
#endif
#endif // LV_VDB_SIZE
/* Garbage Collector settings
* Used if lvgl is binded to higher level language and the memory is managed by that language */
#define LV_ENABLE_GC 0
@ -208,10 +211,13 @@ typedef void* lv_group_user_data_t;
#define LV_USE_FILESYSTEM 1
#if LV_USE_FILESYSTEM
/*Declare the type of the user data of file system drivers (can be e.g. `void *`, `int`, `struct`)*/
typedef void* lv_fs_drv_user_data_t;
typedef const char* lv_fs_drv_user_data_t;
/*File system interface*/
#ifndef LV_USE_FS_IF
#define LV_USE_FS_IF !defined(STM32)
#endif
#if LV_USE_FS_IF
# define LV_FS_IF_FATFS '\0'
#if defined(STM32F4xx) // || defined(ARDUINO_ARCH_ESP8266)
@ -223,7 +229,9 @@ typedef void* lv_fs_drv_user_data_t;
//# define LV_FS_IF_SPIFFS '\0' // no internal esp Flash
#endif
#endif /*LV_USE_FS_IF*/
#if HASP_TARGET_ARDUINO && !defined(LV_FS_PC_PATH)
#define LV_FS_PC_PATH "/littlefs"
#endif
#endif
@ -250,7 +258,7 @@ typedef void* lv_fs_drv_user_data_t;
#define LV_IMG_CACHE_DEF_SIZE 1
#endif
#ifndef LV_IMG_CACHE_DEF_SIZE_PSRAM
#define LV_IMG_CACHE_DEF_SIZE_PSRAM 20 // special openHASP setting when PSRAM is used
#define LV_IMG_CACHE_DEF_SIZE_PSRAM 12 // special openHASP setting when PSRAM is used
#endif
/*Declare the type of the user data of image decoder (can be e.g. `void *`, `int`, `struct`)*/
@ -372,84 +380,252 @@ typedef void* lv_indev_drv_user_data_t; /*Type of user data in the in
/*==================
* FONT USAGE
*===================*/
// #if 1 || HASP_USE_FREETYPE<=0
// #if TFT_HEIGHT>=480 && TFT_WIDTH>=480
// #ifndef ROBOTOCONDENSED_REGULAR_24_LATIN1
// #define ROBOTOCONDENSED_REGULAR_24_LATIN1 1
// #endif
// #ifndef ROBOTOCONDENSED_REGULAR_32_LATIN1
// #define ROBOTOCONDENSED_REGULAR_32_LATIN1 1
// #endif
// #if HASP_USE_FREETYPE<=0
// #ifndef ROBOTOCONDENSED_REGULAR_48_LATIN1
// #define ROBOTOCONDENSED_REGULAR_48_LATIN1 1
// #endif
// #ifndef ROBOTOCONDENSED_REGULAR_64_LATIN1
// #define ROBOTOCONDENSED_REGULAR_64_LATIN1 1
// #endif
// #ifndef ROBOTOCONDENSED_REGULAR_16_LATIN1
// #define ROBOTOCONDENSED_REGULAR_16_LATIN1 1
// #endif
// #endif
#if TFT_HEIGHT>=480 || TFT_WIDTH>=480
#ifndef ROBOTOCONDENSED_REGULAR_16_LATIN1
#define ROBOTOCONDENSED_REGULAR_16_LATIN1 1
// #ifndef HASP_FONT_1
// #define HASP_FONT_1 robotocondensed_regular_24_latin1 /* 5% Width */
// #endif
// #ifndef HASP_FONT_2
// #define HASP_FONT_2 robotocondensed_regular_32_latin1 /* 5% Width */
// #endif
// #if HASP_USE_FREETYPE<=0
// #ifndef HASP_FONT_3
// #define HASP_FONT_3 robotocondensed_regular_48_latin1 /* 10% Width */
// #endif
// #ifndef HASP_FONT_4
// #define HASP_FONT_4 robotocondensed_regular_64_latin1 /* 10% Height */
// #endif
// #ifndef HASP_FONT_5
// #define HASP_FONT_5 robotocondensed_regular_16_latin1 /* 5% Width */
// #endif
// #endif
// #ifndef HASP_FONT_SIZE_1
// #define HASP_FONT_SIZE_1 24
// #endif
// #ifndef HASP_FONT_SIZE_2
// #define HASP_FONT_SIZE_2 32
// #endif
// #if HASP_USE_FREETYPE<=0
// #ifndef HASP_FONT_SIZE_3
// #define HASP_FONT_SIZE_3 48
// #endif
// #ifndef HASP_FONT_SIZE_4
// #define HASP_FONT_SIZE_4 64
// #endif
// #ifndef HASP_FONT_SIZE_5
// #define HASP_FONT_SIZE_5 16
// #endif
// #endif
// #elif TFT_HEIGHT>=320 && TFT_WIDTH>=320
// #ifndef ROBOTOCONDENSED_REGULAR_16_LATIN1
// #define ROBOTOCONDENSED_REGULAR_16_LATIN1 1
// #endif
// #ifndef ROBOTOCONDENSED_REGULAR_24_LATIN1
// #define ROBOTOCONDENSED_REGULAR_24_LATIN1 1
// #endif
// #if HASP_USE_FREETYPE<=0
// #ifndef ROBOTOCONDENSED_REGULAR_32_LATIN1
// #define ROBOTOCONDENSED_REGULAR_32_LATIN1 1
// #endif
// #ifndef ROBOTOCONDENSED_REGULAR_48_LATIN1
// #define ROBOTOCONDENSED_REGULAR_48_LATIN1 1
// #endif
// #ifndef ROBOTOCONDENSED_REGULAR_12_LATIN1
// #define ROBOTOCONDENSED_REGULAR_12_LATIN1 1
// #endif
// #endif
// #ifndef HASP_FONT_1
// #define HASP_FONT_1 robotocondensed_regular_16_latin1 /* 5% Width */
// #endif
// #ifndef HASP_FONT_2
// #define HASP_FONT_2 robotocondensed_regular_24_latin1 /* 5% Width */
// #endif
// #if HASP_USE_FREETYPE<=0
// #ifndef HASP_FONT_3
// #define HASP_FONT_3 robotocondensed_regular_32_latin1 /* 10% Width */
// #endif
// #ifndef HASP_FONT_4
// #define HASP_FONT_4 robotocondensed_regular_48_latin1 /* 10% Height */
// #endif
// #ifndef HASP_FONT_5
// #define HASP_FONT_5 robotocondensed_regular_12_latin1 /* 5% Width */
// #endif
// #endif
// #ifndef HASP_FONT_SIZE_1
// #define HASP_FONT_SIZE_1 16
// #endif
// #ifndef HASP_FONT_SIZE_2
// #define HASP_FONT_SIZE_2 24
// #endif
// #if HASP_USE_FREETYPE<=0
// #ifndef HASP_FONT_SIZE_3
// #define HASP_FONT_SIZE_3 32
// #endif
// #ifndef HASP_FONT_SIZE_4
// #define HASP_FONT_SIZE_4 48
// #endif
// #ifndef HASP_FONT_SIZE_5
// #define HASP_FONT_SIZE_5 12
// #endif
// #endif
// #elif TFT_HEIGHT>=272 && TFT_WIDTH>=272
// #ifndef ROBOTOCONDENSED_REGULAR_14_LATIN1
// #define ROBOTOCONDENSED_REGULAR_14_LATIN1 1
// #endif
// #ifndef ROBOTOCONDENSED_REGULAR_18_LATIN1
// #define ROBOTOCONDENSED_REGULAR_18_LATIN1 1
// #endif
// #if HASP_USE_FREETYPE<=0
// #ifndef ROBOTOCONDENSED_REGULAR_28_LATIN1
// #define ROBOTOCONDENSED_REGULAR_28_LATIN1 1
// #endif
// #ifndef ROBOTOCONDENSED_REGULAR_36_LATIN1
// #define ROBOTOCONDENSED_REGULAR_36_LATIN1 1
// #endif
// #ifndef ROBOTOCONDENSED_REGULAR_48_LATIN1
// #define ROBOTOCONDENSED_REGULAR_48_LATIN1 1
// #endif
// #endif
// #ifndef HASP_FONT_1
// #define HASP_FONT_1 robotocondensed_regular_14_latin1 /* 5% Width */
// #endif
// #ifndef HASP_FONT_2
// #define HASP_FONT_2 robotocondensed_regular_18_latin1 /* 5% Width */
// #endif
// #if HASP_USE_FREETYPE<=0
// #ifndef HASP_FONT_3
// #define HASP_FONT_3 robotocondensed_regular_28_latin1 /* 10% Width */
// #endif
// #ifndef HASP_FONT_4
// #define HASP_FONT_4 robotocondensed_regular_36_latin1 /* 10% Height */
// #endif
// #ifndef HASP_FONT_5
// #define HASP_FONT_5 robotocondensed_regular_48_latin1 /* 5% Width */
// #endif
// #endif
// #ifndef HASP_FONT_SIZE_1
// #define HASP_FONT_SIZE_1 14
// #endif
// #ifndef HASP_FONT_SIZE_2
// #define HASP_FONT_SIZE_2 18
// #endif
// #if HASP_USE_FREETYPE<=0
// #ifndef HASP_FONT_SIZE_3
// #define HASP_FONT_SIZE_3 28
// #endif
// #ifndef HASP_FONT_SIZE_4
// #define HASP_FONT_SIZE_4 36
// #endif
// #ifndef HASP_FONT_SIZE_5
// #define HASP_FONT_SIZE_5 48
// #endif
// #endif
// #else // smaller than 272
// #ifndef HASP_FONT_1
// #define HASP_FONT_1 robotocondensed_regular_12_latin1 /* 5% Width */
// #endif
// #ifndef HASP_FONT_2
// #define HASP_FONT_2 robotocondensed_regular_16_latin1 /* 5% Width */
// #endif
// #if HASP_USE_FREETYPE<=0
// #ifndef HASP_FONT_3
// #define HASP_FONT_3 robotocondensed_regular_24_latin1 /* 10% Width */
// #endif
// #ifndef HASP_FONT_4
// #define HASP_FONT_4 robotocondensed_regular_32_latin1 /* 10% Height */
// #endif
// #endif
// #ifndef ROBOTOCONDENSED_REGULAR_12_LATIN1
// #define ROBOTOCONDENSED_REGULAR_12_LATIN1 1
// #endif
// #ifndef ROBOTOCONDENSED_REGULAR_16_LATIN1
// #define ROBOTOCONDENSED_REGULAR_16_LATIN1 1
// #endif
// #if HASP_USE_FREETYPE<=0
// #ifndef ROBOTOCONDENSED_REGULAR_24_LATIN1
// #define ROBOTOCONDENSED_REGULAR_24_LATIN1 1
// #endif
// #ifndef ROBOTOCONDENSED_REGULAR_32_LATIN1
// #define ROBOTOCONDENSED_REGULAR_32_LATIN1 1
// #endif
// #ifndef ROBOTOCONDENSED_REGULAR_48_LATIN1
// #define ROBOTOCONDENSED_REGULAR_48_LATIN1 1
// #endif
// #endif
// #ifndef HASP_FONT_SIZE_1
// #define HASP_FONT_SIZE_1 12
// #endif
// #ifndef HASP_FONT_SIZE_2
// #define HASP_FONT_SIZE_2 16
// #endif
// #if HASP_USE_FREETYPE<=0
// #ifndef HASP_FONT_SIZE_3
// #define HASP_FONT_SIZE_3 24
// #endif
// #ifndef HASP_FONT_SIZE_4
// #define HASP_FONT_SIZE_4 32
// #endif
// #ifndef HASP_FONT_SIZE_5
// #define HASP_FONT_SIZE_5 48
// #endif
// #endif
// #endif
// #endif
#ifndef ROBOTOCONDENSED_REGULAR_12_ALL
#define ROBOTOCONDENSED_REGULAR_12_ALL 1
#endif
#ifndef ROBOTOCONDENSED_REGULAR_24_LATIN1
#define ROBOTOCONDENSED_REGULAR_24_LATIN1 1
#ifndef ROBOTOCONDENSED_REGULAR_16_ALL
#define ROBOTOCONDENSED_REGULAR_16_ALL 1
#endif
#ifndef ROBOTOCONDENSED_REGULAR_32_LATIN1
#define ROBOTOCONDENSED_REGULAR_32_LATIN1 1
#ifndef ROBOTOCONDENSED_REGULAR_24_ALL
#define ROBOTOCONDENSED_REGULAR_24_ALL 1
#endif
#ifndef ROBOTOCONDENSED_REGULAR_48_LATIN1
#define ROBOTOCONDENSED_REGULAR_48_LATIN1 1
#endif
#ifndef ROBOTOCONDENSED_REGULAR_12_LATIN1
#define ROBOTOCONDENSED_REGULAR_12_LATIN1 1
#ifndef ROBOTOCONDENSED_REGULAR_32_ALL
#define ROBOTOCONDENSED_REGULAR_32_ALL 1
#endif
#ifndef HASP_FONT_1
#define HASP_FONT_1 robotocondensed_regular_16_latin1 /* 5% Width */
#define HASP_FONT_1 robotocondensed_regular_12_all
#endif
#ifndef HASP_FONT_2
#define HASP_FONT_2 robotocondensed_regular_24_latin1 /* 5% Width */
#define HASP_FONT_2 robotocondensed_regular_16_all
#endif
#ifndef HASP_FONT_3
#define HASP_FONT_3 robotocondensed_regular_32_latin1 /* 10% Width */
#define HASP_FONT_3 robotocondensed_regular_24_all
#endif
#ifndef HASP_FONT_4
#define HASP_FONT_4 robotocondensed_regular_48_latin1 /* 10% Height */
#endif
#ifndef HASP_FONT_5
#define HASP_FONT_5 robotocondensed_regular_12_latin1 /* 5% Width */
#endif
#ifndef HASP_FONT_SIZE_1
#define HASP_FONT_SIZE_1 16
#endif
#ifndef HASP_FONT_SIZE_2
#define HASP_FONT_SIZE_2 24
#endif
#ifndef HASP_FONT_SIZE_3
#define HASP_FONT_SIZE_3 32
#endif
#ifndef HASP_FONT_SIZE_4
#define HASP_FONT_SIZE_4 48
#endif
#ifndef HASP_FONT_SIZE_5
#define HASP_FONT_SIZE_5 12
#endif
#else // not 320x480
#ifndef HASP_FONT_1
#define HASP_FONT_1 robotocondensed_regular_12_latin1 /* 5% Width */
#endif
#ifndef HASP_FONT_2
#define HASP_FONT_2 robotocondensed_regular_16_latin1 /* 5% Width */
#endif
#ifndef HASP_FONT_3
#define HASP_FONT_3 robotocondensed_regular_24_latin1 /* 10% Width */
#endif
#ifndef HASP_FONT_4
#define HASP_FONT_4 robotocondensed_regular_32_latin1 /* 10% Height */
#endif
#ifndef ROBOTOCONDENSED_REGULAR_12_LATIN1
#define ROBOTOCONDENSED_REGULAR_12_LATIN1 1
#endif
#ifndef ROBOTOCONDENSED_REGULAR_16_LATIN1
#define ROBOTOCONDENSED_REGULAR_16_LATIN1 1
#endif
#ifndef ROBOTOCONDENSED_REGULAR_24_LATIN1
#define ROBOTOCONDENSED_REGULAR_24_LATIN1 1
#endif
#ifndef ROBOTOCONDENSED_REGULAR_32_LATIN1
#define ROBOTOCONDENSED_REGULAR_32_LATIN1 1
#endif
#ifndef ROBOTOCONDENSED_REGULAR_48_LATIN1
#define ROBOTOCONDENSED_REGULAR_48_LATIN1 1
#define HASP_FONT_4 robotocondensed_regular_32_all
#endif
#ifndef HASP_FONT_SIZE_1
@ -463,11 +639,6 @@ typedef void* lv_indev_drv_user_data_t; /*Type of user data in the in
#endif
#ifndef HASP_FONT_SIZE_4
#define HASP_FONT_SIZE_4 32
#endif
#ifndef HASP_FONT_SIZE_5
#define HASP_FONT_SIZE_5 48
#endif
#endif
/* The built-in fonts contains the ASCII range and some Symbols with 4 bit-per-pixel.
@ -555,30 +726,11 @@ typedef void* lv_font_user_data_t;
// #define HASP_FONT_1_base FONT_CONCAT(HASP_FONT_1_size, _)
// #define HASP_FONT_1 FONT_CONCAT(HASP_FONT_1_base, HASP_CHARACTER_SET)
// /* Concatenate the fontname macros */
// #define HASP_FONT_2_size FONT_CONCAT(HASP_FONTNAME, 16)
// #define HASP_FONT_2_base FONT_CONCAT(HASP_FONT_2_size, _)
// #define HASP_FONT_2 FONT_CONCAT(HASP_FONT_2_base, HASP_CHARACTER_SET)
// /* Concatenate the fontname macros */
// #define HASP_FONT_3_size FONT_CONCAT(HASP_FONTNAME, 22)
// #define HASP_FONT_3_base FONT_CONCAT(HASP_FONT_3_size, _)
// #define HASP_FONT_3 FONT_CONCAT(HASP_FONT_3_base, HASP_CHARACTER_SET)
// /* Concatenate the fontname macros */
// #define HASP_FONT_4_size FONT_CONCAT(HASP_FONTNAME, 28)
// #define HASP_FONT_4_base FONT_CONCAT(HASP_FONT_4_size, _)
// #define HASP_FONT_4 FONT_CONCAT(HASP_FONT_4_base, HASP_CHARACTER_SET)
/*Always set a default font from the built-in fonts*/
#if LV_HIGH_RESOURCE_MCU>0
#if 0 && HASP_USE_FREETYPE<=0 // LV_HIGH_RESOURCE_MCU>0
// #define LV_FONT_CUSTOM_DECLARE LV_FONT_DECLARE(lv_font_montserrat_16);
// #define LV_FONT_CUSTOM_12 LV_FONT_DECLARE(robotocondensed_regular_12)
// #define LV_FONT_CUSTOM_16 LV_FONT_DECLARE(robotocondensed_regular_16)
// #define LV_FONT_CUSTOM_22 LV_FONT_DECLARE(robotocondensed_regular_22)
// #define LV_FONT_CUSTOM_28 LV_FONT_DECLARE(robotocondensed_regular_28)
#define LV_FONT_CUSTOM_DECLARE LV_FONT_DECLARE(HASP_FONT_1) \
LV_FONT_DECLARE(HASP_FONT_2) \
LV_FONT_DECLARE(HASP_FONT_3) \
@ -591,10 +743,32 @@ typedef void* lv_font_user_data_t;
#else
#define LV_FONT_CUSTOM_DECLARE LV_FONT_DECLARE(unscii_8_icon);
//#define LV_FONT_CUSTOM_DECLARE LV_FONT_DECLARE(unscii_8_icon);
#define LV_FONT_CUSTOM_DECLARE LV_FONT_DECLARE(HASP_FONT_1) \
LV_FONT_DECLARE(HASP_FONT_2) \
LV_FONT_DECLARE(HASP_FONT_3) \
LV_FONT_DECLARE(HASP_FONT_4) \
#ifndef LV_FONT_DEFAULT
#define LV_FONT_DEFAULT &unscii_8_icon //&lv_font_unscii_8
#if TFT_HEIGHT >= 480 && TFT_WIDTH >= 480
#define LV_FONT_DEFAULT &HASP_FONT_4
#define LV_THEME_DEFAULT_FONT_SMALL &HASP_FONT_3
#elif TFT_HEIGHT >= 320 && TFT_WIDTH >= 320
#define LV_FONT_DEFAULT &HASP_FONT_3
#define LV_THEME_DEFAULT_FONT_SMALL &HASP_FONT_2
#else // smaller than 320
#define LV_FONT_DEFAULT &HASP_FONT_2
#define LV_THEME_DEFAULT_FONT_SMALL &HASP_FONT_1
#endif
#endif // LV_FONT_DEFAULT
#ifndef LV_THEME_DEFAULT_FONT_SMALL
#define LV_THEME_DEFAULT_FONT_SMALL LV_FONT_DEFAULT
#endif
#define LV_THEME_DEFAULT_FONT_NORMAL LV_FONT_DEFAULT
#define LV_THEME_DEFAULT_FONT_SUBTITLE LV_FONT_DEFAULT
#define LV_THEME_DEFAULT_FONT_TITLE LV_FONT_DEFAULT
#endif // LV_HIGH_RESOURCE_MCU
@ -609,17 +783,17 @@ typedef void* lv_font_user_data_t;
#define LV_THEME_DEFAULT_COLOR_PRIMARY LV_COLOR_RED
#define LV_THEME_DEFAULT_COLOR_SECONDARY LV_COLOR_BLUE
#define LV_THEME_DEFAULT_FLAG 0 //LV_THEME_MATERIAL_FLAG_NONE
#if LV_HIGH_RESOURCE_MCU
#define LV_THEME_DEFAULT_FONT_SMALL &HASP_FONT_1 //&lv_font_montserrat_12
#define LV_THEME_DEFAULT_FONT_NORMAL &HASP_FONT_2 //&lv_font_montserrat_16
#define LV_THEME_DEFAULT_FONT_SUBTITLE &HASP_FONT_3 //&lv_font_montserrat_22
#define LV_THEME_DEFAULT_FONT_TITLE &HASP_FONT_4 //&lv_font_montserrat_22 //&lv_font_montserrat_28_compressed
#else
#define LV_THEME_DEFAULT_FONT_SMALL LV_FONT_DEFAULT // &lv_font_montserrat_12
#define LV_THEME_DEFAULT_FONT_NORMAL LV_FONT_DEFAULT // &lv_font_montserrat_16
#define LV_THEME_DEFAULT_FONT_SUBTITLE LV_FONT_DEFAULT // &lv_font_montserrat_22
#define LV_THEME_DEFAULT_FONT_TITLE LV_FONT_DEFAULT // &lv_font_montserrat_28_compressed
#endif
// #if HASP_USE_FREETYPE<=0 //LV_HIGH_RESOURCE_MCU
// #define LV_THEME_DEFAULT_FONT_SMALL &HASP_FONT_1 //&lv_font_montserrat_12
// #define LV_THEME_DEFAULT_FONT_NORMAL &HASP_FONT_2 //&lv_font_montserrat_16
// #define LV_THEME_DEFAULT_FONT_SUBTITLE &HASP_FONT_2 //&lv_font_montserrat_22
// #define LV_THEME_DEFAULT_FONT_TITLE &HASP_FONT_2 //&lv_font_montserrat_22 //&lv_font_montserrat_28_compressed
// #else
// #define LV_THEME_DEFAULT_FONT_SMALL LV_FONT_DEFAULT // &lv_font_montserrat_12
// #define LV_THEME_DEFAULT_FONT_NORMAL LV_FONT_DEFAULT // &lv_font_montserrat_16
// #define LV_THEME_DEFAULT_FONT_SUBTITLE LV_FONT_DEFAULT // &lv_font_montserrat_22
// #define LV_THEME_DEFAULT_FONT_TITLE LV_FONT_DEFAULT // &lv_font_montserrat_28_compressed
// #endif
#define LV_USE_THEME_EMPTY 0
#define LV_USE_THEME_MONO 1
@ -684,12 +858,13 @@ typedef void* lv_font_user_data_t;
/*Declare the type of the user data of object (can be e.g. `void *`, `int`, `struct`)*/
typedef struct {
uint8_t id:8;
uint8_t objid:8;
uint8_t transitionid:4;
uint8_t actionid:4;
uint8_t objid:6;
//uint8_t transitionid:4;
//uint8_t actionid:4;
uint8_t groupid:4;
uint8_t swipeid:4;
void* tag;
// uint8_t swipeid:4;
void* ext;
// char* action;
} lv_obj_user_data_t;
/*1: enable `lv_obj_realaign()` based on `lv_obj_align()` parameters*/

View File

@ -86,8 +86,10 @@ typedef int16_t lv_coord_t;
/* LittelvGL's internal memory manager's settings.
* The graphical objects and other related data are stored here. */
#ifndef LV_MEM_CUSTOM
/* 1: use custom malloc/free, 0: use the built-in `lv_mem_alloc` and `lv_mem_free` */
#define LV_MEM_CUSTOM 0
#endif
#if LV_MEM_CUSTOM == 0
/* Size of the memory used by `lv_mem_alloc` in bytes (>= 2kB)*/
//# define LV_MEM_SIZE (32U * 1024U)
@ -103,8 +105,8 @@ typedef int16_t lv_coord_t;
# define LV_MEM_AUTO_DEFRAG 1
#else /*LV_MEM_CUSTOM*/
# define LV_MEM_CUSTOM_INCLUDE <stdlib.h> /*Header for the dynamic memory function*/
# define LV_MEM_CUSTOM_ALLOC malloc /*Wrapper to malloc*/
# define LV_MEM_CUSTOM_FREE free /*Wrapper to free*/
# define LV_MEM_CUSTOM_ALLOC hasp_malloc /*Wrapper to malloc*/
# define LV_MEM_CUSTOM_FREE hasp_free /*Wrapper to free*/
#endif /*LV_MEM_CUSTOM*/
/* Use the standard memcpy and memset instead of LVGL's own functions.

View File

@ -125,7 +125,11 @@
#define USE_WINDOWS 0
#endif
#if USE_WINDOWS
#ifndef USE_WIN32DRV
#define USE_WINDOWS 0
#endif
#if USE_WINDOWS || USE_WIN32DRV
#define WINDOW_HOR_RES 480
#define WINDOW_VER_RES 320
#endif

View File

@ -1,4 +1,4 @@
/* MIT License - Copyright (c) 2019-2022 Francis Van Roie
/* MIT License - Copyright (c) 2019-2024 Francis Van Roie
For full license information read the LICENSE file in the project folder */
#ifndef LV_SYMBOL_MDI_DEF_H

View File

@ -1,4 +1,4 @@
/* MIT License - Copyright (c) 2019-2022 Francis Van Roie
/* MIT License - Copyright (c) 2019-2024 Francis Van Roie
For full license information read the LICENSE file in the project folder */
/* Include the normal default core configuration */

View File

@ -1,4 +1,4 @@
/* MIT License - Copyright (c) 2019-2022 Francis Van Roie
/* MIT License - Copyright (c) 2019-2024 Francis Van Roie
For full license information read the LICENSE file in the project folder */
/***************************************************
@ -51,6 +51,7 @@
/***************************************************
* Syslog Settings
**************************************************/
#define HASP_USE_SYSLOG 0
#define SYSLOG_SERVER ""
#define SYSLOG_PORT 514
#define APP_NAME "HASP"
@ -76,6 +77,7 @@
// #define HASP_LANGUAGE pt_BR // Brazilian Portuguese
// #define HASP_LANGUAGE pt_PT // Portuguese
// #define HASP_LANGUAGE ro_RO // Romanian
// #define HASP_LANGUAGE de_DE // German
/***************************************************
* Web interface coloring
@ -133,7 +135,7 @@
// #define HASP_FONT_SIZE_4 48
// #define HASP_FONT_SIZE_5 12
#define LV_FONT_DEFAULT &HASP_FONT_1
// #define LV_FONT_DEFAULT &HASP_FONT_1
/***************************************************
* GPIO Settings
@ -144,8 +146,8 @@
/***************************************************
* Other Settings
**************************************************/
//#define HASP_USE_MDNS 0 // Disable MDNS
//#define HASP_USE_CUSTOM 1 // Enable compilation of custom code from /src/custom
//#define HASP_USE_HA // Enable Home Assistant auto-discovery
//#define HASP_START_CONSOLE 0 // Disable starting of serial console at boot
//#define HASP_START_TELNET 0 // Disable starting of telnet service at boot
//#define HASP_START_HTTP 0 // Disable starting of web interface at boot
@ -154,5 +156,6 @@
//#define LV_VDB_SIZE (32 * 1024U) // 32KiB of lvgl draw buffer (default 32)
//#define HASP_DEBUG_OBJ_TREE // Output all objects to the log on page changes
//#define HASP_LOG_LEVEL LOG_LEVEL_VERBOSE // LOG_LEVEL_* can be DEBUG, VERBOSE, TRACE, INFO, WARNING, ERROR, CRITICAL, ALERT, FATAL, SILENT
//#define HASP_LOG_TASKS // Also log the Taskname and watermark of ESP32 tasks
#endif // HASP_USER_CONFIG_OVERRIDE_H
#endif // HASP_USER_CONFIG_OVERRIDE_H

View File

@ -0,0 +1,125 @@
#include "Arduino_RGBPanel_mod.h"
#if defined(ESP32) && (CONFIG_IDF_TARGET_ESP32S3)
Arduino_RGBPanel_Mod::Arduino_RGBPanel_Mod(
int8_t de, int8_t vsync, int8_t hsync, int8_t pclk,
int8_t r0, int8_t r1, int8_t r2, int8_t r3, int8_t r4,
int8_t g0, int8_t g1, int8_t g2, int8_t g3, int8_t g4, int8_t g5,
int8_t b0, int8_t b1, int8_t b2, int8_t b3, int8_t b4,
uint16_t hsync_polarity, uint16_t hsync_front_porch, uint16_t hsync_pulse_width, uint16_t hsync_back_porch,
uint16_t vsync_polarity, uint16_t vsync_front_porch, uint16_t vsync_pulse_width, uint16_t vsync_back_porch,
uint16_t pclk_active_neg, int32_t prefer_speed, bool useBigEndian)
: _de(de), _vsync(vsync), _hsync(hsync), _pclk(pclk),
_r0(r0), _r1(r1), _r2(r2), _r3(r3), _r4(r4),
_g0(g0), _g1(g1), _g2(g2), _g3(g3), _g4(g4), _g5(g5),
_b0(b0), _b1(b1), _b2(b2), _b3(b3), _b4(b4),
_hsync_polarity(hsync_polarity), _hsync_front_porch(hsync_front_porch), _hsync_pulse_width(hsync_pulse_width), _hsync_back_porch(hsync_back_porch),
_vsync_polarity(vsync_polarity), _vsync_front_porch(vsync_front_porch), _vsync_pulse_width(vsync_pulse_width), _vsync_back_porch(vsync_back_porch),
_pclk_active_neg(pclk_active_neg), _prefer_speed(prefer_speed), _useBigEndian(useBigEndian)
{
}
void Arduino_RGBPanel_Mod::begin(int32_t speed)
{
if (speed == GFX_NOT_DEFINED)
{
#ifdef CONFIG_SPIRAM_MODE_QUAD
_speed = 6000000L;
#else
_speed = 12000000L;
#endif
}
else
{
_speed = speed;
}
}
uint16_t *Arduino_RGBPanel_Mod::getFrameBuffer(int16_t w, int16_t h)
{
esp_lcd_rgb_panel_config_t *_panel_config = (esp_lcd_rgb_panel_config_t *)heap_caps_calloc(1, sizeof(esp_lcd_rgb_panel_config_t), MALLOC_CAP_DMA | MALLOC_CAP_INTERNAL);
_panel_config->clk_src = LCD_CLK_SRC_PLL160M;
_panel_config->timings.pclk_hz = (_prefer_speed == GFX_NOT_DEFINED) ? _speed : _prefer_speed;
_panel_config->timings.h_res = w;
_panel_config->timings.v_res = h;
// The following parameters should refer to LCD spec
_panel_config->timings.hsync_pulse_width = _hsync_pulse_width;
_panel_config->timings.hsync_back_porch = _hsync_back_porch;
_panel_config->timings.hsync_front_porch = _hsync_front_porch;
_panel_config->timings.vsync_pulse_width = _vsync_pulse_width;
_panel_config->timings.vsync_back_porch = _vsync_back_porch;
_panel_config->timings.vsync_front_porch = _vsync_front_porch;
_panel_config->timings.flags.hsync_idle_low = (_hsync_polarity == 0) ? 1 : 0;
_panel_config->timings.flags.vsync_idle_low = (_vsync_polarity == 0) ? 1 : 0;
_panel_config->timings.flags.de_idle_high = 0;
_panel_config->timings.flags.pclk_active_neg = _pclk_active_neg;
_panel_config->timings.flags.pclk_idle_high = 0;
_panel_config->data_width = 16; // RGB565 in parallel mode, thus 16bit in width
_panel_config->sram_trans_align = 8;
_panel_config->psram_trans_align = 64;
_panel_config->hsync_gpio_num = _hsync;
_panel_config->vsync_gpio_num = _vsync;
_panel_config->de_gpio_num = _de;
_panel_config->pclk_gpio_num = _pclk;
if (_useBigEndian)
{
_panel_config->data_gpio_nums[0] = _g3;
_panel_config->data_gpio_nums[1] = _g4;
_panel_config->data_gpio_nums[2] = _g5;
_panel_config->data_gpio_nums[3] = _r0;
_panel_config->data_gpio_nums[4] = _r1;
_panel_config->data_gpio_nums[5] = _r2;
_panel_config->data_gpio_nums[6] = _r3;
_panel_config->data_gpio_nums[7] = _r4;
_panel_config->data_gpio_nums[8] = _b0;
_panel_config->data_gpio_nums[9] = _b1;
_panel_config->data_gpio_nums[10] = _b2;
_panel_config->data_gpio_nums[11] = _b3;
_panel_config->data_gpio_nums[12] = _b4;
_panel_config->data_gpio_nums[13] = _g0;
_panel_config->data_gpio_nums[14] = _g1;
_panel_config->data_gpio_nums[15] = _g2;
}
else
{
_panel_config->data_gpio_nums[0] = _b0;
_panel_config->data_gpio_nums[1] = _b1;
_panel_config->data_gpio_nums[2] = _b2;
_panel_config->data_gpio_nums[3] = _b3;
_panel_config->data_gpio_nums[4] = _b4;
_panel_config->data_gpio_nums[5] = _g0;
_panel_config->data_gpio_nums[6] = _g1;
_panel_config->data_gpio_nums[7] = _g2;
_panel_config->data_gpio_nums[8] = _g3;
_panel_config->data_gpio_nums[9] = _g4;
_panel_config->data_gpio_nums[10] = _g5;
_panel_config->data_gpio_nums[11] = _r0;
_panel_config->data_gpio_nums[12] = _r1;
_panel_config->data_gpio_nums[13] = _r2;
_panel_config->data_gpio_nums[14] = _r3;
_panel_config->data_gpio_nums[15] = _r4;
}
_panel_config->disp_gpio_num = GPIO_NUM_NC;
_panel_config->flags.disp_active_low = 0;
_panel_config->flags.relax_on_idle = 0;
_panel_config->flags.fb_in_psram = 1; // allocate frame buffer in PSRAM
ESP_ERROR_CHECK(esp_lcd_new_rgb_panel(_panel_config, &_panel_handle));
ESP_ERROR_CHECK(esp_lcd_panel_reset(_panel_handle));
ESP_ERROR_CHECK(esp_lcd_panel_init(_panel_handle));
uint16_t color = random(0xffff);
ESP_ERROR_CHECK(_panel_handle->draw_bitmap(_panel_handle, 0, 0, 1, 1, &color));
_rgb_panel = __containerof(_panel_handle, esp_rgb_panel_t, base);
return (uint16_t *)_rgb_panel->fb;
}
#endif // #if defined(ESP32) && (CONFIG_IDF_TARGET_ESP32S3)

View File

@ -0,0 +1,102 @@
#ifdef HASP_USE_ARDUINOGFX
#include "Arduino.h"
#include "Arduino_DataBus.h"
#endif
#if defined(ESP32) && (CONFIG_IDF_TARGET_ESP32S3)
#include "databus/Arduino_ESP32RGBPanel.h" // struct esp_rgb_panel_t
#ifndef _ARDUINO_RGBPANEL_MOD_H_
#define _ARDUINO_RGBPANEL_MOD_H_
#include "esp_lcd_panel_io.h"
#include "esp_lcd_panel_rgb.h"
#include "esp_lcd_panel_vendor.h"
#include "esp_lcd_panel_ops.h"
#include "esp_lcd_panel_interface.h"
#include "esp_private/gdma.h"
#include "esp_pm.h"
#include "hal/dma_types.h"
#include "hal/lcd_hal.h"
#include "hal/lcd_ll.h"
#include "esp32s3/rom/cache.h"
// This function is located in ROM (also see esp_rom/${target}/ld/${target}.rom.ld)
extern int Cache_WriteBack_Addr(uint32_t addr, uint32_t size);
// extract from esp-idf esp_lcd_rgb_panel.c
/*struct esp_rgb_panel_t
{
esp_lcd_panel_t base; // Base class of generic lcd panel
int panel_id; // LCD panel ID
lcd_hal_context_t hal; // Hal layer object
size_t data_width; // Number of data lines (e.g. for RGB565, the data width is 16)
size_t sram_trans_align; // Alignment for framebuffer that allocated in SRAM
size_t psram_trans_align; // Alignment for framebuffer that allocated in PSRAM
int disp_gpio_num; // Display control GPIO, which is used to perform action like "disp_off"
intr_handle_t intr; // LCD peripheral interrupt handle
esp_pm_lock_handle_t pm_lock; // Power management lock
size_t num_dma_nodes; // Number of DMA descriptors that used to carry the frame buffer
uint8_t *fb; // Frame buffer
size_t fb_size; // Size of frame buffer
int data_gpio_nums[SOC_LCD_RGB_DATA_WIDTH]; // GPIOs used for data lines, we keep these GPIOs for action like "invert_color"
size_t resolution_hz; // Peripheral clock resolution
esp_lcd_rgb_timing_t timings; // RGB timing parameters (e.g. pclk, sync pulse, porch width)
gdma_channel_handle_t dma_chan; // DMA channel handle
esp_lcd_rgb_panel_frame_trans_done_cb_t on_frame_trans_done; // Callback, invoked after frame trans done
void *user_ctx; // Reserved user's data of callback functions
int x_gap; // Extra gap in x coordinate, it's used when calculate the flush window
int y_gap; // Extra gap in y coordinate, it's used when calculate the flush window
struct
{
unsigned int disp_en_level : 1; // The level which can turn on the screen by `disp_gpio_num`
unsigned int stream_mode : 1; // If set, the LCD transfers data continuously, otherwise, it stops refreshing the LCD when transaction done
unsigned int fb_in_psram : 1; // Whether the frame buffer is in PSRAM
} flags;
dma_descriptor_t dma_nodes[]; // DMA descriptor pool of size `num_dma_nodes`
};*/
class Arduino_RGBPanel_Mod
{
public:
Arduino_RGBPanel_Mod(
int8_t de, int8_t vsync, int8_t hsync, int8_t pclk,
int8_t r0, int8_t r1, int8_t r2, int8_t r3, int8_t r4,
int8_t g0, int8_t g1, int8_t g2, int8_t g3, int8_t g4, int8_t g5,
int8_t b0, int8_t b1, int8_t b2, int8_t b3, int8_t b4,
uint16_t hsync_polarity, uint16_t hsync_front_porch, uint16_t hsync_pulse_width, uint16_t hsync_back_porch,
uint16_t vsync_polarity, uint16_t vsync_front_porch, uint16_t vsync_pulse_width, uint16_t vsync_back_porch,
uint16_t pclk_active_neg = 0, int32_t prefer_speed = GFX_NOT_DEFINED, bool useBigEndian = false);
void begin(int32_t speed = GFX_NOT_DEFINED);
uint16_t *getFrameBuffer(int16_t w, int16_t h);
esp_lcd_panel_handle_t _panel_handle = NULL;
protected:
private:
int32_t _speed;
int8_t _de, _vsync, _hsync, _pclk;
int8_t _r0, _r1, _r2, _r3, _r4;
int8_t _g0, _g1, _g2, _g3, _g4, _g5;
int8_t _b0, _b1, _b2, _b3, _b4;
uint16_t _hsync_polarity;
uint16_t _hsync_front_porch;
uint16_t _hsync_pulse_width;
uint16_t _hsync_back_porch;
uint16_t _vsync_polarity;
uint16_t _vsync_front_porch;
uint16_t _vsync_pulse_width;
uint16_t _vsync_back_porch;
uint16_t _pclk_active_neg;
int32_t _prefer_speed;
bool _useBigEndian;
esp_rgb_panel_t *_rgb_panel;
};
#endif // _ARDUINO_ESP32RGBPANEL_H_
#endif // #if defined(ESP32) && (CONFIG_IDF_TARGET_ESP32S3)

View File

@ -0,0 +1,290 @@
#include "Arduino_RGB_Display_mod.h"
#if defined(ESP32) && defined(CONFIG_IDF_TARGET_ESP32S3) && defined(HASP_USE_ARDUINOGFX)
#include "Arduino_GFX.h"
#include "Arduino_DataBus.h"
#include "Arduino_RGB_Display_mod.h"
Arduino_RGB_Display_Mod::Arduino_RGB_Display_Mod(int16_t w, int16_t h, Arduino_RGBPanel_Mod* rgbpanel, uint8_t r,
bool auto_flush, Arduino_DataBus* bus, int8_t rst,
const uint8_t* init_operations, size_t init_operations_len)
: Arduino_GFX(w, h), _rgbpanel(rgbpanel), _auto_flush(auto_flush), _bus(bus), _rst(rst),
_init_operations(init_operations), _init_operations_len(init_operations_len)
{
_framebuffer_size = w * h * 2;
_rotation = r;
}
bool Arduino_RGB_Display_Mod::begin(int32_t speed)
{
_rgbpanel->begin(speed);
if(_bus) {
_bus->begin();
}
if(_rst != GFX_NOT_DEFINED) {
pinMode(_rst, OUTPUT);
digitalWrite(_rst, HIGH);
delay(100);
digitalWrite(_rst, LOW);
delay(120);
digitalWrite(_rst, HIGH);
delay(120);
} else {
if(_bus) {
// Software Rest
_bus->sendCommand(0x01);
delay(120);
}
}
if(_bus) {
if(_init_operations_len > 0) {
_bus->batchOperation((uint8_t*)_init_operations, _init_operations_len);
}
}
_framebuffer = _rgbpanel->getFrameBuffer(WIDTH, HEIGHT);
if(!_framebuffer) {
return false;
}
return true;
}
void Arduino_RGB_Display_Mod::writePixelPreclipped(int16_t x, int16_t y, uint16_t color)
{
uint16_t* fb = _framebuffer;
fb += (int32_t)y * _width;
fb += x;
*fb = color;
if(_auto_flush) {
Cache_WriteBack_Addr((uint32_t)fb, 2);
}
}
void Arduino_RGB_Display_Mod::writeFastVLine(int16_t x, int16_t y, int16_t h, uint16_t color)
{
if(_ordered_in_range(x, 0, _max_x) && h) { // X on screen, nonzero height
if(h < 0) { // If negative height...
y += h + 1; // Move Y to top edge
h = -h; // Use positive height
}
if(y <= _max_y) { // Not off bottom
int16_t y2 = y + h - 1;
if(y2 >= 0) { // Not off top
// Line partly or fully overlaps screen
if(y < 0) {
y = 0;
h = y2 + 1;
} // Clip top
if(y2 > _max_y) {
h = _max_y - y + 1;
} // Clip bottom
uint16_t* fb = _framebuffer + ((int32_t)y * _width) + x;
if(_auto_flush) {
while(h--) {
*fb = color;
Cache_WriteBack_Addr((uint32_t)fb, 2);
fb += _width;
}
} else {
while(h--) {
*fb = color;
fb += _width;
}
}
}
}
}
}
void Arduino_RGB_Display_Mod::writeFastHLine(int16_t x, int16_t y, int16_t w, uint16_t color)
{
if(_ordered_in_range(y, 0, _max_y) && w) { // Y on screen, nonzero width
if(w < 0) { // If negative width...
x += w + 1; // Move X to left edge
w = -w; // Use positive width
}
if(x <= _max_x) { // Not off right
int16_t x2 = x + w - 1;
if(x2 >= 0) { // Not off left
// Line partly or fully overlaps screen
if(x < 0) {
x = 0;
w = x2 + 1;
} // Clip left
if(x2 > _max_x) {
w = _max_x - x + 1;
} // Clip right
uint16_t* fb = _framebuffer + ((int32_t)y * _width) + x;
uint32_t cachePos = (uint32_t)fb;
int16_t writeSize = w * 2;
while(w--) {
*(fb++) = color;
}
if(_auto_flush) {
Cache_WriteBack_Addr(cachePos, writeSize);
}
}
}
}
}
void Arduino_RGB_Display_Mod::writeFillRectPreclipped(int16_t x, int16_t y, int16_t w, int16_t h, uint16_t color)
{
uint16_t* row = _framebuffer;
row += y * _width;
uint32_t cachePos = (uint32_t)row;
row += x;
for(int j = 0; j < h; j++) {
for(int i = 0; i < w; i++) {
row[i] = color;
}
row += _width;
}
if(_auto_flush) {
Cache_WriteBack_Addr(cachePos, _width * h * 2);
}
}
void Arduino_RGB_Display_Mod::setRotation(uint8_t r)
{
esp_err_t err = esp_lcd_panel_swap_xy(_rgbpanel->_panel_handle, r & 1);
err = esp_lcd_panel_mirror(_rgbpanel->_panel_handle, r & 4, r & 2);
}
void Arduino_RGB_Display_Mod::invertDisplay(bool i)
{
esp_err_t err = esp_lcd_panel_invert_color(_rgbpanel->_panel_handle, i);
}
void Arduino_RGB_Display_Mod::draw16bitRGBBitmap(int16_t x, int16_t y, uint16_t* bitmap, int16_t w, int16_t h)
{
esp_err_t err = esp_lcd_panel_draw_bitmap(_rgbpanel->_panel_handle, x, y, x + w, y + h, bitmap);
return;
if(((x + w - 1) < 0) || // Outside left
((y + h - 1) < 0) || // Outside top
(x > _max_x) || // Outside right
(y > _max_y) // Outside bottom
) {
return;
} else {
int16_t xskip = 0;
if((y + h - 1) > _max_y) {
h -= (y + h - 1) - _max_y;
}
if(y < 0) {
bitmap -= y * w;
h += y;
y = 0;
}
if((x + w - 1) > _max_x) {
xskip = (x + w - 1) - _max_x;
w -= xskip;
}
if(x < 0) {
bitmap -= x;
xskip -= x;
w += x;
x = 0;
}
uint16_t* row = _framebuffer;
row += y * _width;
uint32_t cachePos = (uint32_t)row;
row += x;
if(((_width & 1) == 0) && ((xskip & 1) == 0) && ((w & 1) == 0)) {
uint32_t* row2 = (uint32_t*)row;
uint32_t* bitmap2 = (uint32_t*)bitmap;
int16_t _width2 = _width >> 1;
int16_t xskip2 = xskip >> 1;
int16_t w2 = w >> 1;
for(int16_t j = 0; j < h; j++) {
for(int16_t i = 0; i < w2; i++) {
row2[i] = *bitmap2++;
}
bitmap2 += xskip2;
row2 += _width2;
}
} else {
for(int j = 0; j < h; j++) {
for(int i = 0; i < w; i++) {
row[i] = *bitmap++;
}
bitmap += xskip;
row += _width;
}
}
if(_auto_flush) {
Cache_WriteBack_Addr(cachePos, _width * h * 2);
}
}
}
void Arduino_RGB_Display_Mod::draw16bitBeRGBBitmap(int16_t x, int16_t y, uint16_t* bitmap, int16_t w, int16_t h)
{
if(((x + w - 1) < 0) || // Outside left
((y + h - 1) < 0) || // Outside top
(x > _max_x) || // Outside right
(y > _max_y) // Outside bottom
) {
return;
} else {
int16_t xskip = 0;
if((y + h - 1) > _max_y) {
h -= (y + h - 1) - _max_y;
}
if(y < 0) {
bitmap -= y * w;
h += y;
y = 0;
}
if((x + w - 1) > _max_x) {
xskip = (x + w - 1) - _max_x;
w -= xskip;
}
if(x < 0) {
bitmap -= x;
xskip -= x;
w += x;
x = 0;
}
uint16_t* row = _framebuffer;
row += y * _width;
uint32_t cachePos = (uint32_t)row;
row += x;
uint16_t color;
for(int j = 0; j < h; j++) {
for(int i = 0; i < w; i++) {
color = *bitmap++;
MSB_16_SET(row[i], color);
}
bitmap += xskip;
row += _width;
}
if(_auto_flush) {
Cache_WriteBack_Addr(cachePos, _width * h * 2);
}
}
}
void Arduino_RGB_Display_Mod::flush(void)
{
if(!_auto_flush) {
Cache_WriteBack_Addr((uint32_t)_framebuffer, _framebuffer_size);
}
}
uint16_t* Arduino_RGB_Display_Mod::getFramebuffer()
{
return _framebuffer;
}
#endif // #if defined(ESP32) && (CONFIG_IDF_TARGET_ESP32S3)

View File

@ -0,0 +1,434 @@
#ifdef HASP_USE_ARDUINOGFX
#include "Arduino.h"
#include "Arduino_DataBus.h"
#endif
#if defined(ESP32) && defined(CONFIG_IDF_TARGET_ESP32S3) && defined(HASP_USE_ARDUINOGFX)
#ifndef _ARDUINO_RGB_DISPLAY_MOD_H_
#define _ARDUINO_RGB_DISPLAY_MOD_H_
#include "Arduino_GFX.h"
#include "Arduino_RGBPanel_mod.h"
static const uint8_t st7701_4848S040_init_operations[] = {
BEGIN_WRITE,
WRITE_COMMAND_8, 0xFF,
WRITE_BYTES, 5, 0x77, 0x01, 0x00, 0x00, 0x10,
WRITE_C8_D16, 0xC0, 0x3B, 0x00,
WRITE_C8_D16, 0xC1, 0x0D, 0x02,
WRITE_C8_D16, 0xC2, 0x31, 0x05,
WRITE_C8_D8, 0xCD, 0x00,//0x08
WRITE_COMMAND_8, 0xB0, // Positive Voltage Gamma Control
WRITE_BYTES, 16,
0x00, 0x11, 0x18, 0x0E,
0x11, 0x06, 0x07, 0x08,
0x07, 0x22, 0x04, 0x12,
0x0F, 0xAA, 0x31, 0x18,
WRITE_COMMAND_8, 0xB1, // Negative Voltage Gamma Control
WRITE_BYTES, 16,
0x00, 0x11, 0x19, 0x0E,
0x12, 0x07, 0x08, 0x08,
0x08, 0x22, 0x04, 0x11,
0x11, 0xA9, 0x32, 0x18,
// PAGE1
WRITE_COMMAND_8, 0xFF,
WRITE_BYTES, 5, 0x77, 0x01, 0x00, 0x00, 0x11,
WRITE_C8_D8, 0xB0, 0x60, // Vop=4.7375v
WRITE_C8_D8, 0xB1, 0x32, // VCOM=32
WRITE_C8_D8, 0xB2, 0x07, // VGH=15v
WRITE_C8_D8, 0xB3, 0x80,
WRITE_C8_D8, 0xB5, 0x49, // VGL=-10.17v
WRITE_C8_D8, 0xB7, 0x85,
WRITE_C8_D8, 0xB8, 0x21, // AVDD=6.6 & AVCL=-4.6
WRITE_C8_D8, 0xC1, 0x78,
WRITE_C8_D8, 0xC2, 0x78,
WRITE_COMMAND_8, 0xE0,
WRITE_BYTES, 3, 0x00, 0x1B, 0x02,
WRITE_COMMAND_8, 0xE1,
WRITE_BYTES, 11,
0x08, 0xA0, 0x00, 0x00,
0x07, 0xA0, 0x00, 0x00,
0x00, 0x44, 0x44,
WRITE_COMMAND_8, 0xE2,
WRITE_BYTES, 12,
0x11, 0x11, 0x44, 0x44,
0xED, 0xA0, 0x00, 0x00,
0xEC, 0xA0, 0x00, 0x00,
WRITE_COMMAND_8, 0xE3,
WRITE_BYTES, 4, 0x00, 0x00, 0x11, 0x11,
WRITE_C8_D16, 0xE4, 0x44, 0x44,
WRITE_COMMAND_8, 0xE5,
WRITE_BYTES, 16,
0x0A, 0xE9, 0xD8, 0xA0,
0x0C, 0xEB, 0xD8, 0xA0,
0x0E, 0xED, 0xD8, 0xA0,
0x10, 0xEF, 0xD8, 0xA0,
WRITE_COMMAND_8, 0xE6,
WRITE_BYTES, 4, 0x00, 0x00, 0x11, 0x11,
WRITE_C8_D16, 0xE7, 0x44, 0x44,
WRITE_COMMAND_8, 0xE8,
WRITE_BYTES, 16,
0x09, 0xE8, 0xD8, 0xA0,
0x0B, 0xEA, 0xD8, 0xA0,
0x0D, 0xEC, 0xD8, 0xA0,
0x0F, 0xEE, 0xD8, 0xA0,
WRITE_COMMAND_8, 0xEB,
WRITE_BYTES, 7,
0x02, 0x00, 0xE4, 0xE4,
0x88, 0x00, 0x40,
WRITE_C8_D16, 0xEC, 0x3C, 0x00,
WRITE_COMMAND_8, 0xED,
WRITE_BYTES, 16,
0xAB, 0x89, 0x76, 0x54,
0x02, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xFF, 0x20,
0x45, 0x67, 0x98, 0xBA,
//-----------VAP & VAN---------------
WRITE_COMMAND_8, 0xFF,
WRITE_BYTES, 5, 0x77, 0x01, 0x00, 0x00, 0x13,
WRITE_C8_D8, 0xE5, 0xE4,
WRITE_COMMAND_8, 0xFF,
WRITE_BYTES, 5, 0x77, 0x01, 0x00, 0x00, 0x00,
WRITE_COMMAND_8, 0x21, // 0x20 normal, 0x21 IPS
WRITE_C8_D8, 0x3A, 0x60, // 0x70 RGB888, 0x60 RGB666, 0x50 RGB565
//WRITE_COMMAND_8, 0x21,0X00,
//END_WRITE,
WRITE_COMMAND_8, 0x11, // Sleep Out
END_WRITE,
DELAY, 120,
BEGIN_WRITE,
WRITE_COMMAND_8, 0x29, // Display On
END_WRITE,
BEGIN_WRITE,
WRITE_COMMAND_8, 0x20, // Invert display
END_WRITE
};
static const uint8_t st7701_sensecap_indicator_init_operations[] = {
BEGIN_WRITE,
WRITE_COMMAND_8, 0xFF,
WRITE_BYTES, 5, 0x77, 0x01, 0x00, 0x00, 0x10,
WRITE_C8_D16, 0xC0, 0x3B, 0x00,
WRITE_C8_D16, 0xC1, 0x0D, 0x02,
WRITE_C8_D16, 0xC2, 0x31, 0x05,
WRITE_C8_D8, 0xC7, 0x04,
WRITE_C8_D8, 0xCD, 0x08,
WRITE_COMMAND_8, 0xB0, // Positive Voltage Gamma Control
WRITE_BYTES, 16,
0x00, 0x11, 0x18, 0x0E,
0x11, 0x06, 0x07, 0x08,
0x07, 0x22, 0x04, 0x12,
0x0F, 0xAA, 0x31, 0x18,
END_WRITE,
BEGIN_WRITE,
WRITE_COMMAND_8, 0xB1, // Negative Voltage Gamma Control
WRITE_BYTES, 16,
0x00, 0x11, 0x19, 0x0E,
0x12, 0x07, 0x08, 0x08,
0x08, 0x22, 0x04, 0x11,
0x11, 0xA9, 0x32, 0x18,
// PAGE1
WRITE_COMMAND_8, 0xFF,
WRITE_BYTES, 5, 0x77, 0x01, 0x00, 0x00, 0x11,
WRITE_C8_D8, 0xB0, 0x60, // Vop=4.7375v
WRITE_C8_D8, 0xB1, 0x32, // VCOM=32
WRITE_C8_D8, 0xB2, 0x07, // VGH=15v
WRITE_C8_D8, 0xB3, 0x80,
WRITE_C8_D8, 0xB5, 0x49, // VGL=-10.17v
WRITE_C8_D8, 0xB7, 0x85,
WRITE_C8_D8, 0xB8, 0x21, // AVDD=6.6 & AVCL=-4.6
WRITE_C8_D8, 0xC1, 0x78,
WRITE_C8_D8, 0xC2, 0x78,
END_WRITE,
DELAY, 20,
BEGIN_WRITE,
WRITE_COMMAND_8, 0xE0,
WRITE_BYTES, 3, 0x00, 0x1B, 0x02,
WRITE_COMMAND_8, 0xE1,
WRITE_BYTES, 11,
0x08, 0xA0, 0x00, 0x00,
0x07, 0xA0, 0x00, 0x00,
0x00, 0x44, 0x44,
WRITE_COMMAND_8, 0xE2,
WRITE_BYTES, 12,
0x11, 0x11, 0x44, 0x44,
0xED, 0xA0, 0x00, 0x00,
0xEC, 0xA0, 0x00, 0x00,
END_WRITE,
BEGIN_WRITE,
WRITE_COMMAND_8, 0xE3,
WRITE_BYTES, 4, 0x00, 0x00, 0x11, 0x11,
WRITE_C8_D16, 0xE4, 0x44, 0x44,
WRITE_COMMAND_8, 0xE5,
WRITE_BYTES, 16,
0x0A, 0xE9, 0xD8, 0xA0,
0x0C, 0xEB, 0xD8, 0xA0,
0x0E, 0xED, 0xD8, 0xA0,
0x10, 0xEF, 0xD8, 0xA0,
WRITE_COMMAND_8, 0xE6,
WRITE_BYTES, 4, 0x00, 0x00, 0x11, 0x11,
WRITE_C8_D16, 0xE7, 0x44, 0x44,
END_WRITE,
BEGIN_WRITE,
WRITE_COMMAND_8, 0xE8,
WRITE_BYTES, 16,
0x09, 0xE8, 0xD8, 0xA0,
0x0B, 0xEA, 0xD8, 0xA0,
0x0D, 0xEC, 0xD8, 0xA0,
0x0F, 0xEE, 0xD8, 0xA0,
WRITE_COMMAND_8, 0xEB,
WRITE_BYTES, 7,
0x02, 0x00, 0xE4, 0xE4,
0x88, 0x00, 0x40,
WRITE_C8_D16, 0xEC, 0x3C, 0x00,
WRITE_COMMAND_8, 0xED,
WRITE_BYTES, 16,
0xAB, 0x89, 0x76, 0x54,
0x02, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xFF, 0x20,
0x45, 0x67, 0x98, 0xBA,
WRITE_C8_D8, 0x36, 0x10,
END_WRITE,
BEGIN_WRITE,
//-----------VAP & VAN---------------
WRITE_COMMAND_8, 0xFF,
WRITE_BYTES, 5, 0x77, 0x01, 0x00, 0x00, 0x13,
WRITE_C8_D8, 0xE5, 0xE4,
WRITE_COMMAND_8, 0xFF,
WRITE_BYTES, 5, 0x77, 0x01, 0x00, 0x00, 0x00,
WRITE_COMMAND_8, 0x21, // 0x20 normal, 0x21 IPS
WRITE_C8_D8, 0x3A, 0x60, // 0x70 RGB888, 0x60 RGB666, 0x50 RGB565
WRITE_COMMAND_8, 0x11, // Sleep Out
END_WRITE,
DELAY, 120,
BEGIN_WRITE,
WRITE_COMMAND_8, 0x29, // Display On
END_WRITE,
DELAY, 120,
};
static const uint8_t st7701_t_panel_init_operations[] = {
BEGIN_WRITE,
WRITE_COMMAND_8, 0xFF,
WRITE_BYTES, 5, 0x77, 0x01, 0x00, 0x00, 0x13,
WRITE_C8_D8, 0xEF, 0x08,
WRITE_COMMAND_8, 0xFF,
WRITE_BYTES, 5, 0x77, 0x01, 0x00, 0x00, 0x10,
WRITE_C8_D16, 0xC0, 0x3B, 0x00,
WRITE_C8_D16, 0xC1, 0x0B, 0x02,
WRITE_COMMAND_8, 0xC2,
WRITE_BYTES, 3, 0x30, 0x02, 0x37,
WRITE_C8_D8, 0xCC, 0x10,
WRITE_COMMAND_8, 0xB0, // Positive Voltage Gamma Control
WRITE_BYTES, 16,
0x00, 0x0F, 0x16, 0x0E,
0x11, 0x07, 0x09, 0x09,
0x08, 0x23, 0x05, 0x11,
0x0F, 0x28, 0x2D, 0x18,
WRITE_COMMAND_8, 0xB1, // Negative Voltage Gamma Control
WRITE_BYTES, 16,
0x00, 0x0F, 0x16, 0x0E,
0x11, 0x07, 0x09, 0x08,
0x09, 0x23, 0x05, 0x11,
0x0F, 0x28, 0x2D, 0x18,
WRITE_COMMAND_8, 0xFF,
WRITE_BYTES, 5, 0x77, 0x01, 0x00, 0x00, 0x11,
WRITE_C8_D8, 0xB0, 0x4D,
WRITE_C8_D8, 0xB1, 0x33,
WRITE_C8_D8, 0xB2, 0x87,
WRITE_C8_D8, 0xB5, 0x4B,
WRITE_C8_D8, 0xB7, 0x8C,
WRITE_C8_D8, 0xB8, 0x20,
WRITE_C8_D8, 0xC1, 0x78,
WRITE_C8_D8, 0xC2, 0x78,
WRITE_C8_D8, 0xD0, 0x88,
WRITE_COMMAND_8, 0xE0,
WRITE_BYTES, 3, 0x00, 0x00, 0x02,
WRITE_COMMAND_8, 0xE1,
WRITE_BYTES, 11,
0x02, 0xF0, 0x00, 0x00,
0x03, 0xF0, 0x00, 0x00,
0x00, 0x44, 0x44,
WRITE_COMMAND_8, 0xE2,
WRITE_BYTES, 12,
0x10, 0x10, 0x40, 0x40,
0xF2, 0xF0, 0x00, 0x00,
0xF2, 0xF0, 0x00, 0x00,
WRITE_COMMAND_8, 0xE3,
WRITE_BYTES, 4, 0x00, 0x00, 0x11, 0x11,
WRITE_C8_D16, 0xE4, 0x44, 0x44,
WRITE_COMMAND_8, 0xE5,
WRITE_BYTES, 16,
0x07, 0xEF, 0xF0, 0xF0,
0x09, 0xF1, 0xF0, 0xF0,
0x03, 0xF3, 0xF0, 0xF0,
0x05, 0xED, 0xF0, 0xF0,
WRITE_COMMAND_8, 0xE6,
WRITE_BYTES, 4, 0x00, 0x00, 0x11, 0x11,
WRITE_C8_D16, 0xE7, 0x44, 0x44,
WRITE_COMMAND_8, 0xE8,
WRITE_BYTES, 16,
0x08, 0xF0, 0xF0, 0xF0,
0x0A, 0xF2, 0xF0, 0xF0,
0x04, 0xF4, 0xF0, 0xF0,
0x06, 0xEE, 0xF0, 0xF0,
WRITE_COMMAND_8, 0xEB,
WRITE_BYTES, 7,
0x00, 0x00, 0xE4, 0xE4,
0x44, 0x88, 0x40,
WRITE_C8_D16, 0xEC, 0x78, 0x00,
WRITE_COMMAND_8, 0xED,
WRITE_BYTES, 16,
0x20, 0xF9, 0x87, 0x76,
0x65, 0x54, 0x4F, 0xFF,
0xFF, 0xF4, 0x45, 0x56,
0x67, 0x78, 0x9F, 0x02,
WRITE_COMMAND_8, 0xEF,
WRITE_BYTES, 6,
0x10, 0x0D, 0x04, 0x08,
0x3F, 0x1F,
// WRITE_C8_D8, 0xCD, 0x05,//Test
WRITE_C8_D8, 0x3A, 0x55,
WRITE_C8_D8, 0x36, 0x08,
WRITE_COMMAND_8, 0x11,
// WRITE_COMMAND_8, 0xFF,//Test
// WRITE_BYTES, 5,
// 0x77, 0x01, 0x00, 0x00,
// 0x12,
// WRITE_C8_D8, 0xD1, 0x81,//Test
// WRITE_C8_D8, 0xD2, 0x08,//Test
WRITE_COMMAND_8, 0x29, // Display On
// WRITE_C8_D8, 0x35, 0x00,//Test
// WRITE_C8_D8, 0xCE, 0x04,//Test
// WRITE_COMMAND_8, 0xF2,//Test
// WRITE_BYTES, 4,
// 0xF0, 0xA3, 0xA3, 0x71,
END_WRITE};
class Arduino_RGB_Display_Mod : public Arduino_GFX{
public:
Arduino_RGB_Display_Mod(
int16_t w, int16_t h, Arduino_RGBPanel_Mod *rgbpanel, uint8_t r = 0, bool auto_flush = true,
Arduino_DataBus *bus = NULL, int8_t rst = GFX_NOT_DEFINED, const uint8_t *init_operations = NULL, size_t init_operations_len = GFX_NOT_DEFINED);
bool begin(int32_t speed = GFX_NOT_DEFINED) override;
void writePixelPreclipped(int16_t x, int16_t y, uint16_t color) override;
void writeFastVLine(int16_t x, int16_t y, int16_t h, uint16_t color) override;
void writeFastHLine(int16_t x, int16_t y, int16_t w, uint16_t color) override;
void writeFillRectPreclipped(int16_t x, int16_t y, int16_t w, int16_t h, uint16_t color) override;
void draw16bitRGBBitmap(int16_t x, int16_t y, uint16_t *bitmap, int16_t w, int16_t h) override;
void draw16bitBeRGBBitmap(int16_t x, int16_t y, uint16_t *bitmap, int16_t w, int16_t h) override;
void flush(void) override;
void setRotation(uint8_t r);
void invertDisplay(bool i);
uint16_t *getFramebuffer();
Arduino_DataBus *_bus;
Arduino_RGBPanel_Mod *_rgbpanel;
protected:
uint16_t *_framebuffer;
size_t _framebuffer_size;
bool _auto_flush;
int8_t _rst;
const uint8_t *_init_operations;
size_t _init_operations_len;
private:
};
#endif // _ARDUINO_RGB_DISPLAY_H_
#endif // #if defined(ESP32) && (CONFIG_IDF_TARGET_ESP32S3)

343
lib/ETHSPI/ETHSPI.cpp Normal file
View File

@ -0,0 +1,343 @@
/* MIT License - Copyright (c) 2022 Ben Suffolk, ben@vanilla.net
For full license information read the LICENSE file in the project folder */
#if defined(HASP_USE_ETHSPI)
#include "ETHSPI.h"
#include "esp_netif.h"
#include "esp_eth.h"
#include "esp_eth_mac.h"
#include "esp_event.h"
#include "esp_log.h"
#include "driver/gpio.h"
#include "sdkconfig.h"
#include "lwip/err.h"
#include "lwip/dns.h"
extern void tcpipInit();
ETHSPIClass::ETHSPIClass()
:initialized(false)
,staticIP(false)
,eth_handle(NULL)
,eth_netif_spi(NULL)
{
}
ETHSPIClass::~ETHSPIClass()
{}
bool ETHSPIClass::begin(int mosi_io, int miso_io, int sclk_io, int cs_io, int int_io, spi_host_device_t spi_host)
{
if(initialized) {
return true;
}
tcpipInit();
// Create instance(s) of esp-netif for SPI Ethernet(s)
esp_netif_inherent_config_t esp_netif_config = ESP_NETIF_INHERENT_DEFAULT_ETH();
esp_netif_config.if_desc = "eth0";
esp_netif_config.route_prio = 30;
esp_netif_config_t cfg_spi = {
.base = &esp_netif_config,
.stack = ESP_NETIF_NETSTACK_DEFAULT_ETH
};
eth_netif_spi = esp_netif_new(&cfg_spi);
// Init MAC and PHY configs to default
eth_mac_config_t mac_config_spi = ETH_MAC_DEFAULT_CONFIG();
eth_phy_config_t phy_config_spi = ETH_PHY_DEFAULT_CONFIG();
// Install GPIO ISR handler to be able to service SPI Eth modlues interrupts
gpio_install_isr_service(0);
// Init SPI bus
spi_device_handle_t spi_handle = NULL;
spi_bus_config_t buscfg = {
.mosi_io_num = mosi_io,
.miso_io_num = miso_io,
.sclk_io_num = sclk_io,
.quadwp_io_num = -1,
.quadhd_io_num = -1,
};
if(spi_bus_initialize(ETHSPI_HOST, &buscfg, SPI_DMA_CH_AUTO) != ESP_OK) {
return false;
}
// Configure SPI interface and Ethernet driver for specific SPI module
esp_eth_mac_t *mac_spi;
esp_eth_phy_t *phy_spi;
spi_device_interface_config_t devcfg = {
.command_bits = 16, // Actually it's the address phase in W5500 SPI frame
.address_bits = 8, // Actually it's the control phase in W5500 SPI frame
.mode = 0,
.clock_speed_hz = ETHSPI_CLOCK_MHZ * 1000 * 1000,
.queue_size = 20
};
// Set SPI module Chip Select GPIO
devcfg.spics_io_num = cs_io;
if(spi_bus_add_device(spi_host, &devcfg, &spi_handle) != ESP_OK) {
return false;
}
// w5500 ethernet driver is based on spi driver
eth_w5500_config_t w5500_config = ETH_W5500_DEFAULT_CONFIG(spi_handle);
// Set remaining GPIO numbers and configuration used by the SPI module
w5500_config.int_gpio_num = int_io;
phy_config_spi.phy_addr = 1;
phy_config_spi.reset_gpio_num = -1;
mac_spi = esp_eth_mac_new_w5500(&w5500_config, &mac_config_spi);
phy_spi = esp_eth_phy_new_w5500(&phy_config_spi);
esp_eth_config_t eth_config_spi = ETH_DEFAULT_CONFIG(mac_spi, phy_spi);
if(esp_eth_driver_install(&eth_config_spi, &eth_handle) != ESP_OK) {
return false;
}
// W5500 Does not have a mac address on the module. So get the enternet mac address from ESP fuse
uint8_t mac[6];
esp_read_mac(mac, ESP_MAC_ETH);
if(esp_eth_ioctl(eth_handle, ETH_CMD_S_MAC_ADDR, mac) != ESP_OK) {
return false;
}
// attach Ethernet driver to TCP/IP stack
if(esp_netif_attach(eth_netif_spi, esp_eth_new_netif_glue(eth_handle)) != ESP_OK) {
return false;
}
if(esp_eth_start(eth_handle) != ESP_OK) {
return false;
}
initialized = true;
return initialized;
}
bool ETHSPIClass::config(IPAddress local_ip, IPAddress gateway, IPAddress subnet, IPAddress dns1, IPAddress dns2)
{
esp_netif_ip_info_t ip_info;
if(local_ip != (uint32_t)0x00000000 && local_ip != INADDR_NONE) {
ip_info.ip.addr = static_cast<uint32_t>(local_ip);
ip_info.gw.addr = static_cast<uint32_t>(gateway);
ip_info.netmask.addr = static_cast<uint32_t>(subnet);
} else {
ip_info.ip.addr = 0;
ip_info.gw.addr = 0;
ip_info.netmask.addr = 0;
}
// Stop DHCP client
esp_netif_dhcp_status_t status;
if(esp_netif_dhcpc_get_status(eth_netif_spi, &status) != ESP_OK) {
log_e("could not get DHCP status");
return false;
}
if(status == ESP_NETIF_DHCP_STARTED && esp_netif_dhcpc_stop(eth_netif_spi) != ESP_OK) {
log_e("DHCP could not be stopped");
return false;
}
// Set IP Details
if(esp_netif_set_ip_info(eth_netif_spi, &ip_info) != ESP_OK) {
log_e("Unable to set IP address");
return false;
}
// Start DHCP client is required
if(ip_info.ip.addr){
staticIP = true;
} else {
if(esp_netif_dhcpc_start(eth_netif_spi) != ESP_OK) {
log_e("DHCP could not be started");
return false;
}
staticIP = false;
}
// Set primary DNS
if(dns1 != (uint32_t)0x00000000 && dns1 != INADDR_NONE) {
esp_netif_dns_info_t dns_info;
dns_info.ip.u_addr.ip4.addr = static_cast<uint32_t>(dns1);
if(esp_netif_set_dns_info(eth_netif_spi, ESP_NETIF_DNS_MAIN, &dns_info) != ESP_OK) {
log_e("Unable to set DNS");
return false;
}
}
// Set secondary DNS
if(dns2 != (uint32_t)0x00000000 && dns2 != INADDR_NONE) {
esp_netif_dns_info_t dns_info;
dns_info.ip.u_addr.ip4.addr = static_cast<uint32_t>(dns2);
if(esp_netif_set_dns_info(eth_netif_spi, ESP_NETIF_DNS_FALLBACK, &dns_info) != ESP_OK) {
log_e("Unable to set DNS");
return false;
}
}
return true;
}
IPAddress ETHSPIClass::localIP()
{
esp_netif_ip_info_t ip_info;
if(esp_netif_get_ip_info(eth_netif_spi, &ip_info) != ESP_OK) {
return IPAddress();
}
return IPAddress(ip_info.ip.addr);
}
IPAddress ETHSPIClass::subnetMask()
{
esp_netif_ip_info_t ip_info;
if(esp_netif_get_ip_info(eth_netif_spi, &ip_info) != ESP_OK) {
return IPAddress();
}
return IPAddress(ip_info.netmask.addr);
}
IPAddress ETHSPIClass::gatewayIP()
{
esp_netif_ip_info_t ip_info;
if(esp_netif_get_ip_info(eth_netif_spi, &ip_info) != ESP_OK) {
return IPAddress();
}
return IPAddress(ip_info.gw.addr);
}
IPAddress ETHSPIClass::dnsIP(esp_netif_dns_type_t dns_type)
{
esp_netif_dns_info_t dns_info;
if(esp_netif_get_dns_info(eth_netif_spi, dns_type, &dns_info) != ESP_OK) {
return IPAddress();
}
return IPAddress(dns_info.ip.u_addr.ip4.addr);
}
IPAddress ETHSPIClass::broadcastIP()
{
esp_netif_ip_info_t ip_info;
if(esp_netif_get_ip_info(eth_netif_spi, &ip_info) != ESP_OK) {
return IPAddress();
}
return WiFiGenericClass::calculateBroadcast(IPAddress(ip_info.gw.addr), IPAddress(ip_info.netmask.addr));
}
IPAddress ETHSPIClass::networkID()
{
esp_netif_ip_info_t ip_info;
if(esp_netif_get_ip_info(eth_netif_spi, &ip_info) != ESP_OK) {
return IPAddress();
}
return WiFiGenericClass::calculateNetworkID(IPAddress(ip_info.gw.addr), IPAddress(ip_info.netmask.addr));
}
uint8_t ETHSPIClass::subnetCIDR()
{
esp_netif_ip_info_t ip_info;
if(esp_netif_get_ip_info(eth_netif_spi, &ip_info) != ESP_OK) {
return IPAddress();
}
return WiFiGenericClass::calculateSubnetCIDR(IPAddress(ip_info.netmask.addr));
}
const char * ETHSPIClass::getHostname()
{
const char *hostname;
if(esp_netif_get_hostname(eth_netif_spi, &hostname) != ESP_OK) {
return NULL;
}
return hostname;
}
bool ETHSPIClass::setHostname(const char *hostname)
{
return(esp_netif_set_hostname(eth_netif_spi, hostname) == ESP_OK);
}
bool ETHSPIClass::fullDuplex()
{
eth_duplex_t duplex;
esp_eth_ioctl(eth_handle, ETH_CMD_G_DUPLEX_MODE, &duplex);
return (duplex == ETH_DUPLEX_FULL);
}
bool ETHSPIClass::linkUp()
{
return esp_netif_is_netif_up(eth_netif_spi);
}
uint8_t ETHSPIClass::linkSpeed()
{
eth_speed_t link_speed;
esp_eth_ioctl(eth_handle, ETH_CMD_G_SPEED, &link_speed);
return (link_speed == ETH_SPEED_10M)?10:100;
}
uint8_t * ETHSPIClass::macAddress(uint8_t* mac)
{
if(!mac) {
return NULL;
}
esp_eth_ioctl(eth_handle, ETH_CMD_G_MAC_ADDR, mac);
return mac;
}
String ETHSPIClass::macAddress(void)
{
uint8_t mac[6];
char macStr[18];
macAddress(mac);
sprintf(macStr, "%02X:%02X:%02X:%02X:%02X:%02X", mac[0], mac[1], mac[2], mac[3], mac[4], mac[5]);
return String(macStr);
}
ETHSPIClass ETHSPI;
#endif

80
lib/ETHSPI/ETHSPI.h Normal file
View File

@ -0,0 +1,80 @@
/* MIT License - Copyright (c) 2022 Ben Suffolk, ben@vanilla.net
For full license information read the LICENSE file in the project folder */
#ifndef _ETHSPI_H_
#define _ETHSPI_H_
#include "WiFi.h"
#include "esp_system.h"
#include "esp_eth.h"
#include "driver/spi_master.h"
#ifndef ETHSPI_HOST
#define ETHSPI_HOST SPI2_HOST
#endif
#ifndef ETHSPI_CLOCK_MHZ
#define ETHSPI_CLOCK_MHZ 12
#endif
#ifndef ETHSPI_INT_GPIO
#define ETHSPI_INT_GPIO 4
#endif
#ifndef ETHSPI_MOSI_GPIO
#define ETHSPI_MOSI_GPIO 13
#endif
#ifndef ETHSPI_MISO_GPIO
#define ETHSPI_MISO_GPIO 12
#endif
#ifndef ETHSPI_SCLK_GPIO
#define ETHSPI_SCLK_GPIO 14
#endif
#ifndef ETHSPI_CS_GPIO
#define ETHSPI_CS_GPIO 15
#endif
class ETHSPIClass {
private:
bool initialized;
bool staticIP;
esp_eth_handle_t eth_handle;
esp_netif_t *eth_netif_spi;
public:
ETHSPIClass();
~ETHSPIClass();
bool begin(int mosi_io = ETHSPI_MOSI_GPIO, int miso_io = ETHSPI_MISO_GPIO, int sclk_io = ETHSPI_SCLK_GPIO, int cs_io = ETHSPI_CS_GPIO, int int_io = ETHSPI_INT_GPIO, spi_host_device_t spi_host = ETHSPI_HOST);
bool config(IPAddress local_ip, IPAddress gateway, IPAddress subnet, IPAddress dns1 = (uint32_t)0x00000000, IPAddress dns2 = (uint32_t)0x00000000);
const char * getHostname();
bool setHostname(const char * hostname);
bool fullDuplex();
bool linkUp();
uint8_t linkSpeed();
IPAddress localIP();
IPAddress subnetMask();
IPAddress gatewayIP();
IPAddress dnsIP(esp_netif_dns_type_t dns_type = ESP_NETIF_DNS_MAIN);
IPAddress broadcastIP();
IPAddress networkID();
uint8_t subnetCIDR();
uint8_t * macAddress(uint8_t* mac);
String macAddress();
friend class WiFiClient;
friend class WiFiServer;
};
extern ETHSPIClass ETHSPI;
#endif /* _ETH_H_ */

View File

@ -0,0 +1,695 @@
// Copyright 2020 Espressif Systems (Shanghai) PTE LTD
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#if defined(HASP_USE_ETHSPI)
#include <string.h>
#include <stdlib.h>
#include <sys/cdefs.h>
#include "driver/gpio.h"
#include "driver/spi_master.h"
#include "esp_attr.h"
#include "esp_log.h"
#include "esp_check.h"
#include "esp_eth.h"
#include "esp_system.h"
#include "esp_intr_alloc.h"
#include "esp_heap_caps.h"
#include "esp_rom_gpio.h"
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
#include "freertos/semphr.h"
#include "hal/cpu_hal.h"
#include "w5500.h"
#include "sdkconfig.h"
static const char *TAG = "w5500.mac";
#define W5500_SPI_LOCK_TIMEOUT_MS (50)
#define W5500_TX_MEM_SIZE (0x4000)
#define W5500_RX_MEM_SIZE (0x4000)
typedef struct {
esp_eth_mac_t parent;
esp_eth_mediator_t *eth;
spi_device_handle_t spi_hdl;
SemaphoreHandle_t spi_lock;
TaskHandle_t rx_task_hdl;
uint32_t sw_reset_timeout_ms;
int int_gpio_num;
uint8_t addr[6];
bool packets_remain;
} emac_w5500_t;
static inline bool w5500_lock(emac_w5500_t *emac)
{
return xSemaphoreTake(emac->spi_lock, pdMS_TO_TICKS(W5500_SPI_LOCK_TIMEOUT_MS)) == pdTRUE;
}
static inline bool w5500_unlock(emac_w5500_t *emac)
{
return xSemaphoreGive(emac->spi_lock) == pdTRUE;
}
static esp_err_t w5500_write(emac_w5500_t *emac, uint32_t address, const void *value, uint32_t len)
{
esp_err_t ret = ESP_OK;
spi_transaction_t trans = {
.cmd = (address >> W5500_ADDR_OFFSET),
.addr = ((address & 0xFFFF) | (W5500_ACCESS_MODE_WRITE << W5500_RWB_OFFSET) | W5500_SPI_OP_MODE_VDM),
.length = 8 * len,
.tx_buffer = value
};
if (w5500_lock(emac)) {
if (spi_device_polling_transmit(emac->spi_hdl, &trans) != ESP_OK) {
ESP_LOGE(TAG, "%s(%d): spi transmit failed", __FUNCTION__, __LINE__);
ret = ESP_FAIL;
}
w5500_unlock(emac);
} else {
ret = ESP_ERR_TIMEOUT;
}
return ret;
}
static esp_err_t w5500_read(emac_w5500_t *emac, uint32_t address, void *value, uint32_t len)
{
esp_err_t ret = ESP_OK;
spi_transaction_t trans = {
.flags = len <= 4 ? SPI_TRANS_USE_RXDATA : 0, // use direct reads for registers to prevent overwrites by 4-byte boundary writes
.cmd = (address >> W5500_ADDR_OFFSET),
.addr = ((address & 0xFFFF) | (W5500_ACCESS_MODE_READ << W5500_RWB_OFFSET) | W5500_SPI_OP_MODE_VDM),
.length = 8 * len,
.rx_buffer = value
};
if (w5500_lock(emac)) {
if (spi_device_polling_transmit(emac->spi_hdl, &trans) != ESP_OK) {
ESP_LOGE(TAG, "%s(%d): spi transmit failed", __FUNCTION__, __LINE__);
ret = ESP_FAIL;
}
w5500_unlock(emac);
} else {
ret = ESP_ERR_TIMEOUT;
}
if ((trans.flags&SPI_TRANS_USE_RXDATA) && len <= 4) {
memcpy(value, trans.rx_data, len); // copy register values to output
}
return ret;
}
static esp_err_t w5500_send_command(emac_w5500_t *emac, uint8_t command, uint32_t timeout_ms)
{
esp_err_t ret = ESP_OK;
ESP_GOTO_ON_ERROR(w5500_write(emac, W5500_REG_SOCK_CR(0), &command, sizeof(command)), err, TAG, "write SCR failed");
// after W5500 accepts the command, the command register will be cleared automatically
uint32_t to = 0;
for (to = 0; to < timeout_ms / 10; to++) {
ESP_GOTO_ON_ERROR(w5500_read(emac, W5500_REG_SOCK_CR(0), &command, sizeof(command)), err, TAG, "read SCR failed");
if (!command) {
break;
}
vTaskDelay(pdMS_TO_TICKS(10));
}
ESP_GOTO_ON_FALSE(to < timeout_ms / 10, ESP_ERR_TIMEOUT, err, TAG, "send command timeout");
err:
return ret;
}
static esp_err_t w5500_get_tx_free_size(emac_w5500_t *emac, uint16_t *size)
{
esp_err_t ret = ESP_OK;
uint16_t free0, free1 = 0;
// read TX_FSR register more than once, until we get the same value
// this is a trick because we might be interrupted between reading the high/low part of the TX_FSR register (16 bits in length)
do {
ESP_GOTO_ON_ERROR(w5500_read(emac, W5500_REG_SOCK_TX_FSR(0), &free0, sizeof(free0)), err, TAG, "read TX FSR failed");
ESP_GOTO_ON_ERROR(w5500_read(emac, W5500_REG_SOCK_TX_FSR(0), &free1, sizeof(free1)), err, TAG, "read TX FSR failed");
} while (free0 != free1);
*size = __builtin_bswap16(free0);
err:
return ret;
}
static esp_err_t w5500_get_rx_received_size(emac_w5500_t *emac, uint16_t *size)
{
esp_err_t ret = ESP_OK;
uint16_t received0, received1 = 0;
do {
ESP_GOTO_ON_ERROR(w5500_read(emac, W5500_REG_SOCK_RX_RSR(0), &received0, sizeof(received0)), err, TAG, "read RX RSR failed");
ESP_GOTO_ON_ERROR(w5500_read(emac, W5500_REG_SOCK_RX_RSR(0), &received1, sizeof(received1)), err, TAG, "read RX RSR failed");
} while (received0 != received1);
*size = __builtin_bswap16(received0);
err:
return ret;
}
static esp_err_t w5500_write_buffer(emac_w5500_t *emac, const void *buffer, uint32_t len, uint16_t offset)
{
esp_err_t ret = ESP_OK;
uint32_t remain = len;
const uint8_t *buf = buffer;
offset %= W5500_TX_MEM_SIZE;
if (offset + len > W5500_TX_MEM_SIZE) {
remain = (offset + len) % W5500_TX_MEM_SIZE;
len = W5500_TX_MEM_SIZE - offset;
ESP_GOTO_ON_ERROR(w5500_write(emac, W5500_MEM_SOCK_TX(0, offset), buf, len), err, TAG, "write TX buffer failed");
offset += len;
buf += len;
}
ESP_GOTO_ON_ERROR(w5500_write(emac, W5500_MEM_SOCK_TX(0, offset), buf, remain), err, TAG, "write TX buffer failed");
err:
return ret;
}
static esp_err_t w5500_read_buffer(emac_w5500_t *emac, void *buffer, uint32_t len, uint16_t offset)
{
esp_err_t ret = ESP_OK;
uint32_t remain = len;
uint8_t *buf = buffer;
offset %= W5500_RX_MEM_SIZE;
if (offset + len > W5500_RX_MEM_SIZE) {
remain = (offset + len) % W5500_RX_MEM_SIZE;
len = W5500_RX_MEM_SIZE - offset;
ESP_GOTO_ON_ERROR(w5500_read(emac, W5500_MEM_SOCK_RX(0, offset), buf, len), err, TAG, "read RX buffer failed");
offset += len;
buf += len;
}
ESP_GOTO_ON_ERROR(w5500_read(emac, W5500_MEM_SOCK_RX(0, offset), buf, remain), err, TAG, "read RX buffer failed");
err:
return ret;
}
static esp_err_t w5500_set_mac_addr(emac_w5500_t *emac)
{
esp_err_t ret = ESP_OK;
ESP_GOTO_ON_ERROR(w5500_write(emac, W5500_REG_MAC, emac->addr, 6), err, TAG, "write MAC address register failed");
err:
return ret;
}
static esp_err_t w5500_reset(emac_w5500_t *emac)
{
esp_err_t ret = ESP_OK;
/* software reset */
uint8_t mr = W5500_MR_RST; // Set RST bit (auto clear)
ESP_GOTO_ON_ERROR(w5500_write(emac, W5500_REG_MR, &mr, sizeof(mr)), err, TAG, "write MR failed");
uint32_t to = 0;
for (to = 0; to < emac->sw_reset_timeout_ms / 10; to++) {
ESP_GOTO_ON_ERROR(w5500_read(emac, W5500_REG_MR, &mr, sizeof(mr)), err, TAG, "read MR failed");
if (!(mr & W5500_MR_RST)) {
break;
}
vTaskDelay(pdMS_TO_TICKS(10));
}
ESP_GOTO_ON_FALSE(to < emac->sw_reset_timeout_ms / 10, ESP_ERR_TIMEOUT, err, TAG, "reset timeout");
err:
return ret;
}
static esp_err_t w5500_verify_id(emac_w5500_t *emac)
{
esp_err_t ret = ESP_OK;
uint8_t version = 0;
ESP_GOTO_ON_ERROR(w5500_read(emac, W5500_REG_VERSIONR, &version, sizeof(version)), err, TAG, "read VERSIONR failed");
// W5500 doesn't have chip ID, we just print the version number instead
ESP_LOGI(TAG, "version=%x", version);
err:
return ret;
}
static esp_err_t w5500_setup_default(emac_w5500_t *emac)
{
esp_err_t ret = ESP_OK;
uint8_t reg_value = 16;
// Only SOCK0 can be used as MAC RAW mode, so we give the whole buffer (16KB TX and 16KB RX) to SOCK0
ESP_GOTO_ON_ERROR(w5500_write(emac, W5500_REG_SOCK_RXBUF_SIZE(0), &reg_value, sizeof(reg_value)), err, TAG, "set rx buffer size failed");
ESP_GOTO_ON_ERROR(w5500_write(emac, W5500_REG_SOCK_TXBUF_SIZE(0), &reg_value, sizeof(reg_value)), err, TAG, "set tx buffer size failed");
reg_value = 0;
for (int i = 1; i < 8; i++) {
ESP_GOTO_ON_ERROR(w5500_write(emac, W5500_REG_SOCK_RXBUF_SIZE(i), &reg_value, sizeof(reg_value)), err, TAG, "set rx buffer size failed");
ESP_GOTO_ON_ERROR(w5500_write(emac, W5500_REG_SOCK_TXBUF_SIZE(i), &reg_value, sizeof(reg_value)), err, TAG, "set tx buffer size failed");
}
/* Enable ping block, disable PPPoE, WOL */
reg_value = W5500_MR_PB;
ESP_GOTO_ON_ERROR(w5500_write(emac, W5500_REG_MR, &reg_value, sizeof(reg_value)), err, TAG, "write MR failed");
/* Disable interrupt for all sockets by default */
reg_value = 0;
ESP_GOTO_ON_ERROR(w5500_write(emac, W5500_REG_SIMR, &reg_value, sizeof(reg_value)), err, TAG, "write SIMR failed");
/* Enable MAC RAW mode for SOCK0, enable MAC filter, no blocking broadcast and multicast */
reg_value = W5500_SMR_MAC_RAW | W5500_SMR_MAC_FILTER;
ESP_GOTO_ON_ERROR(w5500_write(emac, W5500_REG_SOCK_MR(0), &reg_value, sizeof(reg_value)), err, TAG, "write SMR failed");
/* Enable receive event for SOCK0 */
reg_value = W5500_SIR_RECV;
ESP_GOTO_ON_ERROR(w5500_write(emac, W5500_REG_SOCK_IMR(0), &reg_value, sizeof(reg_value)), err, TAG, "write SOCK0 IMR failed");
/* Set the interrupt re-assert level to maximum (~1.5ms) to lower the chances of missing it */
uint16_t int_level = __builtin_bswap16(0xFFFF);
ESP_GOTO_ON_ERROR(w5500_write(emac, W5500_REG_INTLEVEL, &int_level, sizeof(int_level)), err, TAG, "write INTLEVEL failed");
err:
return ret;
}
static esp_err_t emac_w5500_start(esp_eth_mac_t *mac)
{
esp_err_t ret = ESP_OK;
emac_w5500_t *emac = __containerof(mac, emac_w5500_t, parent);
uint8_t reg_value = 0;
/* open SOCK0 */
ESP_GOTO_ON_ERROR(w5500_send_command(emac, W5500_SCR_OPEN, 100), err, TAG, "issue OPEN command failed");
/* enable interrupt for SOCK0 */
reg_value = W5500_SIMR_SOCK0;
ESP_GOTO_ON_ERROR(w5500_write(emac, W5500_REG_SIMR, &reg_value, sizeof(reg_value)), err, TAG, "write SIMR failed");
err:
return ret;
}
static esp_err_t emac_w5500_stop(esp_eth_mac_t *mac)
{
esp_err_t ret = ESP_OK;
emac_w5500_t *emac = __containerof(mac, emac_w5500_t, parent);
uint8_t reg_value = 0;
/* disable interrupt */
ESP_GOTO_ON_ERROR(w5500_write(emac, W5500_REG_SIMR, &reg_value, sizeof(reg_value)), err, TAG, "write SIMR failed");
/* close SOCK0 */
ESP_GOTO_ON_ERROR(w5500_send_command(emac, W5500_SCR_CLOSE, 100), err, TAG, "issue CLOSE command failed");
err:
return ret;
}
IRAM_ATTR static void w5500_isr_handler(void *arg)
{
emac_w5500_t *emac = (emac_w5500_t *)arg;
BaseType_t high_task_wakeup = pdFALSE;
/* notify w5500 task */
vTaskNotifyGiveFromISR(emac->rx_task_hdl, &high_task_wakeup);
if (high_task_wakeup != pdFALSE) {
portYIELD_FROM_ISR();
}
}
static void emac_w5500_task(void *arg)
{
emac_w5500_t *emac = (emac_w5500_t *)arg;
uint8_t status = 0;
uint8_t *buffer = NULL;
uint32_t length = 0;
while (1) {
// check if the task receives any notification
if (ulTaskNotifyTake(pdTRUE, pdMS_TO_TICKS(1000)) == 0 && // if no notification ...
gpio_get_level(emac->int_gpio_num) != 0) { // ...and no interrupt asserted
continue; // -> just continue to check again
}
/* read interrupt status */
w5500_read(emac, W5500_REG_SOCK_IR(0), &status, sizeof(status));
/* packet received */
if (status & W5500_SIR_RECV) {
status = W5500_SIR_RECV;
// clear interrupt status
w5500_write(emac, W5500_REG_SOCK_IR(0), &status, sizeof(status));
do {
length = ETH_MAX_PACKET_SIZE;
buffer = heap_caps_malloc(length, MALLOC_CAP_DMA);
if (!buffer) {
ESP_LOGE(TAG, "no mem for receive buffer");
break;
} else if (emac->parent.receive(&emac->parent, buffer, &length) == ESP_OK) {
/* pass the buffer to stack (e.g. TCP/IP layer) */
if (length) {
emac->eth->stack_input(emac->eth, buffer, length);
} else {
free(buffer);
}
} else {
free(buffer);
}
} while (emac->packets_remain);
}
}
vTaskDelete(NULL);
}
static esp_err_t emac_w5500_set_mediator(esp_eth_mac_t *mac, esp_eth_mediator_t *eth)
{
esp_err_t ret = ESP_OK;
ESP_GOTO_ON_FALSE(eth, ESP_ERR_INVALID_ARG, err, TAG, "can't set mac's mediator to null");
emac_w5500_t *emac = __containerof(mac, emac_w5500_t, parent);
emac->eth = eth;
return ESP_OK;
err:
return ret;
}
static esp_err_t emac_w5500_write_phy_reg(esp_eth_mac_t *mac, uint32_t phy_addr, uint32_t phy_reg, uint32_t reg_value)
{
esp_err_t ret = ESP_OK;
emac_w5500_t *emac = __containerof(mac, emac_w5500_t, parent);
// PHY register and MAC registers are mixed together in W5500
// The only PHY register is PHYCFGR
ESP_GOTO_ON_FALSE(phy_reg == W5500_REG_PHYCFGR, ESP_FAIL, err, TAG, "wrong PHY register");
ESP_GOTO_ON_ERROR(w5500_write(emac, W5500_REG_PHYCFGR, &reg_value, sizeof(uint8_t)), err, TAG, "write PHY register failed");
err:
return ret;
}
static esp_err_t emac_w5500_read_phy_reg(esp_eth_mac_t *mac, uint32_t phy_addr, uint32_t phy_reg, uint32_t *reg_value)
{
esp_err_t ret = ESP_OK;
ESP_GOTO_ON_FALSE(reg_value, ESP_ERR_INVALID_ARG, err, TAG, "can't set reg_value to null");
emac_w5500_t *emac = __containerof(mac, emac_w5500_t, parent);
// PHY register and MAC registers are mixed together in W5500
// The only PHY register is PHYCFGR
ESP_GOTO_ON_FALSE(phy_reg == W5500_REG_PHYCFGR, ESP_FAIL, err, TAG, "wrong PHY register");
ESP_GOTO_ON_ERROR(w5500_read(emac, W5500_REG_PHYCFGR, reg_value, sizeof(uint8_t)), err, TAG, "read PHY register failed");
err:
return ret;
}
static esp_err_t emac_w5500_set_addr(esp_eth_mac_t *mac, uint8_t *addr)
{
esp_err_t ret = ESP_OK;
ESP_GOTO_ON_FALSE(addr, ESP_ERR_INVALID_ARG, err, TAG, "invalid argument");
emac_w5500_t *emac = __containerof(mac, emac_w5500_t, parent);
memcpy(emac->addr, addr, 6);
ESP_GOTO_ON_ERROR(w5500_set_mac_addr(emac), err, TAG, "set mac address failed");
err:
return ret;
}
static esp_err_t emac_w5500_get_addr(esp_eth_mac_t *mac, uint8_t *addr)
{
esp_err_t ret = ESP_OK;
ESP_GOTO_ON_FALSE(addr, ESP_ERR_INVALID_ARG, err, TAG, "invalid argument");
emac_w5500_t *emac = __containerof(mac, emac_w5500_t, parent);
memcpy(addr, emac->addr, 6);
err:
return ret;
}
static esp_err_t emac_w5500_set_link(esp_eth_mac_t *mac, eth_link_t link)
{
esp_err_t ret = ESP_OK;
switch (link) {
case ETH_LINK_UP:
ESP_LOGD(TAG, "link is up");
ESP_GOTO_ON_ERROR(mac->start(mac), err, TAG, "w5500 start failed");
break;
case ETH_LINK_DOWN:
ESP_LOGD(TAG, "link is down");
ESP_GOTO_ON_ERROR(mac->stop(mac), err, TAG, "w5500 stop failed");
break;
default:
ESP_GOTO_ON_FALSE(false, ESP_ERR_INVALID_ARG, err, TAG, "unknown link status");
break;
}
err:
return ret;
}
static esp_err_t emac_w5500_set_speed(esp_eth_mac_t *mac, eth_speed_t speed)
{
esp_err_t ret = ESP_OK;
switch (speed) {
case ETH_SPEED_10M:
ESP_LOGD(TAG, "working in 10Mbps");
break;
case ETH_SPEED_100M:
ESP_LOGD(TAG, "working in 100Mbps");
break;
default:
ESP_GOTO_ON_FALSE(false, ESP_ERR_INVALID_ARG, err, TAG, "unknown speed");
break;
}
err:
return ret;
}
static esp_err_t emac_w5500_set_duplex(esp_eth_mac_t *mac, eth_duplex_t duplex)
{
esp_err_t ret = ESP_OK;
switch (duplex) {
case ETH_DUPLEX_HALF:
ESP_LOGD(TAG, "working in half duplex");
break;
case ETH_DUPLEX_FULL:
ESP_LOGD(TAG, "working in full duplex");
break;
default:
ESP_GOTO_ON_FALSE(false, ESP_ERR_INVALID_ARG, err, TAG, "unknown duplex");
break;
}
err:
return ret;
}
static esp_err_t emac_w5500_set_promiscuous(esp_eth_mac_t *mac, bool enable)
{
esp_err_t ret = ESP_OK;
emac_w5500_t *emac = __containerof(mac, emac_w5500_t, parent);
uint8_t smr = 0;
ESP_GOTO_ON_ERROR(w5500_read(emac, W5500_REG_SOCK_MR(0), &smr, sizeof(smr)), err, TAG, "read SMR failed");
if (enable) {
smr &= ~W5500_SMR_MAC_FILTER;
} else {
smr |= W5500_SMR_MAC_FILTER;
}
ESP_GOTO_ON_ERROR(w5500_write(emac, W5500_REG_SOCK_MR(0), &smr, sizeof(smr)), err, TAG, "write SMR failed");
err:
return ret;
}
static esp_err_t emac_w5500_enable_flow_ctrl(esp_eth_mac_t *mac, bool enable)
{
/* w5500 doesn't support flow control function, so accept any value */
return ESP_ERR_NOT_SUPPORTED;
}
static esp_err_t emac_w5500_set_peer_pause_ability(esp_eth_mac_t *mac, uint32_t ability)
{
/* w5500 doesn't suppport PAUSE function, so accept any value */
return ESP_ERR_NOT_SUPPORTED;
}
static inline bool is_w5500_sane_for_rxtx(emac_w5500_t *emac)
{
uint8_t phycfg;
/* phy is ok for rx and tx operations if bits RST and LNK are set (no link down, no reset) */
if (w5500_read(emac, W5500_REG_PHYCFGR, &phycfg, 1) == ESP_OK && (phycfg & 0x8001)) {
return true;
}
return false;
}
static esp_err_t emac_w5500_transmit(esp_eth_mac_t *mac, uint8_t *buf, uint32_t length)
{
esp_err_t ret = ESP_OK;
emac_w5500_t *emac = __containerof(mac, emac_w5500_t, parent);
uint16_t offset = 0;
// check if there're free memory to store this packet
uint16_t free_size = 0;
ESP_GOTO_ON_ERROR(w5500_get_tx_free_size(emac, &free_size), err, TAG, "get free size failed");
ESP_GOTO_ON_FALSE(length <= free_size, ESP_ERR_NO_MEM, err, TAG, "free size (%d) < send length (%d)", length, free_size);
// get current write pointer
ESP_GOTO_ON_ERROR(w5500_read(emac, W5500_REG_SOCK_TX_WR(0), &offset, sizeof(offset)), err, TAG, "read TX WR failed");
offset = __builtin_bswap16(offset);
// copy data to tx memory
ESP_GOTO_ON_ERROR(w5500_write_buffer(emac, buf, length, offset), err, TAG, "write frame failed");
// update write pointer
offset += length;
offset = __builtin_bswap16(offset);
ESP_GOTO_ON_ERROR(w5500_write(emac, W5500_REG_SOCK_TX_WR(0), &offset, sizeof(offset)), err, TAG, "write TX WR failed");
// issue SEND command
ESP_GOTO_ON_ERROR(w5500_send_command(emac, W5500_SCR_SEND, 100), err, TAG, "issue SEND command failed");
// pooling the TX done event
int retry = 0;
uint8_t status = 0;
while (!(status & W5500_SIR_SEND)) {
ESP_GOTO_ON_ERROR(w5500_read(emac, W5500_REG_SOCK_IR(0), &status, sizeof(status)), err, TAG, "read SOCK0 IR failed");
if ((retry++ > 3 && !is_w5500_sane_for_rxtx(emac)) || retry > 10) {
return ESP_FAIL;
}
}
// clear the event bit
status = W5500_SIR_SEND;
ESP_GOTO_ON_ERROR(w5500_write(emac, W5500_REG_SOCK_IR(0), &status, sizeof(status)), err, TAG, "write SOCK0 IR failed");
err:
return ret;
}
static esp_err_t emac_w5500_receive(esp_eth_mac_t *mac, uint8_t *buf, uint32_t *length)
{
esp_err_t ret = ESP_OK;
emac_w5500_t *emac = __containerof(mac, emac_w5500_t, parent);
uint16_t offset = 0;
uint16_t rx_len = 0;
uint16_t remain_bytes = 0;
emac->packets_remain = false;
w5500_get_rx_received_size(emac, &remain_bytes);
if (remain_bytes) {
// get current read pointer
ESP_GOTO_ON_ERROR(w5500_read(emac, W5500_REG_SOCK_RX_RD(0), &offset, sizeof(offset)), err, TAG, "read RX RD failed");
offset = __builtin_bswap16(offset);
// read head first
ESP_GOTO_ON_ERROR(w5500_read_buffer(emac, &rx_len, sizeof(rx_len), offset), err, TAG, "read frame header failed");
rx_len = __builtin_bswap16(rx_len) - 2; // data size includes 2 bytes of header
offset += 2;
// read the payload
ESP_GOTO_ON_ERROR(w5500_read_buffer(emac, buf, rx_len, offset), err, TAG, "read payload failed, len=%d, offset=%d", rx_len, offset);
offset += rx_len;
// update read pointer
offset = __builtin_bswap16(offset);
ESP_GOTO_ON_ERROR(w5500_write(emac, W5500_REG_SOCK_RX_RD(0), &offset, sizeof(offset)), err, TAG, "write RX RD failed");
/* issue RECV command */
ESP_GOTO_ON_ERROR(w5500_send_command(emac, W5500_SCR_RECV, 100), err, TAG, "issue RECV command failed");
// check if there're more data need to process
remain_bytes -= rx_len + 2;
emac->packets_remain = remain_bytes > 0;
}
*length = rx_len;
err:
return ret;
}
static esp_err_t emac_w5500_init(esp_eth_mac_t *mac)
{
esp_err_t ret = ESP_OK;
emac_w5500_t *emac = __containerof(mac, emac_w5500_t, parent);
esp_eth_mediator_t *eth = emac->eth;
esp_rom_gpio_pad_select_gpio(emac->int_gpio_num);
gpio_set_direction(emac->int_gpio_num, GPIO_MODE_INPUT);
gpio_set_pull_mode(emac->int_gpio_num, GPIO_PULLUP_ONLY);
gpio_set_intr_type(emac->int_gpio_num, GPIO_INTR_NEGEDGE); // active low
gpio_intr_enable(emac->int_gpio_num);
gpio_isr_handler_add(emac->int_gpio_num, w5500_isr_handler, emac);
ESP_GOTO_ON_ERROR(eth->on_state_changed(eth, ETH_STATE_LLINIT, NULL), err, TAG, "lowlevel init failed");
/* reset w5500 */
ESP_GOTO_ON_ERROR(w5500_reset(emac), err, TAG, "reset w5500 failed");
/* verify chip id */
ESP_GOTO_ON_ERROR(w5500_verify_id(emac), err, TAG, "vefiry chip ID failed");
/* default setup of internal registers */
ESP_GOTO_ON_ERROR(w5500_setup_default(emac), err, TAG, "w5500 default setup failed");
return ESP_OK;
err:
gpio_isr_handler_remove(emac->int_gpio_num);
gpio_reset_pin(emac->int_gpio_num);
eth->on_state_changed(eth, ETH_STATE_DEINIT, NULL);
return ret;
}
static esp_err_t emac_w5500_deinit(esp_eth_mac_t *mac)
{
emac_w5500_t *emac = __containerof(mac, emac_w5500_t, parent);
esp_eth_mediator_t *eth = emac->eth;
mac->stop(mac);
gpio_isr_handler_remove(emac->int_gpio_num);
gpio_reset_pin(emac->int_gpio_num);
eth->on_state_changed(eth, ETH_STATE_DEINIT, NULL);
return ESP_OK;
}
static esp_err_t emac_w5500_del(esp_eth_mac_t *mac)
{
emac_w5500_t *emac = __containerof(mac, emac_w5500_t, parent);
vTaskDelete(emac->rx_task_hdl);
vSemaphoreDelete(emac->spi_lock);
free(emac);
return ESP_OK;
}
esp_eth_mac_t *esp_eth_mac_new_w5500(const eth_w5500_config_t *w5500_config, const eth_mac_config_t *mac_config)
{
esp_eth_mac_t *ret = NULL;
emac_w5500_t *emac = NULL;
ESP_GOTO_ON_FALSE(w5500_config && mac_config, NULL, err, TAG, "invalid argument");
emac = calloc(1, sizeof(emac_w5500_t));
ESP_GOTO_ON_FALSE(emac, NULL, err, TAG, "no mem for MAC instance");
/* w5500 driver is interrupt driven */
ESP_GOTO_ON_FALSE(w5500_config->int_gpio_num >= 0, NULL, err, TAG, "invalid interrupt gpio number");
/* bind methods and attributes */
emac->sw_reset_timeout_ms = mac_config->sw_reset_timeout_ms;
emac->int_gpio_num = w5500_config->int_gpio_num;
emac->spi_hdl = w5500_config->spi_hdl;
emac->parent.set_mediator = emac_w5500_set_mediator;
emac->parent.init = emac_w5500_init;
emac->parent.deinit = emac_w5500_deinit;
emac->parent.start = emac_w5500_start;
emac->parent.stop = emac_w5500_stop;
emac->parent.del = emac_w5500_del;
emac->parent.write_phy_reg = emac_w5500_write_phy_reg;
emac->parent.read_phy_reg = emac_w5500_read_phy_reg;
emac->parent.set_addr = emac_w5500_set_addr;
emac->parent.get_addr = emac_w5500_get_addr;
emac->parent.set_speed = emac_w5500_set_speed;
emac->parent.set_duplex = emac_w5500_set_duplex;
emac->parent.set_link = emac_w5500_set_link;
emac->parent.set_promiscuous = emac_w5500_set_promiscuous;
emac->parent.set_peer_pause_ability = emac_w5500_set_peer_pause_ability;
emac->parent.enable_flow_ctrl = emac_w5500_enable_flow_ctrl;
emac->parent.transmit = emac_w5500_transmit;
emac->parent.receive = emac_w5500_receive;
/* create mutex */
emac->spi_lock = xSemaphoreCreateMutex();
ESP_GOTO_ON_FALSE(emac->spi_lock, NULL, err, TAG, "create lock failed");
/* create w5500 task */
BaseType_t core_num = tskNO_AFFINITY;
if (mac_config->flags & ETH_MAC_FLAG_PIN_TO_CORE) {
core_num = cpu_hal_get_core_id();
}
BaseType_t xReturned = xTaskCreatePinnedToCore(emac_w5500_task, "w5500_tsk", mac_config->rx_task_stack_size, emac,
mac_config->rx_task_prio, &emac->rx_task_hdl, core_num);
ESP_GOTO_ON_FALSE(xReturned == pdPASS, NULL, err, TAG, "create w5500 task failed");
return &(emac->parent);
err:
if (emac) {
if (emac->rx_task_hdl) {
vTaskDelete(emac->rx_task_hdl);
}
if (emac->spi_lock) {
vSemaphoreDelete(emac->spi_lock);
}
free(emac);
}
return ret;
}
#endif

View File

@ -0,0 +1,255 @@
// Copyright 2020 Espressif Systems (Shanghai) PTE LTD
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#include <string.h>
#include <stdlib.h>
#include <sys/cdefs.h>
#include "esp_log.h"
#include "esp_check.h"
#include "esp_eth.h"
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
#include "driver/gpio.h"
#include "esp_rom_gpio.h"
#include "esp_rom_sys.h"
#include "w5500.h"
static const char *TAG = "w5500.phy";
/***************Vendor Specific Register***************/
/**
* @brief PHYCFGR(PHY Configuration Register)
*
*/
typedef union {
struct {
uint8_t link: 1; /*!< Link status */
uint8_t speed: 1; /*!< Speed status */
uint8_t duplex: 1; /*!< Duplex status */
uint8_t opmode: 3; /*!< Operation mode */
uint8_t opsel: 1; /*!< Operation select */
uint8_t reset: 1; /*!< Reset, when this bit is '0', PHY will get reset */
};
uint8_t val;
} phycfg_reg_t;
typedef struct {
esp_eth_phy_t parent;
esp_eth_mediator_t *eth;
int addr;
uint32_t reset_timeout_ms;
uint32_t autonego_timeout_ms;
eth_link_t link_status;
int reset_gpio_num;
} phy_w5500_t;
static esp_err_t w5500_update_link_duplex_speed(phy_w5500_t *w5500)
{
esp_err_t ret = ESP_OK;
esp_eth_mediator_t *eth = w5500->eth;
eth_speed_t speed = ETH_SPEED_10M;
eth_duplex_t duplex = ETH_DUPLEX_HALF;
phycfg_reg_t phycfg;
ESP_GOTO_ON_ERROR(eth->phy_reg_read(eth, w5500->addr, W5500_REG_PHYCFGR, (uint32_t *) & (phycfg.val)), err, TAG, "read PHYCFG failed");
eth_link_t link = phycfg.link ? ETH_LINK_UP : ETH_LINK_DOWN;
/* check if link status changed */
if (w5500->link_status != link) {
/* when link up, read negotiation result */
if (link == ETH_LINK_UP) {
if (phycfg.speed) {
speed = ETH_SPEED_100M;
} else {
speed = ETH_SPEED_10M;
}
if (phycfg.duplex) {
duplex = ETH_DUPLEX_FULL;
} else {
duplex = ETH_DUPLEX_HALF;
}
ESP_GOTO_ON_ERROR(eth->on_state_changed(eth, ETH_STATE_SPEED, (void *)speed), err, TAG, "change speed failed");
ESP_GOTO_ON_ERROR(eth->on_state_changed(eth, ETH_STATE_DUPLEX, (void *)duplex), err, TAG, "change duplex failed");
}
ESP_GOTO_ON_ERROR(eth->on_state_changed(eth, ETH_STATE_LINK, (void *)link), err, TAG, "change link failed");
w5500->link_status = link;
}
return ESP_OK;
err:
return ret;
}
static esp_err_t w5500_set_mediator(esp_eth_phy_t *phy, esp_eth_mediator_t *eth)
{
esp_err_t ret = ESP_OK;
ESP_GOTO_ON_FALSE(eth, ESP_ERR_INVALID_ARG, err, TAG, "can't set mediator to null");
phy_w5500_t *w5500 = __containerof(phy, phy_w5500_t, parent);
w5500->eth = eth;
return ESP_OK;
err:
return ret;
}
static esp_err_t w5500_get_link(esp_eth_phy_t *phy)
{
esp_err_t ret = ESP_OK;
phy_w5500_t *w5500 = __containerof(phy, phy_w5500_t, parent);
/* Updata information about link, speed, duplex */
ESP_GOTO_ON_ERROR(w5500_update_link_duplex_speed(w5500), err, TAG, "update link duplex speed failed");
return ESP_OK;
err:
return ret;
}
static esp_err_t w5500_reset(esp_eth_phy_t *phy)
{
esp_err_t ret = ESP_OK;
phy_w5500_t *w5500 = __containerof(phy, phy_w5500_t, parent);
w5500->link_status = ETH_LINK_DOWN;
esp_eth_mediator_t *eth = w5500->eth;
phycfg_reg_t phycfg;
ESP_GOTO_ON_ERROR(eth->phy_reg_read(eth, w5500->addr, W5500_REG_PHYCFGR, (uint32_t *) & (phycfg.val)), err, TAG, "read PHYCFG failed");
phycfg.reset = 0; // set to '0' will reset internal PHY
ESP_GOTO_ON_ERROR(eth->phy_reg_write(eth, w5500->addr, W5500_REG_PHYCFGR, phycfg.val), err, TAG, "write PHYCFG failed");
vTaskDelay(pdMS_TO_TICKS(10));
phycfg.reset = 1; // set to '1' after reset
ESP_GOTO_ON_ERROR(eth->phy_reg_write(eth, w5500->addr, W5500_REG_PHYCFGR, phycfg.val), err, TAG, "write PHYCFG failed");
return ESP_OK;
err:
return ret;
}
static esp_err_t w5500_reset_hw(esp_eth_phy_t *phy)
{
phy_w5500_t *w5500 = __containerof(phy, phy_w5500_t, parent);
// set reset_gpio_num to a negative value can skip hardware reset phy chip
if (w5500->reset_gpio_num >= 0) {
esp_rom_gpio_pad_select_gpio(w5500->reset_gpio_num);
gpio_set_direction(w5500->reset_gpio_num, GPIO_MODE_OUTPUT);
gpio_set_level(w5500->reset_gpio_num, 0);
esp_rom_delay_us(100); // insert min input assert time
gpio_set_level(w5500->reset_gpio_num, 1);
}
return ESP_OK;
}
static esp_err_t w5500_negotiate(esp_eth_phy_t *phy)
{
esp_err_t ret = ESP_OK;
phy_w5500_t *w5500 = __containerof(phy, phy_w5500_t, parent);
esp_eth_mediator_t *eth = w5500->eth;
/* in case any link status has changed, let's assume we're in link down status */
w5500->link_status = ETH_LINK_DOWN;
phycfg_reg_t phycfg;
ESP_GOTO_ON_ERROR(eth->phy_reg_read(eth, w5500->addr, W5500_REG_PHYCFGR, (uint32_t *) & (phycfg.val)), err, TAG, "read PHYCFG failed");
phycfg.opsel = 1; // PHY working mode configured by register
phycfg.opmode = 7; // all capable, auto-negotiation enabled
ESP_GOTO_ON_ERROR(eth->phy_reg_write(eth, w5500->addr, W5500_REG_PHYCFGR, phycfg.val), err, TAG, "write PHYCFG failed");
return ESP_OK;
err:
return ret;
}
static esp_err_t w5500_pwrctl(esp_eth_phy_t *phy, bool enable)
{
// power control is not supported for W5500 internal PHY
return ESP_OK;
}
static esp_err_t w5500_set_addr(esp_eth_phy_t *phy, uint32_t addr)
{
phy_w5500_t *w5500 = __containerof(phy, phy_w5500_t, parent);
w5500->addr = addr;
return ESP_OK;
}
static esp_err_t w5500_get_addr(esp_eth_phy_t *phy, uint32_t *addr)
{
esp_err_t ret = ESP_OK;
ESP_GOTO_ON_FALSE(addr, ESP_ERR_INVALID_ARG, err, TAG, "addr can't be null");
phy_w5500_t *w5500 = __containerof(phy, phy_w5500_t, parent);
*addr = w5500->addr;
return ESP_OK;
err:
return ret;
}
static esp_err_t w5500_del(esp_eth_phy_t *phy)
{
phy_w5500_t *w5500 = __containerof(phy, phy_w5500_t, parent);
free(w5500);
return ESP_OK;
}
static esp_err_t w5500_advertise_pause_ability(esp_eth_phy_t *phy, uint32_t ability)
{
// pause ability advertisement is not supported for W5500 internal PHY
return ESP_OK;
}
static esp_err_t w5500_loopback(esp_eth_phy_t *phy, bool enable)
{
// Loopback is not supported for W5500 internal PHY
return ESP_ERR_NOT_SUPPORTED;
}
static esp_err_t w5500_init(esp_eth_phy_t *phy)
{
esp_err_t ret = ESP_OK;
/* Power on Ethernet PHY */
ESP_GOTO_ON_ERROR(w5500_pwrctl(phy, true), err, TAG, "power control failed");
/* Reset Ethernet PHY */
ESP_GOTO_ON_ERROR(w5500_reset(phy), err, TAG, "reset failed");
return ESP_OK;
err:
return ret;
}
static esp_err_t w5500_deinit(esp_eth_phy_t *phy)
{
esp_err_t ret = ESP_OK;
/* Power off Ethernet PHY */
ESP_GOTO_ON_ERROR(w5500_pwrctl(phy, false), err, TAG, "power control failed");
return ESP_OK;
err:
return ret;
}
esp_eth_phy_t *esp_eth_phy_new_w5500(const eth_phy_config_t *config)
{
esp_eth_phy_t *ret = NULL;
ESP_GOTO_ON_FALSE(config, NULL, err, TAG, "invalid arguments");
phy_w5500_t *w5500 = calloc(1, sizeof(phy_w5500_t));
ESP_GOTO_ON_FALSE(w5500, NULL, err, TAG, "no mem for PHY instance");
w5500->addr = config->phy_addr;
w5500->reset_timeout_ms = config->reset_timeout_ms;
w5500->reset_gpio_num = config->reset_gpio_num;
w5500->link_status = ETH_LINK_DOWN;
w5500->autonego_timeout_ms = config->autonego_timeout_ms;
w5500->parent.reset = w5500_reset;
w5500->parent.reset_hw = w5500_reset_hw;
w5500->parent.init = w5500_init;
w5500->parent.deinit = w5500_deinit;
w5500->parent.set_mediator = w5500_set_mediator;
w5500->parent.negotiate = w5500_negotiate;
w5500->parent.get_link = w5500_get_link;
w5500->parent.pwrctl = w5500_pwrctl;
w5500->parent.get_addr = w5500_get_addr;
w5500->parent.set_addr = w5500_set_addr;
w5500->parent.advertise_pause_ability = w5500_advertise_pause_ability;
w5500->parent.loopback = w5500_loopback;
w5500->parent.del = w5500_del;
return &(w5500->parent);
err:
return ret;
}

77
lib/ETHSPI/w5500.h Normal file
View File

@ -0,0 +1,77 @@
// Copyright 2020 Espressif Systems (Shanghai) PTE LTD
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#define W5500_ADDR_OFFSET (16) // Address length
#define W5500_BSB_OFFSET (3) // Block Select Bits offset
#define W5500_RWB_OFFSET (2) // Read Write Bits offset
#define W5500_BSB_COM_REG (0x00) // Common Register
#define W5500_BSB_SOCK_REG(s) ((s)*4+1) // Socket Register
#define W5500_BSB_SOCK_TX_BUF(s) ((s)*4+2) // Socket TX Buffer
#define W5500_BSB_SOCK_RX_BUF(s) ((s)*4+3) // Socket RX Buffer
#define W5500_ACCESS_MODE_READ (0) // Read Mode
#define W5500_ACCESS_MODE_WRITE (1) // Write Mode
#define W5500_SPI_OP_MODE_VDM (0x00) // Variable Data Length Mode (SPI frame is controlled by CS line)
#define W5500_SPI_OP_MODE_FDM_1 (0x01) // Fixed Data Length Mode, 1 Byte Length
#define W5500_SPI_OP_MODE_FDM_2 (0x02) // Fixed Data Length Mode, 2 Bytes Length
#define W5500_SPI_OP_MODE_FDM_4 (0x03) // Fixed Data Length Mode, 4 Bytes Length
#define W5500_MAKE_MAP(offset, bsb) ((offset) << W5500_ADDR_OFFSET | (bsb) << W5500_BSB_OFFSET)
#define W5500_REG_MR W5500_MAKE_MAP(0x0000, W5500_BSB_COM_REG) // Mode
#define W5500_REG_MAC W5500_MAKE_MAP(0x0009, W5500_BSB_COM_REG) // MAC Address
#define W5500_REG_INTLEVEL W5500_MAKE_MAP(0x0013, W5500_BSB_COM_REG) // Interrupt Level Timeout
#define W5500_REG_IR W5500_MAKE_MAP(0x0015, W5500_BSB_COM_REG) // Interrupt
#define W5500_REG_IMR W5500_MAKE_MAP(0x0016, W5500_BSB_COM_REG) // Interrupt Mask
#define W5500_REG_SIR W5500_MAKE_MAP(0x0017, W5500_BSB_COM_REG) // Socket Interrupt
#define W5500_REG_SIMR W5500_MAKE_MAP(0x0018, W5500_BSB_COM_REG) // Socket Interrupt Mask
#define W5500_REG_RTR W5500_MAKE_MAP(0x0019, W5500_BSB_COM_REG) // Retry Time
#define W5500_REG_RCR W5500_MAKE_MAP(0x001B, W5500_BSB_COM_REG) // Retry Count
#define W5500_REG_PHYCFGR W5500_MAKE_MAP(0x002E, W5500_BSB_COM_REG) // PHY Configuration
#define W5500_REG_VERSIONR W5500_MAKE_MAP(0x0039, W5500_BSB_COM_REG) // Chip version
#define W5500_REG_SOCK_MR(s) W5500_MAKE_MAP(0x0000, W5500_BSB_SOCK_REG(s)) // Socket Mode
#define W5500_REG_SOCK_CR(s) W5500_MAKE_MAP(0x0001, W5500_BSB_SOCK_REG(s)) // Socket Command
#define W5500_REG_SOCK_IR(s) W5500_MAKE_MAP(0x0002, W5500_BSB_SOCK_REG(s)) // Socket Interrupt
#define W5500_REG_SOCK_SR(s) W5500_MAKE_MAP(0x0004, W5500_BSB_SOCK_REG(s)) // Socket Status
#define W5500_REG_SOCK_RXBUF_SIZE(s) W5500_MAKE_MAP(0x001E, W5500_BSB_SOCK_REG(s)) // Socket Receive Buffer Size
#define W5500_REG_SOCK_TXBUF_SIZE(s) W5500_MAKE_MAP(0x001F, W5500_BSB_SOCK_REG(s)) // Socket Transmit Buffer Size
#define W5500_REG_SOCK_TX_FSR(s) W5500_MAKE_MAP(0x0020, W5500_BSB_SOCK_REG(s)) // Socket TX Free Size
#define W5500_REG_SOCK_TX_RD(s) W5500_MAKE_MAP(0x0022, W5500_BSB_SOCK_REG(s)) // Socket TX Read Pointer
#define W5500_REG_SOCK_TX_WR(s) W5500_MAKE_MAP(0x0024, W5500_BSB_SOCK_REG(s)) // Socket TX Write Pointer
#define W5500_REG_SOCK_RX_RSR(s) W5500_MAKE_MAP(0x0026, W5500_BSB_SOCK_REG(s)) // Socket RX Received Size
#define W5500_REG_SOCK_RX_RD(s) W5500_MAKE_MAP(0x0028, W5500_BSB_SOCK_REG(s)) // Socket RX Read Pointer
#define W5500_REG_SOCK_RX_WR(s) W5500_MAKE_MAP(0x002A, W5500_BSB_SOCK_REG(s)) // Socket RX Write Pointer
#define W5500_REG_SOCK_IMR(s) W5500_MAKE_MAP(0x002C, W5500_BSB_SOCK_REG(s)) // Socket Interrupt Mask
#define W5500_MEM_SOCK_TX(s,addr) W5500_MAKE_MAP(addr, W5500_BSB_SOCK_TX_BUF(s)) // Socket TX buffer address
#define W5500_MEM_SOCK_RX(s,addr) W5500_MAKE_MAP(addr, W5500_BSB_SOCK_RX_BUF(s)) // Socket RX buffer address
#define W5500_MR_RST (1<<7) // Software reset
#define W5500_MR_PB (1<<4) // Ping block (block the response to a ping request)
#define W5500_SIMR_SOCK0 (1<<0) // Socket 0 interrupt
#define W5500_SMR_MAC_RAW (1<<2) // MAC RAW mode
#define W5500_SMR_MAC_FILTER (1<<7) // MAC filter
#define W5500_SCR_OPEN (0x01) // Open command
#define W5500_SCR_CLOSE (0x10) // Close command
#define W5500_SCR_SEND (0x20) // Send command
#define W5500_SCR_RECV (0x40) // Recv command
#define W5500_SIR_RECV (1<<2) // Receive done
#define W5500_SIR_SEND (1<<4) // Send done

38
lib/FT6336U/.gitignore vendored Normal file
View File

@ -0,0 +1,38 @@
# Prerequisites
*.d
# Compiled Object files
*.slo
*.lo
*.o
*.obj
# Precompiled Headers
*.gch
*.pch
# Compiled Dynamic libraries
*.so
*.dylib
*.dll
# Fortran module files
*.mod
*.smod
# Compiled Static libraries
*.lai
*.la
*.a
*.lib
# Executables
*.exe
*.out
*.app
# VS Code Setting
.vscode/
# Build Folder
build/

21
lib/FT6336U/LICENSE Normal file
View File

@ -0,0 +1,21 @@
MIT License
Copyright (c) 2020 aselectroworks
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

5
lib/FT6336U/README.md Normal file
View File

@ -0,0 +1,5 @@
# FT6336U Library
FocalTech FT6336U (Self-Capacitive Touch Panel Controller) library for Arduino.
## License
This code is released under the MIT License. Please see [LICENSE](https://github.com/aselectroworks/Arduino-FT6336U/blob/master/LICENSE) for the full text.

View File

@ -0,0 +1,40 @@
#include "FT6336U.h"
#define I2C_SDA 22
#define I2C_SCL 23
#define RST_N_PIN 21
#define INT_N_PIN 34
FT6336U ft6336u(I2C_SDA, I2C_SCL, RST_N_PIN, INT_N_PIN);
void setup() {
Serial.begin(115200);
ft6336u.begin();
Serial.print("FT6336U Firmware Version: ");
Serial.println(ft6336u.read_firmware_id());
Serial.print("FT6336U Device Mode: ");
Serial.println(ft6336u.read_device_mode());
}
void loop() {
if(digitalRead(INT_N_PIN) != -1) {
Serial.print("FT6336U TD Status: ");
Serial.println(ft6336u.read_td_status());
Serial.print("FT6336U Touch Event/ID 1: (");
Serial.print(ft6336u.read_touch1_event()); Serial.print(" / "); Serial.print(ft6336u.read_touch1_id()); Serial.println(")");
Serial.print("FT6336U Touch Position 1: (");
Serial.print(ft6336u.read_touch1_x()); Serial.print(" , "); Serial.print(ft6336u.read_touch1_y()); Serial.println(")");
Serial.print("FT6336U Touch Weight/MISC 1: (");
Serial.print(ft6336u.read_touch1_weight()); Serial.print(" / "); Serial.print(ft6336u.read_touch1_misc()); Serial.println(")");
Serial.print("FT6336U Touch Event/ID 2: (");
Serial.print(ft6336u.read_touch2_event()); Serial.print(" / "); Serial.print(ft6336u.read_touch2_id()); Serial.println(")");
Serial.print("FT6336U Touch Position 2: (");
Serial.print(ft6336u.read_touch2_x()); Serial.print(" , "); Serial.print(ft6336u.read_touch2_y()); Serial.println(")");
Serial.print("FT6336U Touch Weight/MISC 2: (");
Serial.print(ft6336u.read_touch2_weight()); Serial.print(" / "); Serial.print(ft6336u.read_touch2_misc()); Serial.println(")");
}
}

View File

@ -0,0 +1,57 @@
#include "FT6336U.h"
#include <stdio.h>
#define I2C_SDA 22
#define I2C_SCL 23
#define RST_N_PIN 21
#define INT_N_PIN 34
FT6336U ft6336u(I2C_SDA, I2C_SCL, RST_N_PIN, INT_N_PIN);
void setup() {
Serial.begin(115200);
ft6336u.begin();
// ft6336u.write_device_mode(factory_mode);
Serial.print("FT6336U Device Mode: ");
Serial.println(ft6336u.read_device_mode());
Serial.print("FT6336U Threshold: 0x");
Serial.println(ft6336u.read_touch_threshold(), HEX);
Serial.print("FT6336U Filter Coefficient: 0x");
Serial.println(ft6336u.read_filter_coefficient(), HEX);
Serial.print("FT6336U Control Mode: 0x");
Serial.println(ft6336u.read_ctrl_mode(), HEX);
Serial.print("FT6336U Time Period for enter to Monitor Mode: 0x");
Serial.println(ft6336u.read_time_period_enter_monitor(), HEX);
Serial.print("FT6336U Active Rate: 0x");
Serial.println(ft6336u.read_active_rate(), HEX);
Serial.print("FT6336U Monitor Rate: 0x");
Serial.println(ft6336u.read_monitor_rate(), HEX);
Serial.print("FT6336U LIB Ver: 0x");
Serial.println(ft6336u.read_library_version(), HEX);
Serial.print("FT6336U Chip ID: 0x");
Serial.println(ft6336u.read_chip_id(), HEX);
Serial.print("FT6336U G Mode: 0x");
Serial.println(ft6336u.read_g_mode(), HEX);
Serial.print("FT6336U POWER Mode: 0x");
Serial.println(ft6336u.read_pwrmode(), HEX);
Serial.print("FT6336U Firm ID: 0x");
Serial.println(ft6336u.read_firmware_id(), HEX);
Serial.print("FT6336U Focal Tehc ID: 0x");
Serial.println(ft6336u.read_focaltech_id(), HEX);
Serial.print("FT6336U Release Code ID: 0x");
Serial.println(ft6336u.read_release_code_id(), HEX);
Serial.print("FT6336U State: 0x");
Serial.println(ft6336u.read_state(), HEX);
}
FT6336U_TouchPointType tp;
void loop() {
tp = ft6336u.scan();
char tempString[128];
sprintf(tempString, "FT6336U TD Count %d / TD1 (%d, %4d, %4d) / TD2 (%d, %4d, %4d)\r", tp.touch_count, tp.tp[0].status, tp.tp[0].x, tp.tp[0].y, tp.tp[1].status, tp.tp[1].x, tp.tp[1].y);
Serial.print(tempString);
}

View File

@ -0,0 +1,10 @@
name=FT6336U CTP Controller
version=1.0.2
author=Atsushi Sasaki
maintainer=Atsushi Sasaki
sentence=Arduino FT6336U CTP Controller library
paragraph=Arduino FT6336U CTP Controller library
category=Sensors
url=
architectures=*
includes=FT6336U.h

271
lib/FT6336U/src/FT6336U.cpp Normal file
View File

@ -0,0 +1,271 @@
/**************************************************************************/
/*!
@file FT6336U.cpp
Author: Atsushi Sasaki (https://github.com/aselectroworks)
License: MIT (see LICENSE)
*/
/**************************************************************************/
#include "FT6336U.h"
#include <Wire.h>
FT6336U::FT6336U(uint8_t rst_n, uint8_t int_n)
: rst_n(rst_n), int_n(int_n) {
}
#if defined(ESP32) || defined(ESP8266)
FT6336U::FT6336U(int8_t sda, int8_t scl, uint8_t rst_n, uint8_t int_n)
: sda(sda), scl(scl), rst_n(rst_n), int_n(int_n) {
}
#endif
FT6336U::~FT6336U() {
}
void FT6336U::begin(void) {
// Initialize I2C
#if defined(ESP32) || defined(ESP8266)
if(sda != -1 && scl != -1) {
Wire.begin(sda, scl);
}
else {
Wire.begin();
}
#else
Wire.begin();
#endif
// Int Pin Configuration
pinMode(int_n, INPUT);
// Reset Pin Configuration
pinMode(rst_n, OUTPUT);
digitalWrite(rst_n, LOW);
delay(10);
digitalWrite(rst_n, HIGH);
delay(500);
}
uint8_t FT6336U::read_device_mode(void) {
return (readByte(FT6336U_ADDR_DEVICE_MODE) & 0x70) >> 4;
}
void FT6336U::write_device_mode(DEVICE_MODE_Enum mode) {
writeByte(FT6336U_ADDR_DEVICE_MODE, (mode & 0x07) << 4);
}
uint8_t FT6336U::read_gesture_id(void) {
return readByte(FT6336U_ADDR_GESTURE_ID);
}
uint8_t FT6336U::read_td_status(void) {
return readByte(FT6336U_ADDR_TD_STATUS);
}
uint8_t FT6336U::read_touch_number(void) {
return readByte(FT6336U_ADDR_TD_STATUS) & 0x0F;
}
// Touch 1 functions
uint16_t FT6336U::read_touch1_x(void) {
uint8_t read_buf[2];
read_buf[0] = readByte(FT6336U_ADDR_TOUCH1_X);
read_buf[1] = readByte(FT6336U_ADDR_TOUCH1_X + 1);
return ((read_buf[0] & 0x0f) << 8) | read_buf[1];
}
uint16_t FT6336U::read_touch1_y(void) {
uint8_t read_buf[2];
read_buf[0] = readByte(FT6336U_ADDR_TOUCH1_Y);
read_buf[1] = readByte(FT6336U_ADDR_TOUCH1_Y + 1);
return ((read_buf[0] & 0x0f) << 8) | read_buf[1];
}
uint8_t FT6336U::read_touch1_event(void) {
return readByte(FT6336U_ADDR_TOUCH1_EVENT) >> 6;
}
uint8_t FT6336U::read_touch1_id(void) {
return readByte(FT6336U_ADDR_TOUCH1_ID) >> 4;
}
uint8_t FT6336U::read_touch1_weight(void) {
return readByte(FT6336U_ADDR_TOUCH1_WEIGHT);
}
uint8_t FT6336U::read_touch1_misc(void) {
return readByte(FT6336U_ADDR_TOUCH1_MISC) >> 4;
}
// Touch 2 functions
uint16_t FT6336U::read_touch2_x(void) {
uint8_t read_buf[2];
read_buf[0] = readByte(FT6336U_ADDR_TOUCH2_X);
read_buf[1] = readByte(FT6336U_ADDR_TOUCH2_X + 1);
return ((read_buf[0] & 0x0f) << 8) | read_buf[1];
}
uint16_t FT6336U::read_touch2_y(void) {
uint8_t read_buf[2];
read_buf[0] = readByte(FT6336U_ADDR_TOUCH2_Y);
read_buf[1] = readByte(FT6336U_ADDR_TOUCH2_Y + 1);
return ((read_buf[0] & 0x0f) << 8) | read_buf[1];
}
uint8_t FT6336U::read_touch2_event(void) {
return readByte(FT6336U_ADDR_TOUCH2_EVENT) >> 6;
}
uint8_t FT6336U::read_touch2_id(void) {
return readByte(FT6336U_ADDR_TOUCH2_ID) >> 4;
}
uint8_t FT6336U::read_touch2_weight(void) {
return readByte(FT6336U_ADDR_TOUCH2_WEIGHT);
}
uint8_t FT6336U::read_touch2_misc(void) {
return readByte(FT6336U_ADDR_TOUCH2_MISC) >> 4;
}
// Mode Parameter Register
uint8_t FT6336U::read_touch_threshold(void) {
return readByte(FT6336U_ADDR_THRESHOLD);
}
uint8_t FT6336U::read_filter_coefficient(void) {
return readByte(FT6336U_ADDR_FILTER_COE);
}
uint8_t FT6336U::read_ctrl_mode(void) {
return readByte(FT6336U_ADDR_CTRL);
}
void FT6336U::write_ctrl_mode(CTRL_MODE_Enum mode) {
writeByte(FT6336U_ADDR_CTRL, mode);
}
uint8_t FT6336U::read_time_period_enter_monitor(void) {
return readByte(FT6336U_ADDR_TIME_ENTER_MONITOR);
}
uint8_t FT6336U::read_active_rate(void) {
return readByte(FT6336U_ADDR_ACTIVE_MODE_RATE);
}
uint8_t FT6336U::read_monitor_rate(void) {
return readByte(FT6336U_ADDR_MONITOR_MODE_RATE);
}
// Gesture Parameters
uint8_t FT6336U::read_radian_value(void) {
return readByte(FT6336U_ADDR_RADIAN_VALUE);
}
void FT6336U::write_radian_value(uint8_t val) {
writeByte(FT6336U_ADDR_RADIAN_VALUE, val);
}
uint8_t FT6336U::read_offset_left_right(void) {
return readByte(FT6336U_ADDR_OFFSET_LEFT_RIGHT);
}
void FT6336U::write_offset_left_right(uint8_t val) {
writeByte(FT6336U_ADDR_OFFSET_LEFT_RIGHT, val);
}
uint8_t FT6336U::read_offset_up_down(void) {
return readByte(FT6336U_ADDR_OFFSET_UP_DOWN);
}
void FT6336U::write_offset_up_down(uint8_t val) {
writeByte(FT6336U_ADDR_OFFSET_UP_DOWN, val);
}
uint8_t FT6336U::read_distance_left_right(void) {
return readByte(FT6336U_ADDR_DISTANCE_LEFT_RIGHT);
}
void FT6336U::write_distance_left_right(uint8_t val) {
writeByte(FT6336U_ADDR_DISTANCE_LEFT_RIGHT, val);
}
uint8_t FT6336U::read_distance_up_down(void) {
return readByte(FT6336U_ADDR_DISTANCE_UP_DOWN);
}
void FT6336U::write_distance_up_down(uint8_t val) {
writeByte(FT6336U_ADDR_DISTANCE_UP_DOWN, val);
}
uint8_t FT6336U::read_distance_zoom(void) {
return readByte(FT6336U_ADDR_DISTANCE_ZOOM);
}
void FT6336U::write_distance_zoom(uint8_t val) {
writeByte(FT6336U_ADDR_DISTANCE_ZOOM, val);
}
// System Information
uint16_t FT6336U::read_library_version(void) {
uint8_t read_buf[2];
read_buf[0] = readByte(FT6336U_ADDR_LIBRARY_VERSION_H);
read_buf[1] = readByte(FT6336U_ADDR_LIBRARY_VERSION_L);
return ((read_buf[0] & 0x0f) << 8) | read_buf[1];
}
uint8_t FT6336U::read_chip_id(void) {
return readByte(FT6336U_ADDR_CHIP_ID);
}
uint8_t FT6336U::read_g_mode(void) {
return readByte(FT6336U_ADDR_G_MODE);
}
void FT6336U::write_g_mode(G_MODE_Enum mode){
writeByte(FT6336U_ADDR_G_MODE, mode);
}
uint8_t FT6336U::read_pwrmode(void) {
return readByte(FT6336U_ADDR_POWER_MODE);
}
uint8_t FT6336U::read_firmware_id(void) {
return readByte(FT6336U_ADDR_FIRMARE_ID);
}
uint8_t FT6336U::read_focaltech_id(void) {
return readByte(FT6336U_ADDR_FOCALTECH_ID);
}
uint8_t FT6336U::read_release_code_id(void) {
return readByte(FT6336U_ADDR_RELEASE_CODE_ID);
}
uint8_t FT6336U::read_state(void) {
return readByte(FT6336U_ADDR_STATE);
}
//coordinate diagramFPC downwards
////y ////////////////////264x176
//
//
//x
//
//
FT6336U_TouchPointType FT6336U::scan(void){
touchPoint.touch_count = read_td_status();
if(touchPoint.touch_count == 0) {
touchPoint.tp[0].status = release;
touchPoint.tp[1].status = release;
}
else if(touchPoint.touch_count == 1) {
uint8_t id1 = read_touch1_id(); // id1 = 0 or 1
touchPoint.tp[id1].status = (touchPoint.tp[id1].status == release) ? touch : stream;
touchPoint.tp[id1].x = read_touch1_x();
touchPoint.tp[id1].y = read_touch1_y();
touchPoint.tp[~id1 & 0x01].status = release;
}
else {
uint8_t id1 = read_touch1_id(); // id1 = 0 or 1
touchPoint.tp[id1].status = (touchPoint.tp[id1].status == release) ? touch : stream;
touchPoint.tp[id1].x = read_touch1_x();
touchPoint.tp[id1].y = read_touch1_y();
uint8_t id2 = read_touch2_id(); // id2 = 0 or 1(~id1 & 0x01)
touchPoint.tp[id2].status = (touchPoint.tp[id2].status == release) ? touch : stream;
touchPoint.tp[id2].x = read_touch2_x();
touchPoint.tp[id2].y = read_touch2_y();
}
return touchPoint;
}
// Private Function
uint8_t FT6336U::readByte(uint8_t addr) {
uint8_t rdData = 0;
uint8_t rdDataCount;
do {
Wire.beginTransmission(I2C_ADDR_FT6336U);
Wire.write(addr);
Wire.endTransmission(false); // Restart
delay(10);
rdDataCount = Wire.requestFrom(I2C_ADDR_FT6336U, 1);
} while(rdDataCount == 0);
while(Wire.available()) {
rdData = Wire.read();
}
return rdData;
}
void FT6336U::writeByte(uint8_t addr, uint8_t data) {
DEBUG_PRINTLN("")
DEBUG_PRINT("writeI2C reg 0x")
DEBUG_PRINT(addr, HEX)
DEBUG_PRINT(" -> 0x") DEBUG_PRINTLN(data, HEX)
Wire.beginTransmission(I2C_ADDR_FT6336U);
Wire.write(addr);
Wire.write(data);
Wire.endTransmission();
}

201
lib/FT6336U/src/FT6336U.h Normal file
View File

@ -0,0 +1,201 @@
/**************************************************************************/
/*!
@file FT6336U.h
Author: Atsushi Sasaki(https://github.com/aselectroworks)
License: MIT (see LICENSE)
*/
/**************************************************************************/
#ifndef _FT6336U_H
#define _FT6336U_H
#include <stdint.h>
#include <stdbool.h>
#include <Arduino.h>
#define I2C_ADDR_FT6336U 0x48
// Touch Parameter
#define FT6336U_PRES_DOWN 0x2
#define FT6336U_COORD_UD 0x1
// Registers
#define FT6336U_ADDR_DEVICE_MODE 0x00
typedef enum {
working_mode = 0b000,
factory_mode = 0b100,
} DEVICE_MODE_Enum;
#define FT6336U_ADDR_GESTURE_ID 0x01
#define FT6336U_ADDR_TD_STATUS 0x02
#define FT6336U_ADDR_TOUCH1_EVENT 0x03
#define FT6336U_ADDR_TOUCH1_ID 0x05
#define FT6336U_ADDR_TOUCH1_X 0x03
#define FT6336U_ADDR_TOUCH1_Y 0x05
#define FT6336U_ADDR_TOUCH1_WEIGHT 0x07
#define FT6336U_ADDR_TOUCH1_MISC 0x08
#define FT6336U_ADDR_TOUCH2_EVENT 0x09
#define FT6336U_ADDR_TOUCH2_ID 0x0B
#define FT6336U_ADDR_TOUCH2_X 0x09
#define FT6336U_ADDR_TOUCH2_Y 0x0B
#define FT6336U_ADDR_TOUCH2_WEIGHT 0x0D
#define FT6336U_ADDR_TOUCH2_MISC 0x0E
#define FT6336U_ADDR_THRESHOLD 0x80
#define FT6336U_ADDR_FILTER_COE 0x85
#define FT6336U_ADDR_CTRL 0x86
typedef enum {
keep_active_mode = 0,
switch_to_monitor_mode = 1,
} CTRL_MODE_Enum;
#define FT6336U_ADDR_TIME_ENTER_MONITOR 0x87
#define FT6336U_ADDR_ACTIVE_MODE_RATE 0x88
#define FT6336U_ADDR_MONITOR_MODE_RATE 0x89
#define FT6336U_ADDR_RADIAN_VALUE 0x91
#define FT6336U_ADDR_OFFSET_LEFT_RIGHT 0x92
#define FT6336U_ADDR_OFFSET_UP_DOWN 0x93
#define FT6336U_ADDR_DISTANCE_LEFT_RIGHT 0x94
#define FT6336U_ADDR_DISTANCE_UP_DOWN 0x95
#define FT6336U_ADDR_DISTANCE_ZOOM 0x96
#define FT6336U_ADDR_LIBRARY_VERSION_H 0xA1
#define FT6336U_ADDR_LIBRARY_VERSION_L 0xA2
#define FT6336U_ADDR_CHIP_ID 0xA3
#define FT6336U_ADDR_G_MODE 0xA4
typedef enum {
pollingMode = 0,
triggerMode = 1,
} G_MODE_Enum;
#define FT6336U_ADDR_POWER_MODE 0xA5
#define FT6336U_ADDR_FIRMARE_ID 0xA6
#define FT6336U_ADDR_FOCALTECH_ID 0xA8
#define FT6336U_ADDR_RELEASE_CODE_ID 0xAF
#define FT6336U_ADDR_STATE 0xBC
// Function Specific Type
typedef enum {
touch = 0,
stream,
release,
} TouchStatusEnum;
typedef struct {
TouchStatusEnum status;
uint16_t x;
uint16_t y;
} TouchPointType;
typedef struct {
uint8_t touch_count;
TouchPointType tp[2];
} FT6336U_TouchPointType;
// Uncomment to enable debug messages
//#define FT6336U_DEBUG
// Define where debug output will be printed
#define DEBUG_PRINTER Serial
// Setup debug printing macros
#ifdef FT6336U_DEBUG
#define DEBUG_PRINT(...) \
{ \
DEBUG_PRINTER.print(__VA_ARGS__); \
}
#define DEBUG_PRINTLN(...) \
{ \
DEBUG_PRINTER.println(__VA_ARGS__); \
}
#else
#define DEBUG_PRINT(...) \
{ \
}
#define DEBUG_PRINTLN(...) \
{ \
}
#endif
/**************************************************************************/
/*!
@brief FT6336U I2C CTP controller driver
*/
/**************************************************************************/
class FT6336U
{
public:
FT6336U(uint8_t rst_n, uint8_t int_n);
#if defined(ESP32) || defined(ESP8266)
FT6336U(int8_t sda, int8_t scl, uint8_t rst_n, uint8_t int_n);
#endif
virtual ~FT6336U();
void begin(void);
uint8_t read_device_mode(void);
void write_device_mode(DEVICE_MODE_Enum);
uint8_t read_gesture_id(void);
uint8_t read_td_status(void);
uint8_t read_touch_number(void);
uint16_t read_touch1_x(void);
uint16_t read_touch1_y(void);
uint8_t read_touch1_event(void);
uint8_t read_touch1_id(void);
uint8_t read_touch1_weight(void);
uint8_t read_touch1_misc(void);
uint16_t read_touch2_x(void);
uint16_t read_touch2_y(void);
uint8_t read_touch2_event(void);
uint8_t read_touch2_id(void);
uint8_t read_touch2_weight(void);
uint8_t read_touch2_misc(void);
// Mode Parameter Register
uint8_t read_touch_threshold(void);
uint8_t read_filter_coefficient(void);
uint8_t read_ctrl_mode(void);
void write_ctrl_mode(CTRL_MODE_Enum mode);
uint8_t read_time_period_enter_monitor(void);
uint8_t read_active_rate(void);
uint8_t read_monitor_rate(void);
// Gestrue Parameter Register
uint8_t read_radian_value(void);
void write_radian_value(uint8_t val);
uint8_t read_offset_left_right(void);
void write_offset_left_right(uint8_t val);
uint8_t read_offset_up_down(void);
void write_offset_up_down(uint8_t val);
uint8_t read_distance_left_right(void);
void write_distance_left_right(uint8_t val);
uint8_t read_distance_up_down(void);
void write_distance_up_down(uint8_t val);
uint8_t read_distance_zoom(void);
void write_distance_zoom(uint8_t val);
// System Information
uint16_t read_library_version(void);
uint8_t read_chip_id(void);
uint8_t read_g_mode(void);
void write_g_mode(G_MODE_Enum mode);
uint8_t read_pwrmode(void);
uint8_t read_firmware_id(void);
uint8_t read_focaltech_id(void);
uint8_t read_release_code_id(void);
uint8_t read_state(void);
// Scan Function
FT6336U_TouchPointType scan(void);
private:
int8_t sda = -1;
int8_t scl = -1;
uint8_t rst_n = -1;
uint8_t int_n = -1;
uint8_t readByte(uint8_t addr);
void writeByte(uint8_t addr, uint8_t data);
FT6336U_TouchPointType touchPoint;
};
#endif

File diff suppressed because it is too large Load Diff

View File

@ -15,12 +15,15 @@
** **
*******************************************************************************/
#include <FtpServerKey.h>
#ifndef FTP_SERVER_H
#define FTP_SERVER_H
#define FTP_SERVER_VERSION "2021-11-09"
#define FTP_SERVER_VERSION "2.1.5 (2023-01-13)"
#include "ArduinoLog.h"
#include <FtpServerKey.h>
#if ARDUINO >= 100
#include "Arduino.h"
#else
@ -50,6 +53,12 @@
#elif defined(ESP32)
#define FTP_SERVER_NETWORK_TYPE DEFAULT_FTP_SERVER_NETWORK_TYPE_ESP32
#define STORAGE_TYPE DEFAULT_STORAGE_TYPE_ESP32
#elif defined(ARDUINO_ARCH_STM32)
#define FTP_SERVER_NETWORK_TYPE DEFAULT_FTP_SERVER_NETWORK_TYPE_STM32
#define STORAGE_TYPE DEFAULT_STORAGE_TYPE_STM32
#elif defined(ARDUINO_ARCH_RP2040)
#define FTP_SERVER_NETWORK_TYPE DEFAULT_FTP_SERVER_NETWORK_TYPE_RP2040
#define STORAGE_TYPE DEFAULT_STORAGE_TYPE_RP2040
#elif defined(ARDUINO_ARCH_SAMD)
#define FTP_SERVER_NETWORK_TYPE DEFAULT_FTP_SERVER_NETWORK_TYPE_SAMD
#define STORAGE_TYPE DEFAULT_STORAGE_TYPE_SAMD
@ -89,72 +98,96 @@
// Includes and defined based on Network Type
#if(FTP_SERVER_NETWORK_TYPE == NETWORK_ESP8266_ASYNC)
// Note:
// No SSL/WSS support for client in Async mode
// TLS lib need a sync interface!
// Note:
// No SSL/WSS support for client in Async mode
// TLS lib need a sync interface!
#if defined(ESP8266)
#include <ESP8266WiFi.h>
//#include <WiFiClientSecure.h>
#elif defined(ESP32)
#include <WiFi.h>
//#include <WiFiClientSecure.h>
#if defined(ESP8266)
#include <ESP8266WiFi.h>
//#include <WiFiClientSecure.h>
#define FTP_CLIENT_NETWORK_CLASS WiFiClient
//#define FTP_CLIENT_NETWORK_SSL_CLASS WiFiClientSecure
#define FTP_SERVER_NETWORK_SERVER_CLASS WiFiServer
#define FTP_CLIENT_NETWORK_CLASS WiFiClient
//#define FTP_CLIENT_NETWORK_SSL_CLASS WiFiClientSecure
#define FTP_SERVER_NETWORK_SERVER_CLASS WiFiServer
#elif defined(ESP32)
#include <WiFi.h>
//#include <WiFiClientSecure.h>
#elif defined(ESP31B)
#include <ESP31BWiFi.h>
#else
#error "network type ESP8266 ASYNC only possible on the ESP mcu!"
#endif
#define FTP_CLIENT_NETWORK_CLASS WiFiClient
//#define FTP_CLIENT_NETWORK_SSL_CLASS WiFiClientSecure
#define FTP_SERVER_NETWORK_SERVER_CLASS WiFiServer
#elif defined(ESP31B)
#include <ESP31BWiFi.h>
#define FTP_CLIENT_NETWORK_CLASS WiFiClient
//#define FTP_CLIENT_NETWORK_SSL_CLASS WiFiClientSecure
#define FTP_SERVER_NETWORK_SERVER_CLASS WiFiServer
#else
#error "network type ESP8266 ASYNC only possible on the ESP mcu!"
#endif
#elif(FTP_SERVER_NETWORK_TYPE == NETWORK_ESP8266 || FTP_SERVER_NETWORK_TYPE == NETWORK_ESP8266_242)
#if !defined(ESP8266) && !defined(ESP31B)
#error "network type ESP8266 only possible on the ESP mcu!"
#if !defined(ESP8266) && !defined(ESP31B)
#error "network type ESP8266 only possible on the ESP mcu!"
#endif
#ifdef ESP8266
#include <ESP8266WiFi.h>
#include <ESP8266WiFi.h>
#else
#include <ESP31BWiFi.h>
#include <ESP31BWiFi.h>
#endif
#define FTP_CLIENT_NETWORK_CLASS WiFiClient
//#define FTP_CLIENT_NETWORK_SSL_CLASS WiFiClientSecure
#define FTP_SERVER_NETWORK_SERVER_CLASS WiFiServer
#define NET_CLASS WiFi
#define CommandIs( a ) (command != NULL && ! strcmp_P( command, PSTR( a )))
#define ParameterIs( a ) ( parameter != NULL && ! strcmp_P( parameter, PSTR( a )))
#elif(FTP_SERVER_NETWORK_TYPE == NETWORK_W5100)
// #define CommandIs( a ) (command != NULL && ! strcmp_P( command, PSTR( a )))
// #define ParameterIs( a ) ( parameter != NULL && ! strcmp_P( parameter, PSTR( a )))
#elif(FTP_SERVER_NETWORK_TYPE == NETWORK_W5100 || FTP_SERVER_NETWORK_TYPE == NETWORK_ETHERNET_ENC)
#ifdef STM32_DEVICE
#define FTP_CLIENT_NETWORK_CLASS TCPClient
#define FTP_SERVER_NETWORK_SERVER_CLASS TCPServer
#define CommandIs( a ) ( ! strcmp_PF( command, PSTR( a )))
#define ParameterIs( a ) ( ! strcmp_PF( parameter, PSTR( a )))
#define NET_CLASS Ethernet
#else
#include <Ethernet.h>
#include <SPI.h>
#define FTP_CLIENT_NETWORK_CLASS EthernetClient
#define FTP_SERVER_NETWORK_SERVER_CLASS EthernetServer
#define NET_CLASS Ethernet
#define CommandIs( a ) ( ! strcmp_PF( command, PSTR( a )))
#define ParameterIs( a ) ( ! strcmp_PF( parameter, PSTR( a )))
#endif
#elif(FTP_SERVER_NETWORK_TYPE == NETWORK_ENC28J60)
// #if defined(ESP8266) || defined(ESP32)
// #define CommandIs( a ) (command != NULL && ! strcmp_P( command, PSTR( a )))
// #define ParameterIs( a ) ( parameter != NULL && ! strcmp_P( parameter, PSTR( a )))
// #else
// #define CommandIs( a ) ( ! strcmp_PF( command, PSTR( a )))
// #define ParameterIs( a ) ( ! strcmp_PF( parameter, PSTR( a )))
// #endif
#elif(FTP_SERVER_NETWORK_TYPE == NETWORK_ENC28J60 || FTP_SERVER_NETWORK_TYPE == NETWORK_UIPETHERNET)
#include <UIPEthernet.h>
#define FTP_CLIENT_NETWORK_CLASS UIPClient
#define FTP_SERVER_NETWORK_SERVER_CLASS UIPServer
#define NET_CLASS Ethernet
#define CommandIs( a ) ( ! strcmp_PF( command, PSTR( a )))
#define ParameterIs( a ) ( ! strcmp_PF( parameter, PSTR( a )))
//SSLClient client(base_client, TAs, (size_t)TAs_NUM, A5);
// #if define(ESP8266) || define(ESP32)
// #define CommandIs( a ) (command != NULL && ! strcmp_P( command, PSTR( a )))
// #define ParameterIs( a ) ( parameter != NULL && ! strcmp_P( parameter, PSTR( a )))
// #else
// #define CommandIs( a ) ( ! strcmp_PF( command, PSTR( a )))
// #define ParameterIs( a ) ( ! strcmp_PF( parameter, PSTR( a )))
// #endif
#elif(EMAIL_NETWORK_TYPE == NETWORK_ETHERNET_LARGE)
#include <EthernetLarge.h>
#include <SPI.h>
#define FTP_CLIENT_NETWORK_CLASS EthernetClient
#define FTP_SERVER_NETWORK_SERVER_CLASS EthernetServer
#define NET_CLASS Ethernet
#elif(EMAIL_NETWORK_TYPE == NETWORK_ETHERNET_STM)
#include <Ethernet_STM.h>
#include <SPI.h>
#define FTP_CLIENT_NETWORK_CLASS EthernetClient
#define FTP_SERVER_NETWORK_SERVER_CLASS EthernetServer
#define NET_CLASS Ethernet
#elif(FTP_SERVER_NETWORK_TYPE == NETWORK_ESP32)
#include <WiFi.h>
@ -163,16 +196,16 @@
//#define FTP_CLIENT_NETWORK_SSL_CLASS WiFiClientSecure
#define FTP_SERVER_NETWORK_SERVER_CLASS WiFiServer
#define NET_CLASS WiFi
#define CommandIs( a ) (command != NULL && ! strcmp_P( command, PSTR( a )))
#define ParameterIs( a ) ( parameter != NULL && ! strcmp_P( parameter, PSTR( a )))
// #define CommandIs( a ) (command != NULL && ! strcmp_P( command, PSTR( a )))
// #define ParameterIs( a ) ( parameter != NULL && ! strcmp_P( parameter, PSTR( a )))
#elif(FTP_SERVER_NETWORK_TYPE == NETWORK_ESP32_ETH)
#include <ETH.h>
#define FTP_CLIENT_NETWORK_CLASS WiFiClient
#define FTP_SERVER_NETWORK_SERVER_CLASS WiFiServer
#define NET_CLASS Ethernet
#define CommandIs( a ) ( ! strcmp_PF( command, PSTR( a )))
#define ParameterIs( a ) ( ! strcmp_PF( parameter, PSTR( a )))
// #define CommandIs( a ) ( ! strcmp_PF( command, PSTR( a )))
// #define ParameterIs( a ) ( ! strcmp_PF( parameter, PSTR( a )))
#elif(FTP_SERVER_NETWORK_TYPE == NETWORK_WiFiNINA)
#include <WiFiNINA.h>
@ -180,8 +213,8 @@
//#define FTP_CLIENT_NETWORK_SSL_CLASS WiFiSSLClient
#define FTP_SERVER_NETWORK_SERVER_CLASS WiFiServer
#define NET_CLASS WiFi
#define CommandIs( a ) ( ! strcmp_PF( command, PSTR( a )))
#define ParameterIs( a ) ( ! strcmp_PF( parameter, PSTR( a )))
// #define CommandIs( a ) ( ! strcmp_PF( command, PSTR( a )))
// #define ParameterIs( a ) ( ! strcmp_PF( parameter, PSTR( a )))
#elif(FTP_SERVER_NETWORK_TYPE == NETWORK_SEEED_RTL8720DN)
#include <rpcWiFi.h>
@ -189,12 +222,20 @@
//#define FTP_CLIENT_NETWORK_SSL_CLASS WiFiSSLClient
#define FTP_SERVER_NETWORK_SERVER_CLASS WiFiServer
#define NET_CLASS WiFi
#define CommandIs( a ) ( ! strcmp_PF( command, PSTR( a )))
#define ParameterIs( a ) ( ! strcmp_PF( parameter, PSTR( a )))
// #define CommandIs( a ) ( ! strcmp_PF( command, PSTR( a )))
// #define ParameterIs( a ) ( ! strcmp_PF( parameter, PSTR( a )))
#else
#error "no network type selected!"
#endif
#if defined(ESP8266) || defined(ESP32) || defined(ARDUINO_ARCH_RP2040)
#define CommandIs( a ) (command != NULL && ! strcmp_P( command, PSTR( a )))
#define ParameterIs( a ) ( parameter != NULL && ! strcmp_P( parameter, PSTR( a )))
#else
#define CommandIs( a ) ( ! strcmp_PF( command, PSTR( a )))
#define ParameterIs( a ) ( ! strcmp_PF( parameter, PSTR( a )))
#endif
#if(STORAGE_TYPE == STORAGE_SPIFFS)
#if defined(ESP32)
// #define FS_NO_GLOBALS
@ -216,7 +257,6 @@
#endif
#if ESP8266
#define FTP_FILE_READ "r"
#define FTP_FILE_READ_ONLY "r"
@ -231,7 +271,9 @@
#define FTP_FILE_WRITE_CREATE "w"
#endif
#define STORAGE_MANAGER SPIFFS
#define STORAGE_MANAGER SPIFFS
#define FILENAME_LENGTH 32
#elif(STORAGE_TYPE == STORAGE_FFAT)
#include "FS.h"
#include "FFat.h"
@ -247,8 +289,9 @@
#define FTP_FILE_WRITE_APPEND "a"
#define FTP_FILE_WRITE_CREATE "w"
#define FILENAME_LENGTH 255
#elif(STORAGE_TYPE == STORAGE_LITTLEFS)
#if ESP8266
#if ESP8266 || ARDUINO_ARCH_RP2040
#include "LittleFS.h"
#define STORAGE_MANAGER LittleFS
#define FTP_FILE File
@ -260,13 +303,18 @@
#define FTP_FILE_WRITE_APPEND "a+"
#define FTP_FILE_WRITE_CREATE "w+"
#else
#if ESP_ARDUINO_VERSION_MAJOR >= 2
#include "FS.h"
#include "LittleFS.h"
#define STORAGE_MANAGER LittleFS
#ifdef ESP32
#if ESP_ARDUINO_VERSION_MAJOR >= 2
#include "FS.h"
#include "LittleFS.h"
#define STORAGE_MANAGER LittleFS
#else
#include "LITTLEFS.h"
#define STORAGE_MANAGER LITTLEFS
#endif
#else
#include "LITTLEFS.h"
#define STORAGE_MANAGER LITTLEFS
#include "LittleFS.h"
#define STORAGE_MANAGER LittleFS
#endif
#define FTP_FILE File
#define FTP_DIR File
@ -277,6 +325,7 @@
#define FTP_FILE_WRITE_APPEND "a"
#define FTP_FILE_WRITE_CREATE "w"
#endif
#define FILENAME_LENGTH 128
#elif(STORAGE_TYPE == STORAGE_SD)
#include <SPI.h>
#include <SD.h>
@ -287,16 +336,37 @@
#define FTP_FILE_READ FILE_READ
#define FTP_FILE_READ_ONLY FILE_READ
#define FTP_FILE_READ_WRITE FILE_WRITE
#ifdef ESP8266
#define FTP_FILE_READ_WRITE FILE_WRITE
#define FTP_FILE_WRITE_APPEND FILE_WRITE
#else
#ifdef ESP32
#define FTP_FILE_READ_WRITE FILE_WRITE
#define FTP_FILE_WRITE_APPEND FILE_APPEND
#else
#define FTP_FILE_READ_WRITE FILE_WRITE
#define FTP_FILE_WRITE_APPEND FILE_WRITE
#endif
#define FTP_FILE_WRITE_CREATE FILE_WRITE
#define FILENAME_LENGTH 255
#elif(STORAGE_TYPE == STORAGE_SD_MMC)
#include <SPI.h>
#include <SD_MMC.h>
#define STORAGE_MANAGER SD_MMC
#define FTP_FILE File
#define FTP_DIR File
#define FTP_FILE_READ FILE_READ
#define FTP_FILE_READ_ONLY FILE_READ
#define FTP_FILE_READ_WRITE FILE_WRITE
#ifdef ESP32
#define FTP_FILE_READ_WRITE FILE_WRITE
#define FTP_FILE_WRITE_APPEND FILE_APPEND
#else
#define FTP_FILE_READ_WRITE FILE_WRITE
#define FTP_FILE_WRITE_APPEND FILE_WRITE
#endif
#define FTP_FILE_WRITE_CREATE FILE_WRITE
#define FILENAME_LENGTH 255
#elif(STORAGE_TYPE == STORAGE_SEEED_SD)
#include <Seeed_FS.h>
#define STORAGE_MANAGER SD
@ -317,6 +387,8 @@
#define FTP_FILE_WRITE_APPEND FILE_APPEND
#define FTP_FILE_WRITE_CREATE FILE_WRITE
#define FILENAME_LENGTH 255
#elif (STORAGE_TYPE == STORAGE_SDFAT1)
#include <SdFat.h>
#include <sdios.h>
@ -331,6 +403,8 @@
#define FTP_FILE_READ_WRITE O_RDWR
#define FTP_FILE_WRITE_APPEND O_WRITE | O_APPEND
#define FTP_FILE_WRITE_CREATE O_WRITE | O_CREAT
#define FILENAME_LENGTH 255
#elif (STORAGE_TYPE == STORAGE_SDFAT2)
#include <SdFat.h>
#include <sdios.h>
@ -345,6 +419,7 @@
#define FTP_FILE_READ_WRITE O_RDWR
#define FTP_FILE_WRITE_APPEND O_WRITE | O_APPEND
#define FTP_FILE_WRITE_CREATE O_WRITE | O_CREAT
#define FILENAME_LENGTH 255
#elif (STORAGE_TYPE == STORAGE_SPIFM)
#include <SdFat.h>
#include <Adafruit_SPIFlash.h>
@ -355,12 +430,12 @@
#define FTP_DIR File
extern FatFileSystem STORAGE_MANAGER;
extern Adafruit_SPIFlash flash;
#define FTP_FILE_READ O_READ
#define FTP_FILE_READ_ONLY O_RDONLY
#define FTP_FILE_READ_WRITE O_RDWR
#define FTP_FILE_WRITE_APPEND O_WRITE | O_APPEND
#define FTP_FILE_WRITE_CREATE O_WRITE | O_CREAT
#define FTP_FILE_READ FILE_READ
#define FTP_FILE_READ_ONLY FILE_READ
#define FTP_FILE_READ_WRITE FILE_WRITE
#define FTP_FILE_WRITE_APPEND FILE_WRITE
#define FTP_FILE_WRITE_CREATE FILE_WRITE
#define FILENAME_LENGTH 255
#elif (STORAGE_TYPE == STORAGE_FATFS)
#include <FatFs.h>
#include <sdios.h>
@ -380,6 +455,7 @@
#define FTP_FILE_READ_WRITE O_RDWR
#define FTP_FILE_WRITE_APPEND O_WRITE | O_APPEND
#define FTP_FILE_WRITE_CREATE O_WRITE | O_CREAT
#define FILENAME_LENGTH 255
#endif
//#ifdef FTP_CLIENT_NETWORK_SSL_CLASS
@ -391,25 +467,24 @@
// Setup debug printing macros.
#ifdef FTP_SERVER_DEBUG
#define DEBUG_PRINT(...) { DEBUG_PRINTER.print(__VA_ARGS__); }
#define DEBUG_PRINTLN(...) { DEBUG_PRINTER.println(__VA_ARGS__); }
// #define DEBUG_PRINT(...) { DEBUG_PRINTER.print(__VA_ARGS__); }
// #define DEBUG_PRINTLN(...) { DEBUG_PRINTER.println(__VA_ARGS__); }
#define DEBUG_PRINT(...) { Log.verbose(68 /* FTP_TAG */, __VA_ARGS__); }
#define DEBUG_PRINTLN(...) { Log.verbose(68 /* FTP_TAG */, __VA_ARGS__); }
#else
#define DEBUG_PRINT(...) {}
#define DEBUG_PRINTLN(...) {}
#endif
#define FTP_USER "arduino" // Default user'name
#define FTP_PASS "test" // Default password
#define FTP_CMD_PORT 21 // Command port on wich server is listening
#define FTP_DATA_PORT_DFLT 20 // Default data port in active mode
#define FTP_DATA_PORT_PASV 50009 // Data port in passive mode
#define FF_MAX_LFN 255 // max size of a long file name
#define FF_MAX_LFN 255 // max size of a long file name
#define FTP_CMD_SIZE FF_MAX_LFN+8 // max size of a command
#define FTP_CWD_SIZE FF_MAX_LFN+8 // max size of a directory name
#define FTP_FIL_SIZE FF_MAX_LFN // max size of a file name
#define FTP_CRED_SIZE 16 // max size of username and password
#define FTP_FIL_SIZE FF_MAX_LFN // max size of a file name
#define FTP_CRED_SIZE 255 // max size of username and password
#define FTP_NULLIP() IPAddress(0,0,0,0)
enum ftpCmd { FTP_Stop = 0, // In this stage, stop any connection
@ -458,8 +533,11 @@ class FtpServer
public:
FtpServer( uint16_t _cmdPort = FTP_CMD_PORT, uint16_t _pasvPort = FTP_DATA_PORT_PASV );
void begin( const char * _user = FTP_USER, const char * _pass = FTP_PASS, const char * welcomeMessage = "Welcome to Simply FTP server" );
void end();
void begin( const char * _user, const char * _pass, const char * welcomeMessage = "Welcome to Simply FTP server" );
void begin( const char * welcomeMessage = "Welcome to Simply FTP server" );
void end();
void setLocalIp(IPAddress localIp);
void credentials( const char * _user, const char * _pass );
uint8_t handleFTP();
@ -515,11 +593,7 @@ private:
#elif STORAGE_TYPE == STORAGE_FATFS
return file->fileName();
#else
#if ESP_ARDUINO_VERSION_MAJOR >= 2
return file->path();
#else
return file->name();
#endif
return file->name();
#endif
}
bool exists( const char * path ) {
@ -542,7 +616,7 @@ private:
bool removeDir( const char * path ) { return STORAGE_MANAGER.rmdir( path ); };
#endif
#if STORAGE_TYPE == STORAGE_SD
#if STORAGE_TYPE == STORAGE_SD || STORAGE_TYPE == STORAGE_SD_MMC
bool rename( const char * path, const char * newpath );
#else
bool rename( const char * path, const char * newpath ) { return STORAGE_MANAGER.rename( path, newpath ); };
@ -554,7 +628,7 @@ private:
#elif (STORAGE_TYPE == STORAGE_SPIFFS || STORAGE_TYPE == STORAGE_LITTLEFS || STORAGE_TYPE == STORAGE_FFAT )
bool openFile( const char * path, const char * readType );
// bool openFile( char path[ FTP_CWD_SIZE ], int readTypeInt );
#elif STORAGE_TYPE <= STORAGE_SDFAT2
#elif STORAGE_TYPE <= STORAGE_SDFAT2 || STORAGE_TYPE == STORAGE_SPIFM || (STORAGE_TYPE == STORAGE_SD && ARDUINO_ARCH_SAMD)
bool openFile( char path[ FTP_CWD_SIZE ], int readTypeInt );
#else
bool openFile( char path[ FTP_CWD_SIZE ], const char * readType );
@ -563,10 +637,10 @@ private:
#endif
// bool openFile( char path[ FTP_CWD_SIZE ], const char * readType );
// bool openFile( const char * path, const char * readType );
uint16_t fileSize( FTP_FILE file );
uint32_t fileSize( FTP_FILE file );
#if STORAGE_TYPE == STORAGE_SPIFFS || STORAGE_TYPE == STORAGE_LITTLEFS
#if ESP8266
#if ESP8266 || ARDUINO_ARCH_RP2040
uint32_t capacity() {
FSInfo fi;
STORAGE_MANAGER.info(fi);
@ -577,8 +651,7 @@ private:
FSInfo fi;
STORAGE_MANAGER.info(fi);
return fi.totalBytes -
fi.usedBytes >> 1;
return (fi.totalBytes - fi.usedBytes) >> 1;
};
#else
uint32_t capacity() {
@ -589,7 +662,7 @@ private:
STORAGE_MANAGER.usedBytes()) >> 1;
};
#endif
#elif STORAGE_TYPE == STORAGE_SD
#elif STORAGE_TYPE == STORAGE_SD || STORAGE_TYPE == STORAGE_SD_MMC
uint32_t capacity() { return true; };
uint32_t free() { return true; };
#elif STORAGE_TYPE == STORAGE_SEEED_SD
@ -620,7 +693,7 @@ private:
#endif
bool legalChar( char c ) // Return true if char c is allowed in a long file name
{
if( c == '"' || c == '*' || c == '?' || c == ':' ||
if( c == '"' || c == '*' || c == '?' || c == ':' ||
c == '<' || c == '>' || c == '|' )
return false;
#if STORAGE_TYPE == STORAGE_FATFS
@ -629,7 +702,7 @@ private:
return 0x1f < c && c < 0x7f;
#endif
}
IPAddress localIp; // IP address of server as seen by clients
IPAddress dataIp; // IP address of client for data
FTP_SERVER_NETWORK_SERVER_CLASS ftpServer;
@ -638,15 +711,17 @@ private:
FTP_CLIENT_NETWORK_CLASS client;
FTP_CLIENT_NETWORK_CLASS data;
FTP_FILE file;
FTP_DIR dir;
ftpCmd cmdStage; // stage of ftp command connexion
ftpTransfer transferStage; // stage of data connexion
ftpDataConn dataConn; // type of data connexion
uint8_t __attribute__((packed, aligned(4))) // need to be aligned to 32bit for Esp8266 SPIClass::transferBytes()
bool anonymousConnection = false;
uint8_t __attribute__((aligned(4))) // need to be aligned to 32bit for Esp8266 SPIClass::transferBytes()
buf[ FTP_BUF_SIZE ]; // data buffer for transfers
char cmdLine[ FTP_CMD_SIZE ]; // where to store incoming char from client
char cwdName[ FTP_CWD_SIZE ]; // name of current directory
@ -664,7 +739,7 @@ private:
uint16_t nbMatch;
uint32_t millisDelay, //
millisEndConnection, //
millisEndConnection, //
millisBeginTrans, // store time of beginning of a transaction
bytesTransfered; //
};

View File

@ -18,52 +18,76 @@
#define FTP_SERVER_CONFIG_H
// Uncomment to enable printing out nice debug messages.
//#define FTP_SERVER_DEBUG
// #define FTP_SERVER_DEBUG
// Define where debug output will be printed.
#define DEBUG_PRINTER Serial
#define STORAGE_SDFAT1 0 // Library SdFat version 1.4.x
#define STORAGE_SDFAT2 1 // Library SdFat version >= 2.0.2
#define STORAGE_SPIFM 2 // Libraries Adafruit_SPIFlash and SdFat-Adafruit-Fork
#define STORAGE_FATFS 3 // Library FatFs
#define STORAGE_SD 4 // Standard SD library (suitable for Arduino esp8266 and esp32
#define STORAGE_SPIFFS 5 // SPIFFS
#define STORAGE_LITTLEFS 6 // LITTLEFS
#define STORAGE_SEEED_SD 7 // Seeed_SD library
#define STORAGE_FFAT 8 // ESP32 FFAT
#define STORAGE_SDFAT1 1 // Library SdFat version 1.4.x
#define STORAGE_SDFAT2 2 // Library SdFat version >= 2.0.2
#define STORAGE_SPIFM 3 // Libraries Adafruit_SPIFlash and SdFat-Adafruit-Fork
#define STORAGE_FATFS 4 // Library FatFs
#define STORAGE_SD 5 // Standard SD library (suitable for Arduino esp8266 and esp32
#define STORAGE_SPIFFS 6 // SPIFFS
#define STORAGE_LITTLEFS 7 // LITTLEFS
#define STORAGE_SEEED_SD 8 // Seeed_SD library
#define STORAGE_FFAT 9 // ESP32 FFAT
#define STORAGE_SD_MMC 10 // SD_MMC library
#define NETWORK_ESP8266_ASYNC (0)
#define NETWORK_ESP8266 (1)
#define NETWORK_ESP8266_242 (6)
#define NETWORK_W5100 (2)
#define NETWORK_ENC28J60 (3)
#define NETWORK_ESP32 (4)
#define NETWORK_ESP32_ETH (5)
#define NETWORK_WiFiNINA (7)
#define NETWORK_SEEED_RTL8720DN (8)
#define NETWORK_ESP8266_ASYNC (1)
#define NETWORK_ESP8266 (2) // Standard ESP8266WiFi
#define NETWORK_ESP8266_242 (3) // ESP8266WiFi before 2.4.2 core
#define NETWORK_W5100 (4) // Standard Arduino Ethernet library
#define NETWORK_ENC28J60 (5) // UIPEthernet library
#define NETWORK_ESP32 (6) // Standard WiFi library
#define NETWORK_RP2040_WIFI (6) // Raspberry Pi Pico W standard WiFi library
#define NETWORK_ESP32_ETH (7) // Standard ETH library
#define NETWORK_WiFiNINA (8) // Standard WiFiNINA library
#define NETWORK_SEEED_RTL8720DN (9) // Standard SEED WiFi library
#define NETWORK_ETHERNET_LARGE (10)
#define NETWORK_ETHERNET_ENC (11) // EthernetENC library (evolution of UIPEthernet
#define NETWORK_ETHERNET_STM (12)
#define NETWORK_UIPETHERNET (13) // UIPEthernet library same of NETWORK_ENC28J60
// esp8266 configuration
#ifndef DEFAULT_FTP_SERVER_NETWORK_TYPE_ESP8266
#define DEFAULT_FTP_SERVER_NETWORK_TYPE_ESP8266 NETWORK_ESP8266
#define DEFAULT_STORAGE_TYPE_ESP8266 STORAGE_LITTLEFS
#define DEFAULT_STORAGE_TYPE_ESP8266 STORAGE_LITTLEFS
#endif
// esp32 configuration
#ifndef DEFAULT_FTP_SERVER_NETWORK_TYPE_ESP32
#define DEFAULT_FTP_SERVER_NETWORK_TYPE_ESP32 NETWORK_ESP32
#define DEFAULT_STORAGE_TYPE_ESP32 STORAGE_SPIFFS
#define DEFAULT_FTP_SERVER_NETWORK_TYPE_ESP32 NETWORK_ESP32
#define DEFAULT_STORAGE_TYPE_ESP32 STORAGE_FFAT
#endif
// Standard AVR Arduino configuration
#ifndef DEFAULT_FTP_SERVER_NETWORK_TYPE_ARDUINO
#define DEFAULT_FTP_SERVER_NETWORK_TYPE_ARDUINO NETWORK_W5100
#define DEFAULT_STORAGE_TYPE_ARDUINO STORAGE_SDFAT2
#define DEFAULT_STORAGE_TYPE_ARDUINO STORAGE_SD
#endif
// STM32 configuration
#ifndef DEFAULT_FTP_SERVER_NETWORK_TYPE_STM32
#define DEFAULT_FTP_SERVER_NETWORK_TYPE_STM32 NETWORK_W5100
#define DEFAULT_STORAGE_TYPE_STM32 STORAGE_SDFAT2
#endif
// Raspberry Pi Pico (rp2040) configuration
#ifndef DEFAULT_FTP_SERVER_NETWORK_TYPE_RP2040
#define DEFAULT_FTP_SERVER_NETWORK_TYPE_RP2040 NETWORK_RP2040_WIFI
#define DEFAULT_STORAGE_TYPE_RP2040 STORAGE_LITTLEFS
#endif
// Arduino SAMD21 like Arduino MKR Nano 33 IoT or Wio Terminal
#ifndef DEFAULT_FTP_SERVER_NETWORK_TYPE_ARDUINO_SAMD
// Wio Terminal
// #define DEFAULT_FTP_SERVER_NETWORK_TYPE_SAMD NETWORK_SEEED_RTL8720DN
// #define DEFAULT_STORAGE_TYPE_SAMD STORAGE_SEEED_SD
// Arduino SAMD
#define DEFAULT_FTP_SERVER_NETWORK_TYPE_SAMD NETWORK_WiFiNINA // NETWORK_SEEED_RTL8720DN // NETWORK_WiFiNINA
#define DEFAULT_STORAGE_TYPE_SAMD STORAGE_SD // STORAGE_SDFAT2 // STORAGE_SD
#define DEFAULT_FTP_SERVER_NETWORK_TYPE_SAMD NETWORK_WiFiNINA
#define DEFAULT_STORAGE_TYPE_SAMD STORAGE_SD
#endif
#define UTF8_SUPPORT
//#define SD_CS_PIN 4
// Disconnect client after 5 minutes of inactivity (expressed in seconds)
#define FTP_TIME_OUT 5 * 60
@ -77,6 +101,6 @@
// Transfer speed depends of this value
// Best value depends on many factors: SD card, client side OS, ...
// But it can be reduced to 512 if memory usage is critical.
#define FTP_BUF_SIZE 2048 //1024 // 512
#define FTP_BUF_SIZE 1024 //2048 //1024 // 512
#endif // FTP_SERVER_CONFIG_H

View File

@ -3,11 +3,26 @@
[Instruction on FTP server on esp8266 and esp32](https://www.mischianti.org/2020/02/08/ftp-server-on-esp8266-and-esp32)
[Simple FTP Server library now with support for Wio Terminal and SD](https://www.mischianti.org/2021/07/01/simple-ftp-server-library-now-with-support-for-wio-terminal-and-sd/)
Simple FTP Server for
#### Simple FTP Server for
- Raspberry Pi Pico W (Flash: LittleFS) (To test SD and SdFat)
- esp8266 (Flash: SPIFFs, LittleFS. SD: SD, SdFat 2)
- esp32 (SPIFFS, LITTLEFS, FFAT, SdFat)
- Arduino (SD with 8.3 file format, SdFat 2)
- Wio Terminal (SdFat 2, and native FAT)
- esp32 (SPIFFS, LITTLEFS, FFAT, SD: SD, SdFat)
- stm32 (SdFat, SPI flash)
- Arduino (SD with 8.3 file format, SD: SD, SdFat 2)
- Wio Terminal (SdFat 2, Seed SD, and native FAT)
#### Changelog
- 2022-01-13 2.1.5 Fix SPIFM external SPI Flash date management (add SPIFM esp32 example)
- 2022-09-21 2.1.4 Add support for Raspberry Pi Pico W and rp2040 boards, Fix SD card config
- 2022-09-20 2.1.3 Soft AP IP management, more disconnect event and SD_MCC
- 2022-05-21 2.1.2 Fix SD path (#19)
- 2022-05-21 2.1.1 Minor fix
- 2022-03-30 2.1.0 Add UTF8 support and enabled It by default (Thanks to @plaber)
- 2022-03-30 2.0.0 Complete support for STM32 with SD and SPI Flash minor bux fix and HELP command support
- 2022-03-17 1.3.0 Fix enc28j60 and w5500 support and restructuring for local settings
- 2022-02-25 1.2.1 Fix anonymous user begin and fix SPIFFS wrong display
- 2022-02-22 1.2.0 Add anonymous user and implement correct RFC (#9 now work correctly with File Explorer)
- 2022-02-01 1.1.1 Add workaround to start FTP server before connection, add end and setLocalIP method.
<!-- wp:paragraph -->
<p>When I develop a new solution I'd like to divide the application in layer, and so I'd like focus my attention in only one aspect at time. </p>
@ -87,4 +102,6 @@ void loop(void){
// server.handleClient(); //example if running a webserver you still need to call .handleClient();
}
```
```
https://downloads.arduino.cc/libraries/logs/github.com/xreef/SimpleFTPServer/

View File

@ -11,7 +11,7 @@
#ifndef SIMPLE_FTP_SERVER_H
#define SIMPLE_FTP_SERVER_H
#include "FtpServer.h"
#include <FtpServer.h>
#endif

View File

@ -1,62 +0,0 @@
/*
* FtpServer Arduino with Ethernet library and w5100 shield
*
* AUTHOR: Renzo Mischianti
*
* https://www.mischianti.org/2020/02/08/ftp-server-on-esp8266-and-esp32
*
*/
#include <SPI.h>
#include <Ethernet.h>
#include "SD.h"
#include <SimpleFtpServer.h>
// Enter a MAC address for your controller below.
// Newer Ethernet shields have a MAC address printed on a sticker on the shield
byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xE1 };
// Set the static IP address to use if the DHCP fails to assign
byte macAddr[] = {0x5e, 0xa4, 0x18, 0xf0, 0x8a, 0xf2};
IPAddress arduinoIP(192, 168, 1, 177);
IPAddress dnsIP(192, 168, 1, 1);
IPAddress gatewayIP(192, 168, 1, 1);
IPAddress subnetIP(255, 255, 255, 0);
FtpServer ftpSrv;
void setup(void){
Serial.begin(115200);
delay(2000);
// If other chips are connected to SPI bus, set to high the pin connected
// to their CS before initializing Flash memory
pinMode( 4, OUTPUT );
digitalWrite( 4, HIGH );
pinMode( 10, OUTPUT );
digitalWrite( 10, HIGH );
Serial.print("Starting SD.");
while (!SD.begin(4)) {
Serial.print(".");
}
Serial.println("finish!");
// start the Ethernet connection:
Serial.print("Starting ethernet.");
if (Ethernet.begin(mac) == 0) {
Serial.println("Failed to configure Ethernet using DHCP");
Ethernet.begin(macAddr, arduinoIP, dnsIP, gatewayIP, subnetIP);
}else{
Serial.println("ok to configure Ethernet using DHCP");
}
Serial.print("IP address ");
Serial.println(Ethernet.localIP());
Serial.println("SPIFFS opened!");
ftpSrv.begin("esp8266","esp8266"); //username, password for ftp.
}
void loop(void){
ftpSrv.handleFTP(); //make sure in loop you call handleFTP()!!
}

View File

@ -1,96 +0,0 @@
/*
* FtpServer esp8266 and esp32 with SD
*
* AUTHOR: Renzo Mischianti
*
* https://www.mischianti.org/2020/02/08/ftp-server-on-esp8266-and-esp32
*
*/
#include <WiFi.h>
#include "SD.h"
#include <SimpleFTPServer.h>
const char* ssid = "<YOUR-SSID>";
const char* password = "<YOUR-PASSWD>";
FtpServer ftpSrv; //set #define FTP_DEBUG in ESP8266FtpServer.h to see ftp verbose on serial
void _callback(FtpOperation ftpOperation, unsigned int freeSpace, unsigned int totalSpace){
Serial.print(">>>>>>>>>>>>>>> _callback " );
Serial.print(ftpOperation);
/* FTP_CONNECT,
* FTP_DISCONNECT,
* FTP_FREE_SPACE_CHANGE
*/
Serial.print(" ");
Serial.print(freeSpace);
Serial.print(" ");
Serial.println(totalSpace);
// freeSpace : totalSpace = x : 360
if (ftpOperation == FTP_CONNECT) Serial.println(F("CONNECTED"));
if (ftpOperation == FTP_DISCONNECT) Serial.println(F("DISCONNECTED"));
};
void _transferCallback(FtpTransferOperation ftpOperation, const char* name, unsigned int transferredSize){
Serial.print(">>>>>>>>>>>>>>> _transferCallback " );
Serial.print(ftpOperation);
/* FTP_UPLOAD_START = 0,
* FTP_UPLOAD = 1,
*
* FTP_DOWNLOAD_START = 2,
* FTP_DOWNLOAD = 3,
*
* FTP_TRANSFER_STOP = 4,
* FTP_DOWNLOAD_STOP = 4,
* FTP_UPLOAD_STOP = 4,
*
* FTP_TRANSFER_ERROR = 5,
* FTP_DOWNLOAD_ERROR = 5,
* FTP_UPLOAD_ERROR = 5
*/
Serial.print(" ");
Serial.print(name);
Serial.print(" ");
Serial.println(transferredSize);
};
void setup(void){
Serial.begin(115200);
WiFi.begin(ssid, password);
Serial.println("");
// Wait for connection
while (WiFi.status() != WL_CONNECTED) {
delay(500);
Serial.print(".");
}
Serial.println("");
Serial.print("Connected to ");
Serial.println(ssid);
Serial.print("IP address: ");
Serial.println(WiFi.localIP());
/////FTP Setup, ensure SPIFFS is started before ftp; /////////
/////FTP Setup, ensure SPIFFS is started before ftp; /////////
SPI.begin(14, 2, 15, 13); //SCK, MISO, MOSI,SS
if (SD.begin(13, SPI)) {
Serial.println("SD opened!");
ftpSrv.setCallback(_callback);
ftpSrv.setTransferCallback(_transferCallback);
ftpSrv.begin("esp8266","esp8266"); //username, password for ftp. (default 21, 50009 for PASV)
}
}
void loop(void){
ftpSrv.handleFTP(); //make sure in loop you call handleFTP()!!
// server.handleClient(); //example if running a webserver you still need to call .handleClient();
}

View File

@ -1,110 +0,0 @@
/*
* FtpServer esp8266 and esp32 with SPIFFS
*
* AUTHOR: Renzo Mischianti
*
* https://www.mischianti.org/2020/02/08/ftp-server-on-esp8266-and-esp32
*
*/
#ifdef ESP8266
#include <ESP8266WiFi.h>
#elif defined ESP32
#include <WiFi.h>
#include "SPIFFS.h"
#endif
#include <SimpleFTPServer.h>
const char* ssid = "YOUR_SSID";
const char* password = "YOUR_PASS";
FtpServer ftpSrv; //set #define FTP_DEBUG in ESP8266FtpServer.h to see ftp verbose on serial
void _callback(FtpOperation ftpOperation, unsigned int freeSpace, unsigned int totalSpace){
switch (ftpOperation) {
case FTP_CONNECT:
Serial.println(F("FTP: Connected!"));
break;
case FTP_DISCONNECT:
Serial.println(F("FTP: Disconnected!"));
break;
case FTP_FREE_SPACE_CHANGE:
Serial.printf("FTP: Free space change, free %u of %u!\n", freeSpace, totalSpace);
break;
default:
break;
}
};
void _transferCallback(FtpTransferOperation ftpOperation, const char* name, unsigned int transferredSize){
switch (ftpOperation) {
case FTP_UPLOAD_START:
Serial.println(F("FTP: Upload start!"));
break;
case FTP_UPLOAD:
Serial.printf("FTP: Upload of file %s byte %u\n", name, transferredSize);
break;
case FTP_TRANSFER_STOP:
Serial.println(F("FTP: Finish transfer!"));
break;
case FTP_TRANSFER_ERROR:
Serial.println(F("FTP: Transfer error!"));
break;
default:
break;
}
/* FTP_UPLOAD_START = 0,
* FTP_UPLOAD = 1,
*
* FTP_DOWNLOAD_START = 2,
* FTP_DOWNLOAD = 3,
*
* FTP_TRANSFER_STOP = 4,
* FTP_DOWNLOAD_STOP = 4,
* FTP_UPLOAD_STOP = 4,
*
* FTP_TRANSFER_ERROR = 5,
* FTP_DOWNLOAD_ERROR = 5,
* FTP_UPLOAD_ERROR = 5
*/
};
void setup(void){
Serial.begin(115200);
WiFi.begin(ssid, password);
Serial.println("");
// Wait for connection
while (WiFi.status() != WL_CONNECTED) {
delay(500);
Serial.print(".");
}
Serial.println("");
Serial.print("Connected to ");
Serial.println(ssid);
Serial.print("IP address: ");
Serial.println(WiFi.localIP());
/////FTP Setup, ensure SPIFFS is started before ftp; /////////
/////FTP Setup, ensure SPIFFS is started before ftp; /////////
#ifdef ESP32 //esp32 we send true to format spiffs if cannot mount
if (SPIFFS.begin(true)) {
#elif defined ESP8266
if (SPIFFS.begin()) {
#endif
ftpSrv.setCallback(_callback);
ftpSrv.setTransferCallback(_transferCallback);
Serial.println("SPIFFS opened!");
ftpSrv.begin("esp8266","esp8266"); //username, password for ftp. (default 21, 50009 for PASV)
}
}
void loop(void){
ftpSrv.handleFTP(); //make sure in loop you call handleFTP()!!
// server.handleClient(); //example if running a webserver you still need to call .handleClient();
}

View File

@ -1,102 +0,0 @@
/*
* This sketch sends data via HTTP GET requests to examle.com service.
*/
#include <Seeed_FS.h>
#include "SD/Seeed_SD.h"
// #define DEFAULT_FTP_SERVER_NETWORK_TYPE_SAMD NETWORK_SEEED_RTL8720DN
// #define DEFAULT_STORAGE_TYPE_SAMD STORAGE_SEEED_SD
#include <rpcWiFi.h>
#include <FtpServer.h>
FtpServer ftpSrv;
const char *ssid = "<YOUR-SSID>";
const char *password = "<YOUR-PASSWD>";
void listDir(const char* dirname, uint8_t levels) {
Serial.print("Listing directory: ");
Serial.println(dirname);
File root = SD.open(dirname);
if (!root) {
Serial.println("Failed to open directory");
return;
}
if (!root.isDirectory()) {
Serial.println("Not a directory");
return;
}
File file = root.openNextFile();
while (file) {
if (file.isDirectory()) {
Serial.print(" DIR : ");
Serial.println(file.name());
if (levels) {
listDir(file.name(), levels - 1);
}
} else {
Serial.print(" FILE: ");
Serial.print(file.name());
Serial.print(" SIZE: ");
Serial.println(file.size());
}
file = root.openNextFile();
}
}
void setup()
{
Serial.begin(115200);
delay(1000);
pinMode(5, OUTPUT);
digitalWrite(5, HIGH);
while (!SD.begin(SDCARD_SS_PIN,SDCARD_SPI,4000000UL)) {
Serial.println("Card Mount Failed");
return;
}
// We start by connecting to a WiFi network
Serial.println();
Serial.println();
Serial.print("Connecting to ");
Serial.print(ssid);
WiFi.mode(WIFI_STA);
WiFi.begin(ssid, password);
while (WiFi.status() != WL_CONNECTED)
{
Serial.print("Connecting to ");
Serial.println(ssid);
WiFi.begin(ssid, password);
Serial.print(".");
delay(500);
}
Serial.println("");
Serial.println("WiFi connected");
Serial.println("IP address: ");
Serial.println(WiFi.localIP());
delay(1000);
Serial.print("Starting SD.");
Serial.println("finish!");
listDir("/", 0);
ftpSrv.begin("esp8266","esp8266"); //username, password for ftp.
}
void loop(void) {
ftpSrv.handleFTP(); //make sure in loop you call handleFTP()!!
}

View File

@ -1,98 +0,0 @@
/*
* This sketch sends data via HTTP GET requests to examle.com service.
*/
#include "SdFat.h"
#include <rpcWiFi.h>
#include <FtpServer.h>
// #define DEFAULT_FTP_SERVER_NETWORK_TYPE_SAMD NETWORK_SEEED_RTL8720DN
// #define DEFAULT_STORAGE_TYPE_SAMD STORAGE_SDFAT2
#define SD_CONFIG SdSpiConfig(SDCARD_SS_PIN, 2)
SdFs sd;
FtpServer ftpSrv;
const char *ssid = "<YOUR-SSID>";
const char *password = "<YOUR-PASSWD>";
void setup()
{
Serial.begin(115200);
delay(1000);
pinMode(5, OUTPUT);
digitalWrite(5, HIGH);
// Initialize the SD.
if (!sd.begin(SD_CONFIG)) {
sd.initErrorHalt(&Serial);
}
FsFile dir;
FsFile file;
// Open root directory
if (!dir.open("/")){
Serial.println("dir.open failed");
}
// We start by connecting to a WiFi network
Serial.println();
Serial.println();
Serial.print("Connecting to ");
Serial.print(ssid);
WiFi.mode(WIFI_STA);
WiFi.begin(ssid, password);
while (WiFi.status() != WL_CONNECTED)
{
Serial.print("Connecting to ");
Serial.println(ssid);
WiFi.begin(ssid, password);
Serial.print(".");
delay(500);
}
Serial.println("");
Serial.println("WiFi connected");
Serial.println("IP address: ");
Serial.println(WiFi.localIP());
delay(1000);
Serial.print("Starting SD.");
Serial.println("finish!");
while (file.openNext(&dir, O_RDONLY)) {
file.printFileSize(&Serial);
Serial.write(' ');
file.printModifyDateTime(&Serial);
Serial.write(' ');
file.printName(&Serial);
if (file.isDir()) {
// Indicate a directory.
Serial.write('/');
}
Serial.println();
file.close();
}
if (dir.getError()) {
Serial.println("openNext failed");
} else {
Serial.println("Done!");
}
ftpSrv.begin("esp8266","esp8266"); //username, password for ftp.
}
void loop(void) {
ftpSrv.handleFTP(); //make sure in loop you call handleFTP()!!
}

View File

@ -1,367 +0,0 @@
/*
* FtpServer Wio Terminal with SdFat library
* and with callbacks to the main actions of FTP server
* and a monitor on TFT
*
* AUTHOR: Renzo Mischianti
*
* https://www.mischianti.org/
*
*/
#include "SdFat.h"
#include <rpcWiFi.h>
#include <TFT_eSPI.h> // Hardware-specific library
#include <SPI.h>
#include <FtpServer.h>
TFT_eSPI tft = TFT_eSPI(); // Invoke custom library
#define DEG2RAD 0.0174532925
byte inc = 0;
unsigned int col = 0;
#define SD_CONFIG SdSpiConfig(SDCARD_SS_PIN, 2)
SdFs sd;
FtpServer ftpSrv;
const char *ssid = "reef-casa-sopra";
const char *password = "aabbccdd77";
#define MAIN_TOP 110
#define FREE_SPACE_PIE_X 80
#define FREE_SPACE_PIE_Y MAIN_TOP+40
#define FREE_SPACE_PIE_RADIUS 50
void freeSpacePieData(unsigned int freeSpace, unsigned int totalSpace) {
int pieFree = 360 - (freeSpace * 360 / totalSpace);
fillSegment(FREE_SPACE_PIE_X, FREE_SPACE_PIE_Y, 0, pieFree, FREE_SPACE_PIE_RADIUS, TFT_RED);
fillSegment(FREE_SPACE_PIE_X, FREE_SPACE_PIE_Y, pieFree, 360 - pieFree, FREE_SPACE_PIE_RADIUS, TFT_BLUE);
// Set "cursor" at top left corner of display (0,0) and select font 2
// (cursor will move to next line automatically during printing with 'tft.println'
// or stay on the line is there is room for the text with tft.print)
tft.setCursor(FREE_SPACE_PIE_X + 80, MAIN_TOP, 2);
// Set the font colour to be white with a black background, set text size multiplier to 1
tft.setTextColor(TFT_WHITE, TFT_BLACK); tft.setTextSize(1);
// We can now plot text on screen using the "print" class
Serial.print(freeSpace/1000);Serial.print("Mb/");Serial.print(String(totalSpace/1000));Serial.println("Mb");
tft.print(freeSpace/1000);tft.print("Mb/");tft.print(String(totalSpace/1000));tft.println("Mb");
}
void connectedDisconnected(bool connected) {
tft.fillCircle(FREE_SPACE_PIE_X + 80 + 10, MAIN_TOP+25+7, 10, (connected)?TFT_GREEN:TFT_RED);
tft.setCursor(FREE_SPACE_PIE_X + 80 + 25, MAIN_TOP+25, 2);
tft.println(" ");
tft.setCursor(FREE_SPACE_PIE_X + 80 + 25, MAIN_TOP+25, 2);
(connected)?tft.println("Connected!"):tft.println("Disconnected!");
}
void transfer(bool transfer, bool upload) {
tft.fillCircle(FREE_SPACE_PIE_X + 80 + 10, MAIN_TOP+25+25+7, 10, (transfer)?(upload)?TFT_GREEN:TFT_BLUE:TFT_RED);
tft.setCursor(FREE_SPACE_PIE_X + 80 + 25, MAIN_TOP+25+25, 2);
tft.println(" ");
tft.setCursor(FREE_SPACE_PIE_X + 80 + 25, MAIN_TOP+25+25, 2);
(transfer)?tft.println((upload)?"Upload!":"Download!"):tft.println("Idle!");
}
//index - starting at, n- how many chars
char* subString(const char *s, int index, int n){
char* b = (char*) malloc((strlen(s) + 1) * sizeof(char));
strcpy(b,s);
Serial.println("--------------------------------------");
Serial.println(s);
Serial.println(index);
Serial.println(n);
char *res = new char[n + 1];
Serial.println(res);
sprintf(res, "%.*s", n, b + index);
Serial.println(res);
free(b);
return res;
}
void fileTransfer(FtpTransferOperation ftpOperation, const char* filename, unsigned int transferredSize) {
int yoffset = 2;
tft.setCursor(20, MAIN_TOP+(FREE_SPACE_PIE_RADIUS*2)+yoffset, 2);
tft.println(F(" "));
tft.setCursor(20, MAIN_TOP+(FREE_SPACE_PIE_RADIUS*2)+yoffset, 2);
int lenfile = strlen(filename);
Serial.println(lenfile);
if (lenfile>22) {
tft.print(subString(filename, 0, 16));tft.print(F("~"));
tft.print( subString(filename, (lenfile-4), 4) );
} else {
tft.print(filename);
}
tft.setCursor(20+160, MAIN_TOP+(FREE_SPACE_PIE_RADIUS*2)+yoffset, 2);
tft.print(F(" "));
tft.setCursor(20+160, MAIN_TOP+(FREE_SPACE_PIE_RADIUS*2)+yoffset, 2);
tft.print(transferredSize);tft.print("Kb");
tft.setCursor(320-55, MAIN_TOP+(FREE_SPACE_PIE_RADIUS*2)+yoffset, 2);
switch (ftpOperation) {
case FTP_UPLOAD:
tft.setTextColor(TFT_GREEN, TFT_BLACK);
tft.print(F("Upload"));
tft.setTextColor(TFT_WHITE, TFT_BLACK);
break;
case FTP_DOWNLOAD:
tft.setTextColor(TFT_BLUE, TFT_BLACK);
tft.print(F("Down"));
tft.setTextColor(TFT_WHITE, TFT_BLACK);
break;
case FTP_TRANSFER_STOP:
tft.setTextColor(TFT_GREEN, TFT_BLACK);
tft.print(F("OK"));
tft.setTextColor(TFT_WHITE, TFT_BLACK);
break;
case FTP_TRANSFER_ERROR:
tft.setTextColor(TFT_RED, TFT_BLACK);
tft.print(F("Error"));
tft.setTextColor(TFT_WHITE, TFT_BLACK);
break;
default:
break;
}
}
void wifiStrenght (int8_t RSSI, bool connection = false) {
Serial.print("RSSI --> ");Serial.println(RSSI);
int marginX = 30;
int startX = 90;
int widthW = 320-(startX+marginX);
int startY = 60;
int heightY = 10;
tft.setCursor(marginX, startY - 5, 2);
tft.print(F(" "));
tft.setCursor(marginX, startY - 5, 2);
if (connection) {
tft.print(F("Connectint to: "));
tft.print(ssid);
}else{
tft.println("WiFi str: ");
// 120 : 120-RSSI = 300 : x
tft.drawRoundRect(startX, startY, widthW, heightY, 5, TFT_WHITE);
uint32_t colorRSSI = TFT_GREEN;
if (abs(RSSI)<55) {
colorRSSI = TFT_GREEN;
} else if (abs(RSSI)<75) {
colorRSSI = TFT_YELLOW;
} else if (abs(RSSI)<75) {
colorRSSI = TFT_RED;
}
tft.fillRoundRect(startX+1, startY+1, (120+RSSI)*widthW/120, heightY-2, 5, colorRSSI);
tft.setCursor(marginX, startY + 15, 2);
tft.print("IP: ");
tft.println(WiFi.localIP());
}
}
void _callback(FtpOperation ftpOperation, unsigned int freeSpace, unsigned int totalSpace){
Serial.print(">>>>>>>>>>>>>>> _callback " );
Serial.print(ftpOperation);
/* FTP_CONNECT,
* FTP_DISCONNECT,
* FTP_FREE_SPACE_CHANGE
*/
Serial.print(" ");
Serial.print(freeSpace);
Serial.print(" ");
Serial.println(totalSpace);
// freeSpace : totalSpace = x : 360
freeSpacePieData(freeSpace, totalSpace);
if (ftpOperation == FTP_CONNECT) connectedDisconnected(true);
if (ftpOperation == FTP_DISCONNECT) connectedDisconnected(false);
};
void _transferCallback(FtpTransferOperation ftpOperation, const char* name, unsigned int transferredSize){
Serial.print(">>>>>>>>>>>>>>> _transferCallback " );
Serial.print(ftpOperation);
/* FTP_UPLOAD_START = 0,
* FTP_UPLOAD = 1,
*
* FTP_DOWNLOAD_START = 2,
* FTP_DOWNLOAD = 3,
*
* FTP_TRANSFER_STOP = 4,
* FTP_DOWNLOAD_STOP = 4,
* FTP_UPLOAD_STOP = 4,
*
* FTP_TRANSFER_ERROR = 5,
* FTP_DOWNLOAD_ERROR = 5,
* FTP_UPLOAD_ERROR = 5
*/
Serial.print(" ");
Serial.print(name);
Serial.print(" ");
Serial.println(transferredSize);
(ftpOperation==FTP_UPLOAD || ftpOperation==FTP_DOWNLOAD)?transfer(true, ftpOperation==FTP_UPLOAD):transfer(false, false);
fileTransfer(ftpOperation, name, transferredSize);
};
void setup()
{
ftpSrv.setCallback(_callback);
ftpSrv.setTransferCallback(_transferCallback);
Serial.begin(115200);
delay(1000);
tft.init();
tft.begin();
tft.setRotation(3);
tft.fillScreen(TFT_BLACK);
tft.setCursor(0, 0);
tft.setTextColor(TFT_BLACK, TFT_WHITE); tft.setTextSize(2);
tft.fillRoundRect(3, 3, 320-6, 40, 5, TFT_WHITE);
tft.drawCentreString("www.mischianti.org", 160, 14,1);
tft.setTextColor(TFT_WHITE, TFT_BLACK);
freeSpacePieData(0, 0);
connectedDisconnected(false);
transfer(false, false);
wifiStrenght(0, true);
Serial.println();
Serial.println();
Serial.print("Connecting to ");
Serial.print(ssid);
WiFi.mode(WIFI_STA);
WiFi.begin(ssid, password);
while (WiFi.status() != WL_CONNECTED)
{
Serial.print(".");
WiFi.begin(ssid, password);
Serial.print(".");
tft.print(F("."));
delay(500);
}
Serial.println("");
Serial.println("WiFi connected");
Serial.println("IP address: ");
Serial.println(WiFi.localIP());
wifiStrenght(WiFi.RSSI());
delay(1000);
if (!sd.begin(SD_CONFIG)) {
sd.initErrorHalt(&Serial);
}
FsFile dir;
FsFile file;
// Open root directory
if (!dir.open("/")){
Serial.println("dir.open failed");
}
ftpSrv.begin("wioterminal","wioterminal"); //username, password for ftp.
}
void loop() {
ftpSrv.handleFTP(); //make sure in loop you call handleFTP()!!
}
// #########################################################################
// Draw circle segments
// #########################################################################
// x,y == coords of centre of circle
// start_angle = 0 - 359
// sub_angle = 0 - 360 = subtended angle
// r = radius
// colour = 16 bit colour value
int fillSegment(int x, int y, int start_angle, int sub_angle, int r, unsigned int colour) {
// Calculate first pair of coordinates for segment start
float sx = cos((start_angle - 90) * DEG2RAD);
float sy = sin((start_angle - 90) * DEG2RAD);
uint16_t x1 = sx * r + x;
uint16_t y1 = sy * r + y;
// Draw colour blocks every inc degrees
for (int i = start_angle; i < start_angle + sub_angle; i++) {
// Calculate pair of coordinates for segment end
int x2 = cos((i + 1 - 90) * DEG2RAD) * r + x;
int y2 = sin((i + 1 - 90) * DEG2RAD) * r + y;
tft.fillTriangle(x1, y1, x2, y2, x, y, colour);
// Copy segment end to sgement start for next segment
x1 = x2;
y1 = y2;
}
}
// #########################################################################
// Return the 16 bit colour with brightness 0-100%
// #########################################################################
unsigned int brightness(unsigned int colour, int brightness) {
byte red = colour >> 11;
byte green = (colour & 0x7E0) >> 5;
byte blue = colour & 0x1F;
blue = (blue * brightness) / 100;
green = (green * brightness) / 100;
red = (red * brightness) / 100;
return (red << 11) + (green << 5) + blue;
}

View File

@ -9,6 +9,8 @@ SimpleFtpServer KEYWORD1
#######################################
begin KEYWORD2
end KEYWORD2
setLocalIp KEYWORD2
credentials KEYWORD2
setCallback KEYWORD2
setTransferCallback KEYWORD2

View File

@ -1,7 +1,8 @@
{
"name": "SimpleFTPServer",
"description": "Simple FTP Server for using esp8266 and esp32 SPIFFs",
"keywords": "esp8266, ftp, spiffs",
"description": "Simple FTP Server for using esp8266, esp32, STM32, Arduino",
"keywords": "arduino, esp8266, esp32, stm32, rp2040, Raspberry Pi, ftp, FtpServer, spiffs, Fat, LittleFS, Ethernet, WiFi, WiFiNINA",
"homepage": "https://www.mischianti.org/category/my-libraries/simple-ftp-server/",
"authors":
{
"name": "Renzo Mischianti",
@ -15,5 +16,6 @@
},
"url": "https://www.mischianti.org",
"frameworks": "Arduino",
"version": "2.1.5",
"platforms": "*"
}

View File

@ -1,9 +1,9 @@
name=SimpleFTPServer
version=1.0.1
version=2.1.5
author=Renzo Mischianti <renzo.mischianti@gmail.com>
maintainer=Renzo Mischianti <renzo.mischianti@gmail.com>
sentence=Simple FTP server for esp8266, esp32 and Arduino
paragraph=Simple FTP server for esp8266 (SPIFFS and LittleFS), esp32 (SPIFFS, LittleFS ans FFAT) and Arduino (SD basic lib with 8.3 file format), Wio Terminal (SdFat 2), Arduino MKR (SdFat 2). With internal callback to chck the phase of communication.
sentence=Simple FTP server for esp8266, esp32, STM32, Raspberry Pi Pico and Arduino
paragraph=Simple FTP server for Raspberry Pi Pico W (LittleFS), esp8266 (SPIFFS and LittleFS or SD, SdFat 2.x), esp32 (SPIFFS, LittleFS and FFAT or SD, SdFat 2.x) and Arduino (SdFat, SD basic lib with 8.3 file format), Wio Terminal (Seed_SD, SdFat 2.x), Arduino MKR (SdFat 2), STM32 (Flash >64K SdFat 2.x and SPI Flash). Support w5500, w5100 and enc28j60. With internal callback to chck the phase of communication.
category=Communication
url=https://www.mischianti.org/category/my-libraries/simple-ftp-server/
repository=https://github.com/xreef/SimpleFTPServer.git

1
lib/WireGuard-ESP32/.gitignore vendored Normal file
View File

@ -0,0 +1 @@
build.sh

View File

@ -0,0 +1,28 @@
Copyright (c) 2021 Kenta Ida (fuga@fugafuga.org)
Copyright (c) 2021 Daniel Hope (www.floorsense.nz)
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice, this
list of conditions and the following disclaimer in the documentation and/or
other materials provided with the distribution.
* Neither the name of "Floorsense Ltd", "Agile Workspace Ltd" nor the names of
its contributors may be used to endorse or promote products derived from this
software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Author: Daniel Hope <daniel.hope@smartalock.com>

View File

@ -0,0 +1,57 @@
# WireGuard Implementation for ESP32 Arduino
This is an implementation of the [WireGuard&reg;](https://www.wireguard.com/) for ESP32 Arduino.
Almost all of this code is based on the [WireGuard Implementation for lwIP](https://github.com/smartalock/wireguard-lwip), but some potion of the code is adjusted to build with ESP32 Arduino.
## How to use
1. Include `WireGuard-ESP32.h` at the early part of the sketch.
```c++
#include <WireGuard-ESP32.h>
```
2. Define the instance of the `WireGuard` class at module level.
```c++
static WireGuard wg;
```
3. Connect to WiFi AP by using `WiFi` class.
```c++
WiFi.begin(ssid, password);
while( !WiFi.isConnected() ) {
delay(1000);
}
```
4. Sync the system time via NTP.
```c++
configTime(9 * 60 * 60, 0, "ntp.jst.mfeed.ad.jp", "ntp.nict.jp", "time.google.com");
```
5. Start the WireGuard interface.
```c++
wg.begin(
local_ip, // IP address of the local interface
private_key, // Private key of the local interface
endpoint_address, // Address of the endpoint peer.
public_key, // Public key of the endpoint peer.
endpoint_port); // Port pf the endpoint peer.
```
You can see an example sketch `uptime_post.ino`, which connects SORACOM Arc WireGuard endpoint and post uptime to SORACOM Harvest via WireGuard connection.
## License
The original WireGuard implementation for lwIP is licensed under BSD 3 clause license so the code in this repository also licensed under the same license.
Original license is below:
The code is copyrighted under BSD 3 clause Copyright (c) 2021 Daniel Hope (www.floorsense.nz)
See LICENSE for details

View File

@ -0,0 +1,10 @@
name=WireGuard-ESP32
version=0.1.5
author=Kenta Ida
maintainer=Kenta Ida <fuga@fugafuga.org>
sentence=WireGuard implementation for Arduino ESP32
paragraph=
category=Communication
url=https://github.com/ciniml/WireGuard-ESP32-Arduino
includes=WireGuard-ESP32.h
architectures=esp32,Inkplate

View File

@ -0,0 +1,17 @@
/*
* WireGuard implementation for ESP32 Arduino by Kenta Ida (fuga@fugafuga.org)
* SPDX-License-Identifier: BSD-3-Clause
*/
#pragma once
#include <IPAddress.h>
class WireGuard
{
private:
bool _is_initialized = false;
public:
bool begin(const IPAddress& localIP, const IPAddress& Subnet, const IPAddress& Gateway, const char* privateKey, const char* remotePeerAddress, const char* remotePeerPublicKey, uint16_t remotePeerPort);
bool begin(const IPAddress& localIP, const char* privateKey, const char* remotePeerAddress, const char* remotePeerPublicKey, uint16_t remotePeerPort);
void end();
bool is_initialized() const { return this->_is_initialized; }
};

View File

@ -0,0 +1,147 @@
/*
* WireGuard implementation for ESP32 Arduino by Kenta Ida (fuga@fugafuga.org)
* SPDX-License-Identifier: BSD-3-Clause
*/
#include "WireGuard-ESP32.h"
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
#include "freertos/event_groups.h"
#include "esp_system.h"
#include "lwip/err.h"
#include "lwip/sys.h"
#include "lwip/ip.h"
#include "lwip/netdb.h"
#include "esp32-hal-log.h"
extern "C" {
#include "wireguardif.h"
#include "wireguard-platform.h"
}
// Wireguard instance
static struct netif wg_netif_struct = {0};
static struct netif *wg_netif = NULL;
static struct netif *previous_default_netif = NULL;
static uint8_t wireguard_peer_index = WIREGUARDIF_INVALID_INDEX;
#define TAG "[WireGuard] "
bool WireGuard::begin(const IPAddress& localIP, const IPAddress& Subnet, const IPAddress& Gateway, const char* privateKey, const char* remotePeerAddress, const char* remotePeerPublicKey, uint16_t remotePeerPort) {
struct wireguardif_init_data wg;
struct wireguardif_peer peer;
ip_addr_t ipaddr = IPADDR4_INIT(static_cast<uint32_t>(localIP));
ip_addr_t netmask = IPADDR4_INIT(static_cast<uint32_t>(Subnet));
ip_addr_t gateway = IPADDR4_INIT(static_cast<uint32_t>(Gateway));
assert(privateKey != NULL);
assert(remotePeerAddress != NULL);
assert(remotePeerPublicKey != NULL);
assert(remotePeerPort != 0);
// Setup the WireGuard device structure
wg.private_key = privateKey;
wg.listen_port = remotePeerPort;
wg.bind_netif = NULL;
// Initialise the first WireGuard peer structure
wireguardif_peer_init(&peer);
// If we know the endpoint's address can add here
bool success_get_endpoint_ip = false;
for(int retry = 0; retry < 5; retry++) {
ip_addr_t endpoint_ip = IPADDR4_INIT_BYTES(0, 0, 0, 0);
struct addrinfo *res = NULL;
struct addrinfo hint;
memset(&hint, 0, sizeof(hint));
memset(&endpoint_ip, 0, sizeof(endpoint_ip));
if( lwip_getaddrinfo(remotePeerAddress, NULL, &hint, &res) != 0 ) {
vTaskDelay(pdMS_TO_TICKS(2000));
continue;
}
success_get_endpoint_ip = true;
struct in_addr addr4 = ((struct sockaddr_in *) (res->ai_addr))->sin_addr;
inet_addr_to_ip4addr(ip_2_ip4(&endpoint_ip), &addr4);
lwip_freeaddrinfo(res);
peer.endpoint_ip = endpoint_ip;
log_i(TAG "%s is %3d.%3d.%3d.%3d"
, remotePeerAddress
, (endpoint_ip.u_addr.ip4.addr >> 0) & 0xff
, (endpoint_ip.u_addr.ip4.addr >> 8) & 0xff
, (endpoint_ip.u_addr.ip4.addr >> 16) & 0xff
, (endpoint_ip.u_addr.ip4.addr >> 24) & 0xff
);
break;
}
if( !success_get_endpoint_ip ) {
log_e(TAG "failed to get endpoint ip.");
return false;
}
// Register the new WireGuard network interface with lwIP
wg_netif = netif_add(&wg_netif_struct, ip_2_ip4(&ipaddr), ip_2_ip4(&netmask), ip_2_ip4(&gateway), &wg, &wireguardif_init, &ip_input);
if( wg_netif == nullptr ) {
log_e(TAG "failed to initialize WG netif.");
return false;
}
// Mark the interface as administratively up, link up flag is set automatically when peer connects
netif_set_up(wg_netif);
peer.public_key = remotePeerPublicKey;
peer.preshared_key = NULL;
// Allow all IPs through tunnel
{
ip_addr_t allowed_ip = IPADDR4_INIT_BYTES(0, 0, 0, 0);
peer.allowed_ip = allowed_ip;
ip_addr_t allowed_mask = IPADDR4_INIT_BYTES(0, 0, 0, 0);
peer.allowed_mask = allowed_mask;
}
peer.endport_port = remotePeerPort;
// Initialize the platform
wireguard_platform_init();
// Register the new WireGuard peer with the netwok interface
wireguardif_add_peer(wg_netif, &peer, &wireguard_peer_index);
if ((wireguard_peer_index != WIREGUARDIF_INVALID_INDEX) && !ip_addr_isany(&peer.endpoint_ip)) {
// Start outbound connection to peer
log_i(TAG "connecting wireguard...");
wireguardif_connect(wg_netif, wireguard_peer_index);
// Save the current default interface for restoring when shutting down the WG interface.
previous_default_netif = netif_default;
// Set default interface to WG device.
netif_set_default(wg_netif);
}
this->_is_initialized = true;
return true;
}
bool WireGuard::begin(const IPAddress& localIP, const char* privateKey, const char* remotePeerAddress, const char* remotePeerPublicKey, uint16_t remotePeerPort) {
// Maintain compatiblity with old begin
auto subnet = IPAddress(255,255,255,255);
auto gateway = IPAddress(0,0,0,0);
return WireGuard::begin(localIP, subnet, gateway, privateKey, remotePeerAddress, remotePeerPublicKey, remotePeerPort);
}
void WireGuard::end() {
if( !this->_is_initialized ) return;
// Restore the default interface.
netif_set_default(previous_default_netif);
previous_default_netif = nullptr;
// Disconnect the WG interface.
wireguardif_disconnect(wg_netif, wireguard_peer_index);
// Remove peer from the WG interface
wireguardif_remove_peer(wg_netif, wireguard_peer_index);
wireguard_peer_index = WIREGUARDIF_INVALID_INDEX;
// Shutdown the wireguard interface.
wireguardif_shutdown(wg_netif);
// Remove the WG interface;
netif_remove(wg_netif);
wg_netif = nullptr;
this->_is_initialized = false;
}

View File

@ -0,0 +1,23 @@
#include "crypto.h"
#include <stdlib.h>
#include <stdint.h>
#include <stdbool.h>
void crypto_zero(void *dest, size_t len) {
volatile uint8_t *p = (uint8_t *)dest;
while (len--) {
*p++ = 0;
}
}
bool crypto_equal(const void *a, const void *b, size_t size) {
uint8_t neq = 0;
while (size > 0) {
neq |= *(uint8_t *)a ^ *(uint8_t *)b;
a += 1;
b += 1;
size -= 1;
}
return (neq) ? false : true;
}

Some files were not shown because too many files have changed in this diff Show More