Version 11 (modified by 13 years ago) ( diff ) | ,
---|
USB Support
The Cardinal 825 supports many USB devices such as Flash Drives, Printers (Cardinal supported only!), and keyboards.
825 USB A Ports (2)
USB Mass Storage
The 825 supports USB flash storage devices formatted with the FAT (file allocation table) and FAT32 file systems. From the serial command line when a USB storage device is inserted the display will appear similar to:
Use the mount command to access files on the USB flash drive:
mount –t vfat /dev/sda1 /mnt/fl1
The files will then appear in the path /mnt/fl1 such as:
The file manager may be used to access USB flash drives. When the /mnt/fl1 folder is selected the file manager will automatically perform the mount command.
Accessing USB storage from a program
system("mount -t vfat /dev/sda1 /mnt/fl1"); FILE* file = fopen("/mnt/fl1/outfile.txt", "w"); if(file != NULL) { fprintf(file, "Gross Weight %g\r\n", wtdata[1].grosswt); fclose(file); } system("umount /mnt/fl1");
This example will mount the flash device, write a file to it, and then unmount the device. The USB storage device should not be removed or replaced while it is mounted. Programs should be written to mount and unmount each time they write to the flash, or there should be some command provided in the program so that the operator can unmount the drive to replace it.
USB Keyboards
As of kernel 2008-11-13 many USB keyboards should work with the 825. Simply plug the keyboard into an 825 USB connection.
Applications using the lib825 functions such as [[lib825:source:trunk/kypdbeep.cpp#L78 ReadKeypad]] or [[lib825:source:trunk/form.cpp#L1027 FormLCD] will automatically work with the USB keyboard. To test the keyboard without any app running type some characters on the keyboard and type:
# cat /dev/usbkybd
Output:
The characters typed on the USB keyboard should show on the serial port terminal.
USB Printing
usblp.ko device driver module for usb printing support. Type:
# modprobe usblp
Kernel should be configured with /dev/usblp0 device node. If not type:
# mknod /tmp/usblp0 c 180 0
/dev is in read-only file system so device node can be created under /tmp instead
This creates the character device driver with major number 180 and minor number 0. This should work unmodified with USB printers that accept raw text for printing using a default font.
A simple test is:
# echo “ABCDEFGH” > /dev/usblp0 '''or''' # echo “ABCDEFGH” > /tmp/usblp0
Applications may be written to open “/dev/usblp0” to print to USB printer 0 instead of “/dev/ttyS1” to open COM2
Successful Tests
- Okidata Microline 320 Turbo - Older versions of this printer do not have USB port
- Hewlett Packard DeskJet 830C - Does not print page until filled so extra line feeds are required to fill the page to finish the print Text output only (No graphics)
825 USB B Port (1)
USB to PC communications
To load the driver in the 825 for USB to PC communications from a connected terminal type:
# modprobe g_serial use_acm=1
This can also be performed from within a custom application program.
sytem("modprobe g_serial use_acm=1");
When the USB cable is connected from the 825 to the PC it will be recognized by Windows and if the driver is not already installed Windows will prompt for it. Refer to the attachments at the bottom of this page to download Windows driver files.
When the driver is installed the PC will appear to have another COM port. For testing on the PC you can then open a communications program such as HyperTerminal and set it to the appropriate COM port (which is actually a USB connection).
On the terminal connection to the indicator type:
# echo “abcdefg” > /dev/ttygserial
“abcdefg” will then appear on the Hyperterm display.
On the terminal connection to the indicator type:
# cat < /dev/ttygserial
In HyperTerminal, type:
123456<CR>
The received characters “123456” from the PC will then be displayed on the terminal connected to the 825.
Custom 825 application programs may use serial communications code to send and receive data over USB in much the same way as with the COM ports.
Attachments (7)
-
usb_insert.jpg
(48.6 KB
) - added by 15 years ago.
Screenshot of shell after inserting USB.
-
usb_keyboard.jpg
(20.1 KB
) - added by 15 years ago.
Console messages after inserting USB keyboard
-
usb_keyboard_test.jpg
(3.1 KB
) - added by 15 years ago.
Console test of USB keyboard
-
usb_mount.jpg
(14.2 KB
) - added by 15 years ago.
Console messages after USB flash mount
-
g_serial_win7_x64.zip
(602 bytes
) - added by 13 years ago.
Driver for Windows 7 64-bit USB connection to 825
-
gserial_winxp.zip
(14.4 KB
) - added by 13 years ago.
Driver for Windows XP 32-bit USB connection to 825
-
g_serial_win7_x32.zip
(1.2 KB
) - added by 13 years ago.
Driver for Windows 7 32-bit USB connection to 825
Download all attachments as: .zip