Giter Club home page Giter Club logo

rpusbdisp's Introduction

RoboPeak Mini USB Display

Drivers and Tools for RoboPeak Mini USB Display Project

Visit RoboPeak Website for details.

Demo Video

For International Users: YouTube Video

国内用户(Chinese users): 土豆视频

How to Integrate the Driver in the Kernel build operation

1) Copy the content of linux-driver folder in your kernel source (ideally in a new folder called robopeak inside the drivers/video folder)
2) Replace the Makefile file by the NewMakefile one
3) Edit the Kconfig file of the drivers/video file and insert the line
   * source "drivers/video/robopeak/Kconfig"
   after the line
   * comment "Frame buffer hardware drivers"
4) Change the .config of your kernel through the menuconfig
   * make ARCH=your_architecture your_defconfig menuconfig
5) In the menu "Device Drivers -> Graphic supports -> Support for frame buffer display" a Robopeak USB Display menu appears
6) Set the Robopeak USB Display as module (this selection activates automatically the requested frame buffer option, see Prerequites of How to build the Linux Kernel Driver chapter)
7) Generate your kernel

How to Build the Linux Kernel Driver

Here we only provide you the basic building process. Please refer to the related documents for details.

I. Prerequisite

As a linux kernel driver, it requires you to provide the target system's kernel header or the full source code to build.

Before building the driver, you may need to config the linux kernel to enable the features required by the driver. Otherwise, the building process will fail.

If you want to use the driver with your current kernel (without recompiling the kernel and replacing it with the current one), please make sure the kernel header, the config and the related build scripts you used is belonged to this version of kernel.

Please make sure the following kernel features have been enabled. (via make menuconfig under your kernel source)

0) framebuffer support (CONFIG_FB=y)

1) deferred io support in framebuffer (CONFIG_FB_DEFERRED_IO=y)

2) fb file operation support

   * CONFIG_FB_CFB_FILLRECT=y
   * CONFIG_FB_CFB_COPYAREA=y
   * CONFIG_FB_CFB_IMAGEBLIT=y
   * CONFIG_FB_SYS_FILLRECT=m
   * CONFIG_FB_SYS_COPYAREA=m
   * CONFIG_FB_SYS_IMAGEBLIT=m
   * CONFIG_FB_SYS_FOPS=m
   * CONFIG_FB_MODE_HELPERS=y

3) Input event support (Generic input layer support)

You may modify the .config directly to enable these features.

Alternatively, here is a tricky method: Select the Displaylink display driver ( Device Drivers-> Graphics support -> Support for frame buffer devices-> Displaylink USB Framebuffer support) as an external module. By doing so, the above features will be selected by the menuconfiger.

You may need to recompile the kernel if the above configuration changes have been made.

II. Native Build - build the kernel driver for the current machine

You should have followed the steps described in the prerequisite section already. Here let's assume the location of the Linux kernel header(or source) is ~/workspace/linux-kernel.

Enter the Robopeak USB Displayer linux kernel driver folder (i.e. rpusbdisp/drivers/linux-driver), using the following command:

$ make KERNEL_SOURCE_DIR=~/workspace/linux-kernel

You should find the build result under the current folder: rp_usbdisplay.ko

III. Cross Compile - build the kernel driver for other platforms

You should have followed the steps described in the prerequisite section already. Here let's assume the location of the Linux kernel header(or source) is ~/workspace/target-linux-kernel.

Let's also assume the target platform is ARMv7. We need to use the cross-compiler : arm-linux-gnueabihf-gcc.

Enter the following command to build the kernel driver for the target:

make CROSS_COMPILE=arm-linux-gnueabihf- ARCH=arm KERNEL_SOURCE_DIR=~/workspace/target-linux-kernel

You should find the build result under the current folder: rp_usbdisplay.ko

How to Use the Kernel Driver

I. Deploy the dependencies modules

If you had re-configed and recompiled the Linux kernel as required by the building process, you need to deploy the new kernel and all the kernel modules to the target system.

To be specific, you need to deploy AT LEAST the following kernel module to the target system's /lib/module/<target_kernel_version> folder along with the new kenrel image:

  • sysfillrect.ko
  • syscopyarea.ko
  • sysimgblt.ko
  • fb_sys_fops.ko

II. Deploy the compiled kernel driver

Reboot the target system to using the new kernel. Copy the compiled usb display driver (rp_usbdisplay.ko) to the following location:

/lib/modules/`uname -r`/kernel

Enter the above folder and execute the following command:

depmod 

III. Load the kernel driver

Once you had deployed the kernel driver and all of its dependencies, you can ask the kernel to load the driver using :

modprobe rp_usbdisplay

By default the frame per seconds is set to 16. You can change it with the fps option when you load the driver :

modprobe rp_usbdisplay fps=25

In this case the frame per seconds is set to 25.

If you want to let the kernel load the driver automatically each time when the system starts, you can added the following line into the file /etc/modules: rp_usbdisplay

(i.e. echo rp_usbdisplay >> /etc/modules)

IV. Verify the driver

Using the lsmod command to check whether the driver has been loaded correctlly. You should get the output similar to the following text:

# lsmod
Module                  Size  Used by
rp_usbdisplay          12171  0 [permanent]
fb_sys_fops             1412  1 rp_usbdisplay
sysimgblt               2199  1 rp_usbdisplay
sysfillrect             3295  1 rp_usbdisplay
syscopyarea             3112  1 rp_usbdisplay

Also, you should find the following message in the dmesg log:

[    7.535799] input: RoboPeakUSBDisplayTS as /devices/virtual/input/input0
[    7.548115] usbcore: registered new interface driver rp-usbdisp

To verify the driver work with the RoboPeak USB Display, connect the display to the target system via the USB cable. The display should display RoboPea Logo and turn to black (or something else) for about 3 second.

If the display keeps showing the white noise animation and the message : Waiting for signal, you should check the dmesg to see what happens. Normally, the driver will prompt the following message when the display has been pluged in :

[ 1814.173232] rp-usbdisp 4-1:1.0: RP USB Display found (#1), Firmware Version: X.XX, S/N: XXXXXXXXXXXX

Once the driver recognizes the display, a framebuffer device will be created. (e.g. /dev/fb0)

Use the following command to see whether framebuffer device is belonged to the USB display:

# cat /proc/fb  
2 rpusbdisp-fb <

In the above example, /dev/fb2 is the related framebuffer device. To test whether the framebuffer device works, you may using the following command:

# cat /dev/urandom > /dev/fb2

You should see the display screen is filled with random color dots.

V. Make X11 output to the USB display

There is a sample X11 config file under the source folder: rpusbdisp/drivers/linux-driver/xserver_conf/10-disp.conf. You can use this sample file as the template to make X11 on your target system to output to the USB display.

STEP1: determine the framebuffer device name of the display. use the command cat /proc/fb

STEP2: modify the 10-disp.conf, change the framebuffer device name to the one determined in STEP1.

STEP3: copy the file 10-disp.conf to the X11's config folder (/usr/share/X11/xorg.conf.d for most systems).

STEP4: restart the X11 server

The X11 desktop should appear on the USB display.

User Mode SDK

Besides the Linux kernel driver, we also provide a user mode sdk which is available on Windows, OS X, and Linux.

You can find the SDK in the drivers/usermode-sdk subdirectory.

Contact Us

Website: www.RoboPeak.com Email: [email protected]

rpusbdisp's People

Contributors

blackmiaool avatar cheaven avatar cnwzhjs avatar robopeak avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

rpusbdisp's Issues

failed to compile with kernel 3.8

Kernel source is from ubuntu linux-source-3.8.0_3.8.0-23.34_all.deb, got compilation error:

$ make KERNEL_SOURCE_DIR=/usr/src/linux-source-3.8.0/
make -C /usr/src/linux-source-3.8.0/ KCPPFLAGS="-I/root/rpusbdisp/drivers/linux-driver/src -I/root/rpusbdisp/drivers/linux-driver/../common" M=/root/rpusbdisp/drivers/linux-driver modules
make[1]: Entering directory /usr/src/linux-source-3.8.0' CC [M] /root/rpusbdisp/drivers/linux-driver/src/main.o CC [M] /root/rpusbdisp/drivers/linux-driver/src/usbhandlers.o /root/rpusbdisp/drivers/linux-driver/src/usbhandlers.c: In function ‘rpusbdisp_usb_try_send_image’: /root/rpusbdisp/drivers/linux-driver/src/usbhandlers.c:467:9: warning: format ‘%d’ expects argument of type ‘int’, but argument 2 has type ‘size_t’ [-Wformat] /root/rpusbdisp/drivers/linux-driver/src/usbhandlers.c: In function ‘_on_alloc_disp_tickets_pool’: /root/rpusbdisp/drivers/linux-driver/src/usbhandlers.c:683:5: warning: format ‘%d’ expects argument of type ‘int’, but argument 4 has type ‘size_t’ [-Wformat] CC [M] /root/rpusbdisp/drivers/linux-driver/src/fbhandlers.o CC [M] /root/rpusbdisp/drivers/linux-driver/src/touchhandlers.o LD [M] /root/rpusbdisp/drivers/linux-driver/rp_usbdisplay.o Building modules, stage 2. MODPOST 1 modules CC /root/rpusbdisp/drivers/linux-driver/rp_usbdisplay.mod.o LD [M] /root/rpusbdisp/drivers/linux-driver/rp_usbdisplay.ko make[1]: Leaving directory/usr/src/linux-source-3.8.0'

Seems it's because the removal of __devinitdata by commit torvalds/linux@63a29f7 in kernel.

building with kernel 3.12.32

I just tried to build your latest version (454421d) with the lastest raspberry pi kernel (raspberrypi/linux@75effe1) and got these warnings:

WARNING: ../../../modules/lib/modules/3.12.32/extra/rp_usbdisplay.ko needs unknown symbol fb_sys_write
WARNING: ../../../modules/lib/modules/3.12.32/extra/rp_usbdisplay.ko needs unknown symbol sys_imageblit
WARNING: ../../../modules/lib/modules/3.12.32/extra/rp_usbdisplay.ko needs unknown symbol sys_fillrect
WARNING: ../../../modules/lib/modules/3.12.32/extra/rp_usbdisplay.ko needs unknown symbol sys_copyarea
WARNING: ../../../modules/lib/modules/3.12.32/extra/rp_usbdisplay.ko needs unknown symbol fb_sys_read

I verified that these options are set this way in the .config file:

CONFIG_FB=y
CONFIG_FB_DEFERRED_IO=y
CONFIG_FB_CFB_FILLRECT=y
CONFIG_FB_CFB_COPYAREA=y
CONFIG_FB_CFB_IMAGEBLIT=y
CONFIG_FB_SYS_FILLRECT=m
CONFIG_FB_SYS_COPYAREA=m
CONFIG_FB_SYS_IMAGEBLIT=m
CONFIG_FB_SYS_FOPS=m
CONFIG_FB_MODE_HELPERS=y

And also that these files are present in the output directory of the build:

sysfillrect.ko
syscopyarea.ko
sysimgblt.ko
fb_sys_fops.ko

please help, i have no idea what could be wrong...

'make install' damages Ubuntu systems

It appears that 'make' will happily make the .ko file needed with just the kernel headers installed (i.e. without the full sources). However, 'make install' won't just not install it, it destroys /lib/modules completely (which, if you don't catch it and reinstall all the packages with modules, will render the system broken). The right answer appears to be simply to copy the file into place by hand.

Fine, the README does suggest a longer path, but this looks like a shortcut, not a system destroyer, so perhaps some warnings somewhere not to do this?

Screen rotation

I would like to rotate my screen. I tried many solution with the linux framebuffer but anyone work.
It would be great if we can customize the screen rotation when we compile the driver or with the fbcon parameter.

Command tried :

echo 2 > sudo tee /sys/class/graphics/fbcon/rotate_all

I add this command in my boot file :

fbcon=rotate:2

Module build for currently running kernel skipped....

Trying to get USB TFT working on a new Pi3- followed the initial install instructions, got an unsupported kernel error (as expected due to Pi3), followed the added steps from github......DKMS.

  • 'sudo apt install...' appeared to work so ran 'sudo dpkg -i....'
    nb. don't know if it's relevant but this was run from pi@max2play:~/rp_usbdisplay $ which is where the initial install left me
  • Got error re. 'cannot access archive' - searched forums and found I needed to do 'cd dkms' first, which I did then reran '...dpkg -i'
  • Got a different error 'Module build for the currently running kernel was skipped since the
    kernel source for this kernel does not seem to be installed.'
  • looking back through the system responses, at the end of the 'apt install' I found this
    'run-parts: executing /etc/kernel/header_postinst.d/dkms 4.9.35+
    run-parts: executing /etc/kernel/header_postinst.d/dkms 4.9.35-v7+'

    nb. the version no. above seems odd as the currently running kernel is 4.9.39[-v7]+
    and
    'ln: failed to create hard link ‘/boot/initrd.img-3.6-trunk-rpi.dpkg-bak’ => ‘/boot/ini trd.img-3.6-trunk-rpi’: Operation not permitted
    update-initramfs: Generating /boot/initrd.img-3.6-trunk-rpi'

The hard link error also occurred on my 1st install attempt, the above is from my 2nd attempt to install having gone back and done a complete re-install of the OS from a new Max2Play
image,

usb_tft_kernel_issue1
usb_tft_kernel_issue2

Any suggestions to fix this would be appreciated (am Raspberry/Linux newbie but game to have a go)

Usermode driver prints to stderr on disconnect

If you are using the usermode driver and disconnect the device while in use then you get lines like the following sent to stderr:

Unexpcected status: 0x00000006
Error code: 0xfffffffc

This pollutes stderr in my case messing up a program that monitors it. You can find the above code by searching for "Unexpcected" in this project. Searching for stderr ignoring test code shows a few other places this is done.

A library should never do this. An alternative is an error reporting callback, or to return errors to existing api calls.

Usermode-SDK demo not working on Ubuntu System

While I can manually write to device framebuffer and touch functionality is working and moving mouse around, demo code fails when initializing device. When I run demo with strace I see that device is busy/ unreachable.

Is it possible that system is locking device because it is treated as touch device and if how do I prevent this? Also I have more the one framebuffere initialized in my system, is it possible that wrong device is initialized with SDK?

I would also appreciate any pointers where I should look next.

Cursor off with pygame on raspberry pi 3

The touch screen mouse cursor for robopeak 2.8 tft on raspberry pi is way off when tested with python pygame, it seems to have some sort of acceleration.

I have the following kernel, Linux raspberrypi 4.9.59-v7+ #1047 SMP Sun Oct 29 12:19:23 GMT 2017 armv7l GNU/Linux. I have installed the module using dpkg -i rp-usbdisplay-dkms_1.0_all.deb.

Any support to calibrate the mouse cursor position is appreciated.

Red and Blue are swapped

sin titulo-1
Hi, I tried to run DFRobot Usbdisplay by using https://github.com/pimoroni/rp_usbdisplay and no luck, screen always change Red by Blue color when I'm out of X11, then I tried to compile new kernel with drivers included on it like tutorial said, no luck, and same problem occurs, red color and blue color ar swapped.

I use fbcp to send framebuffer to screen

I don't know what to do, I have spent days doing research with no success

Splash Logo

Hello,

We got 10 units from pimoroni.com.
Displays have Robopeak init screen and DFrobot splash logo.
How we can change splah logo ? It is not good to have a promo logo in a final production unit.

Mac OSX driver ?

Hi !
I've a little project with my MacBook Pro, I want to use your mini lcd monitor as a second monitor on my Macintosh. Is this possible or not ? Can it works out of the box ?

Second question, is the lcd screen detachable from the pcb board ?

Thanks !

Multiple robopeak rpusbdisp on single Raspberry Pi

I display a camera live video on my robopeak rpusbdisp. But I have 2 cameras. When I connect a second robopeak rpusbdisp it just says "Waiting for Signal...". So do I need 2 RPi or is it a configuration issue?

Again in short:

  1. Is it possible?
  2. How?

DFRobot, Raspberry Pi Zero and USB Hub

Hi,
I have tested several usb hubs connected to the Raspi Zero in order to give it access to the DFRobot Display and a wifi dongle. However, the only thing that works when I run the Raspi Zero, is the DFRobot display. On the other hand when I run the Raspberry with only the wifi dongle connected to the usb hub, then it works.
Any advice?

Thank you

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.