Display - ST7735 does not work st7735cmd,backlight,1

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
orskavto
Normal user
Posts: 21
Joined: 21 Feb 2024, 14:49

Display - ST7735 does not work st7735cmd,backlight,1

#1 Post by orskavto » 25 Feb 2024, 06:00

Hi Dear!
I use this display
Image
Image
I'm using a module P116 Display - ST77xx TFT
I'm connecting it to Wemos D1 R1
Image
GPIO 2 ► LED
GPIO 14 ► SCK 
GPIO 13 ► SDA
GPIO 16 ► A0 (DS)
GPIO 15 ► RESET
GPIO 0 ► CS 
GND ► GND
5.0 В ► VCC «+»
Image
There are difficulties with some commands.
st7735cmd,backlight,1 and st7735cmd,backlight,100 - not work
st7735cmd,off and st7735cmd,on - It works fine
"Backlight percentage:" - It works fine on the settings page too
I use ESPEasy - custom_beta_ESP8266_1M
What does the triangle with an exclamation mark mean in the settings?
this display also has a flash card
How can I access it to save and read data?
Last edited by orskavto on 25 Feb 2024, 10:39, edited 2 times in total.

User avatar
Ath
Normal user
Posts: 3499
Joined: 10 Jun 2018, 12:06
Location: NL

Re: Display - ST7735 does not work st7735cmd,backlight,1

#2 Post by Ath » 25 Feb 2024, 10:13

The backlight commands do work as intended, but you have connected the LED pin of the display to 3.3V instead of GPIO-2... :?

These kind of displays usually work at a VCC of 3.3V, so connecting it to 5V is probably not the best choice.

For SD-card support you have to add
#define FEATURE_SD 1
to your Custom.h file (or "-DFEATURE_SD=1" in the pre_custom*.py script), and connect the SD_CS pin to a separate GPIO pin (the other SPI pins can be parallel to the display SPI pins) For SD card to work, both MISO and MOSI pins have to be connected (the display only uses MOSI)

The warning at the pin selector indicates that this GPIO has a special purpose during boot, so should not be pulled high or low, depending on its purpose, see: https://espeasy.readthedocs.io/en/lates ... pping-pins
/Ton (PayPal.me)

orskavto
Normal user
Posts: 21
Joined: 21 Feb 2024, 14:49

Re: Display - ST7735 does not work st7735cmd,backlight,1

#3 Post by orskavto » 25 Feb 2024, 11:18

Ath wrote: 25 Feb 2024, 10:13 The backlight commands do work as intended, but you have connected the LED pin of the display to 3.3V instead of GPIO-2... :?
I made a mistake when I wrote it. I actually connected it to GPIO2
Ath wrote: 25 Feb 2024, 10:13 These kind of displays usually work at a VCC of 3.3V, so connecting it to 5V is probably not the best choice.
In different examples from the Internet, the screen was connected in different ways. But if you think 3.3v is better, then I'll redo it.
Ath wrote: 25 Feb 2024, 10:13 For SD-card support you have to add
#define FEATURE_SD 1
to your Custom.h file (or "-DFEATURE_SD=1" in the pre_custom*.py script), and connect the SD_CS pin to a separate GPIO pin (the other SPI pins can be parallel to the display SPI pins) For SD card to work, both MISO and MOSI pins have to be connected (the display only uses MOSI)
My file pre_custom_esp82xx.py has a link

Code: Select all

...
if os.path.isfile('src/Custom.h'):
  custom_defines=["-DUSE_CUSTOM_H"]
else:
custom_defines=[
    "-DCONTROLLER_SET_ALL",
    "-DNOTIFIER_SET_NONE",
    "-DPLUGIN_SET_NONE",
    "-DUSES_P001",  
  ...
but the src/Custom file.h is missing
To enable SD card support, I need to add this to the array:
...
custom_defines=[
"-FEATURE_SD", # add this ???
"-DCONTROLLER_SET_ALL",
...

TD-er
Core team member
Posts: 8739
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: Display - ST7735 does not work st7735cmd,backlight,1

#4 Post by TD-er » 25 Feb 2024, 11:31

In there you need to prefix the defines with "-D"
Thus in C++: (in Custom.h file)

Code: Select all

#define FEATURE_SD 1
Or in the Python file:

Code: Select all

custom_defines=[
"-DFEATURE_SD=1", # add this ???
"-DCONTROLLER_SET_ALL",
...

orskavto
Normal user
Posts: 21
Joined: 21 Feb 2024, 14:49

Re: Display - ST7735 does not work st7735cmd,backlight,1

#5 Post by orskavto » 25 Feb 2024, 11:36

TD-er wrote: 25 Feb 2024, 11:31 In there you need to prefix the defines with "-D"
Thus in C++: (in Custom.h file)

Code: Select all

#define FEATURE_SD 1
Or in the Python file:

Code: Select all

custom_defines=[
"-DFEATURE_SD=1", # add this ???
"-DCONTROLLER_SET_ALL",
...
Ok
Thank You!

orskavto
Normal user
Posts: 21
Joined: 21 Feb 2024, 14:49

Re: Display - ST7735 does not work st7735cmd,backlight,1

#6 Post by orskavto » 25 Feb 2024, 12:59

I added "-DFEATURE_SD=1" to the file pre_custom_esp82xx.py
compiled and uploaded to the board
but the "SD-card" section on the "Hardware page" page did not appear
there were warnings during compilation:

<command-line>: warning: "FEATURE_SD" redefined
<command-line>: note: this is the location of the previous definition

TD-er
Core team member
Posts: 8739
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: Display - ST7735 does not work st7735cmd,backlight,1

#7 Post by TD-er » 25 Feb 2024, 13:05

Which custom build do you try to build?
Isn't an 1M build right?

orskavto
Normal user
Posts: 21
Joined: 21 Feb 2024, 14:49

Re: Display - ST7735 does not work st7735cmd,backlight,1

#8 Post by orskavto » 25 Feb 2024, 13:32

TD-er wrote: 25 Feb 2024, 13:05 Which custom build do you try to build?
Isn't an 1M build right?
I think so. I didn't change anything except the file pre_custom_esp82xx.py

TD-er
Core team member
Posts: 8739
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: Display - ST7735 does not work st7735cmd,backlight,1

#9 Post by TD-er » 25 Feb 2024, 13:40

But which PlatformIO env do you select to build?

orskavto
Normal user
Posts: 21
Joined: 21 Feb 2024, 14:49

Re: Display - ST7735 does not work st7735cmd,backlight,1

#10 Post by orskavto » 25 Feb 2024, 13:51

TD-er wrote: 25 Feb 2024, 13:40 But which PlatformIO env do you select to build?
I just selected custom_beta_ESP8266_1M in PlatformIO and clicked Build

TD-er
Core team member
Posts: 8739
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: Display - ST7735 does not work st7735cmd,backlight,1

#11 Post by TD-er » 25 Feb 2024, 14:27

That's an 1M build.
I guess you don't need to build for a node with only 1M of flash, do you?
So please try using a 4M build.
Also why using "beta"? That's using the latest Arduino code, which may have some issues regarding WiFi and memory usage.

Better just use to top one "Custom_274_ESP8266_4M1M"

User avatar
Ath
Normal user
Posts: 3499
Joined: 10 Jun 2018, 12:06
Location: NL

Re: Display - ST7735 does not work st7735cmd,backlight,1

#12 Post by Ath » 25 Feb 2024, 14:32

When using a 4M flash unit, it's way more convenient to use the OTA Update Firmware feature, available at the Tools page of ESPEasy, and it also allows for more features, because it doesn't use the LIMIT_BUILD_SIZE flag for minimizing the code-size, f.e. by brute-forcing FEATURE_SD to Off/Disabled.
/Ton (PayPal.me)

orskavto
Normal user
Posts: 21
Joined: 21 Feb 2024, 14:49

Re: Display - ST7735 does not work st7735cmd,backlight,1

#13 Post by orskavto » 26 Feb 2024, 04:20

Ath wrote: 25 Feb 2024, 14:32 When using a 4M flash unit, it's way more convenient to use the OTA Update Firmware feature, available at the Tools page of ESPEasy, and it also allows for more features, because it doesn't use the LIMIT_BUILD_SIZE flag for minimizing the code-size, f.e. by brute-forcing FEATURE_SD to Off/Disabled.
For ESPEasy-mega-20231225 in the custom build, the firmware update page looks like this:
Image

orskavto
Normal user
Posts: 21
Joined: 21 Feb 2024, 14:49

Re: Display - ST7735 does not work st7735cmd,backlight,1

#14 Post by orskavto » 26 Feb 2024, 04:36

TD-er wrote: 25 Feb 2024, 14:27 That's an 1M build.
I guess you don't need to build for a node with only 1M of flash, do you?
So please try using a 4M build.
Also why using "beta"? That's using the latest Arduino code, which may have some issues regarding WiFi and memory usage.

Better just use to top one "Custom_274_ESP8266_4M1M"
I tried compiling the Custom_274_ESP8266_4M1M build. The result was the same as for custom_beta_ESP8266_1M
Problems: "FEATURE_SD" redefined [enabled by default]

Code: Select all

<command-line>:0:0: warning: "FEATURE_SD" redefined
<command-line>:0:0: note: this is the location of the previous definition
This is my file pre_custom_esp82xx.py https://drive.google.com/file/d/1sf0rI5 ... sp=sharing
And this is the Builder log https://drive.google.com/file/d/1o_q4RN ... sp=sharing

orskavto
Normal user
Posts: 21
Joined: 21 Feb 2024, 14:49

Re: Display - ST7735 does not work st7735cmd,backlight,1

#15 Post by orskavto » 26 Feb 2024, 07:30

the problem was partially solved when loading another source code.
now I have used the source code from this source https://github.com/letscontrolit/ESPEasy
I took the original source code from this source https://github.com/letscontrolit/ESPEasy/releases
now the compilation has passed, but there are still warnings
Image
The firmware update page is also working fine now

orskavto
Normal user
Posts: 21
Joined: 21 Feb 2024, 14:49

Re: Display - ST7735 does not work st7735cmd,backlight,1

#16 Post by orskavto » 26 Feb 2024, 10:39

Ath wrote: 25 Feb 2024, 10:13 ... and connect the SD_CS pin to a separate GPIO pin (the other SPI pins can be parallel to the display SPI pins) For SD card to work, both MISO and MOSI pins have to be connected (the display only uses MOSI)
Hi Dear!
now I've connected it like this:
Image
GPIO 2 ► LED
GPIO 14 ► SCK  and SD_SCK
GPIO 13 ► SDA and SD_MOSI
GPIO 16 ► A0 (DS)
GPIO 15 ► RESET
GPIO 0 ► CS
GND ► GND
3.3 В ► VCC
GPIO 12 ► SD_MISO
GPIO 1 ► SD_CS
Image
How can I find out that the SD card is connected and working?
I tried to find it in the documentation:
https://espeasy.readthedocs.io/en/lates ... ea=default
But I did not find any examples of writing to a CD card.
I need to save my work data somewhere, in case the power goes out. Also, save some user settings so that the user does not have to enter this data every time they turn on.

User avatar
Ath
Normal user
Posts: 3499
Joined: 10 Jun 2018, 12:06
Location: NL

Re: Display - ST7735 does not work st7735cmd,backlight,1

#17 Post by Ath » 26 Feb 2024, 13:08

orskavto wrote: 26 Feb 2024, 10:39 ...
How can I find out that the SD card is connected and working?
I tried to find it in the documentation:
https://espeasy.readthedocs.io/en/lates ... ea=default
But I did not find any examples of writing to a CD card.
You can use the SD Card filebrowser at the Tools page, where files can be uploaded and downloaded.
You can upload .bmp files there, that can be displayed on the screen using the bmp sub-command for the st7735 command.
Also there is an option to store logging on the SD-card, by enabling the relevant options in Tools/Advanced. (You will have to manually clean-up by the time the SD cards is getting full)
orskavto wrote: 26 Feb 2024, 10:39 I need to save my work data somewhere, in case the power goes out. Also, save some user settings so that the user does not have to enter this data every time they turn on.
Not sure what you are trying to say here. Any configuration items are stored in the usual settings files, but I wouldn't know what other stuff/work data you want to save?
/Ton (PayPal.me)

orskavto
Normal user
Posts: 21
Joined: 21 Feb 2024, 14:49

Re: Display - ST7735 does not work st7735cmd,backlight,1

#18 Post by orskavto » 26 Feb 2024, 13:48

Ath wrote: 26 Feb 2024, 13:08 You can use the SD Card filebrowser at the Tools page, where files can be uploaded and downloaded.
You can upload .bmp files there, that can be displayed on the screen using the bmp sub-command for the st7735 command.
Also there is an option to store logging on the SD-card, by enabling the relevant options in Tools/Advanced. (You will have to manually clean-up by the time the SD cards is getting full)
Ok
I checked the Lock box on the SD card
Image
I went to "Show files on SD card" it was empty
Image
I have uploaded the 1232.bmp file
Image
a message came out that the file was uploaded
Image
I go back to "Show files on SD card", but there are no files there again. there is no log file and there is no 1232.bmp file
I can't figure out how it works.
Ath wrote: 26 Feb 2024, 13:08 Not sure what you are trying to say here. Any configuration items are stored in the usual settings files, but I wouldn't know what other stuff/work data you want to save?
I'm trying to make a whiskey filter. This is my first project. I haven't worked with arduino before.
there are two containers. Container No. 1 stands on the floor, container No. 2 stands high.
There is distillate in container No. 1 - this is the future whiskey
At the initial stage, the user must enter the strength of the distillate (parameter No. 1), and the strength of the final whiskey (parameter No. 2) that he wants to receive. Parameter No. 1 and No. 2 must be saved so that even if the electricity turns off, they remain after switching on.
Next, you need to save the date and time of the start of filtering.
then the pump turns on and pumps the distillate into container No. 2. when container No. 1 becomes empty, the pump turns off.
The distillate will drain under gravity through the carbon filter back into container No. 1. When container No. 2 becomes empty, the pump will turn on again and fill it. The number of such cycles should also remain even if the electricity is turned off.
During the distillate runoff, the Pulse counter will work in order to measure the volume of distillate.
Pulse counter data also needs to be saved.
Therefore, I wanted to use the SD card so as not to spoil the controller's flash. The SD card is cheaper than the controller and it will be easier to replace it.
But I can't figure out how I should create a file on the SD card using ESP Easy? how to write it down and how to read the saved data from it.

User avatar
Ath
Normal user
Posts: 3499
Joined: 10 Jun 2018, 12:06
Location: NL

Re: Display - ST7735 does not work st7735cmd,backlight,1

#19 Post by Ath » 26 Feb 2024, 14:56

orskavto wrote: 26 Feb 2024, 13:48 I go back to "Show files on SD card", but there are no files there again. there is no log file and there is no 1232.bmp file
I can't figure out how it works.
When using the Back button of your browser the page is not refreshed, you have to either press F5/Ctrl-R or re-open the page from the Tools page to get an updated list.
orskavto wrote: 26 Feb 2024, 13:48 ...
Therefore, I wanted to use the SD card so as not to spoil the controller's flash. The SD card is cheaper than the controller and it will be easier to replace it.
But I can't figure out how I should create a file on the SD card using ESP Easy? how to write it down and how to read the saved data from it.
There currently is no functionality like that. Usually the collected data is sent to a (MQTT?) Controller, that can possibly re-provide that data (requires some work to get going) when f.e. the Retain flag is enabled, or by other means.
ESPEasy normally only stores settings (on the regular Flash file-system), though it can store collected data using the Cache controller (only available in specific builds like MAX, or manually added to Custom builds), but no direct way to retrieve data from that cache for re-populating as measured values to a task. Last values will only be restored on warm boot, like when updating the firmware via the Tools page or when using the reboot command, but not on hard reset or after a power cycle.
/Ton (PayPal.me)

orskavto
Normal user
Posts: 21
Joined: 21 Feb 2024, 14:49

Re: Display - ST7735 does not work st7735cmd,backlight,1

#20 Post by orskavto » 26 Feb 2024, 15:21

Ath wrote: 26 Feb 2024, 14:56 When using the Back button of your browser the page is not refreshed, you have to either press F5/Ctrl-R or re-open the page from the Tools page to get an updated list.
I did an update and logged in again via Tools. there are no files anyway
Ath wrote: 26 Feb 2024, 14:56 There currently is no functionality like that. Usually the collected data is sent to a (MQTT?) Controller, that can possibly re-provide that data (requires some work to get going) when f.e. the Retain flag is enabled, or by other means.
ESPEasy normally only stores settings (on the regular Flash file-system), though it can store collected data using the Cache controller (only available in specific builds like MAX, or manually added to Custom builds), but no direct way to retrieve data from that cache for re-populating as measured values to a task. Last values will only be restored on warm boot, like when updating the firmware via the Tools page or when using the reboot command, but not on hard reset or after a power cycle.
It is sad. :cry:
this deprives the device of autonomy. You will have to install an additional server device, this is no longer very convenient. I want to believe that this moment will be finalized, and a plugin will appear that will be able to write and read data from a CD card to support offline operation

User avatar
Ath
Normal user
Posts: 3499
Joined: 10 Jun 2018, 12:06
Location: NL

Re: Display - ST7735 does not work st7735cmd,backlight,1

#21 Post by Ath » 26 Feb 2024, 22:25

There are already a few feature requests registered in the ESPEasy Github repository, requesting similar features for storing the values more permanently, but none have yet been implemented. I don't recall if SD-Card storage was included in that list. more in the direction of FRAM modules or the RTC ram storage.
/Ton (PayPal.me)

TD-er
Core team member
Posts: 8739
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: Display - ST7735 does not work st7735cmd,backlight,1

#22 Post by TD-er » 26 Feb 2024, 23:33

When using a SD card, please be aware not all SD cards are created equal and also the used file system and partition table can make a huge difference whether it will work or not.

As a rule of thumb: Older cards are often the better choice for these kinds of projects.

- Smaller (preferrably < 4 GB as all larger cards are guaranteed to be SD-HC or SD-XC)
- More chance not using (or requiring) multiple serial lanes for higher speed
- Still compatible with "SD" standard and not SD-HC or SD-XC only.
- FAT32 (or even FAT) formatted.

You can also try to format the card in some other device like an older camera as those will also create the most basic partitioning and file system parameters.

orskavto
Normal user
Posts: 21
Joined: 21 Feb 2024, 14:49

Re: Display - ST7735 does not work st7735cmd,backlight,1

#23 Post by orskavto » 27 Feb 2024, 04:33

Ath wrote: 26 Feb 2024, 22:25 There are already a few feature requests registered in the ESPEasy Github repository, requesting similar features for storing the values more permanently, but none have yet been implemented. I don't recall if SD-Card storage was included in that list. more in the direction of FRAM modules or the RTC ram storage.
Yes, I saw messages on the forum with questions similar to mine. However, I hoped that a solution had been found. In fact, the concept of many dependent sensors, one server, is not the best. because if you lose the server, you lose everything. But if the sensors are independent, then if you lose the server, you do not lose anything except the server, you can take everything you need to a new server from autonomous sensors. ;)
therefore, it is better to connect the CD card as a separate plug-in, as well as, for example, a display, and work with it if necessary. This will greatly expand the boundaries of the project beyond the OS for sensors. :!:

orskavto
Normal user
Posts: 21
Joined: 21 Feb 2024, 14:49

Re: Display - ST7735 does not work st7735cmd,backlight,1

#24 Post by orskavto » 27 Feb 2024, 04:34

TD-er wrote: 26 Feb 2024, 23:33 When using a SD card, please be aware not all SD cards are created equal and also the used file system and partition table can make a huge difference whether it will work or not.

As a rule of thumb: Older cards are often the better choice for these kinds of projects.

- Smaller (preferrably < 4 GB as all larger cards are guaranteed to be SD-HC or SD-XC)
- More chance not using (or requiring) multiple serial lanes for higher speed
- Still compatible with "SD" standard and not SD-HC or SD-XC only.
- FAT32 (or even FAT) formatted.

You can also try to format the card in some other device like an older camera as those will also create the most basic partitioning and file system parameters.
Thank You Friend!
I will try

TD-er
Core team member
Posts: 8739
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: Display - ST7735 does not work st7735cmd,backlight,1

#25 Post by TD-er » 27 Feb 2024, 09:15

How much storage do you actually need?
On 16M flash units, the file system is about 8 MB.
That's quite a lot and you can even log sensor data in binary form.
See the "cache controller" and the "Cache Reader plugin"

Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests