You are not logged in.

#1 2017-11-07 11:42:14

tekatom
Member
From: Wadowice / Poland
Registered: 2017-11-07
Posts: 16
Website

Support for a SPI TFT 2.4'' screen

Hi,

I'm new here, I just start building my first SLA printer using nanoDLP software and my engineering skills :)
I wish to be younger an spend more time on Linux computers to understand the structure of this system, but those years has pass away long time ago.
Ok, to the point.
I'm trying to use cheap TFT 2,4'' screen connected to GPIOs & SPI pins, but I'm receiving bad image during using it in nanoDPL system.
The same screen works well when I quit to text mode.

You can see this here:
IMG_0065.jpg
IMG_0066.jpg
IMG_0067.jpg
IMG_0068.jpg


The choice for this inexpensive screen is only one - I'm designing device for my daughter shool to be multiplied on technology clasess :)

I have no idea what I'm doing wrong.
Any help?

Last edited by tekatom (2017-11-08 09:36:17)

Offline

#2 2017-11-07 17:46:07

Shahin
Administrator
Registered: 2016-02-17
Posts: 3,546

Re: Support for a SPI TFT 2.4'' screen

Welcome

Try lcd without nanodlp, if it works. In worst case you need to change display no.

Offline

#3 2017-11-07 18:18:08

tekatom
Member
From: Wadowice / Poland
Registered: 2017-11-07
Posts: 16
Website

Re: Support for a SPI TFT 2.4'' screen

Well.. it works outside nanoDLP, you can see it on linked photos from my Dropbox.
I tried to change drivers, settings for FRAMEBUFFER... but still the same. This is screen with ILI9341 driver and since this time I never had problems with this. It seems to me, that nanoDLP doing something with /dev/fb1
I got bunch of screens, so the screen itself isn't a problem.

Offline

#4 2017-11-08 05:19:08

Shahin
Administrator
Registered: 2016-02-17
Posts: 3,546

Re: Support for a SPI TFT 2.4'' screen

I guess you got images using framebuffer. Looks like wrong resolution and parameters.
First remove framebuffer if you see only blank screen, try changing input called "RPi Display Number" to 1 on setup page and reboot to see if makes it work.

Offline

#5 2017-11-08 09:35:38

tekatom
Member
From: Wadowice / Poland
Registered: 2017-11-07
Posts: 16
Website

Re: Support for a SPI TFT 2.4'' screen

Here is photo that shows the same screen with the same settings working with X's :

IMG_0071.jpg

Offline

#6 2017-11-08 13:24:55

tekatom
Member
From: Wadowice / Poland
Registered: 2017-11-07
Posts: 16
Website

Re: Support for a SPI TFT 2.4'' screen

Without framebuffer set to fb1 or fb2 I can see  pictures  shown only on connected HDMI screen, even if I change RPi Display Number to "1".
No activity on SPI TFT.

Last edited by tekatom (2017-11-08 13:28:58)

Offline

#7 2017-11-09 05:18:44

Shahin
Administrator
Registered: 2016-02-17
Posts: 3,546

Re: Support for a SPI TFT 2.4'' screen

Strange you should able to work with changing display number.

I have found following numbers on https://www.raspberrypi.org/documentati … hooting.md

LCD: 4
TV/HDMI: 5
Auto select non-default display: 6

Try different numbers and restart see if you could take control of the display or not.

Offline

#8 2017-11-09 18:18:16

tekatom
Member
From: Wadowice / Poland
Registered: 2017-11-07
Posts: 16
Website

Re: Support for a SPI TFT 2.4'' screen

Without setting FRAMEBUFFER I always get the same result, no matter of RPi Display Number, I got signal only on HDMI output.
When I set /dev/fb0 I'm getting artefacts on HDMI display:

IMG_0086.jpg

To set my SPI screen I used recipe from this site:
http://marcosgildavid.blogspot.com/2014 … ng-on.html

Offline

#9 2017-11-09 20:04:28

Shahin
Administrator
Registered: 2016-02-17
Posts: 3,546

Re: Support for a SPI TFT 2.4'' screen

If you insist to use framebuffer. Actually it is pretty clear bf settings are not correct. Run fbset command to see settings used for initialization.

Offline

#10 2017-11-10 01:51:56

tekatom
Member
From: Wadowice / Poland
Registered: 2017-11-07
Posts: 16
Website

