Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I have a usb mini-lava lamp. I would light to have it come on and turn off at specific times, to act as an alarm. It is a dum device, just drawing power from the USB port outside the USB spec.
Firstly, does a programme exist to let me do this?
If not, how would I go about programming it?
I found a simple usb-handling programme from the Barry project, it searches for Blackberries then tells them to request higher power. It all looks fairly simple, but I cannot find out what command to use to set the power level on the usb post
Source code from Barry;http://belnet.dl.sourceforge.net/sou...rry/bcharge.cc
My original post on ubuntuforums.org :http://www.ubuntuforums.org/showthread.php?t=327138
Yes, that is what I need. Unfortunately, it does not work!
The output produced is as follows;
$:/sys/bus/usb/devices/6-1/power$ echo "0" > /sys/bus/usb/devices/6-0:1.0/power/state
bash: /sys/bus/usb/devices/6-0:1.0/power/state: Permission denied
This happens when prefixing echo with sudo, putting sudo just after the ">" and both.
Try sudo -i
That will give you a "root shell"
Then give your command echo "0" > /sys/bus/usb/devices/6-0:1.0/power/state
It should work.
Type exit or <CRTL><D> to exit from the root shell.
Hmmm, interesting.
It could well be that there simply isn't a way to power-off a USB port.
If it has suitable intelligence (and your lamp is unlikely to!) I expect you can send a USB device a command that turns it off, or, more likely, puts it "to sleep". This isn't much help to you though.
You could try looking at the datasheets for USB controllers, and see if there is the facility to do what you want, at hardware level, but I suspect the answer is "no" from what I have read so far. You'll have to choose another sort of alarm, or build yourself a special USB device that will remove power from another USB device further down the line. Not a trivial project! Sorry
Distribution: Debian amd64 with 32bit libs and Debian 32 bit laptop
Posts: 119
Rep:
From what I have observed it is my understanding that you might be able to stop the computer from sending power on that usb channel but that means nothing plugged into the usb drive will work\
perhaps you could use the parts from an external hdd or something like that
I like the idea of using a parallel port but I would not solder I would splice a cable
I want to know if you can use the usb the way you want to though cause if it dose I will do the same with a laptop and a set of fans
It may not be possible to turn the power off to a USB port; it's power leads may be hard wired to a power source, not under the control of software.
For mjrclark's problem, software control of a light, the X10 controller and interfaces are perfect. For example, I have used a nightlight to indicate that I have new mail. The mini-lava light only uses the USB port for power; there are many low cost USB chargers that will allow the mini-lava light to be controlled by X10.
This meets the minimum requirement at minimal cost, but also opens many additional home automation possibilities.
Distribution: Debian amd64 with 32bit libs and Debian 32 bit laptop
Posts: 119
Rep:
I do not know the specks for usb so I cant comment but I see how to get the lava lamp to work.
[QUOTE macemoneta]I have used a nightlight to indicate that I have new mail[/QUOTE] I want to do that know but would want the light to stay on till I read the email
I want to do that know but would want the light to stay on till I read the email
It's pretty straight forward. In evolution (the email package I'm using), after email passes all filters, I run a script called 'newmail'. The script turns on the nightlight and sets a flag in a file. A background process checks the flag, and if set waits for the screen saver to deactivate (meaning that I'm at the PC). Once the screen saver deactivates, it clears the flag and turns off the nightlight. It's rather convenient, as you can have the nightlight plugged in anywhere in the house (even multiple locations).
I have a usb mini-lava lamp. I would light to have it come on and turn off at specific times, to act as an alarm. It is a dum device, just drawing power from the USB port outside the USB spec.
Firstly, does a programme exist to let me do this?
If not, how would I go about programming it?
I found a simple usb-handling programme from the Barry project, it searches for Blackberries then tells them to request higher power. It all looks fairly simple, but I cannot find out what command to use to set the power level on the usb post
Source code from Barry;http://belnet.dl.sourceforge.net/sou...rry/bcharge.cc
My original post on ubuntuforums.org :http://www.ubuntuforums.org/showthread.php?t=327138
I just read this thread, because I was looking for a way to switch off the internal UMTS modem in the Eee 901GO.
I wanted to try
# /sys/bus/usb/devices/6-0:1.0/power/state
like one poster proposed, but on my system there is no such file.
To find out the device name (2-2 here), use
# dmesg | grep NAME_OF_YOUR_DEVICE
if necessary, look up the device's name with
# lsusb
Curiously enough, the numbers given in lsusb are not the correct one's... I have still to find out why this is the case.
I tried this on a USB mouse, and the LED went out all right
To switch the port on again, pass either "auto" or "on".
"auto" suspends the port automatically after the period of time specified in /sys/bus/usb/devices/2-2/power/autosuspend (in seconds), "on" (not surprisingly ;o) leaves it on all the time.
On mobile devices, using "auto" for all ports might prove beneficial.
I still have to figure out, what
/sys/bus/usb/devices/2-2/power/wakeup
and
/sys/bus/usb/devices/2-2/power/persist
do exactly.
Anyone?
I think one can find out more about this in the documentation (Documentation/usb/power-management.txt I think) found in the Linux Kernel sources.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.