-
Notifications
You must be signed in to change notification settings - Fork 377
TransportNodeHid.create() on MAC is not working #213
Comments
actually on Mac, the logic does not even use interface, it uses usagePage const filterInterface = device =>
["win32", "darwin"].includes(process.platform)
? device.usagePage === 0xffa0
: device.interface === 0; on Windows and Mac (darwin), it will filter could you make sure that |
During my debugging, |
After more debugging I can say that all 3 platforms return undefined for |
ok make sense for renderer process. const filterInterface = device =>
// filter using interface if available, otherwise fallback on usagePage filtering.
device.interface === -1
? device.usagePage === 0xffa0
: device.interface === 0; |
Is there any workaround for this issue? This is a blocker for including ledger support in our electron-based app. How does ledger live handle this issue? |
hello @tylerlevine, It's quite similar to the code on ledger-live Best, |
Run the device code NOT in the renderer thread and you should be fine, i think the present problem happen only in renderer because process.platform is undefined there. not the case in main thread or in a node forked thread. We recommand to use a dedicated thread to run the transport because node-hid code is synchronous and block the thread. You don't want to block the main thread or the renderer thread. |
@hirishh was too fast 🚀 |
Hi I am using mac also and ran into some issues in electron with TransportNodeHid.create() so I moved to fork a child process. @hirishh has a great example of how to use this code on the main process. I am unsure how to run it on a forked child process , since it can not be ran in any render process. I keep running into the issue that forked process does support babel\polyfill. I just wanted to confirm that I am on the right path and my understanding of the best practices is correct. Any feedback would be greatly appreciated. |
@itsMikeLowrey can you try to do this instead: |
@gre Thank you so much for that tip. It dosnet seem to be working for me right now, but ill try to move some things around and get back to you if I figure something out. |
Please keep me updated with the error you are having.
|
@gre Thank you so much. It works with the code below:
I am using vue.js with electron builder. I am so excited that this works now. I know that this is not the best practice since I am running this in my render process, but I am so glad that it is currently working. I did not need import "babel-polyfill" or anything else. Is there any risk ,beside freezing the app, to running the code on the render process with the gui? thank you again for all the help. |
babel-polyfill is no longer required in v5.0.0. |
Hello,
I have an application that is using
TransportNodeHid.create()
in order to connect and use the Ledger Nano S. What I see is that on Linux and Windows is working fine, but on MAC is not able to connect to the ledger.I've debugged a lot and the issue is here: https://github.com/LedgerHQ/ledgerjs/blob/master/packages/hw-transport-node-hid/src/getDevices.js#L7
On MAC High Sierra, HID.devices() is returning correctly the information of my Ledger Nano S, but is filtered out because of
interface === 0
. Infact, I haveinterface === -1
.Proof here:
Best,
hirishh
The text was updated successfully, but these errors were encountered: