Giter Site home page Giter Site logo

hubpower's Issues

OS locks up after issuing a command

Very serious issue.

I believe I just tried a power off command and my USB ports are currently power cycling (about 0.25s on then 0.75s off). The power cycling is only on the hub which I tried to control, not the onboard USB ports (they're fine).

Additionally, when I try to issue another hubpower command, my entire OS locks up.

I'm on a Raspberry Pi with Raspian for what it's worth.

Am I the idiot?

Hello - I downloaded hubpower.c and compiled with:
gcc -o hubpower hubpower.c - and it compiled ok.
Here is what I get when I use it:
wolff@wolff:/Documents/install/hubpower$ lsusb
Bus 001 Device 003: ID 0a5c:5801 Broadcom Corp. BCM5880 Secure Applications Processor with fingerprint swipe sensor
Bus 001 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 004: ID 046d:c52b Logitech, Inc. Unifying Receiver
Bus 002 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 003 Device 004: ID 0781:5575 SanDisk Corp. Cruzer Glide
Bus 003 Device 003: ID 2357:0604 TP-Link TP-Link UB500 Adapter
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
wolff@wolff:
/Documents/install/hubpower$ ./hubpower 0781:5575 power off
Usage: hubpower busnum:devnum power {portnum (on|off)} ...
hubpower busnum:devnum reset {portnum (on|off)} ...
hubpower busnum:devnum enable {portnum (on|off)} ...
hubpower busnum:devnum status
hubpower busnum:devnum bind
wolff@wolff:/Documents/install/hubpower$ ./hubpower 0781:5575 power on
Usage: hubpower busnum:devnum power {portnum (on|off)} ...
hubpower busnum:devnum reset {portnum (on|off)} ...
hubpower busnum:devnum enable {portnum (on|off)} ...
hubpower busnum:devnum status
hubpower busnum:devnum bind
wolff@wolff:
/Documents/install/hubpower$ ./hubpower 0781:5575 power
Usage: hubpower busnum:devnum power {portnum (on|off)} ...
hubpower busnum:devnum reset {portnum (on|off)} ...
hubpower busnum:devnum enable {portnum (on|off)} ...
hubpower busnum:devnum status
hubpower busnum:devnum bind
wolff@wolff:~/Documents/install/hubpower$ ./hubpower 0781:5575 status
Usage: hubpower busnum:devnum power {portnum (on|off)} ...
hubpower busnum:devnum reset {portnum (on|off)} ...
hubpower busnum:devnum enable {portnum (on|off)} ...
hubpower busnum:devnum status
hubpower busnum:devnum bind

Seems to always give me the help menu

can not be compiled

19:32:59 [aboettger:~] % gcc -o hubpower hubpower.c
hubpower.c: In function ‘port_status’:
hubpower.c:85:13: warning: format ‘%s’ expects argument of type ‘char *’, but argument 4 has type ‘int’ [-Wformat=]
portnum, strerror(errno));
^
hubpower.c: In function ‘main’:
hubpower.c:173:21: warning: format ‘%s’ expects argument of type ‘char *’, but argument 4 has type ‘int’ [-Wformat=]
fname1, strerror(err1));
^
hubpower.c:175:21: warning: format ‘%s’ expects argument of type ‘char *’, but argument 4 has type ‘int’ [-Wformat=]
fname2, strerror(errno));
^
hubpower.c:269:21: warning: format ‘%s’ expects argument of type ‘char *’, but argument 4 has type ‘int’ [-Wformat=]
portnum, strerror(errno));
^

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.