Closed PixnBits closed 10 years ago
the serialport module used allows for listing of ports
var serialPort = require("serialport");
serialPort.list(function (err, ports) {
ports.forEach(function(port) {
console.log('port:', port);
});
});
currently on my Win8 box data is in the form:
{ comName: 'COM13',
manufacturer: 'PJRC.COM, LLC.',
serialNumber: '',
pnpId: 'USB\\VID_2341&PID_0043\\95238343334351014212',
locationId: '',
vendorId: '',
productId: '' }
I'm thinking contributing to that module to properly populate the data fields (parse out VID and PID). I don't have a Mac, is the data the same on that platform?
Hmm. The node-serialport module is in C not JS, so I'll need to brush up on my C string parsing. For now, JS in electron...
Yes, the format on Mac is the same, though it does have a bit more information. A Leonardo on my Mac shows:
{ comName: '/dev/cu.usbmodemfd14121', manufacturer: 'Arduino LLC', serialNumber: '', pnpId: '', locationId: '0xfd141200', vendorId: '0x2341', productId: '0x8036' }
Awesome! Just to confirm, the auto-select works with your Leonardo?
Yep. Worked beautifully. Thank you!
auto-detect which Arduino board is on the port