Giter VIP home page Giter VIP logo

ykush's People

Contributors

kuscsik avatar lkundrak avatar mmind avatar yep1 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

ykush's Issues

Downstream port 0 is OFF

Hello,
I'm facing an issue with the YKUSH board connected to a Debian jessie apu2 board.
The board works perfectly in an Ubuntu computer, however when i plug it in the apu2,
i can see the device with "sudo ./ykushcmd -l", but i'm getting:
"Downstream port 0 is OFF"
when i'm trying to do other up/down processes to any port (e.g. "sudo ./ykushcmd -g 1").
Any ideas? Is it possible the usb hub to be locked somehow?

null issue when listing ykush boards

I saw the previous issue was fixed by running the ykushcmd command with root privileges. This does not work for me and still gives the null result. I am running Debian8.

$ sudo ykushcmd -l

Attached YKUSH Boards

---------------------
YKUSH device found with Serial Number: (null)
  Manufacturer: (null)
  Product:      (null)

YKUSH initial power state

Not actually an issue, but a tech question.

Are 3 downstream USB ports initially-powered-on or initially-powered-off just after ext PWR is supplied to YKUSH? I need a hub like this, but strictly with initially-powered-off downstream ports that I will turn on explicitly, one-after-one, to prevent power spike and be able to use less powerful PSU. Usage scenario is like this: 2 YKUSH boards connected to 2 USB ports of mini–ITX motherboard, with 6 USB devices draining about 1A at boot time and 0.3A–0.4A after that. If these USB devices start at the same time, there will be 30W power spike.

Is it possible on YKUSH? (For example, with PIC16F firmware modification)?

Fails to detect YKUSH3 hub

dmesg says:

[340326.220983] usb 2-1.4: new SuperSpeed Gen 1 USB device number 8 using xhci_hcd
[340326.241297] usb 2-1.4: New USB device found, idVendor=0424, idProduct=5744, bcdDevice= 2.05
[340326.241302] usb 2-1.4: New USB device strings: Mfr=2, Product=3, SerialNumber=0
[340326.241304] usb 2-1.4: Product: USB5744
[340326.241307] usb 2-1.4: Manufacturer: Microchip Tech
[340326.245027] hub 2-1.4:1.0: USB hub found
[340326.245349] hub 2-1.4:1.0: 4 ports detected
[340326.440948] usb 1-1.4: new high-speed USB device number 44 using xhci_hcd
[340326.542001] usb 1-1.4: New USB device found, idVendor=0424, idProduct=2744, bcdDevice= 2.05
[340326.542006] usb 1-1.4: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[340326.542009] usb 1-1.4: Product: USB2744
[340326.542011] usb 1-1.4: Manufacturer: Microchip Tech
[340326.543288] hub 1-1.4:1.0: USB hub found
[340326.543346] hub 1-1.4:1.0: 5 ports detected
[340327.272862] usb 1-1.4.4: new full-speed USB device number 45 using xhci_hcd
[340327.380682] usb 1-1.4.4: New USB device found, idVendor=04d8, idProduct=f11b, bcdDevice= 0.01
[340327.380688] usb 1-1.4.4: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[340327.380691] usb 1-1.4.4: Product: YKUSH3
[340327.380694] usb 1-1.4.4: Manufacturer: Yepkit Lda.
[340327.380696] usb 1-1.4.4: SerialNumber: YKU30631

However:

$ make
g++ -o bin/ykushcmd src/yktrl.o src/commandParser.o src/ykushxs/ykushxs.o src/ykush/ykush.o src/ykush2/ykush2.o src/ykush3/ykush3.o src/yk_usb_device.o src/help/ykush_help.o src/utils/command_parser.o src/utils/string2val.o src/usbhid/usbhid.o -lusb-1.0
$ ./bin/ykushcmd -l
Attached YKUSH Boards:

No YKUSH boards found.
$ sudo ./bin/ykushcmd -l

Attached YKUSH Boards:

No YKUSH boards found.

This is the latest code from the master branch.

Mac Support

The build scripts don't seem to work for MacOSX. Is this support possible?

ykushcmd -s YKxxxx -u 2 order of options shouldn't matter

I have 2 ykush boards connected to my PC and refer to them using -s option.
ykushcmd will ignore -s silently. when -s YKxxxx isn't the first arguement.

I know the docs and cmdline help say to use -s first.
Still, I think one could greatly improve this UX (there was no state change of YK boards inbetween):

bash-5.1$ ./ykushcmd -s YK11111 -g 3
Downstream port 3 is ON

bash-5.1$ ./ykushcmd -s YK66666 -g 3
Downstream port 3 is OFF

bash-5.1$ ./ykushcmd -g 3 -s YK11111
Downstream port 3 is ON

bash-5.1$ ./ykushcmd -g 3 -s YK66666
Downstream port 3 is ON

YK66666, port 3 if OFF all the time, if you measure it.

Reading the code, it seems ykushcmd indeed ignores the option (line 35 case vs. line 57 case).
https://github.com/Yepkit/ykush/blob/master/src/ykush/ykush.cpp

Maybe it's easiest to just throw out the hand-written commandline parser and use some popular library?
E.g. Stackoverflow has some examples. Though, boost is probably overkill here.
https://stackoverflow.com/questions/865668/parsing-command-line-arguments-in-c

Happy to hear any input on this.

PC: Ubuntu 22.04
YKUSHCMD Version 1.3.1

Seg fault on trying to list board

I have a new ykush3 board and when listing it gives me seg fault. with sudo that is not the case:
sudo ykushcmd ykush3 -l

Attached YKUSH3 Boards:

  1. Board found with serial number: Y3004047

$ ykushcmd ykush3 -l

Attached YKUSH3 Boards:
Segmentation fault (core dumped)

dmesg shows:
[7951105.281108] usb 1-2.4.4.1.4: New USB device found, idVendor=04d8, idProduct=f11b, bcdDevice= 0.01
[7951105.281115] usb 1-2.4.4.1.4: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[7951105.281117] usb 1-2.4.4.1.4: Product: YKUSH3
[7951105.281119] usb 1-2.4.4.1.4: Manufacturer: Yepkit Lda.
[7951105.281120] usb 1-2.4.4.1.4: SerialNumber: Y3004047
[7951105.381707] hid-generic 0003:04D8:F11B.0005: hiddev98,hidraw2: USB HID v1.11 Device [Yepkit Lda. YKUSH3] on usb-0000:06:00.1-2.4.4.1.4/input0
[7951105.457526] usb 1-2.4.4.1.5: new high-speed USB device number 6 using xhci_hcd
[7951105.549610] usb 1-2.4.4.1.5: New USB device found, idVendor=0424, idProduct=2740, bcdDevice= 2.00
[7951105.549617] usb 1-2.4.4.1.5: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[7951105.549619] usb 1-2.4.4.1.5: Product: Hub Controller
[7951105.549621] usb 1-2.4.4.1.5: Manufacturer: Microchip Tech
[7951113.801263] ykushcmd[3900225]: segfault at ffffffffffffffd0 ip 00007fdadaf4a268 sp 00007ffe6a0c22e0 error 5 in libusb-1.0.so.0.3.0[7fdadaf3e000+f000]
[7951113.801268] Code: 24 18 31 c0 48 85 ff 0f 84 af 01 00 00 48 89 fd 48 8d 0d 21 2e 00 00 48 8d 15 9c 79 00 00 31 ff be 04 00 00 00 e8 78 58 ff ff <48> 8b 45 40 4c 8b 60 30 41 8b bc 24 44 01 00 00 e8 93 49 ff ff 48

I am on X64 machine, with
$ uname -r
5.16.15-101.fc34.x86_64

Unable to control ykush board

I've built the ykushcmd in a raspbian linux running on a Raspberry pi 3 and I can't control the ykush connected to it.

When listing boards:

$ ./bin/ykushcmd -l

Attached YKUSH Boards

---------------------
YKUSH device found with Serial Number: (null)
  Manufacturer: (null)
  Product:      (null)

When getting the status of port 1:

$ ./bin/ykushcmd -g 1

Unable to get port status for port 1

Device identify differently on Ubuntu 20 and U22

U22:
Bus 001 Device 008: ID 04d8:f11b Microchip Technology, Inc. YKUSH3

U20:
Bus 001 Device 051: ID 04d8:f11b Microchip Technology, Inc. CP2105 Dual USB to UART Bridge Controller

Is that expected?

turning on single port results in all port turned on

We are using YKUSH usb hub. When i tried to POWER ON single port then all 3 port becomes ON.
We are using below command to power ON individually
ex. ykushcmd.exe -s YK16997 -u 1
For power OFF all we are using ykushcmd.exe -a

can you please help here to resolve the same.

ykush downstream ports led is not glow

hi i have connected my ykush board to app3.0 board from the host using ykush comments after few minuts downstream port led is not glow am not able to communicate the app 3.0 board so for this issue wjhat i need to do?

Note:am using ykush 3 board

A new release?

There's quite some development in the Git tip.
I'm wondering if you could tag a release?

Thanks

segfault with ykush3 boards

I have two ubuntu 16 machines with two YKUSH3 boards each. Installed those about a year or two ago and worked fine, haven't used the ykushcmd in some time and needed to reboot an attached USB device today and ykushcmd had stopped working, claiming "no help file present".

So I downloaded and compiled the latest version of the code from the git without error. Now I'm getting this:

ykushcmd ykush3 -l
Attached YKUSH 3 Boards:
Segmentation fault (core dumped)

This happens on both machines. Any help trying to resolve this greatly appreciated.

Memory leaks?

The objects created in ykush/2/3.cpp using new seem never to be freed up, at least if there is not any auto-magically stuff going on in the background I have overlooked. Most simple fix:
Replace dynamic allocations like
Ykush2 *ykush = new Ykush2(0xEFED);
with a simple instance that gets deleted when the scope is left
Ykush2 ykush(0xEFED);
1st alternative: use smart pointers
2nd alternative: use delete ykush when the object is no longer required.

ykushcmd returns no YKUSH board found for YKUSH 3

I ran the "sudo ykushcmd -l" but it returns no board found. Alternatively I installed pykush and it is able to detect the board. So I think the problem lies in the ykushcmd for linux that could not detect the board. I also tried ykushcmd.exe on Windows and it still works.

Unable to build ykushcmd control application on ubuntu 20.04

I followed the below steps to build and install ykushcmd control application,

Download the source package.

$ wget https://github.com/Yepkit/ykush/archive/1.2.2.zip

Extract

$ unzip 1.2.2.zip

Install the required packages

$ sudo apt-get install libusb-1.0-0-dev libusb-1.0-0

Build

$ cd ykush-1.2.2
$ ./build.sh

Install

$ sudo ./install.sh


$ ./build.sh - Getting the following error,
src/commandParser.cpp:55:10: fatal error: ykush.h: No such file or directory
55 | #include <ykush.h>
| ^~~~~~~~~

Do I need to insatll any other dependencies to build without any error?

ykush xs device disappears

Hello,

we've been using ykush xs devices in out automation for few months but sometime they disappear from the host without any message in the dmesg.
In order to make them work again, we need to re-plug them to make them visible to Linux.
We are using Debian Stretch 9.8.

The device is plugged but both ykush and lsusb see the device

root@hostname:~# ykushcmd ykushxs -l


Attached YKUSH XS Boards:

No YKUSH XS boards found.

root@hostname:~# lsusb
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 003: ID 8087:0a2b Intel Corp.
Bus 001 Device 083: ID 0403:6014 Future Technology Devices International, Ltd FT232H Single HS USB-UART/FIFO IC
Bus 001 Device 081: ID 0403:6014 Future Technology Devices International, Ltd FT232H Single HS USB-UART/FIFO IC
Bus 001 Device 013: ID 0403:6010 Future Technology Devices International, Ltd FT2232C Dual USB-UART/FIFO IC
Bus 001 Device 010: ID 0403:6001 Future Technology Devices International, Ltd FT232 USB-Serial (UART) IC
Bus 001 Device 078: ID 1a40:0201 Terminus Technology Inc. FE 2.1 7-port Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
root@hostname:~# 

there is no need to use #!/bin/bash in scripts

Hello.
Could you please consider removing bash shebang from scripts?
There is no need to use bash it is better to use /bin/sh as you can find it litteraly everywhere.

For example I've tried to install ykush inside the docker container based on alpine image
but I need to also install bash just to run the build.sh and install.sh scripts.

Thank you in advance!

FW version reported is 1.0.0 after flashing 1.5.0

Hi,

Before flashing fw-ykush3-1.5.0-ptn-fus.hex
ykushcmd ykush3 --firmware-version
Firmware version-1.5.0

After:
ykushcmd ykush3 --firmware-version
Firmware version-1.0.0

Is that expected?
I was expecting to see 1.5.0

Thanks

sudo inside install.sh

There should be no sudo in scripts.
It gets hard to automate stuff.

I'm using ykush with a docker container and I install everything through an automated script. I get: ./install.sh: line 4: sudo: command not found

Could not control downstream port in mac

Cloned this repo and am able to build for mac. But once run, ykush is detected, but could NOT claim as in the error.

bin $./ykushcmd ykush -l

Attached YKUSH Boards:

  1. Board found with serial number: YK55321

bin $./ykushcmd ykush -d 3 (any port, same result)
cannot claim interface
Unable to open device
Unable to open device

Any help is appreciated.

Help file not found.

commit c585d24

sudo build.sh
sudo install.sh

both ran without problems.

But I cannot run the command

16:30 $ sudo ykushcmd -h

Help file not found.

16:30 $ sudo ykushcmd

Help file not found.

LINUX, YKUSH not working anymore

Hi,
I've downloaded the repo (Commit: ee136bd) and I'm on Ubuntu 16.04
I'm not able to manage my YKUSH device, I can detect it with ykushcmd -l but I can't control the device plugged.

I found one error in parsing the arguments: https://github.com/Yepkit/ykush/blob/master/ykushcmd/ykush/ykush.cpp#L67
You're looking for at least 6 arguments but command line is:
ykushcmd -s SERIAL -u 3
which is 5 arguments
Please explain me or correct the bug

Another problem, on this same version, you set his to blocking mode hid_set_nonblocking(handle, 0); . This command never ends on my Ubuntu 16.04. Using non-blocking mode make YKUSH to work as expected

YKUSH hangs on getting port status

Currently using a YKUSH 3-port USB hub. When listing the board it seems to respond just fine, but when I try to get the status of one of the ports it hangs indefinitely, and the board becomes unresponsive.

chris@LAPTOP4:~/ykush$ sudo ykushcmd -l

Attached YKUSH Boards

---------------------
YKUSH device found with Serial Number: YK20078
  Manufacturer: Yepkit Lda.
  Product:      YKUSH

chris@LAPTOP4:~/ykush$ sudo ykushcmd -g 1
^C
chris@LAPTOP4:~/ykush$ sudo ykushcmd -l

Attached YKUSH Boards

---------------------
YKUSH device found with Serial Number: (null)
  Manufacturer: (null)
  Product:      (null)

Here is the output of lsusb:

