Hi - has anyone managed to get this working on 4.13 ?
I tried using the latest plugin after creating a c++ class in my game and installing Visual Studio. I placed the UE4DUINO folder inside a plugins folder in my project folder and re-opened unreal.
I don’t get any errors when opening my project, I can use the UE4DUINO serial nodes inside blueprint…the only problem is it doesn’t read anything from my arduino. I’ve used this for my last project in v4.10 so I’m aware that the serial window must be closed in arduino. I’m working off windows 10. Any feedback would be great as otherwise I will have to install an older version.
Thanks
Hello ,
I have download UE4Duino for UE4.10 and I have trouble with Read functions. I have windows 10 on my computer so I know there are some errors there, but all of the others functions work perfect and now I am stuck. I wanted to try UE4Duino plugin 4.9 for windows 10 but your link doesnt work. Have someone solved the read functins for windows 10 yet and how?
For windows 10 try using the 4.8 or 4.9 that have a windows 10 version
I have tried using 4.8 and 4.9 plugin for Unreal 4.8 and 4.9 projects, but have still error with Read functions.
Solved it with Arduinokit plugin for UE4.
how about 4.13?
Assure it works in win10+UE4.13+visual studio2015.The important thing is to convert your project to be C++ compatible first and UE could build the plugin.
Hey ,
I found your plugin works well in 4.10.4, however the new version (4.13) doesn’t recognize your plugin (version 4.10). also it often crushes when was running on unreal 4.10.4.
Please let me know is there any means that I can fix this issue, or any means to run your plugin on unreal 4.13?
Many thanks!
P.S: your plugin is awesome!
[UPDATE] Rewritten from ground, packagable, several Arduinos at once and no crashes so far
UPDATE!
UE4Duino 2.0
First of all, thanks a lot to @ for saving me time on understanding how to use serial ports on C++ in Windows!
I’ve rewritten the plugin from ground up, but wanted to keep 's credits for the name and his initiative.
The zip below contains binaries for UE 4.14.0, but it should compile successfully since 4.11. Maybe even lower.
Download:
Attention: if updating it on an existing project, beware! You’ll need to change some stuff as it now works on instanced variables instead of a static connection.
USAGE
- You can use the Construct Object From Class node to create an instance of the Serial class and use the Open COM function to start the connection.
- Or you can use the static function Open COM Port, which will create the instance and open the port for you. Just remember to store that instance in some variable to use later!
- ALWAYS call Close COM before quitting the game (like on Event End Play). If you fail to do so, you won’t be able to reopen it unless you reconnect the device to the PC.
- For now, you have to check for input on Tick. Whatever kind of input you read for, it’ll return Success=true if there was input. But I intend to create a thread just for checking and notifying input changes with events.
CHANGE LOG
- Code is more Unrealish: hide windows platform types; switch from TCHAR] to FString; use *FMemory *methods; *int32 *instead of int; *bool *instead of *BOOL *etc.
- Works with COM10 and above. (If you change your COM to test it, you need to reconnect the device).
- Condensed everything into a single class: Serial.
- Not threaded. Reading when there’s no data to read will return instantly. When reading serial inside Arduino code, remember to use Serial.setTimeout(10) on the setup function, so the Serial.readStringUntil (and other functions that interpret a group of bytes) return faster.
- Added functions to read and write numeric data types (float, int, *byte *and byte array). On the Arduino side you must know how to convert byte arrays from/to these types.
- Added ability to read Strings by line or whole string found in serial.
- Added ability to work with more than one Arduino (COM) simultaneously. The class works with instanced objects instead of static variables.
- It packages successfully (tested on Development and Shipping modes).
- Changed logo and “Creator” on plugin description as I mostly rewrote it. But kept the name as it’s very nice and @ deserves its credits for starting the thing. Hoping he won’t mind much.
Awesome man, I was running into trouble with the old plugin, with the packaging of the game. Are there any special instructions for packaging the game for Windows 64 bit to include the plugin?
EDIT: It works, you’re a lifesaver. I’ve been working on this project for weeks and the deadline is tomorrow. The game finally cooks including the plugin, and correctly works as standalone game now.
EDIT2: Let me thank you again, your update really came just in time. I’ll record a video later this week of our VR + Arduino setup, it has turned out pretty cool.
Hey, I’ve been having trouble with ue4duino and this new plugin made by RVillani for the past three days, I thought changing to the newer version of the plugin might work but it doesn’t. I’m trying to make Unreal output through my Arduino and I do have a serial connection between the two, the problem is that any data I try to send to the Arduino doesn’t seem to go through. I’m relatively new to Unreal Blueprints and Arduino so I don’t know what I’m doing wrong, can I get some feedback?
Here’s my blueprint:
And here’s my Arduino code:
String input;
void setup() {
pinMode(12,OUTPUT);
digitalWrite(12,LOW);
Serial.begin(9600);
input = Serial.readString();
}
// the loop routine runs over and over again forever:
void loop() {
if(input == “palm”)
{
digitalWrite(12,HIGH);
Serial.println(“PALM”);
}
else if(input == “off”)
{
digitalWrite(12,LOW);
Serial.println(“OFF”);
}
}
Thanks
Hi,
thanks for your contribution. Helps a lot.
But I find something wrong. I’m using 4.10 version. When I first start the project, and choose ‘‘play’’ in the toolbar, if I send nothing from Arduino, the readserial funtion will act but won’t return anything. That’s right. Because I indeed receive nothing.
I send sth from arduino, the read function will receive successfully. However, after I stop playing, and playing the game again, also I send nothing from arduino, the readserial function will act and return a value which is the same as the last time. But actually the readserial function receive nothing. It seems when playing the game again, the read buffer was not cleared and remain the value received latest. @ could you help me? Thank you~
Does anyone have experience with splitting multiple values from Arduino? For example, I have 2 values input - the 1st for forw/backw movement, the 2nd for rotation. I have to make UE read them separately. How I can do that?
Career Electronics Tech here. If you are going to be controlling anything with an Arduino I would suggest at the very least that you use an optocoupler so this way what you are controlling is electrically isolated from your Arduino and PC.
But for controlling a device such as a fan I would suggest this You can find hundreds of such devices and most likely Arduino’s have their own brand of one as well. Electrically it most likely will look something like this, Those nifty blue arrows in that box indicates that the diode and transistor there communicate via light and thus are not electrically connected to each other.
Although really if you are driving anything more than an LED or logic, but something that is not attached to a high current source I would suggest some form of isolation, such as the attached image. This will let you power said device without having said device being electrically connected to your machine.
Some words of caution:
1- Unless you are driving logic, do not connect the ground of your high current circuit to the ground of your digital circuit. This is step one of bad things happening, so don’t take it.
2- Think of coils (such as the ones found in relays) as magnetic rubber bands. it takes a relatively long time to build the magnetic field but it will collapse very quickly and produce an inverse voltage spike, that is why you see that diode (and sometimes a ceramic cap) across the contacts for the coil. that is a protective device for both your safety and the safety of your hardware.
3- If you are working with a 120V line please make sure that your work looks neat, and that there is no way that connections can come loose and no exposed conductors, most likely you will live through a jolt from a 120V line but that is not written in stone, and accidents with those can cause a fire.
4- There are IRC channels dedicated to electronics on #freenode, and provided you have a good camera you can most likely find someone to help if needed.
5- Electrical Tape is the devil, don’t use it. Use heat shrink.
6-Use an inline fuse if you are driving something with line current, it will help make sure that your local fire fighters are board.
Hello,
first thanks a lot for the plugin! I am a newbee in Arduino/Unreal and it helps a lot to start with it. Yet there are some questions left. In my project I connected a switch-button via Arduino to UE, the Arduino-Script prints out eather “0” or “1”. With it I would like to control some actions in Unreal, for example the color of a light. Now one point is: The communication between Arduino/Unreal is working, but the reaction of the “Read Line - return value” is quite slow in UE (by the way in the previous plugin, it was´nt the case). I increased the Baud Rate to 4800 already which results in a better reactiontime. But I don’t know how it affects the program in general, maybe you have an idea, what to do?
The other question I have is how to continue with the recieved values. I made an equal (string) test as a condition, as it worked in the previous plugin, but somehow now it has no effect. Maybe another method is needed, but I don´t know what to do. Maybe you have a hint. I attached a screenshot. Best!
Hi - has anyone communicated to an arduino wirelessly from unreal ? If so can you let me know if you used xBee or bluetooth and was there any latency ?
I was using an Arduino YUN, horrible latency, but that was my problem by messing with complex stuff, its faster if you only use only chars, there is a lot of tuts in arduino’s forum for xBee, might you need one of those
Cheers
Hi ZkarmaKun - did you use xBee with Unreal - did you manage to get it working ?
Never, I tested xbee just 1 time before (not UE), either way XBee for arduino was deprecated long time ago, I strongly recommend you, use some wifi shield or YUN wich both of them has official support and the most important thing, you can use TCP or UDP that allow you easy connections
this is my sample
://youtube.com/watch?v=UojxRVAbESA
Hi,
Great plugin indeed !
Works like a charm for UE4 to Arduino communications
But i ve some issue with Arduino to UE4 reading string (i followed your example)
//Arduino side
int incomingByte = 0; // for incoming serial data
int x;
String str;
void setup() {
// put your setup code here, to run once:
Serial.begin(115200);
Serial.setTimeout(10);
}
void loop() {
// put your code here, to run repeatedly:
// send data only when you receive data:
if(Serial.available() > 0)
{
str = Serial.readStringUntil(‘o’);
x = Serial.parseInt();
if (str == “hell”){
Serial.write("hello
"); // not ok
Serial.write(“hello”); // not ok
Serial.print(“hello”); // not ok
Serial.print("hello
"); // not ok
Serial.println(“hello”); // not ok
}
}
}
i made a concat in blueprint and can say that there is something that comes from arduino:
a “z” is printed in UE4 for each character in the arduino print function
if arduino have Serial.print(“hello”), the ue4 function “read string” will be triggered 5 times but no character read
Hope the issue is clear enough
Any advice ? on it
many thanks for the great work anyway !