Re: LCD screen for your dockstar (cheap! <$5) April 22, 2012 07:36AM |
Registered: 12 years ago Posts: 365 |
Re: LCD screen for your dockstar (cheap! <$5) April 22, 2012 07:42PM |
Registered: 14 years ago Posts: 261 |
ax206term
Re: LCD screen for your dockstar (cheap! <$5) April 23, 2012 07:13AM |
if (use_dpf) { char *d=f->data; short rect[4]; // my code if (ch>32 && ch<127) d+=(f->w+1)*f->h*(ch-32); unsigned char *rgb,*rgb_fg=rgb_colors[fg],*rgb_bg=rgb_colors[bg]; int m,n; for (m=0;m<f->h;m++) { //what is m? unsigned char *p=pixels+(y+m)*(sw+sw+sw)+x+x+x; // rect[0]= ??? // rect[1]= ??? // rect[2]= ??? // rect[3]= ??? for (n=0;n<f->w;n++) { //what is n? rgb=(*d++=='#')?rgb_fg:rgb_bg; // dpf_screen_blit(picframe,p,RGB565(*rgb,*rgb++,*rgb++),rect); my code /** Blit data to screen * * \param buf buffer to 16 bpp RGB 565 image data * \param rect rectangle tuple: [x0, y0, x1, y1] */ *p++=*rgb++; //PG: What does this do? Red Byte? *p++=*rgb++; //PG: What does this do? Green Byte? *p++=*rgb++; //PG: What does this do? Blue byte? } d++; // skip linefeed } }
Re: LCD screen for your dockstar (cheap! <$5) April 23, 2012 07:26AM |
Registered: 12 years ago Posts: 365 |
Re: LCD screen for your dockstar (cheap! <$5) April 23, 2012 07:56PM |
Registered: 14 years ago Posts: 261 |
> if (use_dpf) > { > char *d=f->data; > short rect[4]; // my code > if (ch>32 && ch<127) > d+=(f->w+1)*f->h*(ch-32); > unsigned char > *rgb,*rgb_fg=rgb_colors[fg],*rgb_bg=rgb_colors[bg] > ; > int m,n; > for (m=0;m<f->h;m++) { //what is m? Each font character if a rectangular array of pixels. m is the y-coordinate within the pixel array which ranges from 0..font height (f->h-1) > unsigned char > *p=pixels+(y+m)*(sw+sw+sw)+x+x+x; > // rect[0]= ??? > // rect[1]= ??? > // rect[2]= ??? > // rect[3]= ??? Not sure what the coordinates in rect[] are... rect[0]=x; rect[1]=y; // x,y is top left rect[2]=x+f->w-1; rect[3]=y+f->h-1; // bottom right > > for (n=0;n<f->w;n++) { //what is n? > rgb=(*d++=='#')?rgb_fg:rgb_bg; m is the x-coordinate within the pixel array which ranges from 0..font width (f->w-1) > // > dpf_screen_blit(picframe,p,RGB565(*rgb,*rgb++,*rgb > ++),rect); my code The RGB565 would have to convert the RGB data to the right binary format for the picframe back buffer. > /** Blit data to screen > * > * \param buf buffer to 16 bpp RGB 565 image > data > * \param rect rectangle tuple: [x0, y0, x1, > y1] > */ > *p++=*rgb++; //PG: What does this > do? Red Byte? Yes, copies the Red byte (0..255) - see rgb_colors[] > *p++=*rgb++; //PG: What does this > do? Green Byte? Yes, copies the Green byte (0..255) - see rgb_colors[] > *p++=*rgb++; //PG: What does this > do? Blue byte? Yes, copies the Blue byte (0..255) - see rgb_colors[] > } > d++; // skip linefeed > } > } >
Re: LCD screen for your dockstar (cheap! <$5) April 24, 2012 02:31AM |
Registered: 12 years ago Posts: 365 |
ax206term
Re: LCD screen for your dockstar (cheap! <$5) April 24, 2012 09:05AM |
~/st2205term-0.10# ./st2205term --dpf INFO: using keymap from file /root/st2205term-0.10/us.kmap INFO: using fontdata from file /root/st2205term-0.10/fonts.txt INFO: picframe selection automatic (polling /dev/disk/by-id) load_kmap(/root/st2205term-0.10/us.kmap) - loading key defintions load_kmap(/root/st2205term-0.10/us.kmap) - 71 key defintions loaded load_font(/root/st2205term-0.10/fonts.txt,0) - loading font defintion INFO: connecting to picframe device /dev/usb0 (/dev/bus/usb/004/021) Opening generic SCSI device '/dev/bus/usb/004/021' calling SCSI ioctl(): Operation not permitted SCSI inquiry failed WARN: failed to connect to picframe
if (picframe) { // we think we're connected but are we really? struct stat s; // stat device to see if it is still there int rc=stat(device,&s); if (rc<0) { destroy_terminal(); dpf_close(*picframe); free(pixels); pixels=NULL; picframe=NULL; fprintf(stderr,"WARN: picframe disconnected\n"); } } if (picframe==NULL) { char *dev=NULL; if (dev==NULL) { static char path[PATH_MAX]; dev="/dev/usb0"; } if (realpath(dev,device)==NULL)udev rule is working. I'm not sure if it's my code or libdpf is not playing nice.
Re: LCD screen for your dockstar (cheap! <$5) April 24, 2012 07:37PM |
Registered: 14 years ago Posts: 261 |
> ~/st2205term-0.10# ./st2205term --dpf > INFO: using keymap from file > /root/st2205term-0.10/us.kmap > INFO: using fontdata from file > /root/st2205term-0.10/fonts.txt > INFO: picframe selection automatic (polling > /dev/disk/by-id) > load_kmap(/root/st2205term-0.10/us.kmap) - loading > key defintions > load_kmap(/root/st2205term-0.10/us.kmap) - 71 key > defintions loaded > load_font(/root/st2205term-0.10/fonts.txt,0) - > loading font defintion > INFO: connecting to picframe device /dev/usb0 > (/dev/bus/usb/004/021) > Opening generic SCSI device > '/dev/bus/usb/004/021' > calling SCSI ioctl(): Operation not permitted > SCSI inquiry failed > WARN: failed to connect to picframe >
> if (picframe) > { // we think we're connected but are we > really? > struct stat s; // stat device to see > if it is still there > int rc=stat(device,&s); > if (rc<0) > { > destroy_terminal(); > dpf_close(*picframe); > free(pixels); pixels=NULL; > picframe=NULL; > fprintf(stderr,"WARN: picframe > disconnected\n"); > } > } > > if (picframe==NULL) > { > char *dev=NULL; > if (dev==NULL) > { > static char path[PATH_MAX]; > dev="/dev/usb0"; > } > > if (realpath(dev,device)==NULL) >> udev rule is working. I'm not sure if it's my code
Re: LCD screen for your dockstar (cheap! <$5) April 25, 2012 01:55AM |
Registered: 12 years ago Posts: 365 |
Re: LCD screen for your dockstar (cheap! <$5) April 25, 2012 02:03AM |
Registered: 13 years ago Posts: 22 |
Opening generic SCSI device '/dev/bus/usb/004/021' calling SCSI ioctl(): Operation not permitted SCSI inquiry failed
error = dpf_open("usb0", &dpf);
Re: LCD screen for your dockstar (cheap! <$5) April 25, 2012 03:03AM |
Registered: 12 years ago Posts: 365 |
ax206term
Re: LCD screen for your dockstar (cheap! <$5) April 25, 2012 07:18AM |
./st2205term --dpf --font=large --blink INFO: using keymap from file /root/st2205term-0.10/us.kmap INFO: using fontdata from file /root/st2205term-0.10/fonts.txt INFO: picframe selection automatic (polling /dev/disk/by-id) load_kmap(/root/st2205term-0.10/us.kmap) - loading key defintions load_kmap(/root/st2205term-0.10/us.kmap) - 71 key defintions loaded load_font(/root/st2205term-0.10/fonts.txt,2) - loading font defintion Found AX206 DPF Got LCD dimensions: 320x240 create_terminal 320x240 pixels => 40x15 chars rote_vt_forkpty: command='/bin/bash --login' PID=-1 INFO: successfully connected to picframe Opened device /dev/input/by-id/usb-Logitech_Logitech_USB_Keyboard-event-kbd (/dev/input/event0) => Logitech Logitech USB Keyboard
ax206term
Re: LCD screen for your dockstar (cheap! <$5) April 25, 2012 07:34AM |
Re: LCD screen for your dockstar (cheap! <$5) April 25, 2012 09:08AM |
Registered: 13 years ago Posts: 22 |
Re: LCD screen for your dockstar (cheap! <$5) April 25, 2012 10:06AM |
Registered: 12 years ago Posts: 365 |
Re: LCD screen for your dockstar (cheap! <$5) April 25, 2012 11:23AM |
Registered: 12 years ago Posts: 365 |
static unsigned char colormap[8]={0,0,0};should be
static unsigned int colormap[8];
unsigned char rgb,rgb_fg=colormap[fg],rgb_bg=colormap[bg]; int m,n; for (m=0;m<f->h;m++) { //Each font character if a rectangular array of pixels. //m is the y-coordinate within the pixel array which ranges from 0..font height (f->h-1) unsigned char *p=pixels+(y+m)*(sw+sw)+x+x; for (n=0;n<f->w;n++) { // n is the x-coordinate within the pixel array which ranges from 0..font width (f->w-1) rgb=(*d++=='#')?rgb_fg:rgb_bg; *p++=rgb++; *p++=rgb++;should be
unsigned int rgb,rgb_fg=colormap[fg],rgb_bg=colormap[bg]; int m,n; for (m=0;m<f->h;m++) { //Each font character if a rectangular array of pixels. //m is the y-coordinate within the pixel array which ranges from 0..font height (f->h-1) unsigned int *p=(unsigned int *)(pixels+(y+m)*(sw+sw)+x+x); for (n=0;n<f->w;n++) { // n is the x-coordinate within the pixel array which ranges from 0..font width (f->w-1) rgb=(*d++=='#')?rgb_fg:rgb_bg; *p++=rgb;
pixels=(unsigned char*)malloc(sw*sh*3);should be
pixels=(unsigned char*)malloc(sw*sh*2);
Re: LCD screen for your dockstar (cheap! <$5) April 25, 2012 09:37PM |
Registered: 14 years ago Posts: 261 |
static short *pixels=NULL; // pixel buffer that is copied to device ... static short colormap[8]={0,0,0}; ... if (use_dpf) { char *d=f->data; if (ch>32 && ch<127) d+=(f->w+1)*f->h*(ch-32); short rgb,rgb_fg=colormap[fg],rgb_bg=colormap[bg]; int m,n; for (m=0;m<f->h;m++) { //Each font character if a rectangular array of pixels. //m is the y-coordinate within the pixel array which ranges from 0..font height (f->h-1) short *p=pixels+(y+m)*sw+x; for (n=0;n<f->w;n++) { // n is the x-coordinate within the pixel array which ranges from 0..font width (f->w-1) rgb=(*d++=='#')?rgb_fg:rgb_bg; *p++=rgb++; // just one } d++; // skip linefeed } } ... pixels=(short*)malloc(sw*sh*sizeof(short));
ax206term
Re: LCD screen for your dockstar (cheap! <$5) April 26, 2012 09:01AM |
rote_vt_forkpty: command='/bin/bash --login' PID=-1is rote_vt_forkpty bombing out while testing on PC. Once I hooked up the dpf to the dockstar, the correct result:
./st2205term --dpf --font=large --blink --keyboard=/dev/input/event0 INFO: using keymap from file /root/st2205term-0.10/us.kmap INFO: using fontdata from file /root/st2205term-0.10/fonts.txt INFO: picframe selection automatic (polling /dev/disk/by-id) load_kmap(/root/st2205term-0.10/us.kmap) - loading key defintions load_kmap(/root/st2205term-0.10/us.kmap) - 71 key defintions loaded load_font(/root/st2205term-0.10/fonts.txt,2) - loading font defintion Found AX206 DPF Got LCD dimensions: 320x240 create_terminal 320x240 pixels => 40x15 chars rote_vt_forkpty: command='/bin/bash --login' PID=6507 INFO: successfully connected to picframe Opened device /dev/input/event0 (/dev/input/event0) => Microsoft Microsoft® 2.4GHz Transceiver v8.0
protocol_py
Re: LCD screen for your dockstar (cheap! <$5) April 26, 2012 09:26AM |
irimi
Re: LCD screen for your dockstar (cheap! <$5) April 27, 2012 03:47AM |
ax206term
Re: LCD screen for your dockstar (cheap! <$5) April 27, 2012 05:01PM |
neon
Re: LCD screen for your dockstar (cheap! <$5) April 28, 2012 02:40AM |
gcc -Wall -g -O2 -DHAVE_DPF -o st2205term st2205term.c -lrote -ldpfand I get
INFO: using keymap from file /home/st2205term-0.10/us.kmap INFO: using fontdata from file /home/st2205term-0.10/fonts.txt INFO: picframe selection automatic (polling /dev/disk/by-id) load_kmap(/home/st2205term-0.10/us.kmap) - loading key defintions load_kmap(/home/st2205term-0.10/us.kmap) - 71 key defintions loaded load_font(/home/st2205term-0.10/fonts.txt,0) - loading font defintion Error: No matching USB device found! WARN: failed to connect to picframe Error: No matching USB device found! WARN: failed to connect to picframe
Re: LCD screen for your dockstar (cheap! <$5) April 28, 2012 03:17AM |
Registered: 13 years ago Posts: 23 |
Re: LCD screen for your dockstar (cheap! <$5) April 28, 2012 11:05AM |
Registered: 14 years ago Posts: 261 |
dpf/src# sudo python hackit.py /dev/sg1 Reading flash... done No DPF found. Create a record or look for one ('20090504', 'Mar 13 2010\xff\xff\xff\xff\xff', 'ProcTbl6') dpf/src# cd ../../dpf-ax dpf-ax/fw# cp ../Debug/dpf.so . dpf-ax/fw# sudo python detect.py /dev/sg1 Opening generic SCSI device '/dev/sg1' Manufacturer: SST Unknown Manufacturer Got id[3]: bf, 25, 41 Unable to detect flash, just assuming 2MB size Size : 2 MB dpf-ax/fw# lsusb Bus 001 Device 005: ID 1908:0102
Re: LCD screen for your dockstar (cheap! <$5) April 28, 2012 11:42AM |
Registered: 12 years ago Posts: 365 |
Re: LCD screen for your dockstar (cheap! <$5) April 28, 2012 11:49AM |
Registered: 14 years ago Posts: 261 |
dpf-ax/fw# sudo ./hiddetach 1908:3318
dpf-ax/fw# sudo python detect.py usb0
Found AX206 DPF (bootloader)
Manufacturer: SST
Unknown Manufacturer
Got id[3]: bf, 25, 41
Unable to detect flash, just assuming 2MB size
Size : 2 MB
dpf-ax/fw# sudo python detect.py /dev/sg1 Opening generic SCSI device '/dev/sg1' Manufacturer: EON Size : 4 MB dpf-ax/fw# python fulldump.py /dev/sg1 Opening generic SCSI device '/dev/sg1' Manufacturer: EON Size : 4 MB Reading 400000 bytes... Wrote full.bin
dpf-ax/fw# sudo python identify.py /dev/sg1
Re: LCD screen for your dockstar (cheap! <$5) April 28, 2012 12:20PM |
Registered: 14 years ago Posts: 261 |
dpf-ax/fw# sudo ./hiddetach 1908:3318 Detaching dpf at 1-1.2:1.0... done. dpf-ax/fw# sudo python restore.py ../../dpf/fw/full.bin.20120428 Found AX206 DPF (bootloader) Manufacturer: SST Unknown Manufacturer Got id[3]: bf, 25, 41 Unable to detect flash, just assuming 2MB size Size : 2 MB Erase full flash... Flashing sector 0... Flashing sector 1... Flashing sector 2... ... Flashing sector 30... Flashing sector 31... Executing applet..
dpf-ax/fw# python identify.py ../../dpf/fw/full.bin.20120428
Looking for buildwin firmware....: Found (320x240 px).
Looking for known version info...: None.
Looking for Openwin..............: Found.
Looking for LcdIniTbl............: Found.
Looking for known signatures.....: None.
Sorry, no matching dpf found.
dpf-ax/fw# sudo python restore.py ../../dpf/fw/full.bin.20120428 Found AX206 DPF (bootloader) Manufacturer: SST Unknown Manufacturer Got id[3]: bf, 25, 41 Unable to detect flash, just assuming 2MB size Size : 2 MB Erase full flash... Flashing sector 0... Flashing sector 1... Flashing sector 2... ... Flashing sector 29... Flashing sector 30... Flashing sector 31... Executing applet.. dpf-ax/fw# sudo ./hiddetach 1908:3318 Detaching dpf at 1-1.2:1.0... done. dpf-ax/fw# sudo python fulldump.py usb0 Found AX206 DPF (bootloader) Manufacturer: SST Unknown Manufacturer Got id[3]: bf, 25, 41 Unable to detect flash, just assuming 2MB size Size : 2 MB Reading 200000 bytes... Wrote full.bin dpf-ax/fw# python identify.py full.bin Looking for buildwin firmware....: Not found. This in no buildwin firmware! Traceback (most recent call last): File "identify.py", line 348, in <module> dpf, pm = recognize_dpf(data) TypeError: 'NoneType' object is not iterable
neon
Re: LCD screen for your dockstar (cheap! <$5) April 28, 2012 02:42PM |
ax206term
Re: LCD screen for your dockstar (cheap! <$5) April 28, 2012 08:17PM |
apt-get install libncurses5-dev libusb-devwget -nd http://downloads.sourceforge.net/project/rote/rote/rote-0.2.8/rote-0.2.8.tar.gz tar xvfz rote-0.2.8.tar.gz cd rote-0.2.8/ ./configure && make && make install cd .. cp dpf-ax/libdpf.so /usr/local/lib/
@petergunn: I have better experience forcing the flash size with the -f flag for restore.py. You never mentioned what the frame display is showing. That will be a helpful hint of the current state of the frame. ProgSPI is another option which neon mentioned.
This is good news once you get the flashing problem out of the way.
Looking for buildwin firmware....: Found (320x240 px). Looking for known version info...: None. Looking for Openwin..............: Found. Looking for LcdIniTbl............: Found. Looking for known signatures.....: None.For reading, openschemes three articles are very helpful on the inner details of the frame.
Re: LCD screen for your dockstar (cheap! <$5) April 28, 2012 09:23PM |
Registered: 14 years ago Posts: 261 |