I hear ya! I’ll check back here in a week or two. Thanks again!
In Serial.cpp, Line 77-81, missing argument nPort
FString szPort;
if (nPort < 10)
szPort = FString::Printf(TEXT(“COM%d”), nPort);
else
szPort = FString::Printf(TEXT("\\.\COM%d"), nPort);
Hi,
I m new in UE,I basically unity developer,I plan to shift to UE for getting AAA Quality out.I tested this on UE 4.20.3 [SUP][SUB]UE4Duino 2 UE 4.20.2 version on my UE 4.20.3 [/SUB][/SUP] its not working - Port not Opening
while running UE i try to open Arduino software and run my program its working on Arduino software.So my understand in new code UE not creating/opening serial port
@yuanny THANK YOU for spotting that one!! Can’t believe I did that!
@Shauntezuma and [USER=“443233”]Praven P Jose[/USER] Can you check if it’s working now? Thanks, guys!
Here’re the binaries for 4.20.3.
Just found this plugin and think it’s perfect for what I am trying to accomplish. I’m 100% new to Arduino, never looked into them until I found this plugin. I will probably have lots of questions, but first off is it possible to control more than one Arduino with UE4 using this plugin? Also is there a good tutorial you can point me towards to get me going with this plugin?
Quick questions:
- Is the port speed fixed at 9600?
- How many ports are supported at 9600 if its fixed?
I want to transfer a lot of information really quickly. The information will be coming from a triple redundant flight sensor system on a high quality flight controller. I can get data off the flight controller as one or many streams, but it will need to be a lot of information coming to UE4 over serial.
I could do this with Ardupilot, but I want to do it with UE4 just for the challenge. My UE4 flight simulator worked out and now I’m cocky. Gonna make a UE4 controlled drone. It may even happen on a single board computer on the drone. Lattepanda seems to be offering me a ridiculously overpriced way to pull this bad idea off and I can’t resist.
Well, the discussions here will help you a lot.
You can connect to several Arduinos, as long as you know the port numbers. Just create a different variable for each connection and never forget to close them before the end of your game.
I don’t know about any tutorials, but the images that come with the plugin might help you. And the brief explanation in the first post of this thread.
- Not fixed. I’ve use very high speeds already.
- At 9600 or otherwise, as many ports as Windows can work with. Even with numbers of 10 and above.
BTW, if you’ll want to transfer a lot of different variables at once, you might want to create some kind of protocol, like I briefly described in this post.
Thanks for the suggestion . The discussion helped out a lot. I’m having an issue though, the open serial port blueprint is failing. I have the port set to my Arduinos Com number of 4 (found in the arduino software). I’m using UE4 4.20.1
EDIT: Nevermind. I just saw the release note for version 2.2.3 that fixed the bug which was preventing port from opening. I have 2.2.2 installed in my plugins. I will get the updated version! Thanks for being on top of that and fixing the issue already!
I’ve toned my system down but its good to know the speed is available. I have been testing and working on my code, the whole system needed to be pared down from what I had originally intended. I am actually thinking about doing other things with the plug in now though. I’m still working on the drone, its just starting to bog down waiting for parts and genius.
Presently stuck on noise. I based my system on an ARM M4 controller, its a rocket on the breadboard but holy smokes is it prone to reset on electrical noise. I’m finding that when it says optional capacitor on the diagrams, what they really mean is “only a noob wouldn’t put one there.”
edit: just passing through then off to download and setup the plugin.
This is awesome!
lol Noise is always a ■■■■■, ain’t it?
I filtered it in a project by storing the values in an array and using the array’s average value as output. The bigger the array, the stronger the filter. I got very good results at 60fps with a 3-values array. Smooth and still close to the original signal. But for higher framerates, more values might be needed.
Hey there,
I am using the plugin for a current project of mine in UE 4.19.2 and can`t get it to pack. I am getting following error message:
Apparently the file UE4-UE4Duino.lib is missing: I thought that it somehow got deleted so I downloaded the zip again to check if it was in the originally downloaded content but it wasnt. It would be awesome if anyone could tell me what I`m missing here.
/
//Edit:
After browsing countless other threads now, I figured that I overread the instructions. I put the plugin into the installation folder of Unreal and not into the Project folder. After putting it into the project folder and compiling it, it was packing the project as expected.
Hey - I’ve been on another job the last month and a half. I’m finally back to this project. Tested the code and it’s working (as I guessed you knew) Thanks Yuanny and !!!
I see a lot of folks always asking for step by step tutorials…I appreciate this so much I’ll try to knock a few “hello” world tutorials in the next few days.
Best,
Shaun
Hi. First off, thanks for writing this plugin, it’s precisely what I need to complete my CS project!
I am trying to accomplish something similar to what game_master_jodan did with the UE4Duino plugin here:
If anyone could help me write blueprints that would send specific commands to the Arduino and have it successfully execute something based on what it receives like this, it would really be appreciated. I managed to make the blueprints that would trigger the command, as well as the blueprints that open the Serial connection successfully, getting UE4 and Arduino to understand each other is what’s stumping me.
This is my first time trying to use Blueprints so I am sorta confused :rolleyes:.
I made a quick tutorial for using this plugin: https://www.youtube.com/watch?v=XvfG56fa_Lk Thanks for making it!
Best, Shaun
Hey @, thanks a lot for this plugin. It works very well so far, I also have some questions:
- Is it possible to detect if a port is connected to an Arduino device? I’m finding open ports to other devices with “Open Serial Port” (I hoped to make an auto-detection for the Arduino port)
- Losing parts of the message seems normal from what I read here? Or is it speed related? (Read about the protocol method)
- Sending strings through pressing a button on my Arduino board delays the message longer and longer, the longer I press. Say I press the button down for 5 seconds. I’ll have a good half a second of delay where message are still arriving in Unreal. While if I press the button just quickly, it also instantly stops in Unreal again.
Cheers!
-
Serial communication is kinda neutral to Windows. It can’t recognize devices. What you could try is to send some message to the device and expect a specific response to confirm it is the one you want.
-
It’s write/read speed related. If you flush before reading everything, you’ll lose what haven’t read yet. Unless you open the connection in Arduino and Unreal with different baud rates. Then I guess you might really lose stuff because both devices are talking and listening completely out of sync.
-
That might be a problem with how you are reading in Unreal and your Arduino code. If, in Unreal, you expect a line ender, like with ReadLine, it’ll wait until one is found. Then, if in Arduino you are only sending the line ender after you release the button, you’re halting everything.
Hey @
-
Ah, I see… That’s what I’m doing right now, sending a message every second.
-
I actually read about “bouncing” in regards to buttons. It might be that. There’s lots of stuff to find with Google in regards to it.
Thank you for the quick answer!
all i need is to start the arduino and that’s it. i dont need input from arduino all i need is when i press play, the arduino starts. how do i do that? thanks