As you may know (hence why you may have arrived on this page) accomplishing the above is not as straightforward as it is on a Windows computer, for instance; it’s certainly not as “plug and play”, so to speak. Below is a helpful guide/summary of the steps that need to be taken in order to get going with this task, and a list of resources for both initial understanding and further reading.
NOTE: While the IDWedgeKB is compatible with Mac OS X as a barcode scanner, its flash drive mode is only accessible via Windows OS; as such, if you need to configure/re-configure your IDWedgeKB and wanted to do so on Mac OS X — you will need to install a Windows Virtual Machine to do so. Please see this page for instructions on how to do that.
There are at least (3) methods of getting a Macbook to first recognize and then work with serial port events (input/output), and be able to view the results of said events:
This guide will focus exclusively on the first two methods listed above, with the Node.js — node package manager (NPM) — serialport method to be described in a subsequent guide.
Serial Application method to be expanded/added at a later date**
Please note —
This guide assumes that the IDWedgeKB is configured to be connected via serial port mode. However, if yours is not, as noted above — please see instructions for how to do that here
It is likely that you may have trouble finding your serial port device in the same manner that you would via the Windows platform;
So, to test that the IDWedgeKB is both connected properly in Serial Port mode and that you will be able to work with the device in Serial Port mode — you have a few options —
via Terminal
To start, open up a terminal window via Finder (cmd + spacebar) — Then you have (2) options —
Option A
You can find (read: list via the ls command) your IDWedgeKB via Terminal with:
This accesses the devices folder — /dev and /tty represents teletype emulation and serial port devices — the .* represents the prefix attached to all of the relevant devices and selects them all
Option B
You can verify the device is connected and recognized via the I/O Registry — which is a dynamic database that describes a collection of “live” objects (nubs or drivers) and tracks the provider-client relationships between them. When hardware is added or removed from the system, the registry is immediately updated to reflect the new configuration of devices.
This lists the devices currently connected via USB
Same as the above command, but with additional flags (e.g. -l, -b) provides the device names in bold and lists additional devices/connection details
After taking either/both of the above steps and confirming device recognition, it is time to actually start working with your IDWedgeKB — see below
As per Stack Exchange:
“You can use the terminal command screen to do this!!!”
Next, you can read that serial port using the screen command like this —
(see above link to the man page for what this is doing/how it works)
For Example:
(Baud Rate appears to be optional with the above command)
NOTE:
The above screen command should render your existing terminal window blank, signifying that you can now interface with your IDWedgeKB.
This behavior is expected.
Like this —
Try scanning an ID card to see the data captured similarly to the below screenshot —
(in text format, via comma separated values)
Driver’s license information — field values, corresponding the IDWedgeKB formula configuration, comma separated
When you are finished, press ctrl a + k
This will prompt you in the bottom-left of the window to confirm [y/n] if you want to exitUpon confirming yes, your terminal will revert to its previous “normal” mode.
Although it is advisable to perform the above process manually at least once (ideally, twice), If you don’t want to perform the previous steps manually, and/or if you don’t want to have to subsequently manually replicate them, then you can utilize the below AppleScript as a basic template for automating at least some of this process.
As per the same Stack Exchange post as shown above:
“Or, if you prefer Mac OS X hints…
I often have to do router configuration via a console port, so I use a Keyspan Serial Adapter to get access. Two problems then present themselves: ZTerm is a horrible Mac OS X app. It hasn’t been updated in five years or so, and isn’t a Universal Binary. The developer doesn’t seem in any hurry to rectify the situation. It is not worth the shareware fee in its current form. Minicom requires installation of Fink or MacPorts and is overly complex.
Solution: Use screen, Terminal, and a little AppleScripting.
First, launch Script Editor and type/paste in the following code:
Compile and save as an app from within Script Editor, and you have a double-clickable application to launch a serial Terminal session. You may want to customize this slightly — you can change the screen colors or number of columns or rows. You may also need to customize the screen command with a different device name if you are using something other than the Keyspan Serial Adapter (do an ls tty* of the /dev/ directory to get the right name).
screen uses Control-A to take commands directed to it. So type Control-A followed by Control-\ to exit your screen session. If you fail to do this and exit a Terminal session, you’ll leave the screen session alive and the serial resource unavailable until you kill the screen session manually. man screen will show you further commands to send to a screen session.”
Download and install the application at either of the above listed links. Once that is complete open CoolTerm and you will see the following screen —
From here double-click on the serial port connector icon labeled ‘CoolTerm’
NOTE: You shouldn’t simply click Connect listed at the top of the current window.It is very possible that the device the application defaults to is not the one you want to work with.
If the above is the case, You will likely get an error message along the lines of:
“An error occurred while attempting to open the port. 100: Access Denied”
Instead —
Take note of the device information listed in the bottom-left corner
If the device information does not match the IDWedgeKB (you may see ‘Bluetooth-Incoming-Port’ and/or various wirelessly connected devices) then you may receive an error, or at least not get your desired result. Navigate to the Options pane, at the top of the CoolTerm application window, to perform some configuration steps as you see below —
You will then find yourself in the Serial Port Options section of the application. Click on the Port dropdown menu to find and select your IDWedgeKB (possibly listed as usbmodemKINETIS1)
Here there are numerous options you can configure (e.g. BaudRate, Data Bits) as well.
There is also a sidebar with the following additional options sections:
Once you’re satisfied with the configuration options you’ve selected press OK
Finally, back in the original application window it’s time to press Connect
You should see your device listed in the bottom left with the word Connected — along with a running timer of how long the connection has been open/established
Try scanning an ID card to see the data captured in either ASCII format or hexadecimal format —
in (ASCII) text format, via comma separated values
in (hexadecimal) format, via comma separated values
NOTE: There are options in the Receive section of the Options pane as well as listed at the top of the main application window — to capture the data in hexadecimal format and toggle between hexadecimal and ASCII
When finished simply click the Disconnect button beside the Connect button, and you will see the device connection timer disappear and the word Disconnected (both in the bottom-left)
From this Stack Exchange post:
“There’s a new Mac app called Serial, available in the app store. Full disclosure- I wrote it. The main advantage over other apps is it can work with most USB to serial devices without having to install any drivers, as it has its own drivers built-in. It also does full terminal emulation, so you can use it to work with Linux or other devices that require it. You can try it for free, too.”
To be expanded at a later date*
———————
END OF GUIDE
I/O Registry Kit and interpreting the results of the ioreg command:
https://stackoverflow.com/questions/12254378/how-to-find-the-serial-port-number-on-mac-os-x#12260359
The above linked-to post features a more involved/advanced version of the ioreg command —