<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>VSC &#8211; esa@1410</title>
	<atom:link href="https://e1410.be/category/projet/vsc/feed/" rel="self" type="application/rss+xml" />
	<link>https://e1410.be</link>
	<description>You&#039;re only here for a short visit. Don&#039;t hurry, don&#039;t worry. And be sure to smell flowers along the way</description>
	<lastBuildDate>Sat, 12 Feb 2022 17:36:17 +0000</lastBuildDate>
	<language>fr-FR</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=7.0.2</generator>

<image>
	<url>https://e1410.be/wp-content/uploads/2023/12/cropped-20210600-VresseSurSemois-20210627-111524-32x32.jpg</url>
	<title>VSC &#8211; esa@1410</title>
	<link>https://e1410.be</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>Arduino-Howto-VSC-02-SerialCOM Whit Hyper V</title>
		<link>https://e1410.be/2022/02/12/5408/</link>
		
		<dc:creator><![CDATA[admin]]></dc:creator>
		<pubDate>Sat, 12 Feb 2022 17:34:41 +0000</pubDate>
				<category><![CDATA[Projet]]></category>
		<category><![CDATA[VSC]]></category>
		<guid isPermaLink="false">https://e1410.be/?p=5408</guid>

					<description><![CDATA[1 Goal 1 2 Setup an Arduino programmer on a Virtual machine 2 2.1 SERIAL COM MAP with CHANGE PORT 3 2.2 SERIAL COM MAP with VSPE 3 2.3 Upload Squetch 4 3 VM : SERIAL with Pipe 5 4 Pipe 2 COM 6 4.1 NP2COM 6 4.2 Check COM in the VM 6 4.3 [&#8230;]]]></description>
										<content:encoded><![CDATA[<p><a href="#post-5408-_Toc95581991">1 Goal 1</a></p>
<p><a href="#post-5408-_Toc95581992">2 Setup an Arduino programmer on a Virtual machine 2</a></p>
<p><a href="#post-5408-_Toc95581993">2.1 SERIAL COM MAP with CHANGE PORT 3</a></p>
<p><a href="#post-5408-_Toc95581994">2.2 SERIAL COM MAP with VSPE 3</a></p>
<p><a href="#post-5408-_Toc95581995">2.3 Upload Squetch 4</a></p>
<p><a href="#post-5408-_Toc95581996">3 VM : SERIAL with Pipe 5</a></p>
<p><a href="#post-5408-_Toc95581997">4 Pipe 2 COM 6</a></p>
<p><a href="#post-5408-_Toc95581998">4.1 NP2COM 6</a></p>
<p><a href="#post-5408-_Toc95581999">4.2 Check COM in the VM 6</a></p>
<p><a href="#post-5408-_Toc95582000">4.3 VM SERIAL 6</a></p>
<p><a href="#post-5408-_Toc95582001">4.4 Check COM with Arduino 8</a></p>
<p><a href="#post-5408-_Toc95582002">4.4.1 Baud Rate 8</a></p>
<p><a href="#post-5408-_Toc95582003">5 Serial with RDP 9</a></p>
<h1><a id="post-5408-_Toc95581991"></a>Goal</h1>
<p>The goal is to use a USB Serial connected on a Hyper V Host for a VM.</p>
<p>There are several solutions and it depends of the program which can detect serial in device manager or in registry.</p>
<h1><a id="post-5408-_Toc483131211"></a><a id="post-5408-_Toc95581992"></a>Setup an Arduino programmer on a Virtual machine</h1>
<p>The Physical COM port to program the Arduino is on the Host Machine (W2012) and detected as « COM4 »</p>
<p><img width="239" height="58" class="wp-image-5409"  / loading="lazy" decoding="async" src="https://e1410.be/wp-content/uploads/2022/02/word-image.png"></p>
<p>Make a RDP with Port activated as Local resources :</p>
<p><img width="546" height="314" class="wp-image-5410"  / loading="lazy" decoding="async" src="https://e1410.be/wp-content/uploads/2022/02/word-image-1.png"></p>
<p>On the VM, it is not detected in Device Manager , but can be checked in registry :</p>
<p><img width="783" height="396" class="wp-image-5411"  / loading="lazy" decoding="async" src="https://e1410.be/wp-content/uploads/2022/02/word-image-2.png"></p>
<p>You can also see that COM 4 in the VM is linked to TSclient COM4 (it is a rdpDrPort):</p>
<p><img width="354" height="69" class="wp-image-5412"  / loading="lazy" decoding="async" src="https://e1410.be/wp-content/uploads/2022/02/word-image-3.png"></p>
<p>Some program like IDE Arduino can use dieectly the COM4. So, there is nothing to do.</p>
<p>But other program like VSC can’t detect the COM 4 as it isn’t detected in Device manager.</p>
<h2><a id="post-5408-_Toc95581993"></a>SERIAL COM MAP with CHANGE PORT</h2>
<p><a href="https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/change-port">https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/change-port</a></p>
<p>change port [&lt;portX&gt;=&lt;portY&gt;| /d &lt;portX&gt; | /query</p>
<p>You can MAP a serial with the command : change port COM1=COM4</p>
<p><img width="396" height="176" class="wp-image-5413"  / loading="lazy" decoding="async" src="https://e1410.be/wp-content/uploads/2022/02/word-image-4.png"></p>
<h2><a id="post-5408-_Toc95581994"></a>SERIAL COM MAP with VSPE</h2>
<p>In the VM, create a MAP between PORT 1 and port 4 : <a href="http://www.eterlogic.com/Products.VSPE.html">http://www.eterlogic.com/Products.VSPE.html</a></p>
<p><img width="786" height="533" class="wp-image-5414"  / loading="lazy" decoding="async" src="https://e1410.be/wp-content/uploads/2022/02/word-image-5.png"></p>
<p>Now, you can see that COM1 is linked to COM 4 :</p>
<p><img width="354" height="76" class="wp-image-5415"  / loading="lazy" decoding="async" src="https://e1410.be/wp-content/uploads/2022/02/word-image-6.png"></p>
<h2><a id="post-5408-_Toc95581995"></a>Upload Squetch</h2>
<p>With VSC, upload squetch : it works</p>
<p><img width="1058" height="235" class="wp-image-5416"  / loading="lazy" decoding="async" src="https://e1410.be/wp-content/uploads/2022/02/word-image-7.png"></p>
<h1><a id="post-5408-_Toc95581996"></a>VM : SERIAL with Pipe</h1>
<p>change port /query</p>
<p><img width="463" height="101" class="wp-image-5417"  / loading="lazy" decoding="async" src="https://e1410.be/wp-content/uploads/2022/02/word-image-8.png"></p>
<p>Create a pipe with the <strong>VM stopped</strong>.</p>
<p>Shutdown the VM</p>
<p><img width="287" height="27" class="wp-image-5418"  / loading="lazy" decoding="async" src="https://e1410.be/wp-content/uploads/2022/02/word-image-9.png"></p>
<p>Set-VMComPort -VMName W2019-DEV -Number 1</p>
<p>Path: \\ .\pipe\SERIAL1 (it&rsquo;s a arbitrary name : give a name to a new pipe on the host).</p>
<p>Set-VMComPort -VMName W2019-DEV -Number 2 <a href="file:///\\.\pipe\PipeDream2">\\.\pipe\PipeDream2</a></p>
<p>Check the port created :</p>
<p>Get-VMComPort -VMName W2019-DEV</p>
<p><img width="448" height="124" class="wp-image-5419"  / loading="lazy" decoding="async" src="https://e1410.be/wp-content/uploads/2022/02/word-image-10.png"></p>
<p><strong>I don’t think I was able to make a serial connection with pipe. It doesn’t work</strong></p>
<h1><a id="post-5408-_Toc95581997"></a>Pipe 2 COM</h1>
<ul>
<li><a href="https://github.com/albertjan/PipeToCom">https://github.com/albertjan/PipeToCom</a></li>
<li><a href="https://www.makingtechhappen.com/pipedream-for-hyper-v-2/">https://www.makingtechhappen.com/pipedream-for-hyper-v-2/</a></li>
</ul>
<h2><a id="post-5408-_Toc95581998"></a>NP2COM</h2>
<p>On the Host Hyper V start c:\Program1\NP2COM\NP2COMV.exe</p>
<p>Select the pipe + select the correct baud rate and click on testing :</p>
<p><img width="744" height="232" class="wp-image-5420"  / loading="lazy" decoding="async" src="https://e1410.be/wp-content/uploads/2022/02/word-image-11.png"></p>
<h2><a id="post-5408-_Toc95581999"></a>Check COM in the VM</h2>
<p>Check that the RDP on the VM doesn&rsquo;t have the option PORT select (to avoid conflict) :</p>
<p><img width="315" height="91" class="wp-image-5421"  / loading="lazy" decoding="async" src="https://e1410.be/wp-content/uploads/2022/02/word-image-12.png"></p>
<h2><a id="post-5408-_Toc95582000"></a>VM SERIAL</h2>
<p><img width="939" height="444" class="wp-image-5422"  / loading="lazy" decoding="async" src="https://e1410.be/wp-content/uploads/2022/02/word-image-13.png"></p>
<p>Test with Kitty</p>
<p><img width="446" height="234" class="wp-image-5423"  / loading="lazy" decoding="async" src="https://e1410.be/wp-content/uploads/2022/02/word-image-14.png"> <img width="1225" height="783" class="wp-image-5424"  / loading="lazy" decoding="async" src="https://e1410.be/wp-content/uploads/2022/02/word-image-15.png"></p>
<p>Install as a service :</p>
<p>c:\windows\microsoft.net\framework\v4.0.30319\installutil.exe -t c:\Program1\NP2COM\NP2COMS.exe</p>
<h2><a id="post-5408-_Toc95582001"></a>Check COM with Arduino</h2>
<h3><a id="post-5408-_Toc95582002"></a>Baud Rate</h3>
<p>The first think is to know the baud rate of Arduino Board.</p>
<p>Start Kitty on the Host HyperV and select baud rate to be able to read the Serial from arduino board : 115000</p>
<p><img width="548" height="118" class="wp-image-5425"  / loading="lazy" decoding="async" src="https://e1410.be/wp-content/uploads/2022/02/word-image-16.png"></p>
<p>On the VM , I don’t get something correct at the same speed : 115000</p>
<p><img width="308" height="91" class="wp-image-5426"  / loading="lazy" decoding="async" src="https://e1410.be/wp-content/uploads/2022/02/word-image-17.png"></p>
<p>In the setting NP2COM, it is not correct</p>
<p><img width="688" height="219" class="wp-image-5427"  / loading="lazy" decoding="async" src="https://e1410.be/wp-content/uploads/2022/02/word-image-18.png"></p>
<p>Restart service :</p>
<p><img width="694" height="125" class="wp-image-5428"  / loading="lazy" decoding="async" src="https://e1410.be/wp-content/uploads/2022/02/word-image-19.png"></p>
<p>Now, it is correct :</p>
<p><img width="360" height="119" class="wp-image-5429"  / loading="lazy" decoding="async" src="https://e1410.be/wp-content/uploads/2022/02/word-image-20.png"></p>
<p>Conclusion : change baud rate setting in IDE Arduino or KITTY is not important as it is fixed in the NP2COM</p>
<p><strong>Unfortunately, I was never able to download a squetch with Arduino IDE.</strong></p>
<h1><a id="post-5408-_Toc95582003"></a>Serial with RDP</h1>
<p>Connect with Port enable in Local resources :</p>
<p><img width="547" height="374" class="wp-image-5430"  / loading="lazy" decoding="async" src="https://e1410.be/wp-content/uploads/2022/02/word-image-21.png"></p>
<p>COM 4 not detected with Hardware manager :</p>
<p><img width="271" height="90" class="wp-image-5431"  / loading="lazy" decoding="async" src="https://e1410.be/wp-content/uploads/2022/02/word-image-22.png"></p>
<p>But detected in Registry :</p>
<p><img width="589" height="144" class="wp-image-5432"  / loading="lazy" decoding="async" src="https://e1410.be/wp-content/uploads/2022/02/word-image-23.png"></p>
<p>With Arduino IDE, the Serail COM 4 can be selected :</p>
<p><img width="575" height="451" class="wp-image-5433"  / loading="lazy" decoding="async" src="https://e1410.be/wp-content/uploads/2022/02/word-image-24.png"> <img width="479" height="257" class="wp-image-5434"  / loading="lazy" decoding="async" src="https://e1410.be/wp-content/uploads/2022/02/word-image-25.png"></p>
<p>Flash done :</p>
<p><img width="881" height="328" class="wp-image-5435"  / loading="lazy" decoding="async" src="https://e1410.be/wp-content/uploads/2022/02/word-image-26.png"></p>
]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
