USB Serial Drivers package

All discussions/development regarding the Intel D510 Chip can be placed here.
lebovitz
Experienced
Experienced
Posts: 139
Joined: Sun Oct 30, 2011 9:49 am

USB Serial Drivers package

Postby lebovitz » Sun Mar 16, 2014 9:54 pm

Hi,

Since we have a long thread on pl2303 drivers, and every time a new DSM version gets out people ask me for new drivers for either pl2303 or c210x etc', I've decided to create an SPK package.

This package will ask you during installation, which drivers you need (general, FTDI_SIO, PL2303, C210x), and will install the necessary drivers according to your DSM version and NAS type. Notice that you always need the "general" driver.

I currently support all DSM-4.3 versions and DSM-5.0.

The package supports the following CPU architectures:
x86 cedarview bromlow evansport 88f6281 88f6282 armadaxp qoriq ppc853x armada370

The package will determine by itself the DSM version and CPU type and will install the proper drivers.

You don't need to update any file (i.e. /etc/rc.local). The package will update /etc/rc.local and keep a backup of the original /etc/rc.local that will be restored when the package in uninstalled. It will also create its own startup file under /usr/local/etc/rc.d that loads automatically when system boots.

I tested it on cedarview machine (DS412+), I'd appreciate if people could test it under other machines as well.
I promise to make every effort that once Synology releases new kernel source, I'll update the package.

Package can be obtained from here: http://lebovitz.co.il/SPK/UsbSerialDrivers_3.0.2.spk

If someone wants older DSM versions support or other CPUs please let me know
Last edited by lebovitz on Wed Dec 17, 2014 9:30 pm, edited 7 times in total.
HanHel
I'm New!
I'm New!
Posts: 5
Joined: Thu Oct 10, 2013 3:10 pm

Re: USB Serial Drivers package

Postby HanHel » Wed Mar 19, 2014 6:57 pm

Great idea ... - Thanks.
However I'm running into problems when trying to install your package(DS1820+, DSM 5.0-4458). I get an error message about my os build not being supported (or something similiar). Looking at the contents of your install package it looks like your link to the driver subdirectory for this DSM version got the wrong name. Having patched the package myself I now run into another problem....
When I try to install my patched version it tells me to uninstall the already installed version first. However that fails with a simple error message (probably because the original install failed and the package did not really get installed in the first place ...

Kind regards,
Hanno
lebovitz
Experienced
Experienced
Posts: 139
Joined: Sun Oct 30, 2011 9:49 am

Re: USB Serial Drivers package

Postby lebovitz » Thu Mar 20, 2014 6:36 pm

Hi HanHel,

I fixed the first issue, and the package is updated.

What is the error you get when trying to install?

What does this command return when you run it:
lsmod | grep '^cp210x\|^ftdi_sio\|^pl2303' | awk '{ sum += $3 } END { print sum }

Do you see the package in the package center?
If not - just remove the following:

/volume1/@appstore/UsbSerialDrivers
/var/packages/UsbSerialDrivers
/usr/local/etc/rc.d/UsbSerialDrivers.sh

then try to install again
HanHel
I'm New!
I'm New!
Posts: 5
Joined: Thu Oct 10, 2013 3:10 pm

Re: USB Serial Drivers package

Postby HanHel » Fri Mar 21, 2014 12:11 am

Actually I had already manually removed the package files from /var/packages/UsbSerialDrivers and after that was able to install the patched version of your install package. Next problem I ran into was that my default install volume was volume2(no idea why) and your package only works on volume1. After fixing that I got the package installed. However now I did end up in boot loop where the diskstation would boot up and I would be able to connect using SSH but shortly afterwards it would just suddenly reboot. After playing around with it for a while and deinstalling/installing the files manually I finally seemed to have it working( the pl2303 seemed to connect to ttyUSB0 correctly) however I was not able to get my UPS connected. Since the crashes/reboots lead to the diskstation starting a resync of the raid I finally called it a day and deleted/restored everything to it's original state. Since there are quite a few disks connected to the DS the resync will take a few days after which I might try again....
I also noticed that when installing your package it allows for specifically selecting/deselecting the usbserial.ko driver - not sure this is advisable since this driver is allways needed if you install any of the other. Anyone having more than one USB2Serial converter would also need to edit the load_usb.sh file which you create during installation to allow for the creation of the corresponding /dev/ttyUSBx nodes.
Anyone trying this package out before it's confirmed to work without flaws for their system should make sure they've got (internal) SSH access enabled .... ;-)
lebovitz
Experienced
Experienced
Posts: 139
Joined: Sun Oct 30, 2011 9:49 am

Re: USB Serial Drivers package

Postby lebovitz » Fri Mar 21, 2014 8:07 am

I tried it a lot of times on my DS-412+ running 4.3-3810

As I said in the first post - I'm not sure the Synology source code for DSM-5.0 final is the same one as they published for the Beta.

Did you have PL2303 running on your DSM-5.0 final installation before?

Also - did you remove any configurations from the etc/rc.local file?
You might be trying to load the kernel twice.

I've fixed both issues:
- UsbSerial.ko will always load. User has no option to select/deselect it.
- Package will check on which volume it's installed and will update the startup script accordingly.

The package works great for me.
What I think might be the problem is that your UPS module is trying to load itself before the pl2303 driver was loaded. How is your UPS module loaded? Through the Synology UPS GUI?
I'm not sure of the startup sequence. If /usr/local/etc/rc.d files are loaded after /usr/syno/etc/rc.d files then this might be the root cause.
HanHel
I'm New!
I'm New!
Posts: 5
Joined: Thu Oct 10, 2013 3:10 pm

Re: USB Serial Drivers package

Postby HanHel » Fri Mar 21, 2014 5:53 pm

I had the PL2303 running with my UPS under DSM 4.3 without any problems but obviously Synology might have changed something ind the UPS support in DSM 5.0 - I did not check that yet.
For testing the UPS connection I used the ups.sh script, when you get a connection there the UPS GUI will also work.
As mentioned in my earlier post I finally did get the drivers installed (without the reboot issue) however I did not immediatley get it to work with the UPS and then decided to wait for the raid to resync. To be on the safe side (and in a known state ) I also did a complete rollback. I'll try the new version of your package once the resync is done.

Btw. it looks like Synology updated their sources to include DSM 5.0 Release Version earlier today ...

Thanks for your work on this package so far.
lebovitz
Experienced
Experienced
Posts: 139
Joined: Sun Oct 30, 2011 9:49 am

Re: USB Serial Drivers package

Postby lebovitz » Sun Mar 23, 2014 12:14 am

Hi,

When you had your UPS working, where exactly did you load the USB serial modules?
Was it in rc.local file or somewhere else?

I've updated the package to include the updated Synology source drivers for DSM 5.0-4458 (final).
HanHel
I'm New!
I'm New!
Posts: 5
Joined: Thu Oct 10, 2013 3:10 pm

Re: USB Serial Drivers package

Postby HanHel » Sun Mar 23, 2014 6:10 am

Good News - I downloaded the last version of your package and it installed without a glitch!
I was then able to connect to my UPS using the pl2303 driver. So I can confirm now that this package works on a DS1812+ with DSM 5.0-4458(final).

- while testing I restarted the UPS driver manually so the sequence was not a problem - However during normal boot /usr/local/etc/rc.d files are loaded after /usr/syno/etc/rc.d so the driver is not yet loaded when needed - as a quick fix I just run another script doing a ups restart after your script has completed.

Again thanks for compiling the drivers/creating the package - it's appreciated.
lebovitz
Experienced
Experienced
Posts: 139
Joined: Sun Oct 30, 2011 9:49 am

Re: USB Serial Drivers package

Postby lebovitz » Sun Mar 23, 2014 7:38 am

Great. Thanks for the effort you invested for helping me fix the bugs. :D

Is /etc/rc.local file loaded before /usr/syno/etc/rc.d ?

If so, I'll change the call to load the modules to edit /etc/rc.local file.

I didn't want to do this initially as each user might have a different rc.local file, which means that if I edit this file I might break something in the user setup. The way things are now, the package is more "standalone".

What's your opinion?
Again - you might have the capabilities to alter and add scripts to load UPS after driver is loaded, the whole idea of the package is to help people who don't know how to do that...
Commandeur
I'm New!
I'm New!
Posts: 5
Joined: Wed Apr 02, 2014 6:45 pm

Re: USB Serial Drivers package

Postby Commandeur » Wed Apr 02, 2014 6:58 pm

Hi lebovitz,

Today I tried to obtain your UsbSerialDivers.spk directly via the package centre of DSM 4.3 but I get an error message that this is not a valid location.
Is it still there?
And most important will it work (contain the DSM 4.3 drivers) for the DS212j (MV6281 ARM Marvel Armada 300) and a ch341.ko file?
Please let me know
lebovitz
Experienced
Experienced
Posts: 139
Joined: Sun Oct 30, 2011 9:49 am

Re: USB Serial Drivers package

Postby lebovitz » Wed Apr 02, 2014 10:55 pm

Hi,

First of all, I can download the file from the link above.

The package however is currently only for Intel based devices.
I can compile it also for Marvell based NAS, but as I don't have time this week, it'll have to wait for next week.

Also - not sure what is the ch341.ko file. Usually the files I compile are:
usbserial.ko, pl2303.ko, ftdi_sio.ko and c210x.ko

I can look for the driver file you need when I compile the drivers. What is this driver used for?
Commandeur
I'm New!
I'm New!
Posts: 5
Joined: Wed Apr 02, 2014 6:45 pm

Re: USB Serial Drivers package

Postby Commandeur » Thu Apr 03, 2014 1:59 pm

Thanks for your quick reply. Via the Package Center in the menu of my Synology DS212j (DSM 4.3-3827) I tried to add a new spk location to obtain the UsbSerialDrivers.spk (name ‘UsbSerialDrivers’ + location ‘http://lebovitz.co.il/SPK’) but I get the error ‘not a valid location’. If I download it directly it seems to be not a .spk file but a .tar file.

After your reaction I saw that your solution is for Intel-based Nas, but it would be great if you can compile it to the Marvel Based NAS type I mentioned.
I need a usbserail.ko and ch341.ko. The ch341.ko is for 2 (cheap) USB Serial converters to connect a Mastervolt Soladin 600 Inverter (solar panels) it uses a ch341 Winchiphead chip.

And…. I can wait for next week. Thanks before!
lebovitz
Experienced
Experienced
Posts: 139
Joined: Sun Oct 30, 2011 9:49 am

Re: USB Serial Drivers package

Postby lebovitz » Sun Apr 06, 2014 5:56 pm

Hi,

I've updated the package to include drivers for DSM 4.3 for Marvell 88f6281 devices.
These drivers include the CH341 drivers too.

Please tell me if this works for you.
You need to download the package from the path above and do manual install.

I still need to figure out how to make this path a searchable path so you will get automatic updates when I update the package...
Commandeur
I'm New!
I'm New!
Posts: 5
Joined: Wed Apr 02, 2014 6:45 pm

Re: USB Serial Drivers package

Postby Commandeur » Wed Apr 09, 2014 12:42 pm

Hi,
Thanks for the usbserail.ko and ch341.ko files. I have placed them in a directory I named /opt/lib/modules/2.6.32/
I have used the command 'insmod /opt/lib/modules/2.6.32/usbserial.ko' and the same for ch341 to load them.
After that I used the command 'mknod /dev/soladin/ttyUSB0 c 188 0' and the same for ttyUSB1 c 188 1
The usb serial driver seems now to be installed and registered the same as with the DSM 4.1 version I have checked that with dmesg.

My .sh file contains the command lines 'PORT0=/dev/soladin/ttyUSB0' and PORT1=/dev/soladin/ttyUSB1'
But when I run it I get an error message /dev/soladin/ttyUSB0:No such device and the same for ttyUSB1 device.
With the old DSM 4.1 this worked fine without errors for DSM 4.1. I don't know what I am doing wrong.

Maybe its because in DSM 4.3 there are already ttyUSB0 and ttyUSB1 files in the /dev directory and /dev/usb directory
when I search for a usbserial.ko file there is already one that came with DSM 4.3 in the directory /lib/modules. Maybe I have to use that one?

I don't know what I did wrong or what I can do to solve it. Do I need other usb-serial converters?
lebovitz
Experienced
Experienced
Posts: 139
Joined: Sun Oct 30, 2011 9:49 am

Re: USB Serial Drivers package

Postby lebovitz » Thu Apr 10, 2014 1:26 pm

Hi,

1. Don't use the usbserial that came with the release. Anyway you're not loading it, so it shouldn't cause a problem.
2. My package also installs a script that loads the modules and creates /dev/ttyUSB0. This script is loaded at startup. script location is at /usr/local/etc/rc.d/...

Besides that I don't know what else might cause this.
Remember I can't test these drivers on my NAS, so I'm pretty much limited here.

Return to “Intel D510 Development Room”

Who is online

Users browsing this forum: No registered users and 1 guest