dl9rdz / rdz_ttgo_sonde

270 stars 94 forks source link

Frozen display screen ILI9225 - T-beam V1.2 - dev soft. #407

Closed PiroRiro closed 8 months ago

PiroRiro commented 9 months ago

Hello Guys :)

I'm using a t-beam v1.2 board and i have see/found a bug. When i'm use ili9225 disp with 180 degree rotated disp (option 3) then when i clik some of buttons on the bottom of board to switch type of radiosonde or screen, the disply its frozen and i cant nothing do. Only restart works, but if i clike user buttons again the screen froz again and again.

The problem i have with devel20231203-B17-full.bin and older dev soft. With master release evrything works fine.

Best redgards PiroRiro

Sorry for my bad english :/

dl9rdz commented 9 months ago

Can you send me a log from the serial port output of the TTGO?

I wonder about "With master release evrything works fine." because the master does not yet include support for the power management chip in the t-beam 1.2 board. Does usually means that (a) the LoRa chip does not get any power, so no decoding, and (b) the left button that is handled by the power management chip is not supported. What did you do to make the master version work on that board?

PiroRiro commented 9 months ago

Log from ttgo after reboot and clicking middle button:

Board fingerprint is 23
Autoconfig: looks like T-Beam 1.0 or M5Stack Core2 board
no I2C display found, assuming large TFT display

... with large TFT display

