Announcement

Collapse
No announcement yet.

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

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Originally posted by RVillani View Post

    I want to test it as soon as possible, but this week I'm on two tight deadlines, so it'll be really hard to focus on the plugin.
    I hear ya! I'll check back here in a week or two. Thanks again!

    Comment


      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);

      Comment


        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 UE4Duino 2 UE 4.20.2 version on my UE 4.20.3

        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

        Comment


          yuanny THANK YOU for spotting that one!! Can't believe I did that!
          Shauntezuma and Praven P Jose Can you check if it's working now? Thanks, guys!
          Here're the binaries for 4.20.3.
          Freelancer Game Dev Generalist and Unreal Consultant | Portfolio
          Unreal products: Dynamic Picture Frames, Neo Kinect

          Comment


            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?

            Comment


              Quick questions:

              1. Is the port speed fixed at 9600?
              2. 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.

              Comment


                Originally posted by dixonian89 View Post
                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?
                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.
                Freelancer Game Dev Generalist and Unreal Consultant | Portfolio
                Unreal products: Dynamic Picture Frames, Neo Kinect

                Comment


                  Originally posted by Vitorius714 View Post
                  Quick questions:

                  1. Is the port speed fixed at 9600?
                  2. 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.
                  1. Not fixed. I've use very high speeds already.
                  2. 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.
                  Freelancer Game Dev Generalist and Unreal Consultant | Portfolio
                  Unreal products: Dynamic Picture Frames, Neo Kinect

                  Comment


                    Originally posted by RVillani View Post

                    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.
                    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!
                    Last edited by dixonian89; 10-16-2018, 11:20 AM.

                    Comment


                      Originally posted by RVillani View Post

                      1. Not fixed. I've use very high speeds already.
                      2. 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.
                      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.
                      Last edited by Vitorius714; 11-07-2018, 09:15 PM. Reason: Almost forgot to mention...

                      Comment


                        This is awesome!

                        Comment


                          Originally posted by Vitorius714 View Post
                          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."
                          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.
                          Freelancer Game Dev Generalist and Unreal Consultant | Portfolio
                          Unreal products: Dynamic Picture Frames, Neo Kinect

                          Comment


                            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:


                            UATHelper: Packaging (Windows (64-bit)): LINK : fatal error LNK1181: Eingabedatei "C:\Program Files\Epic Games\UE_4.19\Engine\Plugins\UE4Duino\Binaries\Win64\UE4-UE4Duino.lib" kann nicht ge�ffnet werden.
                            UATHelper: Packaging (Windows (64-bit)): ERROR: UBT ERROR: Failed to produce item: D:\MEDIA\UNREAL ENGINE\UE4_Arduino_Mockup\Binaries\Win64\UE4_Arduino_Mockup-Win64-DebugGame.exe
                            PackagingResults: Error: UBT ERROR: Failed to produce item: D:\MEDIA\UNREAL ENGINE\UE4_Arduino_Mockup\Binaries\Win64\UE4_Arduino_Mockup-Win64-DebugGame.exe
                            UATHelper: Packaging (Windows (64-bit)): Total build time: 36,09 seconds (Local executor: 0,00 seconds)
                            UATHelper: Packaging (Windows (64-bit)): Took 36,2876135s to run UnrealBuildTool.exe, ExitCode=5
                            UATHelper: Packaging (Windows (64-bit)): ERROR: Command failed (Result:5): C:\Program Files\Epic Games\UE_4.19\Engine\Binaries\DotNET\UnrealBuildTool.exe UE4_Arduino_Mockup Win64 DebugGame -Project="D:\MEDIA\UNREAL ENGINE\UE4_Arduino_Mockup\UE4_Arduino_Mockup.uproject" "D:\MEDIA\UNREAL ENGINE\UE4_Arduino_Mockup\UE4_Arduino_Mockup.uproject" -NoUBTMakefiles
                            -remoteini="D:\MEDIA\UNREAL ENGINE\UE4_Arduino_Mockup" -skipdeploy -noxge -NoHotReload -ignorejunk. See logfile for details: 'UnrealBuildTool-2018.11.20-17.14.38.txt'
                            UATHelper: Packaging (Windows (64-bit)): (see C:\Users\User\AppData\Roaming\Unreal Engine\AutomationTool\Logs\C+Program+Files+Epic+Games+UE_4.19\UAT_Log.txt for full exception trace)
                            PackagingResults: Error: Command failed (Result:5): C:\Program Files\Epic Games\UE_4.19\Engine\Binaries\DotNET\UnrealBuildTool.exe UE4_Arduino_Mockup Win64 DebugGame -Project="D:\MEDIA\UNREAL ENGINE\UE4_Arduino_Mockup\UE4_Arduino_Mockup.uproject" "D:\MEDIA\UNREAL ENGINE\UE4_Arduino_Mockup\UE4_Arduino_Mockup.uproject" -NoUBTMakefiles -remoteini="D:\MEDIA\UN
                            REAL ENGINE\UE4_Arduino_Mockup" -skipdeploy -noxge -NoHotReload -ignorejunk. See logfile for details: 'UnrealBuildTool-2018.11.20-17.14.38.txt'
                            UATHelper: Packaging (Windows (64-bit)): AutomationTool exiting with ExitCode=5 (5)
                            UATHelper: Packaging (Windows (64-bit)): BUILD FAILED
                            PackagingResults: Error: Unknown Error

                            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.

                            /Sh4rp



                            //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.
                            Last edited by Sh4rp_; 11-21-2018, 04:05 AM.

                            Comment


                              Originally posted by RVillani View Post
                              yuanny THANK YOU for spotting that one!! Can't believe I did that!
                              Shauntezuma and Praven P Jose Can you check if it's working now? Thanks, guys!
                              Here're the binaries for 4.20.3.
                              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 RVillani!!!!
                              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

                              Comment


                                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:

                                Originally posted by game_master_jodan View Post
                                This is the code for my basic arduino 4xrelay board. I use a baut rate (arduino and Ue4) of 1200, seems enough to me. What ever I write to the serial it gets parsed as a integer (ParseInt). So... when I write 10 to the serial relay 1 gets switched off. When I write 11, relay 1 gets switched on. same for 20 21 30 31 40 41. There is no trickery just write according to the docs to the serial port. Works absolutely perfect for me and a big thanks to the creators of this plugin and Ue4. Hope it helps someone.
                                (slightly modified Arduino code

                                // Basic 4 Realy board connection

                                // Each relay is turned on and off when sending 10 11 20 21 30 31 40 41
                                // You can here them click as there state changes from off to on and on to
                                // off.

                                // You will also see the corresponding Red LED on the 4 Relay board
                                // light up when the relay is on.

                                // define names for the 4 Digital pins On the Arduino
                                // These data pins link to 4 Relay board pins IN1, IN2, IN3,IN4

                                #define RELAY1 13
                                #define RELAY2 7
                                #define RELAY3 8
                                #define RELAY4 9

                                long mydata = 0;

                                void setup() {
                                // Initialise the Arduino data pins for OUTPUT
                                Serial.begin(9600);
                                Serial.setTimeout(10);

                                pinMode(RELAY1, OUTPUT);
                                pinMode(RELAY2, OUTPUT);
                                pinMode(RELAY3, OUTPUT);
                                pinMode(RELAY4, OUTPUT);
                                }

                                void loop() {

                                while (Serial.available() == 0) {}
                                mydata = Serial.parseInt();
                                if (mydata == 10) {
                                digitalWrite(RELAY1, LOW);
                                }
                                if (mydata == 11) {
                                digitalWrite(RELAY1, HIGH);
                                }
                                if (mydata == 20) {
                                digitalWrite(RELAY2, LOW);
                                }
                                if (mydata == 21) {
                                digitalWrite(RELAY2, HIGH);
                                }
                                if (mydata == 30) {
                                digitalWrite(RELAY3, LOW);
                                }
                                if (mydata == 31) {
                                digitalWrite(RELAY3, HIGH);
                                }
                                if (mydata == 40) {
                                digitalWrite(RELAY4, LOW);
                                }
                                if (mydata == 41) {
                                digitalWrite(RELAY4, HIGH);
                                }
                                }
                                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 .

                                Comment

                                Working...
                                X