This partially fixed my problem: I have right documentation and a class GUID. This exposed not only the device you want to access… It exposes all devices of that class.įor example, if you want to access port COM1, using this container binding with the COM port GUID, you also get access to all other COM ports! Keep in mind that you must use the class of devices as binding. This is the table from that page with all device types supported: Device Type I found out that Microsoft recently documented this as part of the “Containers on Windows” documentation. The only challenge I had was: how do I bind a Windows COM port to a Docker module?
This made me thinking… Will this code run on Windows too? Bindings Once I upgraded the docker file, I was able to ingest data from a serial port in Linux, running native C# code! Net Core 3.1, I removed all C code, removed the C# wrapper for the C code and introduced the same Serial IO class for both Windows and Linux.
Net Core 3.1, I took some time to update our IoT Edge Serial module. Click the Inbound Rules category on the left. This launches Windows Defender Firewall with Advanced Security. Once Windows Firewall opens, click on Advanced Settings. We also well documented how Linux physical ports should be exposed inside containers by binding the serial port names.īecause Microsoft recently released a new Azure IoT Edge C# module template, supporting. Clicking Start, type Windows Firewall into the search box, and then click on Windows Defender Firewall. For Linux, a trick using C code was executed while the container loaded for the very first time. Net C# Serial IO classes were only supported in Windows. The first version of this IoT Edge Serial module was in fact based on the work done by Microsoft in the Modbus module. This is part of a bigger story, our IoT Edge foundation, where we share the stuff we think other IoTEdgers will find useful too. Together with my friend Jan Willem Groenenberg, we created this module able to read from and writing to serial ports: In the last couple of weeks, I did some rework on another project. Check those ports after Windows assignes them a COM port, there should be written 'in-use'. Click on the drop down menu COM Port Number, and we see that all COM ports available. Choose Port Settings and click Advanced 4. It is possible to use this module on devices running Windows 10!īut first a little side-step. From the middle pane, expand Ports (COM & LPT), right-click on any of the available ports and Properties 3. Why? The documentation stated, “RTU is currently not available in Windows environment, please use Linux host + Linux container to play with RTU mode”.Īnd if something is documented in the readme, it’s true, isn’t it?
But I did not check out Windows support until recently. In the past, I have already blogged about using serial ports on Linux with this module. This module handles both Modbus TCP (over the local network) and Modbus RTU (over serial ports). Microsoft supports a Modbus module for Azure IoT Edge.