Replies: 5 comments
-
|
Beta Was this translation helpful? Give feedback.
-
About topic 2:
About topic 3: Like @kjm1102 said, you might get out of that using pre-compiled code, especially if you get the error during import of code. When you have large data objects, pre-compiling might not help. Sometime it helps to call gc.collect() in the main loop of your code, reducing somewhat memory fragmentation. The device does not seem to have PSRAM, so you are limited to the internal RAM. But a ~500 lines of code should fit, unless as said you have large data objects. What helps is freezing your code into flash. Then the code resies in flash and not in RAM. But for that you have to build the firmware yourself. |
Beta Was this translation helpful? Give feedback.
-
Got the same problem. Changing text and re-run main.py does not change anything on the display until hard-reset. Also the tft methods within the REPL seem to not have any effect after the script has run. Only the backlight switching works. |
Beta Was this translation helpful? Give feedback.
-
If it's the TTGO T-display it is supported by nano-gui and micro-gui. |
Beta Was this translation helpful? Give feedback.
-
The TTGO T-display is 135x240 pixels and it uses 16 bit color, consequently the buffer size is 64,800 bytes. The driver used in the GUIs listed above reduces this by a factor of 4 to 16,200 bytes which leaves a lot more headroom for code. The tradeoff is that you can only display 16 different 16-bit colors at a time. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I have just bought a TTGO esp32 with tft display. After 3 hours of struggling I managed to flash the firmware and bring life to the color display. However, I still have (at least) 3 problems:
import machine, display, time, math, network, utime
tft = display.TFT()
tft.init(tft.ST7789,bgr=False,rot=tft.LANDSCAPE, miso=17,backl_pin=4,backl_on=1, mosi=19, clk=18, cs=5, dc=16)
tft.setwin(40,52,320,240)
#tft.clear()
for i in range(0,241):
color=0xFFFFFF-tft.hsb2rgb(i/241*360, 1, 1)
tft.line(i,0,i,135,color)
#tft.clearWin(0x000000)
tft.set_fg(0x000000)
tft.set_bg(0x113355)
tft.ellipse(120,67,120,67)
tft.line(0,0,240,135)
tft.line(240,0,0,135)
text="TTGO!"
tft.text(120-int(tft.textWidth(text)/2),67-int(tft.fontSize()[1]/2),text,0x987654)
def connecttowifi(username,password):
import network
global mywifi
mywifi = network.WLAN(network.STA_IF)
mywifi.active(True)
while not mywifi.isconnected():
mywifi.connect(username, password)
utime.sleep_ms(10)
I get the following error message:
**W (503546) [modnetwork]: WiFi not started
False
W (503647) wifi: wifi osi_nvs_open fail ret=4353
E (503648) wifi: wifi_init_in_caller_task 707 ret=4353
E (503648) [modnetwork]: Error initializing WiFi (4353)
Traceback (most recent call last):
File "", line 34, in
File "", line 28, in connecttowifi
OSError: 4353**
How can I make it work?
MemoryError: memory allocation failed, allocating 308 bytes
Is my program really too long for my board or is there a way to make my board accept it?
I used the following simple (!) command to flash the firmware:
C:\esptoolmaster2>python esptool.py --chip esp32 --port COM14 --baud 460800 --before default_reset --after no_reset write_flash -z --flash_mode dio --flash_freq 40m --flash_size detect 0x1000 bootloader.bin 0xf000 phy_init_data.bin 0x10000 MicroPython.bin 0x8000 partitions_mpy.bin
Can I do better by changing something in this command? Or is there a better firmware?
Poul Riis
Beta Was this translation helpful? Give feedback.
All reactions