chris@LAPTOP4:~/ykush$ lsusb
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 005: ID 04f2:b571 Chicony Electronics Co., Ltd 
Bus 001 Device 003: ID 04ca:3015 Lite-On Technology Corp. 
Bus 001 Device 114: ID 04d8:f2f7 Microchip Technology, Inc. 
Bus 001 Device 113: ID 0424:2514 Standard Microsystems Corp. USB 2.0 Hub
Bus 001 Device 112: ID 04f2:0976 Chicony Electronics Co., Ltd 
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

[minor] Typo in embedded help

Greetings,

lintian, Debian's pedantic packaging checker, reported a typo. Please fix when convenient.

Cheers,

--- a/src/help/ykush_help.cpp
+++ b/src/help/ykush_help.cpp
@@ -45,7 +45,7 @@
        std::cout << " ykush3\t\tYKUSH3 board.\n";
        std::cout << " ykushxs\tYKUSHXS board.\n";
        std::cout << "The [board_name] must be provided for commands addressed for a specific board.\n";
-       std::cout << "For general or common commands, applicable to all board models, the [board_name] is to ommited from the command.\n";
+       std::cout << "For general or common commands, applicable to all board models, the [board_name] is to omited from the command.\n";
 }

 void Help::print_common_options(void)

"Help file not found" when using option -s

If i list all attached ykush boards using -l, it works and returns 2 serial numbers. However if i try to use any of those serial numbers with -s, it always returns "Help file not found". I'm using it on Raspberry pi 3b+, with Raspbian Stretch.

Firmware update.

Hello.

I need to update my ykush board to work with pykush library:
ykush\ykushcmd.exe ykush3 --firmware-version
Firmware version-0.0.0

ykush\ykushcmd.exe ykush3 -l
Attached YKUSH Boards:

  1. Board found with serial number: YK3B2104

I have tried to contact You using contact on website but without success.
I need a hex file to update firmware.

Best Regards,

Michal

"Unable to write to device" - Port switching fails under Linux

Hi,

I'm getting "Unable to write to device" any time I try to use the -d or -u options. Getting the serial on ykush3 works fine.

$ sudo ykushcmd ykush3 -l
Attached YKUSH Boards:

  1. Board found with serial number: YK3BXXXX (XXXX replaced)
    $ sudo ykushcmd ykush3 -d 1
    Unable to write to device

Furthermore, having a view on dmesg, it says the following 👍
[10996.094157] usb 1-3.1.1.4: new full-speed USB device number 23 using xhci_hcd
[10996.217231] usb 1-3.1.1.4: New USB device found, idVendor=04d8, idProduct=f11b, bcdDevice= 0.01
[10996.217235] usb 1-3.1.1.4: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[10996.217237] usb 1-3.1.1.4: Product: YKUSH3
[10996.217238] usb 1-3.1.1.4: Manufacturer: Yepkit Lda.
[10996.217239] usb 1-3.1.1.4: SerialNumber: YK3BXXXX (XXXX replaced)
[10996.298486] hid-generic 0003:04D8:F11B.000F: hiddev6,hidraw8: USB HID v1.11 Device [Yepkit Lda. YKUSH3] on usb-0000:09:00.1-3.1.1.4/input0
[11004.369927] usb 1-3.1.1.4: usbfs: process 34449 (ykushcmd) did not claim interface 0 before use

Feature request: return code

Currently the program seems to return always 0, which generally indicates success. In the context of running ykush in shell scripts or automation tools it would be a significant improvement if the application would return non-zero status code(s) if the command could not be executed as expected.

Additional depenency on linux

I was following the instructions here: https://www.yepkit.com/learn/setup-guide-ykush to install the command application, and got the error fatal error: libudev.h: No such file or directory when running ./build.sh.

I was able to solve this by installing libudev (sudo apt-get install libudev-dev), but wanted to give you a heads up that all of the relevant dependencies weren't listed in your instructions. Thanks!

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.