Developing a Custom Printer Driver for Linux/Windows - windows

I want to use my designed USB/Serial device as a printer so that the "print" action on my Linux/Windows send the data (which asked to print) to my new printer (my own designed device/printer) connected on USB/Serial port.
Could you please give me the steps to do it? I am not sure where I should start from and how to proceed with this project?
I have an option for either Windows or Linux.

Related

IPP Driver is missing in Windows 10 (needed to connect to CUPS)

I have a HP Color Laserjet Pro 454dn printer connected to CUPS, but some of my Windows 10 computers can't print Duplex to it. Android and IOS devices have no problem printing duplex. I did notice that the driver on the working Windows 10 computer is a "Microsoft IPP driver". I cannot find this driver on the other computers. Does anyone know how to install this? I have turned the "Internet Printing Client" on, but this does not help. Also, I have tried the universal and device specific drivers from HP both with post script and PCL, some print only greyscale and others don't print duplex.
Android and iOS can print without drivers. I have looked into driverless printing for Windows, have made no progress. This would be my favourite solution.
Thank you all very much.
The IPP Driver is built into Windows 10. You might want to look at adding SAMBA to your CUPS implementation. Especially for older Windows and Android clients wanting to see your printer.
Click the 'The Printer that I want isn't listed'.
Then the radio button of "Select a shared printer by name".
Then put the printer network name in the window using this format:
http://hostname-or-ip-of-your-pi:631/printers/Printer_Name
Windows will now find the printer and ask for a print driver for it.
This link tells you all you ever wanted to know about CUPS printing but assumes your using Ubuntu to make a network printer: http://www.auxnet.org/index.php/the-news/214-installing-an-ipp-printer-in-windows-10

Spying on a USB connection on Windows?

I have an Arduino application talking over USB to an application on Windows 8 using the MAVLINK protocol. The connection appears as COM3.
Is there a Windows application that can spy on this connection and display the traffic going in both directions? Raw bytes are fine, I don't need the protocol decoded.
You could log serial port activity using Portmon. (Edit: You need to first connect to the local computer via the Computer menu, and you must start capture on the port before a program opens it.)
You may not want to log USB traffic. Such a log would include a lot of extra information relating to the USB to serial adapter which is providing COM3. Portmon would only give you the bytes transferred over COM3, and the Mavlink protocol is entirely contained within that data stream. If you're sure you want to log all USB traffic to and from that device, then I recommend SnoopyPro. In Windows 7, you need to run it as administrator.
If you can use Windows XP in your environment, USB sniff should work for you. If you need something more powerful (and are willing to pay a fee for it) then USBLyzer might be a viable option.
The answer is SnoopyPro, and you can download it at:
SnoopyPro Sourceforge
This tool allows you to get USB information and also USB communication data. I used it in the past to know how a USB device worked in order to do its driver on Linux. I used this tool as a sniffer.
Basically, SnoopyPro allows you to intercept, display, record and analyze the USB protocol and all transferred data between any USB device connected to your PC and applications. It can be successfully used in application development, USB device driver or hardware development and offers the powerful platform for effective coding, testing and optimization.

How can I make a custom USB device show up in Windows as a COM Port?

I have developed a USB device that communicates with linux over a simple but proprietary interface and some custom Linux drivers. My goal is to port this to Windows without writing windows drivers. What I would like to do is find an open source or inbuilt class driver for windows that would look like a COM port in Windows. Then I would tailor the embedded software to match what ever protocol and descriptors the virtual COM port expects to see.
The idea would be that I could plug my device in to a Windows machine and a relatively high speed COM port would appear with out me having to develop Windows drivers for it.
I have been looking at the USB CDC (Communications Device Class) documentation and it looks promising, but I don't know which sub interface would be best to use so that it would show up as a COM port.
Has anyone here done any work like this before or could provide some insight?
Specifically:
Are there virtual COM drivers "built in" to windows or would I need a 3rd party driver.
Which CDC sub class should I use for simple RS232 emulation (No need for modem AT commands, etc)
Is there a better option to do what I am trying to do.
Thanks
There is a USB-to-serial driver built in to Windows that will do what you want. It is called usbser.sys:
http://support.microsoft.com/kb/837637
You will have to write an INF file and distribute that to your users, but that will not be too hard because it is only a few kilobytes of text and you can find examples online.
I'm not aware of any great documentation for this driver by Microsoft, so my advice would be to find some other device that uses it, such as Pololu Wixel, and copy what they did.
Here are the device descriptors we used and the special control tranfers we had to implement:
https://github.com/pololu/wixel-sdk/blob/master/libraries/src/usb_cdc_acm/usb_cdc_acm.c
You can see our INF file, wixel_serial.inf, by downloading the software and looking in the drivers folder:
http://www.pololu.com/docs/0J46/3.a
(There are other files in there that are not necessary for you.)
You can also look at the Arduino Uno because they use the same driver.
Whatever you do, please don't use our USB Vendor ID in your product! You need to get your own.
Update: In Windows 10, you don't need an INF file anymore because of the new usbser.inf driver that comes with Windows.
If you are using a UART you can easily interface it to a FTDI USB chip like http://www.ftdichip.com/Products/ICs/FT232R.htm or a Prolific like http://www.prolific.com.tw/eng/products.asp?id=59
For development, prototype and testing I have half dozen of these laying around http://www.pololu.com/catalog/product/391
I connect it directly to the UART pins on AVR and 8051 micros.

Windows Phone 7 programming the use of the USB port

I would like to make a Windows Phone 7 application that takes advantage of it's USB port to communicate with the PC. I would like to write an application to control or push information/data to the PC from the application. But I am having problems finding information on where to start. Can anyone help point me in the right direction with some resources?
The only way to communicate over the USB connection is over HTTP.
To get this to work you'll need:
- a webservice hosted on the PC you're connecting to.
- a way for the app (on the phone) to know the hostname of the PC. (You'll probably need to enter it manually)
When you have these it should be straight forward.
You can't.
If you want to make sure to push data to a client PC, you will have to use a kind of synchronization by using the internet. For example create a wp7 application and a desktop application and let them sync the data based on a user object or anything like that.
As far as I know also the updated SDK for Mango will not support programming against the USB dataconnection.

Writing device driver?

I wonder if I understand correctly...
Say, if I want to control how my mouse work, i.e Left Button open window, Right Button send keystroke 'A' etc.
But I am not talking about writting something like follows in an application:
void MouseDown(xxxxEventArgs e, sender object)
{
}
I want to completely controls how the device work, then I will need to write a driver for it? From what I learn in assembly before, controlling a device I should need to know their port to communicate with the device. But say if I buy a Logitech mouse, is it possible to write a mouse driver myself to use it?
Because I saw some project that they buy a usb web cam from store, and they could able to control the web came to rotate, recevie the image from the web cam, I wonder if that's because the web cam has API provided them?
Thanks in advance.
If you want to control the device in it's entirety, then you need to write a device driver indeed. This is a non-trivial task and you should read up on it. There is a tutorial on it here and there a book for windows driver development here.
If you want to write device drivers, you should be very well versed with C and/or C++.
You do not need to write a device driver for what you are trying to do.The device driver has nothing but as per the data sheet of the device address of registers where it can read,write,do IOMMU etc or some other stuff.What you will need is some kind of hacking the application programming part of the thing which you are trying to achieve.
Because device driver code just reads the data from device and writes back it is the application which is concerned for it.Though in some case device driver programmer provide a method (function) to application programmer so that they can write their application and invoke those methods.In your case you need to just understand how the application code is talking to device driver.
In case you want to write a device driver check this
http://www.freesoftwaremagazine.com/articles/drivers_linux?page=0%2C0
In such kind of cases you can proceed with writing your own device driver by C++ and assemb
lyem

Resources