Opensourcetechブログ

OpensourcetechによるNGINX/Kubernetes/Zabbix/Neo4j/Linuxなどオープンソース技術に関するブログです。

ELECOM UC-SGTを Mac OS Xで使用出来るようにしてみる! (2017/12/21更新)

 

こんにちは、鯨井貴博@opensourcetechです。

 

 Macで使えるUSBシリアルコンソールが必要になったので、

家に転がっていたElECOM UC-SGTを使えるようにしてみます。

ちなみに既に販売終了してます。

USB to シリアルケーブル - UC-SGT

 f:id:opensourcetech:20170405014506j:plain

 

しかし、問題となったのがドライバー。

メーカーのサイトを見ても、windowsのみしかドライバー提供されていません。

ダウンロード(UC-SGT) - ELECOM WEB SITE!

 

夢と希望を持って(ダメモト)、Macに接続してみますが、

当然ですが使用することは出来ません。

 

という事で、Macでも使えるように頑張ってみました。

 

 

 まずはMacからどう見えているのかというと、

以下のようになっていました。

(ここまで見えてるなら動いてくれ!と思うのですが。。。)

f:id:opensourcetech:20170405020247p:plain

 

調べてみると、UC-SGTではPL2303というchipが使われており、

製造元のProlific Technologyのサイトから入手するドライバーに手を加えれば使えるようです。

 

http://www.prolific.com.tw/US/ShowProduct.aspx?p_id=229&pcid=41

Products

早速、上記からPL2303_MacOSX_v1.5.1_20160309.zipをダウンロードします。

 

zipなので、解凍してインストールします。

 

file /System/Library/Extensions/ProlificUsbSerial.kext/Contents/MacOS/ProlificUsbSerialの出力をみるとx86_64とあるので、64bitにも対応しているようです。

f:id:opensourcetech:20170405020334p:plain

 

続いて、/System/Library/Extensions/ProlificUsbSerial.kext/Contents/にあるInfo.plistを編集します。(sudo vi)

 

変更内容は、以下の通り。

-------
43行目  <key>056E_5003</key>
56行目  <integer>20484</integer>
58行目  <integer>1390</integer>
60行目   <key>056E_5004</key>
73行目   <integer>20484</integer>
75行目   <integer>1390</integer>

※ProcudtID(0x5004=20484)、VendorID(0x056e=1390)

 

Info.plistの全体は、以下のようになります。

※以下のGithubへアップしました。(2017/12/21)

github.com

-------

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>BuildMachineOSBuild</key>
    <string>10K549</string>
    <key>CFBundleDevelopmentRegion</key>
    <string>English</string>
    <key>CFBundleExecutable</key>
    <string>ProlificUsbSerial</string>
    <key>CFBundleGetInfoString</key>
    <string>ProlificUsbSerial v1.5.0, Copyright 2013 Prolific Technology Inc.</string>
    <key>CFBundleIdentifier</key>
    <string>com.prolific.driver.PL2303</string>
    <key>CFBundleInfoDictionaryVersion</key>
    <string>6.0</string>
    <key>CFBundleName</key>
    <string>Mac OS X Driver for Prolific USB-to-Serial Bridge Device</string>
    <key>CFBundlePackageType</key>
    <string>KEXT</string>
    <key>CFBundleShortVersionString</key>
    <string>1.5.1</string>
    <key>CFBundleSignature</key>
    <string>????</string>
    <key>CFBundleVersion</key>
    <string>1.5.1</string>
    <key>DTCompiler</key>
    <string>com.apple.compilers.llvm.clang.1_0</string>
    <key>DTPlatformBuild</key>
    <string>10M2518</string>
    <key>DTPlatformVersion</key>
    <string>PG</string>
    <key>DTSDKBuild</key>
    <string>10M2518</string>
    <key>DTSDKName</key>
    <string>macosx10.6</string>
    <key>DTXcode</key>
    <string>0400</string>
    <key>DTXcodeBuild</key>
    <string>10M2518</string>
    <key>IOKitPersonalities</key>
    <dict>
        <key>056E_5003</key>
        <dict>
            <key>CFBundleIdentifier</key>
            <string>com.prolific.driver.PL2303</string>
            <key>IOClass</key>
            <string>com_prolific_driver_PL2303</string>
            <key>IOProviderClass</key>
            <string>IOUSBInterface</string>
            <key>bConfigurationValue</key>
            <integer>1</integer>
            <key>bInterfaceNumber</key>
            <integer>0</integer>
            <key>idProduct</key>
            <integer>20484</integer>
            <key>idVendor</key>
            <integer>1390</integer>
        </dict>
        <key>056E_5004</key>
        <dict>
            <key>CFBundleIdentifier</key>
            <string>com.prolific.driver.PL2303</string>
            <key>IOClass</key>
            <string>com_prolific_driver_PL2303</string>
            <key>IOProviderClass</key>
            <string>IOUSBInterface</string>
            <key>bConfigurationValue</key>
            <integer>1</integer>
            <key>bInterfaceNumber</key>
            <integer>0</integer>
            <key>idProduct</key>
            <integer>20484</integer>
            <key>idVendor</key>
            <integer>1390</integer>
        </dict>
    </dict>
    <key>OSBundleLibraries</key>
    <dict>
        <key>com.apple.iokit.IOSerialFamily</key>
        <string>1.0.4</string>
        <key>com.apple.iokit.IOUSBFamily</key>
        <string>1.8</string>
        <key>com.apple.kpi.iokit</key>
        <string>10.2.0</string>
        <key>com.apple.kpi.libkern</key>
        <string>10.2.0</string>
        <key>com.apple.kpi.mach</key>
        <string>10.2.0</string>
    </dict>
</dict>
</plist>

 

sudo touch /System/Library/Extensions/

そして、Mac OS X を再起動します。

 

起動後、UC-SGTを接続し、

/dev/tty.usbserialがある事が確認出来ればOKです。

 

UC-SGT接続前

f:id:opensourcetech:20170405020547p:plain

UC-SGT接続後

f:id:opensourcetech:20170405020550p:plain


ターミナルからscreen /dev/tty.usbserialとして

バイスとの接続も問題なく、Okでした。

f:id:opensourcetech:20170405111326p:plain

 

 

 

 

にほんブログ村 IT技術ブログ Linuxへ
Linux

にほんブログ村 IT技術ブログ オープンソースへ
オープンソー

Opensourcetech by Takahiro Kujirai