Re: Support for a SPI TFT 2.4'' screen

Fbset shows right settings (compared to Adafruit screen's data)

I tried other sizes and other manufacturer's screens connected to SPI (e.g. Adafruit) and the result is still the same

The issue is:
1. no picture on screen when mode:4 is set (no framebuffer set, empty field)
2. artefacts on screen when framebuffer (/dev/fb1) is on

With the same settings, drivers and connections there are no problems when running "X"
Maybe there are some hidden settings that can be switched in nano DLP? I feel down...

Offline

#11 2017-11-10 04:50:32

Shahin
Administrator
Registered: 2016-02-17
Posts: 3,546

Re: Support for a SPI TFT 2.4'' screen

Unfortunately no hidden options on nanodlp side. Without hardware it is very difficult to troubleshoot the issue.
I have checkout the data sheet, maybe issue is we are representing pixels on nanodlp side as 32bit RGBA but data sheet clearly state memory being used is 18bit for each pixel.

"GRAM is a graphic RAM to store display data. GRAM size is 172,800 bytes with 18 bits per pixel for a
maximum 240(RGB) x320 dot graphic display."

If GRAM directly mapped as framebuffer (I just guess), what you see could be correct. I think we can convert our images to 18bit and copy to framebuffer. Before doing that please, run command below and share the result also output of the fbset command.

cat /dev/fb1 > screen.capture

Offline

#12 2017-11-10 11:22:11

tekatom
Member
From: Wadowice / Poland
Registered: 2017-11-07
Posts: 16
Website

Re: Support for a SPI TFT 2.4'' screen

Here it is:

https://ufile.io/ixr36

pi@raspberrypi:~ $ fbset -i -fb /dev/fb1

mode "320x240"
    geometry 320 240 320 240 16
    timings 0 0 0 0 0 0 0
    nonstd 1
    rgba 5/11,6/5,5/0,0/0
endmode

Frame buffer device information:
    Name        : fb_ili9341
    Address     : 0
    Size        : 153600
    Type        : PACKED PIXELS
    Visual      : TRUECOLOR
    XPanStep    : 0
    YPanStep    : 0
    YWrapStep   : 0
    LineLength  : 640
    Accelerator : No

Here the capture during display of calibration pattern:
https://ufile.io/avkmz

Last edited by tekatom (2017-11-10 11:41:58)

Offline

#13 2017-11-10 17:18:04

Shahin
Administrator
Registered: 2016-02-17
Posts: 3,546

Re: Support for a SPI TFT 2.4'' screen

Try latest beta see if it makes any difference. It should report back type of screen it has been detected.

Offline

#14 2017-11-10 23:24:15

tekatom
Member
From: Wadowice / Poland
Registered: 2017-11-07
Posts: 16
Website

Re: Support for a SPI TFT 2.4'' screen

Beta has an issue and doesn't start after install. Log says something about pigpio ("Can't initialise pigpio library")

Offline

#15 2017-11-10 23:32:09

Shahin
Administrator
Registered: 2016-02-17
Posts: 3,546

Re: Support for a SPI TFT 2.4'' screen

NanoDLP does not come up at all?

Offline

#16 2017-11-10 23:53:44

tekatom
Member
From: Wadowice / Poland
Registered: 2017-11-07
Posts: 16
Website

Re: Support for a SPI TFT 2.4'' screen

Nope. Stops trying to run "run.sh"

Error points at this file:

https://ufile.io/lbasq

Ok, I'm sorry, my bad. I've changed something in /etc/rc.local.
Now it's working properly, i.e. nanoDLP system

Screen still has artefacts.
Where I can find the report you mentioned?

I realized, I still have Build 1718, cannot get newer one. I tried wget & upgrade from nanoDLP...    It's late night at my place, I'm surely doing something wrong.

Last edited by tekatom (2017-11-11 01:26:10)

Offline

#17 2017-11-11 05:44:56

Shahin
Administrator
Registered: 2016-02-17
Posts: 3,546

Re: Support for a SPI TFT 2.4'' screen

1718 is fine. Are the artifacts has been changed since last version?
Check the dashboard activity log, it should echo channel type just after you start display.

Offline

#18 2017-11-11 13:45:13

tekatom
Member
From: Wadowice / Poland
Registered: 2017-11-07
Posts: 16
Website

Re: Support for a SPI TFT 2.4'' screen

This is what the log says:
Clipboard01.jpg

"Unsupported framebuffer length. 32bit channel will be used"
"Failure to display image, retrying"

And when I try to print calibration plate:
"Failure to display image, retrying."

Offline

#19 2017-11-11 18:56:11

Shahin
Administrator
Registered: 2016-02-17
Posts: 3,546

Re: Support for a SPI TFT 2.4'' screen

On datasheet for your LCD chip, listed framebuffer size is 172800 not 153600.
Please, try fbi to confirm if framebuffer working correctly or not.
http://manpages.ubuntu.com/manpages/xen … fbi.1.html

Offline

#20 2017-11-11 19:51:20

tekatom
Member
From: Wadowice / Poland
Registered: 2017-11-07
Posts: 16
Website

Re: Support for a SPI TFT 2.4'' screen

Without hesitation:

IMG_0088.jpg

Displaying photo 320x240 24bit on /dev/fb1

I'm thinking, maybe fbi function could be implemented in nanoDLP to solve problem?
That would increase a number of  TFTs that can be used in easy way to build SLAs. Inexpensive ones.

Last edited by tekatom (2017-11-11 20:46:34)

Offline

#21 2017-11-12 05:36:30

Shahin
Administrator
Registered: 2016-02-17
Posts: 3,546

Re: Support for a SPI TFT 2.4'' screen

If you are sure about 24bit, it easy to add to nanodlp. Will push another update to support 24bit within an hour.
About fbi, you can already call it through syscall inputs.

Offline

#22 2017-11-12 12:22:00

tekatom
Member
From: Wadowice / Poland
Registered: 2017-11-07
Posts: 16
Website

Re: Support for a SPI TFT 2.4'' screen

Shahin, I just tested other picture formats: 320x240 16bit, 8bit, 4bit, 1bit, saved as .jpg, .gif, .png

They all working without problems with fbi. In each case displayed picture is correct. The issue must be somwhere else...

 fbi -d /dev/fb1 picture.jpg

   
and
 

fbi picture.jpg  (with "con2fbmap 1 1" in  /etc/rc.local ) 

  works as well.

Last edited by tekatom (2017-11-12 12:28:44)

Offline

#23 2017-11-12 13:33:38

tekatom
Member
From: Wadowice / Poland
Registered: 2017-11-07
Posts: 16
Website

Re: Support for a SPI TFT 2.4'' screen

This is strange:

Debug	4	2017-11-12 12:54:08.633354	Shutter	Shutter Open
Error	4	2017-11-12 12:54:08.632671	Image	Failure to display image, retrying.
Warning	4	2017-11-12 12:54:08.632206	Image	Display layer public/plates/1/5.png
Debug	4	2017-11-12 12:54:06.810226	Shutter	Shutter Close
Debug	4	2017-11-12 12:54:06.794112	Image	Clear screen
Debug	4	2017-11-12 12:53:54.256149	Shutter	Shutter Open
Error	4	2017-11-12 12:53:54.255446	Image	Failure to display image, retrying.
Warning	4	2017-11-12 12:53:54.254985	Image	Display layer public/plates/1/4.png
Debug	4	2017-11-12 12:53:52.008867	Shutter	Shutter Close
Debug	4	2017-11-12 12:53:52.003845	Image	Clear screen

Calibration shows artefacts on connected SPI screen, printing process hangs up, a try to display layers gives no picture on screen.

Offline

#24 2017-11-12 14:52:34

Shahin
Administrator
Registered: 2016-02-17
Posts: 3,546

Re: Support for a SPI TFT 2.4'' screen

I do not mean 24bit for image, it is framebuffer channel width. Please rerun with latest beta, it should display more details about failure.

Offline

#25 2017-11-12 20:33:02

tekatom
Member
From: Wadowice / Poland
Registered: 2017-11-07
Posts: 16
Website

Re: Support for a SPI TFT 2.4'' screen

Log of using /dev/fb0 - display connected to HDMI:

Notice	1	2017-11-12 20:20:53.135395	Printing	Job Completed
Debug	1	2017-11-12 20:20:53.134758	Pulsing	Movement Finished Pulse 3016 / 3016 ; Height -349 / 2667 ; Time 4.47120126
Debug	1	2017-11-12 20:20:48.663124	Pulsing	Moving Down 3016 pulses 11.31 mm
Debug	1	2017-11-12 20:20:48.662623	Pulsing	Moving to Stop Position
Debug	1	2017-11-12 20:20:48.662335	Pulsing	Movement Finished Pulse 1333 / 1333 ; Height 984 / -349 ; Time 1.759576851
Debug	1	2017-11-12 20:20:46.902043	Pulsing	Moving Up 1333 pulses 4.99875 mm
Debug	1	2017-11-12 20:20:46.899717	Shutter	Shutter Close
Warning	1	2017-11-12 20:20:46.899473	Printing	Stop Command Received
Debug	1	2017-11-12 20:20:46.899027	Shutter	Shutter Close
Debug	1	2017-11-12 20:20:46.896018	Image	Clear screen
Error	1	2017-11-12 20:20:46.895621	Printing	Failed to send image to GPU - Err Code 0
Error	1	2017-11-12 20:20:46.85955	Image	Failure to display image, retrying.
Warning	1	2017-11-12 20:20:46.480259	Image	Display layer public/plates/1/1.png
Debug	1	2017-11-12 20:20:43.478967	Shutter	Shutter Open
Debug	1	2017-11-12 20:20:43.478393	Pulsing	Movement Finished Pulse 1683 / 1683 ; Height 2667 / 984 ; Time 3.717764316
Debug	1	2017-11-12 20:20:39.759584	Pulsing	Moving Up 1683 pulses 6.31125 mm
Debug	1	2017-11-12 20:20:39.758368	Pulsing	Moving to Layer
Debug	1	2017-11-12 20:20:39.75669	Shutter	Shutter Close
Debug	1	2017-11-12 20:20:39.753214	Image	Clear screen
Debug	1	2017-11-12 20:20:04.756845	WiFi	Status Monitoring
Error	1	2017-11-12 20:20:04.754953	WIFI	No WIFI dongle has been found.
Error	1	2017-11-12 20:20:04.471948	Framebuffer	Unsupported framebuffer length. 32bit channel will be used. 16 {0 5 0}
Notice	1	2017-11-12 20:20:04.429889	Terminal	Terminal Reader Activated
Debug	1	2017-11-12 20:20:04.42924	Shutter	Shutter Close
Debug	1	2017-11-12 20:20:04.428598	Hardware	Stepper motor enabled
Notice	1	2017-11-12 20:20:04.3874	Hardware	Initializing build # 1721 - generic 

Log of using /dev/fb1 - display connected to SPI TFT (gpio):

Notice	1	2017-11-12 20:18:00.014675	Printing	Job Completed
Debug	1	2017-11-12 20:17:59.940644	Pulsing	Movement Finished Pulse 3016 / 3016 ; Height -349 / 2667 ; Time 4.386258281
Debug	1	2017-11-12 20:17:55.553864	Pulsing	Moving Down 3016 pulses 11.31 mm
Debug	1	2017-11-12 20:17:55.553424	Pulsing	Moving to Stop Position
Debug	1	2017-11-12 20:17:55.55322	Pulsing	Movement Finished Pulse 1333 / 1333 ; Height 984 / -349 ; Time 1.964041394
Debug	1	2017-11-12 20:17:53.589262	Shutter	Shutter Close
Debug	1	2017-11-12 20:17:53.588775	Pulsing	Moving Up 1333 pulses 4.99875 mm
Debug	1	2017-11-12 20:17:53.586193	Shutter	Shutter Close
Warning	1	2017-11-12 20:17:53.585969	Printing	Stop Command Received
Debug	1	2017-11-12 20:17:53.583092	Image	Clear screen
Error	1	2017-11-12 20:17:53.582881	Printing	Failed to send image to GPU - Err Code 0
Error	1	2017-11-12 20:17:53.547865	Image	Failure to display image, retrying.
Warning	1	2017-11-12 20:17:53.503446	Image	Display layer public/plates/1/1.png
Debug	1	2017-11-12 20:17:50.500557	Shutter	Shutter Open
Debug	1	2017-11-12 20:17:50.499727	Pulsing	Movement Finished Pulse 1683 / 1683 ; Height 2667 / 984 ; Time 2.47854021
Debug	1	2017-11-12 20:17:48.020537	Pulsing	Moving Up 1683 pulses 6.31125 mm
Debug	1	2017-11-12 20:17:47.999641	Pulsing	Moving to Layer
Debug	1	2017-11-12 20:17:47.998547	Shutter	Shutter Close
Debug	1	2017-11-12 20:17:47.990831	Image	Clear screen
Debug	1	2017-11-12 20:16:29.853666	WiFi	Status Monitoring
Error	1	2017-11-12 20:16:29.851874	WIFI	No WIFI dongle has been found.
Error	1	2017-11-12 20:16:29.585768	Framebuffer	Unsupported framebuffer length. 32bit channel will be used. 16 {0 5 0}
Notice	1	2017-11-12 20:16:29.544261	Terminal	Terminal Reader Activated
Debug	1	2017-11-12 20:16:29.543517	Shutter	Shutter Close
Debug	1	2017-11-12 20:16:29.543008	Hardware	Stepper motor enabled
Notice	1	2017-11-12 20:16:29.503038	Hardware	Initializing build # 1721 - generic  

When I changed /boot/config.txt   "framebuffer_depth=32"  (previous setting was "framebuffer_depth=16") and set to /dev/fb0 (HDMI):

Notice	1	2017-11-12 20:24:25.290316	Printing	Job Completed
Debug	1	2017-11-12 20:24:25.289815	Pulsing	Movement Finished Pulse 3016 / 3016 ; Height -349 / 2667 ; Time 4.41959888
Debug	1	2017-11-12 20:24:20.869616	Pulsing	Moving Down 3016 pulses 11.31 mm
Debug	1	2017-11-12 20:24:20.869386	Pulsing	Moving to Stop Position
Debug	1	2017-11-12 20:24:20.869205	Pulsing	Movement Finished Pulse 1333 / 1333 ; Height 984 / -349 ; Time 2.533192553
Warning	1	2017-11-12 20:24:19.378202	Update	Connectivity problem Get https://www.nanodlp.com/build.generic.txt: net/http: TLS handshake timeout
Debug	1	2017-11-12 20:24:18.33546	Pulsing	Moving Up 1333 pulses 4.99875 mm
Debug	1	2017-11-12 20:24:18.332825	Shutter	Shutter Close
Warning	1	2017-11-12 20:24:18.332205	Printing	Stop Command Received
Debug	1	2017-11-12 20:24:18.312077	Shutter	Shutter Close
Debug	1	2017-11-12 20:24:18.305853	Image	Clear screen
Error	1	2017-11-12 20:24:18.305419	Printing	Failed to send image to GPU - Err Code 0
Error	1	2017-11-12 20:24:18.205997	Image	Failure to display image, retrying.
Warning	1	2017-11-12 20:24:17.814517	Image	Display layer public/plates/1/1.png
Debug	1	2017-11-12 20:24:14.789916	Shutter	Shutter Open
Debug	1	2017-11-12 20:24:14.78907	Pulsing	Movement Finished Pulse 1683 / 1683 ; Height 2667 / 984 ; Time 2.736375111
Debug	1	2017-11-12 20:24:12.051686	Pulsing	Moving Up 1683 pulses 6.31125 mm
Debug	1	2017-11-12 20:24:12.051001	Pulsing	Moving to Layer
Debug	1	2017-11-12 20:24:12.049997	Shutter	Shutter Close
Debug	1	2017-11-12 20:24:12.044625	Image	Clear screen
Debug	1	2017-11-12 20:23:35.049227	WiFi	Status Monitoring
Error	1	2017-11-12 20:23:35.047971	WIFI	No WIFI dongle has been found.
Notice	1	2017-11-12 20:23:34.706702	Terminal	Terminal Reader Activated
Debug	1	2017-11-12 20:23:34.705922	Shutter	Shutter Close
Debug	1	2017-11-12 20:23:34.705613	Hardware	Stepper motor enabled
Notice	1	2017-11-12 20:23:34.704956	Framebuffer	32bit channel will be used
Notice	1	2017-11-12 20:23:34.661986	Hardware	Initializing build # 1721 - generic  

I checked also fbi function with higher framebuffer depth. No changes, works with 32bit as well as with 16bit depth.

(nanoDLP build 1721)

Last edited by tekatom (2017-11-12 20:33:42)

Offline

Board footer

Powered by FluxBB