arduino.inf should load serenum.sys in addition with usbser.sys #1745
Labels
feature request
A request to make an enhancement (not a bug fix)
OS: Windows
Specific to the Windows version of the Arduino IDE
This is related to this old issue (#934) which is still open as of this writing.
When I plug in a typical USB-to-serial converter such as any FTDI-based converter, Windows will send a
WM_DEVICECHANGE
message to all interested applications. By inspecting theWM_DEVICECHANGE
message, you can determine if the message is due to the attachment of a specific device type i.e. serial ports.I can take advantage of this to give any microcontroller project true plug-and-play capabilities and not have to mess around COM port settings or require any other manual intervention by the user. This would greatly improve the end-user experience, and would be especially useful for Firmata-based PC + microcontroller projects. I got this working fine with my FTDI-based converters.
However, because arduino.inf does not have directives to load serenum.sys, Windows will not generate the right
WM_DEVICECHANGE
messages for boards like the Arduino UNO. This is an issue for me since quite a few of my friends and colleagues primarily use Arduinos, and thus my program won't work with their boards. Other USB-to-serial converters do in fact load the serenum.sys driver in addition to usbser.sys (or whatever custom driver they use), and do not have this issue as a result.I was able to modify the arduino.inf file (from Arduino software version 1.0.5) and reinstall it to load this additional driver. This allows Arduino boards to look more like a proper COM port to Windows. Since usbser.sys is untouched in the fix, it is fully backwards compatible with any existing programs that open a COM port to the Arduino. The fix has been tested in Windows 7.
I would love to contribute the fix as a patch. I'm not sure how to handle this since the original INF file itself is signed, and thus my patch as-is won't load in Windows 8.
This fix also allows Windows to generate what's called a device path to the Arduino's ATmega16U2-based converter. It looks something like this:
This path is synonymous with the
COM<arduino port number>
path. It appears that serenum.sys is responsible for generating this path. You can pass this device path directly to any serial library on Windows that allows passing file names directly to the OS and it will work. I would effectively be able to open a COM port to an Arduino UNO or similar systems without ever having to touch COM port numbers.Modifications to the INF file:
Updated
DriverVer
directive in[Version]
section to indicate newer versionAdded
SerEnumServiceName="SerEnum Filter Driver"
directive to[Strings]
sectionAdded
AddService=serenum,,SerEnumDriverService
directive to[DriverInstall.Services]
section.Added new sections:
Moved the following directives from
[DriverAddReg]
to[DriverAddReg.HW]
section:Other directives were not modified.
The text was updated successfully, but these errors were encountered: