enable/disable usb ?

Anything related to hardware modding of the Synology Disk Station, including modifying the RAM, or changing the color scheme of the Disk Station and others.
Forum rules
Please note the disclaimer before modifying your Synology Product.

enable/disable usb ?

Postby olivier57 » Sat May 19, 2012 1:48 pm

Hi,

Would it be possible to build a command (script, java...) to enable/disable 5v alimentation for one of the USB plugs ?

Thanks,

Olivier
olivier57
Novice
Novice
 
Posts: 55
Joined: Sat Mar 20, 2010 10:08 am

Re: enable/disable usb ?

Postby olivier57 » Sun May 27, 2012 5:00 pm

Well, no answer ? Nobody knows ?
olivier57
Novice
Novice
 
Posts: 55
Joined: Sat Mar 20, 2010 10:08 am

Re: enable/disable usb ?

Postby myCloud » Sun May 27, 2012 5:47 pm

I think many, if not most, of us had to lookup the word, "alimentation." :lol:

What is it you want to do? Turn 5V power on and off?
DS 1512+ w/3GB, 5 x 3TB Seagate ST3000DM001 8.2TB RAID 6, half files/half Time Machine.
Icy Dock MB559U3S-1SB enclosure w/4TB Hitachi UltraStar via USB 3 for files backup
UVERSE to AirPort Extreme + 2 AirPort Express w/speakers. TRENDnet TV-IP312WN camera
CyberPower CP1500PFCLCD Sine Wave UPS
DSM 4.1-2661 w/SSH + SFTP, VPN Server, Syslog Server, Media Server, Mail Server, Mail Station,
Audio Station, Surveillance Station, Photo Station, Web Station - DS Apps on iPad & iPod Touch.
User avatar
myCloud
Skilled
Skilled
 
Posts: 648
Joined: Fri Mar 23, 2012 11:28 am

Re: enable/disable usb ?

Postby olivier57 » Sun May 27, 2012 5:58 pm

;-))) So sorry, thanks, I didn't notice my mistake.... I didn't want to feed my Syno, you're right, I wanted to switch on and off power of a given usb port in order to control an external relay.
olivier57
Novice
Novice
 
Posts: 55
Joined: Sat Mar 20, 2010 10:08 am

Re: enable/disable usb ?

Postby myCloud » Sun May 27, 2012 6:23 pm

Perhaps this might help.
DS 1512+ w/3GB, 5 x 3TB Seagate ST3000DM001 8.2TB RAID 6, half files/half Time Machine.
Icy Dock MB559U3S-1SB enclosure w/4TB Hitachi UltraStar via USB 3 for files backup
UVERSE to AirPort Extreme + 2 AirPort Express w/speakers. TRENDnet TV-IP312WN camera
CyberPower CP1500PFCLCD Sine Wave UPS
DSM 4.1-2661 w/SSH + SFTP, VPN Server, Syslog Server, Media Server, Mail Server, Mail Station,
Audio Station, Surveillance Station, Photo Station, Web Station - DS Apps on iPad & iPod Touch.
User avatar
myCloud
Skilled
Skilled
 
Posts: 648
Joined: Fri Mar 23, 2012 11:28 am

Re: enable/disable usb ?

Postby olivier57 » Sun May 27, 2012 6:47 pm

Thanks, yes, this is close to what I'm thinking about but what I want to control is the electric bolt of a gate. I found a product that could do the trick (see below) and will even work with Synology as there are ubuntu commands but I was thinking that if I can power on and of 5v, I can connect directly a relay to the usb port.

Thanks for your kind help,

Olivier

http://sigma-shop.com/product/72/web-internet-ethernet-controlled-relay-board-arduino-compatible-rs485-usb.html%20wic
olivier57
Novice
Novice
 
Posts: 55
Joined: Sat Mar 20, 2010 10:08 am

Re: enable/disable usb ?

Postby myCloud » Sun May 27, 2012 6:59 pm

Your link broke, but I found this. If I understand it correctly, the USB is only needed to program the board and after that, it uses a network connection. Am I wrong?
DS 1512+ w/3GB, 5 x 3TB Seagate ST3000DM001 8.2TB RAID 6, half files/half Time Machine.
Icy Dock MB559U3S-1SB enclosure w/4TB Hitachi UltraStar via USB 3 for files backup
UVERSE to AirPort Extreme + 2 AirPort Express w/speakers. TRENDnet TV-IP312WN camera
CyberPower CP1500PFCLCD Sine Wave UPS
DSM 4.1-2661 w/SSH + SFTP, VPN Server, Syslog Server, Media Server, Mail Server, Mail Station,
Audio Station, Surveillance Station, Photo Station, Web Station - DS Apps on iPad & iPod Touch.
User avatar
myCloud
Skilled
Skilled
 
Posts: 648
Joined: Fri Mar 23, 2012 11:28 am

Re: enable/disable usb ?

Postby olivier57 » Sun May 27, 2012 7:31 pm

I probably did a but cut/paste, the one I was thinking is this one :

http://sigma-shop.com/product/75/usb-4-relay-board-rs232-serial-controlled-pcb.html
olivier57
Novice
Novice
 
Posts: 55
Joined: Sat Mar 20, 2010 10:08 am

Re: enable/disable usb ?

Postby myCloud » Sun May 27, 2012 8:34 pm

It appears that after you get the FTDI Linux USB to serial drivers installed in DSM, there won't be any need to control the USB power. The board itself probably draws a small number of milliamps. All the control is done by writing a 3 byte sequence over the serial port -- no reading involved. It would be nice to have a visual indicator of whether the gate is latched or not though.
DS 1512+ w/3GB, 5 x 3TB Seagate ST3000DM001 8.2TB RAID 6, half files/half Time Machine.
Icy Dock MB559U3S-1SB enclosure w/4TB Hitachi UltraStar via USB 3 for files backup
UVERSE to AirPort Extreme + 2 AirPort Express w/speakers. TRENDnet TV-IP312WN camera
CyberPower CP1500PFCLCD Sine Wave UPS
DSM 4.1-2661 w/SSH + SFTP, VPN Server, Syslog Server, Media Server, Mail Server, Mail Station,
Audio Station, Surveillance Station, Photo Station, Web Station - DS Apps on iPad & iPod Touch.
User avatar
myCloud
Skilled
Skilled
 
Posts: 648
Joined: Fri Mar 23, 2012 11:28 am

Re: enable/disable usb ?

Postby olivier57 » Sun May 27, 2012 9:20 pm

Well, I'm not sure I understand. Do you mean that if I use kmtronic stuff, I won't be able to make it work immediately with a command like their example ?

#!/bin/bash
# sends on signal to the USB relay
echo -e "\xFF\x01\x01" > /dev/ttyUSB0

Do you mean that I would have to go thru this commands http://hallard.wikidot.com/synomodules

which looks rather complicated to me and could compromise the functioning of my synology ?

Do you mean that there is another way of doing so ?

edit : having a closer search, I'm afraid I would have to go thru ftdi drivers installation :-((
olivier57
Novice
Novice
 
Posts: 55
Joined: Sat Mar 20, 2010 10:08 am

Re: enable/disable usb ?

Postby myCloud » Sun May 27, 2012 10:08 pm

Amazingly, the USB class does not include a serial port. You need driver software for the chip in a USB to serial converter, while you don't with a device such as a USB soundcard, where the USB-compliant OS takes care of it. It would probably be productive contacting their support folks.
DS 1512+ w/3GB, 5 x 3TB Seagate ST3000DM001 8.2TB RAID 6, half files/half Time Machine.
Icy Dock MB559U3S-1SB enclosure w/4TB Hitachi UltraStar via USB 3 for files backup
UVERSE to AirPort Extreme + 2 AirPort Express w/speakers. TRENDnet TV-IP312WN camera
CyberPower CP1500PFCLCD Sine Wave UPS
DSM 4.1-2661 w/SSH + SFTP, VPN Server, Syslog Server, Media Server, Mail Server, Mail Station,
Audio Station, Surveillance Station, Photo Station, Web Station - DS Apps on iPad & iPod Touch.
User avatar
myCloud
Skilled
Skilled
 
Posts: 648
Joined: Fri Mar 23, 2012 11:28 am

Re: enable/disable usb ?

Postby olivier57 » Sun May 27, 2012 10:15 pm

Thanks for your help, I'll see if I carry on this way, I found different blogs going in the same direction...
http://www.bydavy.com/2012/01/compiling-linux-kernel-modules-for-synology-devices/

Getting rather complicated my basic idea to switch usb power on and off to ... feed the relay :lol:
olivier57
Novice
Novice
 
Posts: 55
Joined: Sat Mar 20, 2010 10:08 am

Re: enable/disable usb ?

Postby myCloud » Sun May 27, 2012 10:20 pm

Best wishes for a successful solution! :D
DS 1512+ w/3GB, 5 x 3TB Seagate ST3000DM001 8.2TB RAID 6, half files/half Time Machine.
Icy Dock MB559U3S-1SB enclosure w/4TB Hitachi UltraStar via USB 3 for files backup
UVERSE to AirPort Extreme + 2 AirPort Express w/speakers. TRENDnet TV-IP312WN camera
CyberPower CP1500PFCLCD Sine Wave UPS
DSM 4.1-2661 w/SSH + SFTP, VPN Server, Syslog Server, Media Server, Mail Server, Mail Station,
Audio Station, Surveillance Station, Photo Station, Web Station - DS Apps on iPad & iPod Touch.
User avatar
myCloud
Skilled
Skilled
 
Posts: 648
Joined: Fri Mar 23, 2012 11:28 am

Re: enable/disable usb ?

Postby olivier57 » Tue Jun 05, 2012 8:18 pm

Hi,

So it's ok, it works !

For those who want to drive external stuff with usb and relays, I recommend
- kmtronic products (I used http://www.sigma-shop.com/product/75/usb-4-relay-board-rs232-serial-controlled-pcb.html) and
- this page http://hallard.wikidot.com/synomodules that I followed to build the drivers. Thanks to Charles-Henri Hallard.

I would add a few comments to avoid some difficulties I encountered (but I'm Ubuntu newbie) :
install ncurse with "apt-get install ncurses-dev"
use "make arch/powerpc/lib/crtsavres.o" to avoid a file not found during "make modules"
use make -i as we just need the drivers and don't care if any problem elsewhere.

As a conclusion, I would appreciate if someone is able to explain me how this set of commands
mknod /dev/ttyUSB0 c 188 0
insmod /opt/lib/modules/2.6.32/usbserial.ko
insmod /opt/lib/modules/2.6.32/ftdi_sio.ko
insmod /opt/lib/modules/2.6.32/pl2303.ko

allows
echo -e "\xFF\x01\x01" > /dev/ttyUSB0 to be received by DS209II+ front port. Is it because "0" is its number ?
olivier57
Novice
Novice
 
Posts: 55
Joined: Sat Mar 20, 2010 10:08 am


Return to Hardware Mods

Who is online

Users browsing this forum: No registered users and 0 guests