Solved: Reading ASCII PLC data from a usb/serial connection
Hi there, I've been commissioned to write an embedded Linux component of a larger, more complicated machine and I'm having real trouble reading data from an Automation Direct "Click" PLC.
The PLC was programmed by someone-not-me to send an ASCII string over a serial connection every time a button was pushed. My code would then read said data from the serial connection and do a bunch of interesting stuff. The PLC is doing its job, because if I connect a Windows laptop to the serial-to-usb cable and connect to it with Putty, I see the aforementioned output. The trouble comes when I try this with Linux. Using the very same settings are were used on the Windows machine, I only *sometimes* see the output. I'm at the end of my rope here and I'm coming up empty. I've tried using minicom, which insists that I'm always "Offline", and I've written a simple Python script to use the same settings with the same results. The settings I'm using are: Code:
ser = serial.Serial( In terms of modules, I've made sure that there are no modules loaded, and then I run the following: Code:
modprobe usbserial vendor=0x067b product=0x2303 So, that's all I have... please tell me that someone out there understands what I'm doing wrong? |
Figured it out
Turns out that you don't always need to pass arguments to usbserial as I have above. I thought you did since usbserial was being used by another device on this machine and that one did need the extra arguments. Providing them in this case seems to just have broken it :-(
To make it work, all I had to do was make sure that no related modules were loaded and then run: Code:
modprobe pl2303 |
All times are GMT -5. The time now is 08:06 AM. |