UE4Duino - Arduino to UE4 plugin Release!

Hi Grizly,

I’m currently working on a project for which I use the input of five encoders via arduino to control the camera in unreal. Because I don’t don’t know cpp, I made a small app in Processing that reads the values from arduino and sends the data as osc messages to a port. I use monsieurgustav’s unreal-osc plugin to read in the values in unreal ([Plugin] OSC for UE4 - Engine Source & GitHub - Unreal Engine Forums). It would of course be handier to read the values straight from the arduino into unreal.

The way I read the values in processing at the moment is via a command that only reacts when there is something to be read at the serialport. It is not continuously reading the port, but only when there is a new value in the buffer. The osc plugin for unreal works similarly. An event is triggered when there is a message in the buffer to be read. The advantage of this is that I often have multiple messages from the different encoders that arrive very quickly one after the other. With the approach of reading the port with a tick event, it happens that I miss messages coming from the arduino because the tick works on every rendered frame and more data might have passed at the moment that is left unread.

Is it clear how I described it? Or i made it more confusing :slight_smile:

Best,

wim

When I try to launch or package my test game with this plugin, I get a black screen telling me that the UE4duino plugin is missing. It does show in my Windows>Plugins as being installed and enabled, is there something I am missing to have a plugin be packaged into a game? Thanks!

Edit:Capture1.PNG

Still having issues, possibly a windows 10 problem though.

With the Leonardo I am able to get the writes from Unreal to work fine, but read’s return nothing.
With a Uno or Mega I can’t communicate either way, but they both work fine with the serial display in the arduino programmer.
Trying to fix the driver for my Duemilanove and windows just BSOD on me so that 1s a bit interesting.
Going to give my Due a go at the moment which requires me to update the arduino software anyway so maybe that will relieve some headaches.

Yep still the same deal. Only board that I can actually get to open the serial port connection with is the Leonardo but I can’t get a read serial working with it even though just through the serial monitor I see everything working as expected.

What OS and boards are other guys using that have managed to get this to work correctly?

@nickadoo - I think you may have put the plugin folder in the wrong place. From your pic it looks like you put it in your engine folder, but it needs to go into your project folder…the plugin should show up under “Installed” at the bottom of the Plugin Window list. Let me know if that helps! :slight_smile:

@ZoltanJr - Hmmmm…not sure what the problem is, especially since you can write from Unreal to the Arduino but not read. Could be Windows 10. I am using Windows 7 x64 and the Arduino UNO R3…do you have a Win 7 or Win 8 system available to test it on?

Yeah it’s got me pretty stumped too. Definitely seems like it must be something odd going on with windows 10 since nobody else is reporting any issues with it.I will take some home with me over the weekend and give them a go on windows 8. Thanks for the update you did with being able to see if the connection has worked or not, at least narrows it down on the other boards, can’t quite see why the Leonardo writes but doesn’t read though. If I’m doing a read on tick then any write that I do in unreal should show up in the read correct?

Oh also I don’t see anything in the log with any of the boards but I can get a success on connection with the leonardo, not sure if that’s any indicator as to what the problem might be.

Thanks grizly32, I’ve tried both locations- and I receive the error each time. I looked around and a few sites said that you need to make your project a C++ project to have plugins get packaged. I installed Visual Studio and tried to do “add code to my project”, but still receive the module missing error. I’m on Windows 8 x64 if that helps!

Edit: I noticed that the “Port Opened/Closed” messages appear in the log if I hit play in the viewport. Still receiving the module missing error upon launch/packaging however.

Yes, the read on tick should show up. That example I showed a few posts up outputs a constant stream of "2"s to the screen.

You don’t get any notifications at all in the log? Not even anything saying that the port is not opened? If so then it seems like the plugin isn’t starting up at all. For example, if I start a scene with a blueprint that has just the ‘Open Serial’ node at ‘Event Begin Play’ and the ‘Close Serial’ at ‘Event End Play’ and don’t even hook the Arduino up I get a “ERROR: SERIAL PORT NOT OPENED!!” warning in the Output Log. That is strange that you don’t get any messages at all. Let me know how it goes on Windows 8!

Just came across this project, while i happen to recieve my Arduino Mega in the mail today! :stuck_out_tongue: Too bad i have no time to test out this awesomely goodness called UE4Duino ^^

Ok yep I get those notifications. I had the message log up not the **** output log! And I still definitely connect with the Leonardo, but it’s the only board which gets a success on opening the serial port for whatever reason. Trying to do some research into windows 10 issues with arduino, I have had driver problems with pretty much every board being automatically detected and had to manually do them, all except for the Uno oddly enough. I couldn’t get my 3D printer to connect at all, would just BSOD every time I tried to do anything with the drivers. So not sure if those drivers still aren’t co-operating or require something different. But with the serial monitor in arduino I can send serial commands without any problems.

Hopefully on my windows 8 machine it all works fine, but I hate having a problem that I can’t figure out any way to beat hah. Maybe your DLL needs to be compiled on a windows 10 machine or something and grab some extra library? Or maybe security settings are blocking other programs from sending outgoing signals over serial perhaps? I will keep ******** around but if anybody has any thoughts would be great to hear them.

Hey wim,

I see what you are saying now…that’s a good point! I will look into adding a serial event or something similar so data isn’t missed.

Thanks!
-Tim

Just wanted to let you all know that I released another update to the plugin…please see the top post for details. :slight_smile:

Cool, I have tested it on a Arduino Mega R3 2560 on Win7 64bit. And it worked straight away. That is, reading a simple printIn() from Arduino → UE4. And some simple buttons that change the printIn().
So far, I have not been able to send data back to the Arduino but I’m most likely doing something wrong. Trying to light a LED on port 13 when a Box was hit by a projectile. Anyway, thanks for this super cool plugin.

Hi, I have problems with getting serial connection to work reliably.
Here is the log message:


LogTemp: THREAD STARTED!!
LogTemp:Warning: ERROR: SERIAL PORT NOT OPENED!!
LogBlueprintUserMessages: Serial open!
LogStats:Warning: MetaData mismatch. Did you assign a stat to two groups? New //STATGROUP_Threads//ThreadTest///Thread_a90_0///////STATCAT_Advanced//// old //STATGROUP_Threads//ThreadTest///Thread_594_0///////STATCAT_Advanced////

Basically sometimes i can connect, sometimes not. When I am connected sometimes I can read serial, sometimes I cant.

What can be the reason of such erratic behaviour?
Tested on UnoR3, Nano and Mega2560.

Hey stressless! Glad you like the plugin!

Are you still having trouble with sending back to Arduino? If so, let me know and post your blueprint and Arduino sketch and I’ll try to help! :slight_smile:
-Tim

Hey 7hny!

Sorry you are having problems!

A lot of times is that if the serial port connects once and not the next time is that the port didn’t close properly or it is open somewhere else.

Be sure that the Arduino Serial Monitor is closed before running your UE4 level and also be sure to use the Close Serial node in your blueprint.

Hope that helps, but if not please post your blueprint and Arduino sketch and I will try to help you out further,

Thanks!
-Tim

Hi Tim!

Thank you for the reply. Connection issues aside (they are managable), I have problems with established connection, perhaps you can guide me how to mitigate them. I am on Win 8.1.

Close Serial is not working, after i open serial and close it, Is Serial Port Open returns true in the next session, despite log saying it was closed. When I print output of the serial (after closing it) it hangs to the last value.



LogTemp: THREAD CLOSED!!
LogTemp: SERIAL PORT CLOSED!!


I have no serial monitors connected etc. I tried various sketches, all of them works properly in other serial monitors.

Besides that, I’m not sure if/how can I do something like serial.available() with this plugin?

I was wondering if you could you share the source for this plugin?

Thanks,
7hny

This is a cool plugin! Thanks for building it. What I’m trying to do is rather uncomplicated, I have attached a Heart Rate monitor to my arduino and it serialprints the heart rate every line. I used the UE4Duino plugin an it seems to open the serial port fine. I am at a baud rate of 115200. However, when I try reading serial and converting string to int it doesn’t work. Can someone please help me. I need to convert to int to compare the heart rate with another value.

Hey karanparikhpgl,

It looks like you don’t have your execution line connected between your ‘Read Serial’ and ‘Set’ nodes so right now the blueprint is only executing up to the ‘Read Serial’ node.

Hope that helps! :slight_smile:

-Tim

Hey,

I’m with a small academic group attempting to build haptic gloves in conjunction with the Leap Motion. We’re controlling the gloves with an arduino and this project seems perfect for what we’re doing!

Right now we’re using an engine build from the github 4.7.6 source folder so we can use the built-in Leap Motion plug-in; when we attempt to load the project with this plug-in installed, the launcher warns that “UE4Editor-EU4Duino.dll is built with a different engine version” and prompts to rebuild (it won’t rebuild).

Not really sure how to address this issue. Do you have any insight?

Thanks,

Sean