Posted on Leave a comment

eBay Special 2.5″ HDD USB Case

Since I have a fair few 750GB disks sat doing nothing, I figured I’d get some USB3 caddies for them. Back when USB -> IDE caddies appeared, they were hideously expensive. Not so much these days!

USB HDD
USB HDD

For £6 on eBay, you get a basic plastic box with the required bridge circuitry.

USB - SATA Bridge
USB – SATA Bridge

Here’s the PCB – a very basic affair, with only 2 ICs. The large QFN IC on the left is the USB-SATA bridge. It’s a JMicron JMS567. Unfortunately JMicron are rather secretive about their bridge chips & I can’t find much information about it, nor a datasheet.

PCB Reverse
PCB Reverse

Here’s the other side of the bridge PCB – not much on here, the activity indicator LED is a bit of a bodge job, but it’s functional. The IC on the right is a Pm25LD512 512Kbit SPI EEPROM. This is used to store things like the USB device & vendor IDs, device name, type, etc. Here’s what dmesg spits out when the disk is connected on my standard Linux system:

[10397.893298] usb 2-3.1.1: new SuperSpeed USB device number 8 using xhci_hcd
[10397.909019] usb 2-3.1.1: New USB device found, idVendor=152d, idProduct=1562
[10397.909025] usb 2-3.1.1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[10397.909027] usb 2-3.1.1: Product: ELEMENTS
[10397.909028] usb 2-3.1.1: Manufacturer: ELEMENTS
[10397.909029] usb 2-3.1.1: SerialNumber: 0F00000000157DC
[10397.912679] scsi host13: uas
[10397.913198] scsi 13:0:0:0: Direct-Access     WD       ELEMENTS         0225 PQ: 0 ANSI: 6
[10397.914043] sd 13:0:0:0: Attached scsi generic sg11 type 0
[10397.914179] sd 13:0:0:0: [sdk] Spinning up disk...
[10398.917575] .....ready
[10402.939800] sd 13:0:0:0: [sdk] 1465149168 512-byte logical blocks: (750 GB/698 GiB)
[10402.939803] sd 13:0:0:0: [sdk] 4096-byte physical blocks
[10402.940358] sd 13:0:0:0: [sdk] Write Protect is off
[10402.940363] sd 13:0:0:0: [sdk] Mode Sense: 53 00 00 08
[10402.940662] sd 13:0:0:0: [sdk] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
[10403.038847]  sdk: sdk1
[10403.040572] sd 13:0:0:0: [sdk] Attached SCSI disk
[10404.347605] device-mapper: table: 252:0: adding target device sdk1 caused an alignment inconsistency: physical_block_size=4096, logical_block_size=512, alignment_offset=0, start=4096
[10404.347611] device-mapper: table: 252:0: adding target device sdk1 caused an alignment inconsistency: physical_block_size=4096, logical_block_size=512, alignment_offset=0, start=4096
[10404.626320] device-mapper: table: 252:0: adding target device sdk1 caused an alignment inconsistency: physical_block_size=4096, logical_block_size=512, alignment_offset=0, start=2100224
[10404.626325] device-mapper: table: 252:0: adding target device sdk1 caused an alignment inconsistency: physical_block_size=4096, logical_block_size=512, alignment_offset=0, start=2100224

Here’s some speed benchmarks:


USB2 Benchmark
USB2 Benchmark

First attached to a USB2 port, above

USB3 Benchmark
USB3 Benchmark

And finally attached to a USB3 port, above

Tests were done with a 320GB 5400RPM Samsung HM321HI drive, direct into the root hub, for the shortest possible signal length.

 

Posted on Leave a comment

Recording QSO’s From My Shack

Since my new Wouxun has audio output jacks, I figured it would be useful to have the ability to record what my rig hears, if anything interesting comes on the air.

Under Linux, I use an application called, (creatively enough), Audio Recorder.

Recorder Screenshot
Recorder Screenshot

Using a simple connection to the mic input on a USB soundcard, I can capture everything the radio hears. Unfortunately this doesn’t work for outgoing audio, so it’s not much good at capture of my personal QSOs. For this I will have to set up another radio to act as the main receiver.

At some point in the future I will implement this with a Raspberry Pi as the audio capture server.

Posted on Leave a comment

NCR Receipt Printer Script

Just a short script to directly print files to the NCR 7197 Series printers under Linux as there is no direct driver. Certainly not finished or pretty, but functional.

#/bin/sh
###Depends on fmt & iconv for file formatting for printer to operate correctly. Also expects UTF-8 encoded text files.

if [ "$1" == "--help" ];
    then
		echo "NCR 7197 file printing Script"
		echo "Usage:"
		echo "./ReceiptPrinter.sh <FILE> <SERIAL PORT NUMBER>"
		echo "To trim paper off, pass --cut parameter with port number instead of file name."
		echo "This script is currently set up for USB Connection of the printer"
		echo "Make sure your user has access to the serial port you intend to use,"
		echo "otherwise an error will occur"
		echo "This script uses fmt & iconv to format the provided text file for the printer."
		echo "This is 44 characters wide, word wrap enabled & format conversion to US English"

	else
		if [ "$1" == "--cut" ];
			then
				echo -e "\x1B\x07\x1D\x56\x41\x06" > /dev/ttyUSB$2
				echo "Scissor Operated"
				exit 0
	else
		if [ ! -z "$1" ];
			then
				cat $1 | fmt -w 44 | iconv -f UTF-8 -t ISO-8859-1//TRANSLIT > /dev/ttyUSB$2
				echo -e "\x1D\x56\x41\x06" > /dev/ttyUSB$2
				echo "Print Complete"
				exit 0
			else
			echo "No File provided!!! Returning to shell!"
			fi	
		fi
	fi
exit 0