TrendNet TU-S9 RS232 / USB and OS X

I recently bought a TrendNet TU-S9 USB to RS232 converter. I need to talk with microcontrollers that use RS232 at 9600 baud. The code I have for Linux works fine. I installed the drivers according to the instructions on my laptop and Mac Mini running OS X 10.6.7. I changed the device to /dev/cu.usbserial.

This is what happens. Of course, it looks like communication will work the first time I try. But if I exit the process, I can no longer write to the serial device. If I disconnect the USB connection and reconnect it, I can go again. That is, it looks like plugging in a USB connector is what is needed so that things reset can be used.

When I get an error, the second time I try to start the process, I can open this device, but the error occurs the first time when I try to send a byte via the serial interface. The error from perror is "Serial: there is no such file or directory."

I can work around this problem by writing a second program that simply opens the cu.usbserial device, and then cyclically forever. This does not seem to be the best way to fix this.

Has anyone seen this behavior? Can anyone repeat it? Does anyone know how to fix this?

Note: this may be due to a previous message programmatically talking to the serial port in OS X or Linux , or it may not be so.

Eric

+6
source share
1 answer

I don’t have an answer to what you know for sure, but I had a problem with the TU-S9 working with my MacBook Pro today. I have a new MBP 2011 running 10.6.7. I installed the drivers from TrendNet and the device appeared in my system profiler as a Prolific USB serial adapter, but the device was not available with any of my terminal programs (zterm and goSerial).

Later, I discovered that I needed to actually download the latest drivers from Prolific directly from http://prolificusa.com/pl-2303hx-drivers/ (md_PL2303_MacOSX10.6_dmg_v1.4.0.zip). As soon as I installed the latest drivers and rebooted, it worked perfectly.

In / dev, I had cu.usbserial and tty.usbserial. I managed to access the terminal using any of them using the command "screen tty.usbserial 9600" (it also worked from zTerm)

Hope this helps someone!

+19
source

Source: https://habr.com/ru/post/887974/


All Articles