-
-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Linux (especially embedded) serial port listing issues #610
Comments
@xuqianli @lfk @abrinsmead Can you all |
@jacobrosenthal Thank you for summarizing these issues. I should have access to some suitable hardware tonight or tomorrow -- I'll check the proposed solution and provide feedback ASAP. As for my PR, it was simply a quick fix that wouldn't have impacted backwards compatibility at all. Naturally I'm all for finding a "better" way of doing things, and as long as feature parity can be assured, I've got nothing against moving away from the udev-dependency. Cheers! |
@digihaven Can you all npm install https://github.com/jacobrosenthal/node-serialport/tree/mitsos1os-master to see if it solves your port listing issues or creates any new issues |
Added ttyS and ttyAMA, Can anyone provide any feedback on their linux boxes, especially around identical devices. Also Can anyone dig up any more /dev/ files we should be whitelisting? |
The popular Beaglebone Black board uses ttyO |
@techninja apparently you've found problems with the new linux port listing that came as of 2.0.3? Id love to hear about which platforms and what it looks like. |
@jacobrosenthal Yes yes yes, I have. I've been spending today looking into figuring it out and seeing if it's duplicated in another ticket. Might not be. Just tried your Ubuntu 14.04: Port listing dies with 64 "Uncaught TypeError: Cannot read property 'split' of undefined" from line 541 of serialport.js. It's looking for
My guess is that these are just system TTYs not hardware serial ports like we expect to be listing. I obviously blame @reconbot ;) |
@techninja This is 2.0.4? |
Actually was using #623 directly (which you merged a bit ago). You do a |
Yes On Mon, Nov 9, 2015 at 5:28 PM, James T [email protected] wrote:
|
Don't answer that, I did. Just installed latest 2.0.4 and getting the same issue. So, the answer is yes definitely. There a command I can run to list the same TTYs on the console? I'm generally suspecting filtering is the issue here. |
I'm seeing the same error with serialport v2.0.4 on a Raspberry Pi 2
|
:( Sigh. The list code is Whats your distro, node, npm etc? On Mon, Nov 9, 2015 at 5:31 PM, James T [email protected] wrote:
|
Node 4.2.1 stable, npm 2.14.7, same error in Electron as well (which is as we know, a slightly different node env), shouldn't matter though. Here's a full list of my system TTYs with one real one (the EBB controller shows up like the Arduino as
|
On the Raspberry Pi
node v5.0.0, npm v3.3.6, Raspbian Jessie 2015-09-24
|
I have a similar error on a Gentoo with the device on mos@snake ~/Projects/sport $ cat list.js
var serialPort = require("serialport");
serialPort.list(function (err, ports) {
ports.forEach(function(port) {
console.log(port.comName);
console.log(port.pnpId);
console.log(port.manufacturer);
});
});
mos@snake ~/Projects/sport $ sudo node list.js
/home/mos/Projects/sport/list.js:5
console.log(port.comName);
^
TypeError: Cannot read property 'comName' of undefined
at /home/mos/Projects/sport/list.js:5:21
at Array.forEach (native)
at /home/mos/Projects/sport/list.js:4:9
at /home/mos/Projects/sport/node_modules/async/lib/async.js:254:17
at done (/home/mos/Projects/sport/node_modules/async/lib/async.js:129:15)
at /home/mos/Projects/sport/node_modules/async/lib/async.js:32:16
at /home/mos/Projects/sport/node_modules/async/lib/async.js:251:21
at /home/mos/Projects/sport/node_modules/serialport/serialport.js:585:15
at ChildProcess.exithandler (child_process.js:210:5)
at emitTwo (events.js:87:13)
mos@snake ~/Projects/sport $ node -v
v5.0.0
mos@snake ~/Projects/sport $ npm -v
3.3.6
mos@snake ~/Projects/sport $ uname -a
Linux snake 4.0.5-gentoo #1 SMP Sat Jul 18 13:27:50 CEST 2015 x86_64 Intel(R) Core(TM) i5-2520M CPU @ 2.50GHz GenuineIntel GNU/Linux ``` |
Wow, lots of people running v5, and I thought it was crazy to jump on such a fast moving train. Hopefully Jacob has enough info to get moving on this. I moved to 2.0.1 for Mavericks support which works on Linux, but have to move to 2.04 for the Windows crash fix, which now doesn't work on Linux because we're finding too many of the wrong kind. Bleh! |
I was having this install issue as well. I recently updated my rpi to Linux kernel version 4.1.7+ and was noticing numerous make (gcc) errors. After numerous attempts to install serialport, including previous versions, I began hunting around for a communication alternative such as I2C. In the process, I learned that the installed versions of gcc and g++ may be the culprit. After following the upgrade instructions here I was finally able to compile [email protected] on my raspberry pi. Not sure if this fixes all of the compile errors noted here but it fixed mine. BTW, using node-4.0.0/npm-3.3.12 |
Things have improved with serialport v2.0.5. Here's what can be seen on a Raspbery Pi 2 running Raspbian Jessie:
The values of |
Vendor and Product id tracked separately here #621 |
We've got problems around listing ports, especially around using /dev/serial
queryPortsByPath is false by default, so we use /dev/serial/by-id by default
but how would someone set it true if they wanted? @voodootikigod originally added it with 5cfe6e4 #576 asks to expose the factory method
#561 just wants to query by-name by default instead as ids can be duplicate apparently? Why are we on by-id at all? It looks like we always have been? Ah, raspbian for instance doesn't even have a by-name so that seems unlikely.
#565 wants to ditch /dev/serial all together which would be nice as we're having trouble on embedded systems that don't have /dev/serial created like in #564 and #481
However its currently only searching for ttyUSB devices and the first device I picked up off my desk (segger) doesn't come up as ttyUSB but rather ttyACM0 so this is either a losing game or we need a far more expansive whitelist of devices to search for
This older doc talks about ttyS* ttyACM* and ttyUSB* Is that still the exhaustive list?
The text was updated successfully, but these errors were encountered: