# \[Free\]\[Windows only\] UE4Duino 2 - Arduino (COM port) communication

**URL:** <https://forums.unrealengine.com/t/free-windows-only-ue4duino-2-arduino-com-port-communication/95217>\
**Category:** Programming & Scripting\
**Tags:** unreal-engine\
**Created:** [June 27, 2017, 12:46am UTC](https://forums.unrealengine.com/t/free-windows-only-ue4duino-2-arduino-com-port-communication/95217 "2017-06-27T00:46:47Z")\
**Posts on this page:** 20\
**Page:** 2

<div class="post-metadata">

**Author:** ![RVillani](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/rvillani/32/1194572_2.png) [@RVillani](https://forums.unrealengine.com/u/RVillani)\
**Post date:** [September 1, 2017, 2:25am UTC](https://forums.unrealengine.com/t/free-windows-only-ue4duino-2-arduino-com-port-communication/95217/24 "2017-09-01T02:25:43Z")

</div>

@HysiK That error means invalid Handle. It doesn’t help much. Are you using the monitor with Arduino at the same time as you use it with Unreal? Because you can’t open a COM port for two programs at once.

@game_master_jodan Nice one, man!

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_b0a5a8fe](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_b0a5a8fe](https://forums.unrealengine.com/u/anonymous_user_b0a5a8fe)\
**Post date:** [September 1, 2017, 11:09am UTC](https://forums.unrealengine.com/t/free-windows-only-ue4duino-2-arduino-com-port-communication/95217/25 "2017-09-01T11:09:12Z")

</div>

Hi, I previously had a project working in Unity, I have jumped ship and would like to now have the following MyoWear Sensor ] working in UR4 with a little help from the URDuion Plugin. Please would some one take a little time to help me. ? I am happy to speak directly on a live chat / video chat to speed thing up and donate a little for your help.

Please contact me asap.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_b0a5a8fe](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_b0a5a8fe](https://forums.unrealengine.com/u/anonymous_user_b0a5a8fe)\
**Post date:** [September 1, 2017, 12:46pm UTC](https://forums.unrealengine.com/t/free-windows-only-ue4duino-2-arduino-com-port-communication/95217/26 "2017-09-01T12:46:23Z")

</div>

Can I have some help creating the Blue prints / Functions / Variables Please?

---

<div class="post-metadata">

**Author:** ![xG\_V3RT](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@xG\_V3RT](https://forums.unrealengine.com/u/xG_V3RT)\
**Post date:** [September 1, 2017, 1:34pm UTC](https://forums.unrealengine.com/t/free-windows-only-ue4duino-2-arduino-com-port-communication/95217/27 "2017-09-01T13:34:09Z")

</div>

I’ve gotten the Blueprint to work and am able to control elements within the game engine now (Yay!)  
However, I’m not sure if it’s the Blueprint or what but I am getting a flashing every now and then even when the button is held down.

When I watch my serial monitor it seems consistent, but it’s hard to tell. Is there a known issue with the plugin or maybe issues with how I have approached this that could do that, or should I focus on the hardware side of things?

---

<div class="post-metadata">

**Author:** ![RVillani](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/rvillani/32/1194572_2.png) [@RVillani](https://forums.unrealengine.com/u/RVillani)\
**Post date:** [September 2, 2017, 6:05am UTC](https://forums.unrealengine.com/t/free-windows-only-ue4duino-2-arduino-com-port-communication/95217/28 "2017-09-02T06:05:46Z")

</div>

@PolyBionics I answered you on Skype 🙂

> [@jwsargent.me](#):
>
> I’ve gotten the Blueprint to work and am able to control elements within the game engine now (Yay!)  
> However, I’m not sure if it’s the Blueprint or what but I am getting a flashing every now and then even when the button is held down.
> 
> When I watch my serial monitor it seems consistent, but it’s hard to tell. Is there a known issue with the plugin or maybe issues with how I have approached this that could do that, or should I focus on the hardware side of things?

Your Blueprint seems pretty solid to me. Is there some delay on the Arduino loop code? Because then, even with the button being held down, Unreal would read a non-zero byte on one frame and then, for several frames, read nothing (that gives you zero). So Arduino should be sending the bytes to Unreal at least **as fast as** UE can read them each frame. Or even faster (bytes wouldn’t accumulate because you’re preventing that with FlushPort, so no problem)

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_b25516ac](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_b25516ac](https://forums.unrealengine.com/u/anonymous_user_b25516ac)\
**Post date:** [October 2, 2017, 4:53pm UTC](https://forums.unrealengine.com/t/free-windows-only-ue4duino-2-arduino-com-port-communication/95217/29 "2017-10-02T16:53:59Z")

</div>

This does not appear to work for ports over 10. This worked geat for lower ports but I don’t have any available one the machine at work Is there a workaround?

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_34c406be](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_34c406be](https://forums.unrealengine.com/u/anonymous_user_34c406be)\
**Post date:** [October 8, 2017, 7:51am UTC](https://forums.unrealengine.com/t/free-windows-only-ue4duino-2-arduino-com-port-communication/95217/30 "2017-10-08T07:51:08Z")

</div>

Hey,  
I’m doing a C++ UE4 project. please assist me how to use this plugin in C++.  
thank you

---

<div class="post-metadata">

**Author:** ![RVillani](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/rvillani/32/1194572_2.png) [@RVillani](https://forums.unrealengine.com/u/RVillani)\
**Post date:** [October 10, 2017, 11:16pm UTC](https://forums.unrealengine.com/t/free-windows-only-ue4duino-2-arduino-com-port-communication/95217/31 "2017-10-10T23:16:46Z")

</div>

> [@Bawboc](#):
>
> This does not appear to work for ports over 10. This worked geat for lower ports but I don’t have any available one the machine at work Is there a workaround?

I’ve just tested in a packaged game using COM 13. Worked just fine. Look for errors in the Output Log to see what’s not working.

---

<div class="post-metadata">

**Author:** ![RVillani](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/rvillani/32/1194572_2.png) [@RVillani](https://forums.unrealengine.com/u/RVillani)\
**Post date:** [October 10, 2017, 11:17pm UTC](https://forums.unrealengine.com/t/free-windows-only-ue4duino-2-arduino-com-port-communication/95217/32 "2017-10-10T23:17:40Z")

</div>

> [@ricco\_igle](#):
>
> Hey,  
> I’m doing a C++ UE4 project. please assist me how to use this plugin in C++.  
> thank you

What’s your understanding level of C++ in Unreal? Where are you stuck?

---

<div class="post-metadata">

**Author:** ![knotff](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@knotff](https://forums.unrealengine.com/u/knotff)\
**Post date:** [October 19, 2017, 4:05pm UTC](https://forums.unrealengine.com/t/free-windows-only-ue4duino-2-arduino-com-port-communication/95217/33 "2017-10-19T16:05:05Z")

</div>

> [@](#):
>
> @gaofei7439 That’s weird. I did the same setup as you and this is what I got:  
> ![e5da7ad445ba14c54a50c003392704316a2f31fb.jpeg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/e/5/d/e5da7ad445ba14c54a50c003392704316a2f31fb.jpeg)
> 
> Are you sure the Arduino code was uploaded to the Arduino board?  
> Or maybe there’s something else in your Blueprint consumig the characters by accident and ReadLine just works because it finds anything there, like the "  
> ".

Getting the exact same thing.  
Using the provided script “ArduinoTypesExample”.  
It works on the Serial Monitor on the IDE if I type in “lines”, but getting nothing on the UE editor. Lines comes out as blank, Float as 0.0 and Integer as 0.

I know the Arduino to UE communication is working, because I made a light turn on/off with a button using this example : [https://www.arduino.cc/en/Tutorial/DigitalReadSerial](https://www.arduino.cc/en/Tutorial/DigitalReadSerial)

What I did notice is that typing the commands on the Serial Monitor only works if “No line ending” is selected, the other options return nothing. Could this be the issue since there is option for that in the “Write LIne End” in Blueprint?

 ![96305d528dbe0f3c6cea4c41f5189a81.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/b/0/5/b055b6764e65f4bf8225dc83121f8d234ac052f7.png)  
 ![96305d528dbe0f3c6cea4c41f5189a81.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/b/0/5/b055b6764e65f4bf8225dc83121f8d234ac052f7.png)

---

<div class="post-metadata">

**Author:** ![knotff](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@knotff](https://forums.unrealengine.com/u/knotff)\
**Post date:** [October 21, 2017, 7:16pm UTC](https://forums.unrealengine.com/t/free-windows-only-ue4duino-2-arduino-com-port-communication/95217/34 "2017-10-21T19:16:34Z")

</div>

Just to add one more info on my last post:  
The RX light on the arduino board does lit up every time press the “F” key, so something is happening… just not seeing the result on the board.

---

<div class="post-metadata">

**Author:** ![DanielDurys](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@DanielDurys](https://forums.unrealengine.com/u/DanielDurys)\
**Post date:** [October 25, 2017, 9:49am UTC](https://forums.unrealengine.com/t/free-windows-only-ue4duino-2-arduino-com-port-communication/95217/35 "2017-10-25T09:49:55Z")

</div>

Is a chance to get binaries for 4.18 unreal version?

---

<div class="post-metadata">

**Author:** ![RVillani](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/rvillani/32/1194572_2.png) [@RVillani](https://forums.unrealengine.com/u/RVillani)\
**Post date:** [October 31, 2017, 9:11pm UTC](https://forums.unrealengine.com/t/free-windows-only-ue4duino-2-arduino-com-port-communication/95217/36 "2017-10-31T21:11:04Z")

</div>

> [@DanielDurys](#):
>
> Is a chance to get binaries for 4.18 unreal version?

Added it to [the latest release](https://github.com//UE4Duino/releases/tag/v2.2.1)

> [@knotFF](#):
>
> Getting the exact same thing.  
> Using the provided script “ArduinoTypesExample”.  
> It works on the Serial Monitor on the IDE if I type in “lines”, but getting nothing on the UE editor. Lines comes out as blank, Float as 0.0 and Integer as 0.

That’s weird. This is my setup:

 ![Arduino.png](https://d3kjluh73b9h9o.cloudfront.net/original/3X/c/3/c3646777531e6563ac46af6866dd8813480d724e.png)  
And it works. Baud Rate is set to 9600 to match the script’s.

---

<div class="post-metadata">

**Author:** ![knotff](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@knotff](https://forums.unrealengine.com/u/knotff)\
**Post date:** [November 1, 2017, 3:30pm UTC](https://forums.unrealengine.com/t/free-windows-only-ue4duino-2-arduino-com-port-communication/95217/37 "2017-11-01T15:30:23Z")

</div>

> [@](#):
>
> Added it to [the latest release](https://github.com//UE4Duino/releases/tag/v2.2.1)
> 
> That’s weird. This is my setup:
> 
> ![Arduino.png](https://d3kjluh73b9h9o.cloudfront.net/original/3X/c/3/c3646777531e6563ac46af6866dd8813480d724e.png)  
> And it works. Baud Rate is set to 9600 to match the script’s.

* * *

Thanks for the 4.18 update!

Thing remain the same on my end. Everything works on the SERIAL MONITOR, but nothing happens on the Editor.  
Furthermore, when I package the project to WIN64 (which was not working for either versions on 4.17) , I cannot open any port. I did a loop to go through 1-50 port, but they all turn FALSE.

![image_121594.png](https://d3kjluh73b9h9o.cloudfront.net/original/3X/8/c/8cce4d98c9e397a1a245c1e85648b53f39b67259.png)  
Editor Output Log

 ![752634ebddf051b30f3ab7a102a89e9f.png](https://d3kjluh73b9h9o.cloudfront.net/original/3X/e/c/ece1fe9fb0237a324433b137d4615c049dab33af.png)  
Setup

 ![14c5a4c261ee400ce458485bbec3dd12.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/3X/0/c/0cc6aff69ddf59e64b6535bff88e6e3217e9af16.jpeg)  
Unable to open port when running EXE

![d4edf1c58fcb4beae9041370ddf03275.png](https://d3kjluh73b9h9o.cloudfront.net/original/3X/5/e/5e418934e2d615836742920df663e7bb284656c1.png)  
Running error on WIN32 (4.18) and Wind32/64 on 4.17.

---

<div class="post-metadata">

**Author:** ![DanielDurys](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@DanielDurys](https://forums.unrealengine.com/u/DanielDurys)\
**Post date:** [November 2, 2017, 8:10am UTC](https://forums.unrealengine.com/t/free-windows-only-ue4duino-2-arduino-com-port-communication/95217/38 "2017-11-02T08:10:18Z")

</div>

knotFF, you can’t use the same port in UE and in Serial Monitor at the same time 🙂 I had this problem, just close Serial Monitor and UE4 will now can use the port.  
**, thank you for the 4.18 binaries 🙂**

---

<div class="post-metadata">

**Author:** ![knotff](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@knotff](https://forums.unrealengine.com/u/knotff)\
**Post date:** [November 2, 2017, 1:32pm UTC](https://forums.unrealengine.com/t/free-windows-only-ue4duino-2-arduino-com-port-communication/95217/39 "2017-11-02T13:32:50Z")

</div>

> [@DanielDurys](#):
>
> knotFF, you can’t use the same port in UE and in Serial Monitor at the same time 🙂 I had this problem, just close Serial Monitor and UE4 will now can use the port.  
> **, thank you for the 4.18 binaries 🙂**

Sure thing. But what I meant was, I can see it working in the Serial Monitor, where I type in “lines” or “float” or “int”, I get the desired feedback. On the other hand, when I run it on the UE Editor, with the Serial Monitor closed (otherwise the COM port won’t open), I get no reading from Arduino.

This is what I should be getting (image from **@]([https://forums.unrealengine.com/member/30654-](https://forums.unrealengine.com/member/30654-))** post #12):

![image_121594.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/d/d/5/dd55d2534ca704401b30985b140625b7ef5bca89.png)

But this is what I get:  
 ![image_121594.png](https://d3kjluh73b9h9o.cloudfront.net/original/3X/8/c/8cce4d98c9e397a1a245c1e85648b53f39b67259.png)

You can see I get nothing after the brackets and the FALSE printed there is because the comparison to the text, which is turning negative.  
Nonetheless, when I make a build of a level and run the EXE, I cannot open any PORT, even looping the OPEN PORT from 1-50. This is the happening on 2 different machines.  
I wonder if I am missing some Library or something like that.

---

<div class="post-metadata">

**Author:** ![RVillani](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/rvillani/32/1194572_2.png) [@RVillani](https://forums.unrealengine.com/u/RVillani)\
**Post date:** [November 8, 2017, 12:06am UTC](https://forums.unrealengine.com/t/free-windows-only-ue4duino-2-arduino-com-port-communication/95217/40 "2017-11-08T00:06:20Z")

</div>

@DanielDurys You are welcome, mate!

@knotFF You are also welcome and, as for your problems, solutions follow below. Hope these help!

I’ve had the port not opening problem in a project, without errors or anything, and the problem was that Unreal simply was not compiling the plugin. It also happened with another plugin in another project. Seems kinda random.

After some fiddling (days of it) **the solution was to make the plugin not load by default and re-enable it in the plugins window**. Here’s how you do it without corrupting any Blueprints already using the plugin:

- Close the editor
- Open the **[Project]\Plugins\UE4Duino\UE4Duino.uplugin** file in a text editor (like Notepad)
- Change \*\*“EnabledByDefault”: true \*\*to **false**
- Open the \*\*[Project][Project].uproject \*\*file in a text editor
- Before the final closing curly bracket ( **}** ) add a **comma** and:

```auto

"Plugins": 
	   {
	       "Name": "UE4Duino",
	       "Enabled": true
	   }
	]

```

- Save both files, launch the project and build it to test. Avoid Win32 as it never worked for me without VS 2015. And the error message window you posted has to do with DirectX, not the plugin ([FONT=courier new]WindowsD3D11Device.cpp).

As for the “Arduino not responding back in Unreal” problem, found the issue:  
You are sending the [FONT=courier new]float command, not [FONT=courier new]lines. So the script answers with 4 bytes that make a float. That doesn’t end with a line break, thus [FONT=courier new]ReadLine won’t work (even for reading the bytes).

---

<div class="post-metadata">

**Author:** ![knotff](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@knotff](https://forums.unrealengine.com/u/knotff)\
**Post date:** [November 9, 2017, 5:04pm UTC](https://forums.unrealengine.com/t/free-windows-only-ue4duino-2-arduino-com-port-communication/95217/41 "2017-11-09T17:04:32Z")

</div>

> [@](#):
>
> @DanielDurys You are welcome, mate!
> 
> @knotFF You are also welcome and, as for your problems, solutions follow below. Hope these help!
> 
> I’ve had the port not opening problem in a project, without errors or anything, and the problem was that Unreal simply was not compiling the plugin. It also happened with another plugin in another project. Seems kinda random.
> 
> After some fiddling (days of it) **the solution was to make the plugin not load by default and re-enable it in the plugins window**. Here’s how you do it without corrupting any Blueprints already using the plugin:
> 
> - Close the editor
> - Open the **[Project]\Plugins\UE4Duino\UE4Duino.uplugin** file in a text editor (like Notepad)
> - Change \*\*“EnabledByDefault”: true \*\*to **false**
> - Open the \*\*[Project][Project].uproject \*\*file in a text editor
> - Before the final closing curly bracket ( **}** ) add a **comma** and:
> 
> ```auto
> 
> "Plugins": 
> {
> "Name": "UE4Duino",
> "Enabled": true
> }
> ]
> 
> ```
> 
> - Save both files, launch the project and build it to test. Avoid Win32 as it never worked for me without VS 2015. And the error message window you posted has to do with DirectX, not the plugin ([FONT=courier new]WindowsD3D11Device.cpp).
> 
> As for the “Arduino not responding back in Unreal” problem, found the issue:  
> You are sending the [FONT=courier new]float command, not [FONT=courier new]lines. So the script answers with 4 bytes that make a float. That doesn’t end with a line break, thus [FONT=courier new]ReadLine won’t work (even for reading the bytes).

@  
Thanks so much for the plug-in solutions not loading on build. That was spot on:

No in regards to the “UE4Duino/ArduinoTypesExample”, I continue to get no data from Arduino\<\>Unreal. When I use “lines” I get nothing back (Read Line), when I use float (ReadBytes+BytesToFloat or ReadAFloat) I get “0.0”. Same with ''int", where I get a “0”.

 ![e31047cebb665342f08ef6c88dc06d10.png](https://d3kjluh73b9h9o.cloudfront.net/original/3X/0/f/0f788864c066f26c4bf0a14602ce976ccdb73a89.png)  
 ![b47cc60c2117364d82dde221733be4d3.png](https://d3kjluh73b9h9o.cloudfront.net/original/3X/8/d/8d948660fdb326bde7cb68f8ad14cdc7b421fc5f.png)

---

<div class="post-metadata">

**Author:** ![joeycampbell](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@joeycampbell](https://forums.unrealengine.com/u/joeycampbell)\
**Post date:** [November 13, 2017, 8:42pm UTC](https://forums.unrealengine.com/t/free-windows-only-ue4duino-2-arduino-com-port-communication/95217/42 "2017-11-13T20:42:15Z")

</div>

Hi - thanks for the plugin - a great creation!  
I am having a small problem with my sensor readings.I am bringing in a float from Arduino which has two decimal places (1.05, 3.09, 0.01 etc).

The sensor readings appear fine on the serial window in Arduino…but when I bring the float readings into unreal the data is not so clean.  
I think the data readings when brought into unreal sometimes get jumbled up…for example it seems as though sometimes the float value is put on two lines instead of one line.  
I have tried using read float and read line but no improvement with either.

I have not included “? is valid” or put in a “0.1 delay” - could this cause a problem ?  
Is it better not to bring in decimal points - should I multiply all data by 100 in arduino and bring it in as an int and then divide inside my blueprint ?  
Any advice would be great.

---

<div class="post-metadata">

**Author:** ![joeycampbell](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@joeycampbell](https://forums.unrealengine.com/u/joeycampbell)\
**Post date:** [November 14, 2017, 11:02am UTC](https://forums.unrealengine.com/t/free-windows-only-ue4duino-2-arduino-com-port-communication/95217/43 "2017-11-14T11:02:27Z")

</div>

Hi - as per my last message this is what is causing issues with my readings (in the screenshot one of the lines appears as it should and the other appears on two lines)…any ideas?

[Previous page](https://forums.unrealengine.com/t/free-windows-only-ue4duino-2-arduino-com-port-communication/95217.md?page=1)

[Next page](https://forums.unrealengine.com/t/free-windows-only-ue4duino-2-arduino-com-port-communication/95217.md?page=3)