Initializing SPIFFS
Reading initial configuration
configuration option 'wifi'=3 
configuration option 'mdnsname'=rdzsonde 
configuration option 'ephftp'=gssc.esa.int/gnss/data/daily/%1$04d/brdc/brdc%2$03d0.%3$02dn.gz 
configuration option 'debug'=0 
configuration option 'maxsonde'=20 
configuration option 'rxlat'= 
configuration option 'rxlon'= 
configuration option 'rxalt'= 
configuration option 'screenfile'=2 
configuration option 'display'=0,1,2,3,4 
appending value 0  next is 1,2,3,4
appending value 1  next is 2,3,4
appending value 2  next is 3,4
appending value 3  next is 4
appending value 4  next is 
configuration option 'dispsaver'=0 
configuration option 'dispcontrast'=-1 
configuration option 'norx_timeout'=20 
configuration option 'tft_orient'=1 
configuration option 'spectrum'=-1 
configuration option 'startfreq'=400 
configuration option 'channelbw'=10 
configuration option 'marker'=1 
configuration option 'noisefloor'=-125 
configuration option 'freqofs'=0 
configuration option 'rs41.agcbw'=12500 
configuration option 'rs41.rxbw'=6300 
configuration option 'rs92.rxbw'=12500 
configuration option 'rs92.alt2d'=480 
configuration option 'dfm.agcbw'=20800 
configuration option 'dfm.rxbw'=10400 
configuration option 'm10m20.agcbw'=20800 
configuration option 'm10m20.rxbw'=12500 
configuration option 'mp3h.agcbw'=12500 
configuration option 'mp3h.rxbw'=12500 
configuration option 'call'=N0CALL 
configuration option 'passcode'=12345 
configuration option 'kisstnc.active'=1 
configuration option 'axudp.active'=1 
configuration option 'axudp.host'=192.168.42.20 
configuration option 'axudp.port'=9002 
configuration option 'axudp.highrate'=1 
configuration option 'tcp.active'=0 
configuration option 'tcp.timeout'=0 
configuration option 'tcp.host'=radiosondy.info 
configuration option 'tcp.port'=14590 
configuration option 'tcp.highrate'=20 
configuration option 'tcp.objcall'= 
configuration option 'tcp.beaconsym'=/`/( 
configuration option 'tcp.chase'=0 
configuration option 'tcp.comment'= 
configuration option 'mqtt.active'=0 
configuration option 'mqtt.id'=rdz_sonde_server 
configuration option 'mqtt.host'= 
configuration option 'mqtt.port'=1883 
configuration option 'mqtt.username'= 
configuration option 'mqtt.password'= 
configuration option 'mqtt.prefix'=rdz_sonde_server/ 
configuration option 'cm.active'=0 
configuration option 'cm.host'= 
configuration option 'cm.port'=0 
configuration option 'sondehub.active'=0 
configuration option 'sondehub.chase'=3 
configuration option 'sondehub.host'=api.v2.sondehub.org 
configuration option 'sondehub.callsign'=CHANGEME_RDZTTGO 
configuration option 'sondehub.antenna'= 
configuration option 'sondehub.email'= 
configuration option 'sondehub.fiactive'=0 
configuration option 'sondehub.fiinterval'=5 
configuration option 'sondehub.fimaxdist'=150 
configuration option 'sondehub.fimaxage'=2 
configuration option 'disptype'=1 
configuration option 'oled_sda'=21 
configuration option 'oled_scl'=22 
configuration option 'oled_rst'=14 
configuration option 'tft_rs'=4 
configuration option 'tft_cs'=13 
configuration option 'tft_spifreq'=40000000 
configuration option 'button_pin'=38 
configuration option 'button2_pin'=143 
configuration option 'button2_axp'=1 
configuration option 'touch_thresh'=70 
configuration option 'power_pout'=-1 
configuration option 'led_pout'=-1 
configuration option 'gps_rxd'=34 
configuration option 'gps_txd'=12 
configuration option 'batt_adc'=-1 
configuration option 'sx1278_ss'=18 
configuration option 'sx1278_miso'=19 
configuration option 'sx1278_mosi'=27 
configuration option 'sx1278_sck'=5 
I2C device found at address 0x34 !
axp2101 PMU found
done

PMU found
I2C device found at address 0x34 !
axp2101 PMU found
done

button1.pin is 38, attaching interrupt
Initializing touch 2 on pin 15
disptype is 1
Display created
ILI9225/ILI9341 init
Font 0: yofs=12, yclear=16
Font 1: yofs=12, yclear=16
Font 2: yofs=12, yclear=16
Font 3: yofs=12, yclear=16
Font 4: yofs=13, yclear=18
Font 5: yofs=17, yclear=23
Font 6: yofs=4, yclear=6
Font 7: yofs=26, yclear=35
ILI9225/ILI9341/ST7789 init: done
Display initialized
Showing welcome display
Clearing display
2 networks in networks.txt

RDZsonde: RDZsonde
DinoGast: Schokolade
before disp.initFromFile... layouts is 0x3ffbe12c
Reading /screens2.txt
Reading from screen config: available=11646
ScannerTFT: alloc 158 bytes (6 entries) for 0x3ffb47c0 (addr=0x3ffb4a0c)
MainTFT: alloc 318 bytes (14 entries) for 0x3ffb47d4 (addr=0x3ffb4b2c)
PeilungTFT: alloc 238 bytes (10 entries) for 0x3ffb47e8 (addr=0x3ffb4d3c)
GPSdataTFT: alloc 218 bytes (9 entries) for 0x3ffb47fc (addr=0x3ffb4f54)
BatteryTFT: alloc 258 bytes (11 entries) for 0x3ffb4810 (addr=0x3ffb5128)
Scan.TFT.Bazjo: alloc 298 bytes (13 entries) for 0x3ffb4824 (addr=0x3ffb536c)
Decode/General.TFT.Bazjo: alloc 518 bytes (24 entries) for 0x3ffb4838 (addr=0x3ffb55f0)
Decode/Battery.TFT.Bazjo: alloc 358 bytes (16 entries) for 0x3ffb484c (addr=0x3ffb59f8)
Scanner.Puspis: alloc 278 bytes (12 entries) for 0x3ffb4860 (addr=0x3ffb5d38)
Main.Puspis: alloc 518 bytes (24 entries) for 0x3ffb4874 (addr=0x3ffb5f88)
JotaEme.Puspis: alloc 438 bytes (20 entries) for 0x3ffb4888 (addr=0x3ffae758)
CompassTFT.Puspis: alloc 238 bytes (10 entries) for 0x3ffb489c (addr=0x3ffaeacc)
GPSdataTFT.Puspis: alloc 338 bytes (15 entries) for 0x3ffb48b0 (addr=0x3ffaecdc)
BatteryTFT.Puspis: alloc 338 bytes (15 entries) for 0x3ffb48c4 (addr=0x3ffaefd4)
TelemetryData: alloc 318 bytes (14 entries) for 0x3ffb48d8 (addr=0x3ffaf2c4)
replaceLayouts: idx=0 n(new)=0
disp.initFromFile... layouts is 0x3ffb47c0Setup sx1278
Configuing SX1278FSK SPI with miso=19, mosi=27, sck=5, ss=18
Setting freq: SUCCESS 
Frequency set to 402699936.00
Setting freq: SUCCESS 
Frequency set to 402699936.00
RX LNA Gain is 0
SX1278 configuration finished
Setup finished

Reading channel config:
Adding 402.299988 - 1 - 1 - Greifswald
Adding 402.500000 - 1 - 0 - Schleswig
Adding 402.700012 - 1 - 1 - HH-Sasel
Adding 403.000000 - 1 - 0 - DeBilt
Adding 404.100006 - 1 - 1 - Norderney
Adding 404.299988 - 1 - 0 - Schleswig_2
Adding 404.500000 - 1 - 0 - Meppen
Adding 404.700012 - 1 - 0 - Greifswald_2
Adding 405.100006 - 1 - 0 - Lindenberg
Adding 405.700012 - 1 - 1 - Bergen
Adding 405.899994 - 1 - 1 - Bergen_2
Adding 405.100006 - 1 - 1 - Meppen_2
Adding 405.299988 - 1 - 0 - Essen
Invalid rxtask.currentSonde: -1
Sonde::setup() start on index 0
Exact bitrate is 4799.98
Sonde::setup() done: Type RS41 Freq 402.300000, AFC BW: 12500, RX BW: 6250
GPS reset file: not found/isdir

MAIN: Running loop in state 2 [currentDisp:1, lastDisp:1]. free heap: 217624, unused stack: 6132
[WiFi-event] event: 0
WiFi interface ready
[WiFi-event] event: 2
WiFi client started
[WiFi-event] event: 1
Completed scan for access points
Network 2.4G-Vectra-WiFi-658DD4: RSSI -62, MAC 48:5F:99:65:8D:DA, enc: WPA2_PSK
Network STRONG_4d94_2.4GHz: RSSI -71, MAC 8C:6D:50:A5:05:C4, enc: WPA2_PSK
Network 2.4G-Vectra-WiFi-6DFACC: RSSI -74, MAC 1C:9E:CC:6D:FA:D0, enc: WPA2_PSK
Network Orange_Swiatlowod_1BB0: RSSI -75, MAC C0:3C:04:4B:1B:B0, enc: WPA2_PSK
Network Internet_Domowy_3FF764: RSSI -75, MAC 34:BA:9A:3F:F7:64, enc: WPA2_PSK
Network Tenda_3B27070: RSSI -76, MAC 58:D9:D5:3B:20:70, enc: WPA_WPA2_PSK
Network 2.4G-Vectra-WiFi-F1B8A1: RSSI -78, MAC A4:98:13:BD:8E:87, enc: WPA_WPA2_PSK
Network Orange_Swiatlowod_1C92: RSSI -79, MAC AC:84:C9:2F:1C:92, enc: WPA2_PSK
Network Orange_Swiatlowod_0800: RSSI -84, MAC F0:81:75:62:08:00, enc: WPA2_PSK
Network 2.4G-Vectra-WiFi-C1AF04: RSSI -88, MAC 98:9D:5D:C1:AF:09, enc: WPA_WPA2_PSK
Network NETGEAR26: RSSI -88, MAC 08:36:C9:E1:C4:9A, enc: WPA2_PSK
Network 9634_ostrog.net: RSSI -88, MAC 54:DB:A2:FE:8B:51, enc: WPA_WPA2_PSK
Network STRONG_4d94_2.4GHz_plus: RSSI -89, MAC 9C:9D:7E:2C:D5:72, enc: WPA_WPA2_PSK
[WiFi-event] event: 3
WiFi clients stopped
Activating access point mode
[WiFi-event] event: 0
WiFi interface ready
Wait 100 ms for AP_START...
[WiFi-event] event: 14
WiFi access point started
Ready
updateDisplayIP: 65 154
AP IP address: 192.168.4.1
[WiFi-event] event: 16
Client connected
[WiFi-event] event: 18
Assigned IP address to client
[WiFi-event] event: 18
Assigned IP address to client
SetupAsyncServer()

enableNetwork done
setCurrentDisplay: setting index 0, entry 0(8)enterMode(0)
clearing and updating display
enterMode ok
setLayout: 0 (max is 15)
RXtask: start DECODER for sonde 0 (was --)
Sonde::setup() start on index 0

MAIN: Running loop in state 0 [currentDisp:0, lastDisp:0]. free heap: 129424, unused stack: 5672
Exact bitrate is 4799.98
Sonde::setup() done: Type RS41 Freq 402.300000, AFC BW: 12500, RX BW: 6250
Sonde::timeoutEvent: NORX
Sonde:receive(): result 1 (RX_TIMEOUT), event 0b => action 82
waitRXcomplete returning 8201 (RX_TIMEOUT)
MAIN: loopDecoder: action 82 (Sonde=2) => 65  [current: main=2, rxtask=2]
last_in - now: 18949
MAIN: updateDisplay started
RXtask: start DECODER for sonde 2 (was DECODER)
Sonde::setup() start on index 2
MAIN: updateDisplay done (after 18 ms)

MAIN: Running loop in state 0 [currentDisp:0, lastDisp:0]. free heap: 128804, unused stack: 5400
Exact bitrate is 4799.98
Sonde::setup() done: Type RS41 Freq 402.699936, AFC BW: 12500, RX BW: 6250
PMU_IRQ is set

Keypress: 3 (mid)Key 1 was pressed [1]
Sonde:receive(): result 1 (RX_TIMEOUT), event 01 => action 3f
waitRXcomplete returning 3f01 (RX_TIMEOUT)
Setting display mode 1
setLayout: 1 (max is 15)
MAIN: loopDecoder: action 3f (Default Display) => 255  [current: main=2, rxtask=2]
last_in - now: 20194
MAIN: updateDisplay started
MAIN: updateDisplay done (after 25 ms)

MAIN: Running loop in state 0 [currentDisp:0, lastDisp:0]. free heap: 128804, unused stack: 4980
Key 2 was pressed [7]
Sonde:receive(): result 1 (RX_TIMEOUT), event 07 => action ff
waitRXcomplete returning ff01 (RX_TIMEOUT)
last_in - now: 21220
MAIN: updateDisplay started
MAIN: updateDisplay done (after 24 ms)

MAIN: Running loop in state 0 [currentDisp:0, lastDisp:0]. free heap: 129412, unused stack: 4936
Sonde:receive(): result 1 (RX_TIMEOUT), event 00 => action ff
waitRXcomplete returning ff01 (RX_TIMEOUT)
last_in - now: 22245
MAIN: updateDisplay started
MAIN: updateDisplay done (after 24 ms)

MAIN: Running loop in state 0 [currentDisp:0, lastDisp:0]. free heap: 129412, unused stack: 4872
Sonde:receive(): result 1 (RX_TIMEOUT), event 00 => action ff
waitRXcomplete returning ff01 (RX_TIMEOUT)
last_in - now: 23270
MAIN: updateDisplay started
MAIN: updateDisplay done (after 24 ms)

Log after clicning left button

MAIN: Running loop in state 0 [currentDisp:0, lastDisp:0]. free heap: 129412, unused stack: 4872
PMU_IRQ is set

Keypress: 1 (short)Key 2 was pressed [5]
Sonde:receive(): result 1 (RX_TIMEOUT), event 05 => action 40
waitRXcomplete returning 4001 (RX_TIMEOUT)
Setting display mode 2
setLayout: 2 (max is 15)
MAIN: loopDecoder: action 40 (Display=64) => 255  [current: main=11, rxtask=11]
last_in - now: 272696
MAIN: updateDisplay started
Drawing circle with size 111 at 0,22
GPS0: NCS N=0, A=0, B=-1
25: 55,29
Drawing circle with size 111 at 104,22
GPS0: CCS N=360, A=0, B=359
30: 159,29
MAIN: updateDisplay done (after 34 ms)

Sorry i have make bad description :/ The display with master release works fine. Yes, the pwr button doesn't work, but if i click him the display goes frozen. If i click user defined button disp goes frozen too. To power lora module i have make a wiring between gps vcc and lora vcc with 22R resistor.

hr-ru commented 9 months ago

Sorry, I cannot reproduce this here, I tested it with all my displays, including two different ILI9225.

Can you describe more details of the problem?

PiroRiro commented 9 months ago

Only display its frozen. The web interface is still working, and yes the serial output its going on. When i click left or middle button the display stock and nothing its changing.

Here i add my hardware and screen configuration: hardware screen

I have make a video whats show that problem. I hope that the quality of the video it's good enough. https://github.com/dl9rdz/rdz_ttgo_sonde/assets/146319901/7a126ac9-ec48-4287-8522-4ffb6dd73d8b

Now i'm using the newest devel soft.

CT2IRJ commented 8 months ago

Hi,

I'm having the exact same issue. Screen freezes if any button is pressed, also some other screen options even if comanded by the web interface, starting at 4=Battery.TFT and all others from that option up.

My config is different from the above, I'm following SDA=4, CLK=21, RST=22, RS=2, CS=0

Edit: I'm using the latest devel20240110-B17-full.bin - Jan 10 22:11:02 2024

Anyway, I would like to thank all involved on this project, it has been a great tool, especially while "hunting" on the field.

Cheers

hr-ru commented 8 months ago

I so far was unable to reproduce. Maybe one of you could share your config file with me by email (dl9rdz@darc.de)?

You can either get it from the web interface, should be one of the following URLs (replace rdzsonde.local with ip in case mDNS is not working for you) http://rdzsonde.local/edit.html?file=config.txt http://rdzsonde.local/file/config.txt Or use "scripts/ttgoconfig get file config.txt"

hr-ru commented 8 months ago

Alright, you are both using GPIO21 and GPIO22 for connecting the display. These two pins are used by the I2C connection to the power management controller of the board (on any T-Beam except the very old v0.7). You cannot use it for a SPI connection to a display at the same time.

I assume this causes problems in particular when pressing buttons (in particular one of the buttons), because the button is connected to the power management controller, and information about button presses is sent via the I2C connection. There is a good chance that this conflicts with display operation. Or, other possibility, when you switch to the display that shows battery voltage. This also communicates with the power management chip via I2C.

The reason why you might have had fewer problems with older firmware is that the older firmware did not support the new AX2101 power management chip on the T-Beam 1.2 boards.

Fix should be simple: Use different pins for connecting the TFT display. My standard suggestion for T-Beam 1.0/1.1/1.2 is 1/4/13/14/2 for SDA/CLK/RST/RS/CS

See wiki: "you should not connect a SPI display to pin 21/22" (https://github.com/dl9rdz/rdz_ttgo_sonde/wiki/Supported-boards)

CT2IRJ commented 8 months ago

Ok. Despite being a noob :) on this subject, i understand the reason of conflicting addresses for two separate functions. I'll change settings and wiring when I get home, and report back.

Thanks again for your insight. 73

Edit Please confirm: SDA -> 1, or is it 0? From memory I think my board does not have a pin1

CT2IRJ commented 8 months ago

Well, from my side things are working OK now. As from my previous message Edit,

SDA --->0 CLK --->4 RST --->13 RS ---->14 CS ---->2

Thanks Hans for your great help.

rdz_ttgo_sonde-config

If PiroRiro has managed to sort out his problem we can close this issue . Cheers

dl9rdz commented 8 months ago

Ok, perfect.

I strongly assume that this also solves the problem of @PiroRiro , as the startup log above similarly shows the use of ports 21 and 22

configuration option 'oled_sda'=21 
configuration option 'oled_scl'=22 

I am thus closing the issue, feel free to re-open in case it does not solve problem for you.

PiroRiro commented 8 months ago

I had use the same configuration like @CT2IRJ and now everything works very well :) thx anyway :)