ILI9341 seems to work in new firmware

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
Quart
Normal user
Posts: 37
Joined: 16 Jul 2019, 10:08
Location: Sweden
Contact:

ILI9341 seems to work in new firmware

#1 Post by Quart » 05 May 2020, 17:35

I just read that the version mega-20200426 has support for ILI9341 displays
Has anyone tried it and maybe help howto wiring it up to a Vemos d1 mini?

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

Re: ILI9341 seems to work in new firmware

#2 Post by Ath » 23 May 2020, 17:00

Well, the documentation is quite easy to find using standard Google fu, this page is pretty clear: https://petergodwin.wordpress.com/2016/ ... 266-board/

I just hope you haven't waited (or held your breath) for an answer all these days... :D

Quart
Normal user
Posts: 37
Joined: 16 Jul 2019, 10:08
Location: Sweden
Contact:

Re: ILI9341 seems to work in new firmware

#3 Post by Quart » 23 May 2020, 22:51

Ath wrote:
23 May 2020, 17:00
Well, the documentation is quite easy to find using standard Google fu, this page is pretty clear: https://petergodwin.wordpress.com/2016/ ... 266-board/

I just hope you haven't waited (or held your breath) for an answer all these days... :D
Thanks :oops:

Wiki
Normal user
Posts: 272
Joined: 23 Apr 2018, 17:55

Re: ILI9341 seems to work in new firmware

#4 Post by Wiki » 24 May 2020, 13:11

Looking at the release notes:
[ILI9341] Move to custom build due to build size
I think in this case you have to build ESPEasy by your own....

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

Re: ILI9341 seems to work in new firmware

#5 Post by TD-er » 24 May 2020, 13:15

Wiki wrote:
24 May 2020, 13:11
Looking at the release notes:
[ILI9341] Move to custom build due to build size
I think in this case you have to build ESPEasy by your own....
Not 100% sure if there is a 'custom' build included in the nightly build zip, but if there is, it may also be included in there.

Quart
Normal user
Posts: 37
Joined: 16 Jul 2019, 10:08
Location: Sweden
Contact:

Re: ILI9341 seems to work in new firmware

#6 Post by Quart » 24 May 2020, 14:14

Cant find it.
Too bad. I looked how I custum build a image but its to complicated for me.
Just have to wait until ILI9341 is included in image or try something else.
I only need a MQTT importer and the ILI9431 display to work.

-macke-
Normal user
Posts: 20
Joined: 03 Sep 2016, 21:53

Re: ILI9341 seems to work in new firmware

#7 Post by -macke- » 04 Jun 2020, 08:10

Just install ESP_Easy_mega-20200426_custom_ESP8266_4M1M.bin from "Release mega-20200426 "and you will find both ILI9341 and MQTT-import. Works fine :)

Quart
Normal user
Posts: 37
Joined: 16 Jul 2019, 10:08
Location: Sweden
Contact:

Re: ILI9341 seems to work in new firmware

#8 Post by Quart » 04 Jun 2020, 13:45

Thats great.
Got it working.
On my other displays I can show data from MQTT easy with sttings in the display menu.
Now it seems like Commands must be use for getting text on display.
How do I get the display show example temp if I got MQTT imprt setup like this
Attachments
mqtt_imp.JPG
mqtt_imp.JPG (118.62 KiB) Viewed 1435 times

-macke-
Normal user
Posts: 20
Joined: 03 Sep 2016, 21:53

Re: ILI9341 seems to work in new firmware

#9 Post by -macke- » 05 Jun 2020, 17:40

I'm updating my display with a Python script running on another server...

But it should work with rules...

I think it should be something like this... but I can't get it to work...


on Clock#Time=All,**:00 do //update every 10min

SendToHTTP http://<yourIP>,80,/control?cmd=tft,txtfull,0,0,2,RED,[MQTT#Value]

endon

Quart
Normal user
Posts: 37
Joined: 16 Jul 2019, 10:08
Location: Sweden
Contact:

Re: ILI9341 seems to work in new firmware

#10 Post by Quart » 05 Jun 2020, 19:14

Thanks !!
Tried just running this command from the esp.
tft,txtfull,0,0,2,BLACK,Utomhus temperatur [imp#t] C

In this case I got.
Utomhus temperatur 12 C

Now I need it to on a new line display :D
tft,txtfull,0,0,2,BLACK,Rain [imp#rain]mm

Can you share you script ? I have a ubuntu serer upnrunning so I can easliy make it run som python script

-macke-
Normal user
Posts: 20
Joined: 03 Sep 2016, 21:53

Re: ILI9341 seems to work in new firmware

#11 Post by -macke- » 05 Jun 2020, 19:29

Great!

Just change here for a new line... you set the position pixel by pixel.

tft,txtfull,0,15,2

0=X axis
15=Y axis

If this doesn’t help you I had to clean up my script a bit before I can share it ;)

Quart
Normal user
Posts: 37
Joined: 16 Jul 2019, 10:08
Location: Sweden
Contact:

Re: ILI9341 seems to work in new firmware

#12 Post by Quart » 05 Jun 2020, 21:53

Once again, thanks !!
I have got it working perfect when sending commands from ESP Easy
tft,txtfull,1,1,2,BLACK,Utomhus temperatur [imp#t] C

But when trying this from Chrome it just displays the text [imp#t] C and not the value from MQTT
http://192.168.1.102/control?cmd=tft,tx ... peratur%20[imp#t]

-macke-
Normal user
Posts: 20
Joined: 03 Sep 2016, 21:53

Re: ILI9341 seems to work in new firmware

#13 Post by -macke- » 05 Jun 2020, 22:45

Good to hear it’s working :)

You can’t send that commando from another browser. The browser don’t know what that is [imp#t]

Quart
Normal user
Posts: 37
Joined: 16 Jul 2019, 10:08
Location: Sweden
Contact:

Re: ILI9341 seems to work in new firmware

#14 Post by Quart » 06 Jun 2020, 11:55

Sorry for more questions.
You are right, browser dont work.
Runned commands from curl and it works.
All except the most important, the MQTT import values :D

Tried this but only get errors
curl http://192.168.1.102/control?cmd=tft,tx ... emperature [imp#t]

It displays Temperature (just the text and no values)

-macke-
Normal user
Posts: 20
Joined: 03 Sep 2016, 21:53

Re: ILI9341 seems to work in new firmware

#15 Post by -macke- » 06 Jun 2020, 13:13

Here is my python script. So can you try if it works for you aswell...

Place all files in same folder. Then you had to do some small changes in main.py before you run main.py
Attachments
PythonScript.zip
(2.33 KiB) Downloaded 10 times

Quart
Normal user
Posts: 37
Joined: 16 Jul 2019, 10:08
Location: Sweden
Contact:

Re: ILI9341 seems to work in new firmware

#16 Post by Quart » 06 Jun 2020, 13:58

-macke- wrote:
06 Jun 2020, 13:13
Here is my python script. So can you try if it works for you aswell...

Place all files in same folder. Then you had to do some small changes in main.py before you run main.py
I changed IP settings and also found some "f" capital ifront och urllinks.
But now I got his message:
main.py", line 1, in <module>
import requests
ImportError: No module named requests
>>>

I am no programmer but what I can see there is no request done until it runs further along the code.
Maybe I shall move the line "import request" down the code ?
Or I am doing some other misstake?

-macke-
Normal user
Posts: 20
Joined: 03 Sep 2016, 21:53

Re: ILI9341 seems to work in new firmware

#17 Post by -macke- » 06 Jun 2020, 14:03

Sorry, forgot to mention that.. you need to install the module requests

Pip install requests

Quart
Normal user
Posts: 37
Joined: 16 Jul 2019, 10:08
Location: Sweden
Contact:

Re: ILI9341 seems to work in new firmware

#18 Post by Quart » 06 Jun 2020, 14:29

Yes done that.
Now I am struggling with the esp_values
This is how my sonsors in json looks like on my ESP.
Is it
temp_outside = esp_values['t'] #add value names here...
Or how should it be written ?

"Sensors":[
{
"DataAcquisition": [
{"Controller":1,
"IDX":0,
"Enabled":"false"
},
{"Controller":2,
"IDX":0,
"Enabled":"false"
},
{"Controller":3,
"IDX":0,
"Enabled":"false"
}],
"TaskInterval":60,
"Type":"Display - TFT 2.4 inches ILI9341/XPT2046 [TESTING]",
"TaskName":"tft",
"TaskDeviceNumber":95,
"TaskEnabled":"true",
"TaskNumber":1
},
{
"TaskValues": [
{"ValueNumber":1,
"Name":"t",
"NrDecimals":1,
"Value":9.8
},
{"ValueNumber":2,
"Name":"t1h",
"NrDecimals":1,
"Value":-3.3
},
{"ValueNumber":3,
"Name":"rain",
"NrDecimals":1,
"Value":2.0
},
{"ValueNumber":4,
"Name":"tb",
"NrDecimals":1,
"Value":24.6
}],
"DataAcquisition": [
{"Controller":1,
"IDX":0,
"Enabled":"false"
},
{"Controller":2,
"IDX":0,
"Enabled":"false"
},
{"Controller":3,
"IDX":0,
"Enabled":"false"
}],
"TaskInterval":60,
"Type":"Generic - MQTT Import",
"TaskName":"imp",
"TaskDeviceNumber":37,
"TaskEnabled":"true",
"TaskNumber":2
}
],
"TTL":60000
}




Also getting this errors: Seems like it dont like the (ip) variable
ConnectionError: HTTPConnectionPool(host='%7bip%7d', port=80): Max retries exceeded with url: /control?cmd=tftcmd,clear,black (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x0000000004325F98>: Failed to establish a new connection: [Errno 11001] getaddrinfo failed',))
[
Last edited by Quart on 06 Jun 2020, 14:40, edited 1 time in total.

-macke-
Normal user
Posts: 20
Joined: 03 Sep 2016, 21:53

Re: ILI9341 seems to work in new firmware

#19 Post by -macke- » 06 Jun 2020, 14:34

you just hade change these values... for example: ['Kwh/Day'] should be ['rain'] in your case and so on...


kwh = esp_values['Kwh/Day'] #add value names here...
temp_outside = esp_values['TempOutside'] #add value names here...
temp_bedroom = esp_values['TempBedroom'] #add value names here...
soil_sensor = esp_values['Moisture'] #add value names here...

Quart
Normal user
Posts: 37
Joined: 16 Jul 2019, 10:08
Location: Sweden
Contact:

Re: ILI9341 seems to work in new firmware

#20 Post by Quart » 06 Jun 2020, 14:51

AHH
Now I understand
Next problem, maybe to old Python (2.7)

Traceback (most recent call last):
File "C:\Users\k\Downloads\PythonScriptx\main.py", line 11, in <module>
start_screen(ip) # Run "intro"
File "C:\Users\kj\Downloads\PythonScriptx\start_screen.py", line 8, in start_screen
requests.post(url_post)
File "C:\Python27\lib\site-packages\requests\api.py", line 119, in post
return request('post', url, data=data, json=json, **kwargs)
File "C:\Python27\lib\site-packages\requests\api.py", line 61, in request
return session.request(method=method, url=url, **kwargs)
File "C:\Python27\lib\site-packages\requests\sessions.py", line 530, in request
resp = self.send(prep, **send_kwargs)
File "C:\Python27\lib\site-packages\requests\sessions.py", line 643, in send
r = adapter.send(request, **kwargs)
File "C:\Python27\lib\site-packages\requests\adapters.py", line 516, in send
raise ConnectionError(e, request=request)
ConnectionError: HTTPConnectionPool(host='%7bip%7d', port=80): Max retries exceeded with url: /control?cmd=tftcmd,clear,black (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x0000000003E4DFD0>: Failed to establish a new connection: [Errno 11001] getaddrinfo failed',))

-macke-
Normal user
Posts: 20
Joined: 03 Sep 2016, 21:53

Re: ILI9341 seems to work in new firmware

#21 Post by -macke- » 06 Jun 2020, 14:58

I have used python 3.7 so could be that...

Quart
Normal user
Posts: 37
Joined: 16 Jul 2019, 10:08
Location: Sweden
Contact:

Re: ILI9341 seems to work in new firmware

#22 Post by Quart » 06 Jun 2020, 15:42

YYYEEEESSSSS !!!!
It works.
Seems like it was the Python versions that was wrong.
Did this for getting it to work.
1. Removed Python 2.7 and installed Python 3.8
2 Extracted your script and did nothing to the files except
a. Inserted ip-adress in main.py
b. added my sensor values ex. rain in main.py

Thanks -macke- for your time and support !

-macke-
Normal user
Posts: 20
Joined: 03 Sep 2016, 21:53

Re: ILI9341 seems to work in new firmware

#23 Post by -macke- » 06 Jun 2020, 17:15

Good to hear it works :) Hope you can get some use for it..

Quart
Normal user
Posts: 37
Joined: 16 Jul 2019, 10:08
Location: Sweden
Contact:

Re: ILI9341 seems to work in new firmware

#24 Post by Quart » 06 Jun 2020, 18:55

Already have got a excellent dashboard with a 2.4" screen.
Is it complicated to have it change between different dashboard?

Planning to use these "bigger"screens to take the place from my other 4-5 smaller screens.
And it would be nice to have like say 3-4 dashboard that the esp is displaying.
1.Temperatures and humidity both inside and outside
2. Rain and wind, today, yesterday, this week, month and year
3. Energy consumption, now, last 24h for different devices.
4. Weather forecast

I can get all data from my MQTT server

-macke-
Normal user
Posts: 20
Joined: 03 Sep 2016, 21:53

Re: ILI9341 seems to work in new firmware

#25 Post by -macke- » 06 Jun 2020, 19:49

You can add four different MQTT "device'" and the script will found all values if you are using unique value names.

Then you just had du add a clear screen and add a timer ( time.sleep(sec) ) before switching to next dashboard.

besterquester
Normal user
Posts: 6
Joined: 07 Jun 2020, 11:38

Re: ILI9341 seems to work in new firmware

#26 Post by besterquester » 07 Jun 2020, 15:48

Hi there,

I have tested a lot with this plugin. I tried to define also fonts for the display.
I updated the Plugin in order to use 7 segment fonts. If usefull i can try a push request for an update.
_P095_ILI9341.zip
(14.5 KiB) Downloaded 5 times
In order to use new fonts you can copy the fonts (Seven_Segment18pt7b.h, Seven_Segment24pt7b.h) to the path of the distribution before compilation

.... ESPEasy_mega-20200426\source\.pio\libdeps\test_beta_ESP8266_4M1M\Adafruit GFX Library_ID13\Fonts

Command: tft| font, <fntnumber> 0 standard, 1 Seven_Segment24pt7b, 2 Seven_Segment18pt7b
Example in rules:

Code: Select all

on System#Boot do
    tftcmd,clear,black
    tft,font,1
endon
Maybe you can give feeback on the change if usefull or not.

kind regards
Chris

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

Re: ILI9341 seems to work in new firmware

#27 Post by TD-er » 07 Jun 2020, 21:22

besterquester wrote:
07 Jun 2020, 15:48
[...]
Maybe you can give feeback on the change if usefull or not.
[...]
You're always welcome to provide a pull request for it :)

coffeejunkie_de
Normal user
Posts: 3
Joined: 29 Jun 2020, 17:09

Re: ILI9341 seems to work in new firmware

#28 Post by coffeejunkie_de » 29 Jun 2020, 17:11

Hi Friends,

I have trouble with the original lolin 2.45 Touch tft https://docs.wemos.cc/en/latest/d1_mini ... t_2_4.html configuring for ESPEASY

It just shows a blank white screen and doesnt react on any tft/tftcmd

can someone show me his plugin settings to compare?

Whats about the jumpers on the bottom of the PCB something to adjust here?

tx
//coffeejunkie

Quart
Normal user
Posts: 37
Joined: 16 Jul 2019, 10:08
Location: Sweden
Contact:

Re: ILI9341 seems to work in new firmware

#29 Post by Quart » 30 Jun 2020, 08:21

Did you do as above with the python script?

coffeejunkie_de
Normal user
Posts: 3
Joined: 29 Jun 2020, 17:09

Re: ILI9341 seems to work in new firmware

#30 Post by coffeejunkie_de » 30 Jun 2020, 08:29

I havent a problem with the python script. Even HTTP api is not working.
So I'm asking for a screenshot of the Plugin settings which shows how to configure the pin assignment...

Quart
Normal user
Posts: 37
Joined: 16 Jul 2019, 10:08
Location: Sweden
Contact:

Re: ILI9341 seems to work in new firmware

#31 Post by Quart » 30 Jun 2020, 08:32

Will publish mine, give me a hour or two

Quart
Normal user
Posts: 37
Joined: 16 Jul 2019, 10:08
Location: Sweden
Contact:

Re: ILI9341 seems to work in new firmware

#32 Post by Quart » 30 Jun 2020, 11:48

This is my config for D1 shield TFT
Attachments
TFT Lolin D1 espeasy.JPG
TFT Lolin D1 espeasy.JPG (63.85 KiB) Viewed 254 times

coffeejunkie_de
Normal user
Posts: 3
Joined: 29 Jun 2020, 17:09

Re: ILI9341 seems to work in new firmware

#33 Post by coffeejunkie_de » 30 Jun 2020, 12:16

yeaaah - got it working.
It was a L8 prolblem.

Yesterday I didnt' saw the small text on the display during my testst and I was irritated a tftcmd,off didnt turn the screen off - it keeps white and I expect black

Quart
Normal user
Posts: 37
Joined: 16 Jul 2019, 10:08
Location: Sweden
Contact:

Re: ILI9341 seems to work in new firmware

#34 Post by Quart » 30 Jun 2020, 12:59

Great !
Keep us updated when you move along with the TFT

Post Reply

Who is online

Users browsing this forum: No registered users and 11 guests