Welcome! Log In Create A New Profile

Advanced

LCD screen for your dockstar (cheap! <$5)

Posted by petergunn 
Re: LCD screen for your dockstar (cheap! <$5)
October 20, 2012 03:50PM
I'm trying to use the orientation setting in dpf.config with lcd4linux to rotate the display. I've tried 0, 1, 2 & 3 and the display never rotates.
Does the "sevenday_pebble" DPF support rotation?

Also does anyone know if its possible to cross compile lcd4linux to run on a MIPS processor?
I'd like to plug one of these DPF's into mu Asus N16 router which has a Broadcom BCM4176 SoC.
I've changed the router firmware to Tomato USB and installed optware on it.
cat /proc/cpuinfo lists the CPU model as MIPS 74K V4.0
Is it possible to cross compile lcd4linux for the MIPS cpu? If it is any pointers on how to do this.

Cheers
Dave
Re: LCD screen for your dockstar (cheap! <$5)
October 20, 2012 08:32PM
@daveg:

Most of the frames including sevenday_pebble don't support rotation, see code comments in lcdsetor.s

; Just a nop at the moment - only landscape supported!
; If you want other orientations, add code here,
; create a correspondig method to lcdblit_*.s" and modify lcdinit_*.c accordingly.
;
_lcd_custom_setorientation::
	ret
Perhaps superelchi can explain how this works and how we can add orientation support.

There's a openwrt thread for lcd4linux: https://forum.openwrt.org/viewtopic.php?id=30396

./configure CC=mips-openwrt-linux-gcc --with-drivers='DPF' --with-plugins='all,!dbus,!mpris_dbus'  --host=...

I'm not sure about tomato toolchain though. I found this though: http://tomatousb.org/tut:how-to-build-and-rebuild-tomato-for-total-noobs. I used tomato firmware once upon a time....
Re: LCD screen for your dockstar (cheap! <$5)
October 21, 2012 03:26AM
@ ax206geek

thanks for the info. I'm on a steep learning curve here :D
took lots of head scratching and reading up on the forum here, raspberry pi and the dpf wiki.
not much of it makes sense as I'm not a programmer or a hardened Linux user, but the Pi and these DPF projects will hopefully change that.

With regard to the router, I was thinking I could maybe compile lcd4linux and the DPF-AX stuff as stand alone and run them off the optware partition, but i guess I shall have to ask over on the tomato forums for advice on that one.

once again many thanks

Dave
Re: LCD screen for your dockstar (cheap! <$5)
October 21, 2012 05:25AM
ax206geek Wrote:
-------------------------------------------------------
> Perhaps superelchi can explain how this works and how we can add orientation support.

1. Find out what kind of Lcd is in your display (manufacturer / type).
2. Find a spec-sheet / application-note how to initialize the Lcd.
3. Analyse the initialisation code in lcdinit.s, find the landscape init values and change them for portrait.
4. Write a new lcdblit.s
5. Change lcdsetor.s.

The actual implementation is left as an exercise to the reader. :-)

superelchi
Re: LCD screen for your dockstar (cheap! <$5)
October 21, 2012 06:33AM
Just got a delight LCD from China and wanted to flash. During flash an error occurred and i know cannot access the device. I just get a white screen, Pressing menu doesn't do anything.

Any possibility to revive it? It's still recognised as "USB Display" but not as mass storage device...
Re: LCD screen for your dockstar (cheap! <$5)
October 21, 2012 06:51AM
Could you please give some more infos. Else we have to use our crystal ball. :-O

- Identify.py output?
- Which fw used for flashing?
- Flashing done under Windows or Linux?
- What error message?
- Messages when connecting the display?

superelchi



Edited 1 time(s). Last edit at 10/21/2012 06:52AM by superelchi.
Re: LCD screen for your dockstar (cheap! <$5)
October 21, 2012 07:02AM
Sorry, just found another post which expained the bootmode. Flashed fw_linkdelight_2 from 33er rev.
Reseting and pressing mode at the same time makes it reflashable. I made a fulldump of my second LCD and reflashed it to the first one. Now it is back as before in mass storage mode. But actually, the display still remains white - so no images/splash screen showing. When i press Menu three times, it connects back as "mass storage device". So actually, the fw is working and the whole menu thing - I'm just blind cause of the white screen.

Detecting & reading dpf flash...
Opening generic SCSI device '/dev/sr1'
Manufacturer: Apple
Size        : 1 MB
Reading 100000 bytes...
Flash written to file 'identify.out/full.bin'.

Looking for firmware.............: Found (coby, 320x240 px).
Looking for Openwin..............: Found.
Looking for LcdIniTbl............: Found.
Looking for known signatures.....: Found.

Your dpf is compatible with model ['linkdelight_2'].

Edit2: Okay, the focal fw brings me the eyes and menu. Strange.



Edited 2 time(s). Last edit at 10/21/2012 07:33AM by Gr3yh0und.
Re: LCD screen for your dockstar (cheap! <$5)
October 21, 2012 07:50AM
Looks like you have to different devices.
First one (with the white sceen) is a focal compatible one, second one linkdelight_2.

superelchi
Re: LCD screen for your dockstar (cheap! <$5)
October 21, 2012 03:12PM
superelchi Wrote:
-------------------------------------------------------
> ax206geek Wrote:
> --------------------------------------------------
> -----
> > Perhaps superelchi can explain how this works
> and how we can add orientation support.
>
> 1. Find out what kind of Lcd is in your display
> (manufacturer / type).

Do you mean break open the DPF and find the manufacturer and model number of the actual LCD screen?

> 2. Find a spec-sheet / application-note how to
> initialize the Lcd.
> 3. Analyse the initialisation code in lcdinit.s,
> find the landscape init values and change them for
> portrait.
> 4. Write a new lcdblit.s
> 5. Change lcdsetor.s.
>
> The actual implementation is left as an exercise
> to the reader. :-)
>
> superelchi

Once this is done I assume we'd need to recompile the DPF firmware? or lcd4linux?

Sorry to ask lots of stupid questions but there are a few grey areas.
Re: LCD screen for your dockstar (cheap! <$5)
October 22, 2012 07:07AM
@daveg:

What I wanted to say is, that it's really a LOT of know-how, work and sweat necessary to bring this to life. I dont think it is worth the time to do this for just one specific model. It's much easier to buy one of the square 128x128 dpfs that can be mounted in any direction. Physical rotation. :-)
But if you like to learn ax206 programmming / 8052 assembler / sdcc / etc. - your welcome! Just be prepared for some hard weeks of studying hardware manuals and source code, frustration, head scratching and bricked dpfs. At least that the way I learned it. :-)

superelchi
grouproot
Re: LCD screen for your dockstar (cheap! <$5)
October 22, 2012 11:30AM
Hi

Here is another firmware - a device from Intertronic (Switzerland).
But it is not working. If someone is interested - here is the Dump-File:
http://www.file-upload.net/download-6723471/full.bin.html


Looking for firmware.............: Found (buildwin, 128x128 px).
Looking for Openwin..............: Found.
Looking for LcdIniTbl............: None.
Looking for known signatures.....: None.
Looking for known version info...: None.

Sorry, no matching dpf found.
But following models have a partial signature match: [['delightdigi_black']]


Opening generic SCSI device '/dev/sr0'
Manufacturer: Winbond
Size : 1 MB
Reading 100000 bytes...
Wrote full.bin
Re: LCD screen for your dockstar (cheap! <$5)
October 22, 2012 12:11PM
@grouproot

Please try attached fw.

Do you have a manufacturer / shop link for this display?

superelchi



Edited 2 time(s). Last edit at 10/22/2012 12:13PM by superelchi.
Attachments:
open | download - fw_disp_intertronic.zip (27.4 KB)
Re: LCD screen for your dockstar (cheap! <$5)
October 22, 2012 12:22PM
@ superelchi:

I know it isn't going to be easy, maybe your idea for using a square DPF would be better for me at this stage as the pebble DPF doesnt really lend itself to mounting how i want as the USB is on the bottom rather than the side.
I have been making personal progress having finally managed to compile the firmware on linux where I was getting errors previously. Baby steps in the right direction :) still a long way to go!
Do you have any good links for background reading on the resources you mentioned, the manuals, ax206, sdcc etc.
As you well know goggling stuff doesnt always take you to hte best resources.

cheers
dave
grouproot
Re: LCD screen for your dockstar (cheap! <$5)
October 22, 2012 12:23PM
Hi superelchi

Thank you very much for the fast reply. I bougth it in interdiscount.ch.
Here is the link.

http://www.interdiscount.ch/idshop/product/Spielwaren/873152_ER-324609050132160/INTERTRONIC_Digitaler_Bilderrahmen/detail.jsf

Text on the back of the device:
Intertronic
ITR Dig. Photoframe Keych.
Item no.: PT-805B

I will boot my second computer and try your attachment. Thank you.

Regards
Florian
grouproot
Re: LCD screen for your dockstar (cheap! <$5)
October 22, 2012 12:54PM
Is fwload a tool to upload the firmware? Last time i used a windows computer and another flash tool...

sudo ./fwload /dev/sr0 fw/fw_disp_intertronic.bin
Opening generic SCSI device '/dev/sr0'
invalid line in ihx
Executing applet..
Failed.
Re: LCD screen for your dockstar (cheap! <$5)
October 22, 2012 12:55PM
Because this thread is getting longer and longer and we have a whole section for displays (thanks again Jeff!), I think its time to move requests for unsupported dpfs out of here.

Please post new request for unsupported dpfs here: dpf-ax: unsupported dpf - requests.

superelchi
Re: LCD screen for your dockstar (cheap! <$5)
October 22, 2012 01:02PM
grouproot Wrote:
-------------------------------------------------------
> Is fwload a tool to upload the firmware? Last time
> i used a windows computer and another flash
> tool...

You can use ProgSPI.exe (Windows) or restore.py (Linux):
cd ./fw
sudo ./restore.py /dev/sgX -f
With "/dev/sgX" = "/dev/sg1", "/dev/sg2", ..
Depending on your hardware/distro this may also be "/dev/srX".

superelchi
grouproot
Re: LCD screen for your dockstar (cheap! <$5)
October 22, 2012 02:00PM
Wow, it works! I had to change some paths in the python scripts and start it in bootloader mode (MENU+RESET).
Thank you very much!
Regards
Florian
grouproot
Re: LCD screen for your dockstar (cheap! <$5)
October 22, 2012 04:26PM
Another problem: I can't get the Splashscreen to work. I just see a lot of colored pixels on the display :)... Testscreen and Menu is working correct.
Here is the output:

sudo ./setsplash.sh ./Botticelli_Venus2.jpg 128 128 usb0
Using ffmpeg pix_fmt rgb565be
Splashfile saved to ./Botticelli_Venus2.128x128.rgb
Sending splashfile ./Botticelli_Venus2.128x128.rgb to flash...
Found AX206 DPF
Got LCD dimensions: 128x128
offset: 0x30000
Erasing sector at 0x030000...
Flashing sector at 0x030000...

Another question:
Could you please tell me what to change in the source-code to get the firmware compiled?
Re: LCD screen for your dockstar (cheap! <$5)
October 23, 2012 02:44AM
@grouproot

I've not tried the splash screens myself, but after reading the readme files and looking through the source code files, there are the splash images in src/res/
These are in a special format to upload directly onto the dpf or embed into the complied firmware.
You will have to use ffmpeg to re-encode the image from jpg into the rgb format.
I googled how to use ffmpeg to convert rgb into jpg when I was looking around the source tree a week ago, I can't remember of the top of my head the syntax used, but google had the correct answer.

Hope that helps
Re: LCD screen for your dockstar (cheap! <$5)
October 23, 2012 09:21AM
@grouproot

