OpenWrt Forum Archive

Topic: Problem with pl2303X USB to RS485 commector on WR703n

The content of this topic has been archived on 17 Apr 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

Hi,

I have installed OpenWrt on a TL-WR703n with the intention of using aurora to monitor my solar panel output. The USB to RS485 connector I am using uses the pl2303 chipset. I have installed kmod-usb-serial-pl2303 and can see the adaptor yet it does not seem to communicate correctly. If I connect my laptop to the device I can communicate with my inverter so I can eliminate the USB to RS458 device or my wiring as an issue.

If I run aurora in verbose mode it appears to be talking to the USB device happily, but failing to read any data back.

root@OpenWrt:~/aroura_files# ./aurora -v -a2 -e /dev/ttyUSB0
20130605-23:05:01: aurora: No response after 1 attempts
20130605-23:05:02: aurora: ERROR: Received bad return code (-1 0)
root@OpenWrt:~/aroura_files# ./aurora -verbose -a2 -e /dev/ttyUSB0

szttyDevice: /dev/ttyUSB0
yDelay:     1
yTimeout    0 mS
yMaxRunTime ~
devLCKfile: </var/lock/LCK..ttyUSB0>
devLCKfileNew: </var/lock/LCK..ttyUSB0.1670>
Got Params

RunTime 20130605-23:05:12 v1.8.3
Endian : Big
PID : 1670

Attempting to get lock on Serial Port /dev/ttyUSB0...
Checking for lock

Checking process 1670 for lock
rPID: 1670 SubStrPos: aurora command: ./aurora = me
Appears we got the lock.

Opening Serial Port /dev/ttyUSB0...  Serial Port /dev/ttyUSB0 successfully opened.
Configuring serial device... Flushing unread data first...  Success!
Flushing serial device buffer... Success!

Comm Check: Let's see if the Aurora is listening...
Elapsed time since last comm 0 us
Attempt 1
Clearing read buffer Success!
szSerBufferSave OK! 02 3a 00 00 00 00 00 00 00 00
command: 02 3a 00 00 00 00 00 00 01 b7
Flushing serial device buffer... Success!
Sending command... sent 10 characters
Draining serial device buffer... Success!
Cleared data buffer: 00 00 00 00 00 00 00 00 00 00
Read char #1 RC=0 (00) waited/max    95914/1000000  uS
answer:  Got -1 characters
Comm Check: Failure, aborting...

Restoring Serial Port settings /dev/ttyUSB0... Success!
Flushing serial device buffer... Success!
Closing Serial Port /dev/ttyUSB0... Success!

devLCKfile: </var/lock/LCK..ttyUSB0>
devLCKfileNew: </var/lock/LCK..ttyUSB0.1670>
Clearing Serial Port Lock (1670)... done.

20130605-23:05:13: aurora: ERROR: Received bad return code (-1 0)

Complete 20130605-23:05:13

root@OpenWrt:~/aroura_files#
root@OpenWrt:~# uname -a
Linux OpenWrt 3.3.8 #1 Sat Mar 23 16:49:30 UTC 2013 mips GNU/Linux
root@OpenWrt:~/aroura_files# lsusb -v -s2

Bus 001 Device 002: ID 067b:2303 Prolific Technology, Inc. PL2303 Serial Port
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               1.10
  bDeviceClass            0 (Defined at Interface level)
  bDeviceSubClass         0
  bDeviceProtocol         0
  bMaxPacketSize0        64
  idVendor           0x067b Prolific Technology, Inc.
  idProduct          0x2303 PL2303 Serial Port
  bcdDevice            3.00
  iManufacturer           1 Prolific Technology Inc.
  iProduct                2 USB-Serial Controller
  iSerial                 0
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength           39
    bNumInterfaces          1
    bConfigurationValue     1
    iConfiguration          0
    bmAttributes         0x80
      (Bus Powered)
    MaxPower              100mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           3
      bInterfaceClass       255 Vendor Specific Class
      bInterfaceSubClass      0
      bInterfaceProtocol      0
      iInterface              0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x81  EP 1 IN
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x000a  1x 10 bytes
        bInterval               1
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x02  EP 2 OUT
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0040  1x 64 bytes
        bInterval               0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x83  EP 3 IN
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0040  1x 64 bytes
        bInterval               0
Device Status:     0x0000
  (Bus Powered)
root@OpenWrt:~/aroura_files#

I believe "bMaxPacketSize0        64" indicates the chip-set is the 2303X variant. Is the 2303X varient supported, or does anyone have any suggestions as to what the issue may be ?

Thanks in advance.

Hi,

Any success with this setup? I'm planning to buy the same device for exactly the same purpose, so I'm a bit scared that there was no answer in this tread.

And by the way, did you find the aurora package for openwrt, or did you have to compile it?

Thanks,

(Last edited by neostorm on 2 Oct 2013, 16:06)

I tried a different device which didn't use the X variant of the chip-set this works fine so I concluded the original device wasn't supported.

If you have the time to modify the prolific drivers a quick google will provide the changes needed.

Hi!

Can I ask what's your actual setup?

I've two aurora connected with daisy chain rs485 and I want to monitor with an openwrt solution.
I'm thinking about an openwrt router with two usb port running aurora logger (I need to recompile it?), usb memory to store logged data (next I will try to push over pachube or similar), running a php webserver with 123solar.
I'll plan to use an ftdi based usb/rs485 converter (I see ther's a kmod package for ftdi).

But I'm a beginner with openwrt.. so I need some help.
Can yoiu help me?

I have an Aurora one inverter, connected to the WR703 via a pl2303 device. I'm running the aurora software package to query the inverter and uploading that directly to pvoutput.org with a simple script.

Hi,
I can't find the aurora package in the openwrt repository.
Did you have to compile it?

Thanks

Hi,
how can I know which is the chipset used for rs232/usb converter?

Where can i find aurora binary for openwrt on HG553? I have 1.8.5 sources but I don't know how to compile for my openwrt router.

Please help me smile

Thanks
Alex

(Last edited by aleics on 21 Oct 2013, 22:03)

Hi again,
I find chipset and installed it but now I don't know how to compile aurora on openwrt for HW553.
Can you help me?

Thanks again

The discussion might have continued from here.