I will commit the new model "intertronic" to svn asap. Atm sourceforge will not accept my commit (500 Internal Server Error). :-(

To build the firmware, do a "svn co https://dpf-ax.svn.sourceforge.net/svnroot/dpf-ax/trunk"; or "svn update".
Build the firmware & flash it with:
cd src
make TYPE=intertronic clean all
make download

Please upload you splash (jpg AND .rgb), so I can have a look.
If you want to change the "standard" splash, put yours in the src/res folder under the correct name (in your case "splash.128x128.rgb") and recompile.
For the correct params for ffmpeg have a look at fw/setsplash.sh.

superelchi
grouproot
Re: LCD screen for your dockstar (cheap! <$5)
October 23, 2012 10:06AM
@superelchi and daveg
Thank you very much for your reply.
I tested a lot but can't get the proper format with ffmpeg to set the splash. (setsplash.sh and splash2flash.py scripts)

I tried the tool dpfsend and it displays the image correctly. But dpfsend is not able to set the splash - after reboot the image is gone.

@superelchi
Fantastic work and thanks for commiting that to sourceforge. I will check it out and try to compile.

Here are the two files (The same jpg is working with the tool dpfsend):
http://www.file-upload.net/download-6727125/jpg_rgb.tar.gz.html
Re: LCD screen for your dockstar (cheap! <$5)
October 23, 2012 01:03PM
@grouproot
Your rgb-image is in the correct format. Works perfectly as splashscreen on my dx27893.
But I know that there are splash problems with certain displays. Don't ask me why. All dpfs I have at hand work flawlessly.
For the time being, I suggest to put your splash in the src/res folder and re-flash the fw.

I hope to commit the code for your display tomorrow. Now I'm getting ".. temporarily unavailable..". Giving up for today. :-(

superelchi
Re: LCD screen for your dockstar (cheap! <$5)
October 24, 2012 03:36AM
Finally! Model "intertronic" comitted.

superelchi
Re: LCD screen for your dockstar (cheap! <$5)
October 28, 2012 04:12AM
mrlinux Wrote:
-------------------------------------------------------
> So I decided to write a setpic-like utility for
> sending still images to dpf-ax frames. It
> supports png, jpg and gif formats, although gif is
> untested. It supports automatic resizing, either
> preserving aspect ratio or filling the frame. I
> also threw in a mode to fill the screen with a
> solid RGB color.
>
> This is definitely a work in progress but I
> thought I'd share anyway. I wrote it mainly
> because I need the practice. In other words, I
> won't take responsibility if anything catches on
> fire. I still have a bunch of stuff I want add to
> this, like a simple text display mode and some
> other still-image related things. Maybe a way to
> pipe in images, who knows...
>
> Oh and I'm calling it dpfsend for now, in case I
> add support for st2205/ax203 frames. A lot of the
> code comes from st2205term as it is. Build
> instructions in README
>
Finally got to test this. This works on my 128x128 dpf but the output for the 320x240 has a partial image repeated 4 times across the frame in 4 columns.

I am suspecting this section of the code
for (y=0; y<sw; y++)
	{
		for (x=0; x<sh; x++)
		{
			c = gdImageGetPixel(im, x, y);
			if (gdImageTrueColor(im))
			{
				r=gdTrueColorGetRed(c);
				g=gdTrueColorGetGreen(c);
				b=gdTrueColorGetBlue(c);
			}
			else
			{
				r=gdImageRed(im,c);
				g=gdImageGreen(im,c);
				b=gdImageBlue(im,c);
			}

			b1 = ( ( ( (r >> 3) << 3) | (g >> 5) ) );
			b2 = ( (g & 28) << 3 ) | (b >> 3);

			*p++ = b1;
			*p++ = b2;
		}
	}
How should we calculate the p address?
Re: LCD screen for your dockstar (cheap! <$5)
November 02, 2012 03:05AM
Just exchange sw and sh:

        .
        .
	for (y=0; y<sh; y++)
	{
		for (x=0; x<sw; x++)
		{
        .
        .

superelchi
Re: LCD screen for your dockstar (cheap! <$5)
November 02, 2012 08:56AM
superelchi Wrote:
-------------------------------------------------------
> Just exchange sw and sh:
>
>
>         .
>         .
> 	for (y=0; y<sh; y++)
> 	{
> 		for (x=0; x<sw; x++)
> 		{
>         .
>         .
>
>
> superelchi

I can't believe I missed that! superelchi you are absolutely right. Now dpfsend works nicely on my 320x240 frames.
joelbl
Re: LCD screen for your dockstar (cheap! <$5)
January 22, 2013 03:41AM
Hey all,

I know I am out of line here :) but I have managed to upload hackfin's landscape hack to my dpf (it is the same model and the windows' factory tool is so easy so no problem)

I managed to assign the dpf (on windows) with the lib-usb drivers (the inf wizard is amazing - kudos to their dev team!) and fetch it's vid (1908) and pid (0102) and detect when plugged/unplugged.

I am currently in the stage where the dpf's screen is blue (and after pressing for 5 seconds a brighter blue - which as far as I understood is the moment where I can start streaming specially trucated images (which I create using : This code)

but sedning the image using the file handle (like in the code inside the link above) errors (the stream does not allow seeking, and wrting is an invalid operation - might be because of my win 7 x64 - the code looks like it worked for the other dude)

so while trying to use use Lib Usb's code to upload data - no errors are returned besides Timeout :(

Any ideas on what I am doing wrong? (besides using windows, please... :) )

Any ideas would be appreciated.
joelbl
Re: LCD screen for your dockstar (cheap! <$5)
January 22, 2013 04:17AM
to elaborate on the data I send, I took the buff param from the file handle code creating the proper image (supposedly) right before the writing in the "write_stream" function and saved it to a file (using writeallbytes).

then using lib isb's code I get to the writing phase with no problem (device is found and ok - supposedly):

if (File.Exists(Environment.CurrentDirectory + "\\test.jpg"))
{
//Image test = Image.FromFile(Environment.CurrentDirectory + "\\test.jpg");

int bytesWritten;

//ec = writer.Write(Encoding.Default.GetBytes(cmdLine), 2000, out bytesWritten);

byte[] imgData = File.ReadAllBytes(Environment.CurrentDirectory + "\\test.jpg");
reader.DataReceived += (OnRxEndPointData);
reader.DataReceivedEnabled = true;

ec = writer.Write(imgData, 20000, out bytesWritten);
if (ec != ErrorCode.None) throw new Exception(UsbDevice.LastErrorString);

LastDataEventDate = DateTime.Now;
while ((DateTime.Now - LastDataEventDate).TotalMilliseconds < 1000000)
{
}

// Always disable and unhook event when done.
reader.DataReceivedEnabled = false;
reader.DataReceived -= (OnRxEndPointData);

Console.WriteLine("\r\nDone!\r\n");
}

but still - timeout. never "Done".
joelbl
Re: LCD screen for your dockstar (cheap! <$5)
January 22, 2013 04:52AM
Correction:

Timeout is reached only on the second try and forth.

The first try always return:
Win32Error:GetOverlappedResult Ep 0x01 31:

Which made me think maybe I do not need to wait for any data received so I modified the code to:

(Winforms codebehind)


public static UsbDeviceFinder MyUsbFinder = new UsbDeviceFinder(0x1908, 0x0102);
public static DateTime LastDataEventDate = DateTime.Now;
public static UsbDevice MyUsbDevice;

public void Main()
{
Constructor etc....
}

private void btnTestDataSend_Click(object sender, EventArgs e)
{
ErrorCode ec = ErrorCode.None;

try
{
// Find and open the usb device.
MyUsbDevice = UsbDevice.OpenUsbDevice(MyUsbFinder);

// If the device is open and ready
if (MyUsbDevice == null) throw new Exception("Device Not Found.");


// If this is a "whole" usb device (libusb-win32, linux libusb-1.0)
// it exposes an IUsbDevice interface. If not (WinUSB) the
// 'wholeUsbDevice' variable will be null indicating this is
// an interface of a device; it does not require or support
// configuration and interface selection.
IUsbDevice wholeUsbDevice = MyUsbDevice as IUsbDevice;
if (!ReferenceEquals(wholeUsbDevice, null))
{
// This is a "whole" USB device. Before it can be used,
// the desired configuration and interface must be selected.

// Select config #1
wholeUsbDevice.SetConfiguration(1);

// Claim interface #0.
wholeUsbDevice.ClaimInterface(0);
}

// open read endpoint 1.
UsbEndpointReader reader = MyUsbDevice.OpenEndpointReader(ReadEndpointID.Ep01);

// open write endpoint 1.
UsbEndpointWriter writer = MyUsbDevice.OpenEndpointWriter(WriteEndpointID.Ep01);

// Remove the exepath/startup filename text from the begining of the CommandLine.
//string cmdLine = Regex.Replace(
// Environment.CommandLine, "^\".+?\"^.*? |^.*? ", "", RegexOptions.Singleline);

//string cmdLine = "sdvsdc";

//if (!String.IsNullOrEmpty(cmdLine))

if (File.Exists(Environment.CurrentDirectory + "\\test.jpg"))
{
//Image test = Image.FromFile(Environment.CurrentDirectory + "\\test.jpg");

////Some init line I saw on the net and cant be run since the enum values "Endpoint" and "Recip.."
//// don't really exist in the libusb binary
//UsbSetupPacket setupPacket = new UsbSetupPacket(UsbRequestType.EndpointOut | UsbRequestType.RecipInterface | UsbRequestType.TypeVendor, (DeviceRequestType)0xff);
//bool success = mDev.ControlTransfer(ref setupPacket, new byte[0], 0, out uiTransmitted);

int bytesWritten;

//ec = writer.Write(Encoding.Default.GetBytes(cmdLine), 2000, out bytesWritten);
byte[] imgData = File.ReadAllBytes(Environment.CurrentDirectory + "\\test.jpg");
ec = writer.Write(imgData, 20000, out bytesWritten);

//reader.DataReceived += (OnRxEndPointData);
//reader.DataReceivedEnabled = true;

//maybe:
reader.DataReceivedEnabled = false;

if (ec != ErrorCode.None) throw new Exception(UsbDevice.LastErrorString);

//LastDataEventDate = DateTime.Now;
//while ((DateTime.Now - LastDataEventDate).TotalMilliseconds < 1000)
//{
//}

//// Always disable and unhook event when done.
//reader.DataReceivedEnabled = false;
//reader.DataReceived -= (OnRxEndPointData);

Console.WriteLine("\r\nDone!\r\n");
}
else
throw new Exception("Nothing to do.");
}
catch (Exception ex)
{
Console.WriteLine();
Console.WriteLine((ec != ErrorCode.None ? ec + ":" : String.Empty) + ex.Message);
}
finally
{
if (MyUsbDevice != null)
{
if (MyUsbDevice.IsOpen)
{
// If this is a "whole" usb device (libusb-win32, linux libusb-1.0)
// it exposes an IUsbDevice interface. If not (WinUSB) the
// 'wholeUsbDevice' variable will be null indicating this is
// an interface of a device; it does not require or support
// configuration and interface selection.
IUsbDevice wholeUsbDevice = MyUsbDevice as IUsbDevice;
if (!ReferenceEquals(wholeUsbDevice, null))
{
// Release interface #0.
wholeUsbDevice.ReleaseInterface(0);
}
MyUsbDevice.Close();
}
}
MyUsbDevice = null;

// Free usb resources
UsbDevice.Exit();

// Wait for user input..
//Console.ReadKey();
}


private static void OnRxEndPointData(object sender, EndpointDataEventArgs e)
{
LastDataEventDate = DateTime.Now;
Console.Write(Encoding.Default.GetString(e.Buffer, 0, e.Count));
}

but still:


A first chance exception of type 'System.Exception' occurred in USB_LCD.exe
'USB_LCD.vshost.exe' (Managed (v4.0.30319)): Loaded 'C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Configuration\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Configuration.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.

Win32Error:Win32Error:GetOverlappedResult Ep 0x01
31:
Author:

Your Email:


Subject:


Spam prevention:
Please, enter the code that you see below in the input field. This is for blocking bots that try to post this form automatically. If the code is hard to read, then just try to guess it right. If you enter the wrong code, a new image is created and you get another chance to enter it right.
Message: