Announcement

Collapse
No announcement yet.

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

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

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

    Use this plugin to communicate with Arduino or other COM port devices on Windows.

    The GitHub page contains the source code and binaries. I try to keep it always updated with latest Engine Launcher version.

    UE 4.16 binaries download
    UE 4.17 binaries download
    UE 4.18 binaries download
    UE 4.19.2 binaries download
    UE 4.20.3 binaries download
    UE 4.21.1 binaries download
    UE 4.22.0 binaries download
    UE 4.23.1 binaries download
    All releases here.

    How to use it
    Create a Plugins folder in your project directory. Place the folder UE4Duino (the one that contains Source, Resources etc) in the Plugins folder.

    You can use the Open Serial Port function and store the result in a variable


    Or create the Serial object yourself and open the port afterwards

    Either way, never forget to call ClosePort on the Serial instance before quitting the game. EndPlayEvent is a good place for that. If you forget to do it, you'll have to unplug the Arduino (or other COM device) from the PC and plug it back.

    You can set the type of line endings used with the WriteLine function.


    There's an example Arduino script in UE4Duino/ArduinoTypesExample. It demonstrates how to send floats, ints and strings to Unreal.



    Credits
    Original version of the plugin was created by @gryzly32
    Thread for first version here.
    Last edited by RVillani; 11-05-2019, 12:11 PM. Reason: added 4.23.1 binaries link
    Freelancer Game Dev Generalist and Unreal Consultant | Portfolio
    Unreal products: Dynamic Picture Frames, Neo Kinect

    #2
    This is absolutely neat stuff. I love microcontroller, psd's, and fpga's. Well done.

    Comment


      #3
      Thanks! Me too!
      It's awesome when you make your game control real life electronics, lights etc.
      Freelancer Game Dev Generalist and Unreal Consultant | Portfolio
      Unreal products: Dynamic Picture Frames, Neo Kinect

      Comment


        #4
        Hey, really cool project! I'm having trouble using it though. I've installed it by placing it in a Plugins folder and everything. My problem is, when I go to add nodes in a blueprint, it seems that I only have "Open Serial Port." I can't find a Close Port, Read, or Write. New to Arduino and UE4, so I would be grateful if someone could walk me through this. Thanks!

        Comment


          #5
          Promote it to variable and drag from that.

          Comment


            #6
            Originally posted by nmkitch View Post
            Hey, really cool project! I'm having trouble using it though. I've installed it by placing it in a Plugins folder and everything. My problem is, when I go to add nodes in a blueprint, it seems that I only have "Open Serial Port." I can't find a Close Port, Read, or Write. New to Arduino and UE4, so I would be grateful if someone could walk me through this. Thanks!
            Look at the first example image. Promote the return value from OpenSerialPort to a variable. Than call the other functions from that variable.
            If you don't know how to do that, or what are instances and variables, you should study a bit more the Blueprint system and maybe some Object Oriented Programing too.
            Freelancer Game Dev Generalist and Unreal Consultant | Portfolio
            Unreal products: Dynamic Picture Frames, Neo Kinect

            Comment


              #7
              Important question: Everything works perfectly fine in the editor. When I build the "windows no editor version" the port doesnt open...... tryed with a delay or keypress but the port doesnt open and on the download page there there are 2 download versions 2.2.1 4.16 and 2.2 4.16.1 which makes it a bit confusing what is the newest.

              Anyway don't get me wrong, the thing is perfectly documented and I had a 3 step Fan working in half a day so thanks a lot!

              Hope you can help with how to open the port on a windows no editor build.

              And this is the warning: LogPluginManager:Warning: Engine version string in D:/Gebruikers/Gebruiker/Nieuwe map - kopie (3)/Unreal Projects/arduino_1/Plugins/UE4Duino/UE4Duino.uplugin could not be parsed ("4.16")

              Did some research myself, I guess this link is part of the solution, at least I hope.

              https://wiki.unrealengine.com/Plugin...With_Your_Game

              BTW: I use arduino to 4x relay and UE4 version 4.16.2
              Last edited by game_master_jodan; 07-18-2017, 11:11 AM.

              Comment


                #8
                Originally posted by game_master_jodan View Post
                Important question: Everything works perfectly fine in the editor. When I build the "windows no editor version" the port doesnt open...... tryed with a delay or keypress but the port doesnt open
                I've used it a lot in packaged games, so I know it works. Are you sure you're opening the correct port number on the packaged version? Or that the game or the Arduino IDE is not still using the port when you try it? Do you close the port when closing the game?

                Originally posted by game_master_jodan View Post
                on the download page there there are 2 download versions 2.2.1 4.16 and 2.2 4.16.1 which makes it a bit confusing what is the newest.
                2.2.1 is the latest. I removed the engine hotfix version because C++ APIs don't change between major versions, so the hotfix version doesn't matter.

                Originally posted by game_master_jodan View Post
                And this is the warning: LogPluginManager:Warning: Engine version string in D:/Gebruikers/Gebruiker/Nieuwe map - kopie (3)/Unreal Projects/arduino_1/Plugins/UE4Duino/UE4Duino.uplugin could not be parsed ("4.16")
                Just add " .1" at the end of the version string. (4.16.1)
                Freelancer Game Dev Generalist and Unreal Consultant | Portfolio
                Unreal products: Dynamic Picture Frames, Neo Kinect

                Comment


                  #9
                  Originally posted by RVillani View Post
                  Use this plugin to communicate with Arduino or other COM port devices on Windows.

                  The GitHub page contains the source code and binaries. I try to keep it always updated with latest Engine Launcher version.

                  UE 4.16.1 binaries download
                  All releases here.

                  How to use it
                  Create a Plugins folder in your project directory. Place the folder UE4Duino (the one that contains Source, Resources etc) in the Plugins folder.

                  You can use the Open Serial Port function and store the result in a variable


                  Or create the Serial object yourself and open the port afterwards

                  Either way, never forget to call ClosePort on the Serial instance before quitting the game. EndPlayEvent is a good place for that. If you forget to do it, you'll have to unplug the Arduino (or other COM device) from the PC and plug it back.

                  You can set the type of line endings used with the WriteLine function.


                  There's an example Arduino script in UE4Duino/ArduinoTypesExample. It demonstrates how to send floats, ints and strings to Unreal.



                  Credits
                  Original version of the plugin was created by [MENTION]gryzly32[/MENTION].
                  Thread for first version here.

                  I am confused; I want to konow does this plugin suit for UE4 4.16.2 . I have tested this plugin on UE4.16.2 ,and I used the Arduino code of example , But On UE4, The BP did receice somthing ,but diaplay nothing. I am in trouble for a few days, can you give me some suggestions? Thank you !

                  Comment


                    #10
                    Originally posted by gaofei7439 View Post
                    I am confused; I want to konow does this plugin suit for UE4 4.16.2 . I have tested this plugin on UE4.16.2 ,and I used the Arduino code of example , But On UE4, The BP did receice somthing ,but diaplay nothing. I am in trouble for a few days, can you give me some suggestions? Thank you !
                    Yes, it suits. I am using it myself in 4.16.2.
                    Show me the code you're using in Arduino and the Blueprint part.
                    Freelancer Game Dev Generalist and Unreal Consultant | Portfolio
                    Unreal products: Dynamic Picture Frames, Neo Kinect

                    Comment


                      #11
                      I created the Arduino code as follows:
                      void setup() {
                      // put your setup code here, to run once:
                      Serial.begin(9600);
                      Serial.setTimeout(5);

                      }

                      void loop() {
                      // put your main code here, to run repeatedly:

                      Serial.println("this is the new line ");
                      delay(1000);
                      }


                      And In UE4(4.16.2) I created a bp_cube (is this style ok?);
                      Click image for larger version

Name:	1.png
Views:	1
Size:	292.5 KB
ID:	1131540Click image for larger version

Name:	2.png
Views:	1
Size:	64.5 KB
ID:	1131541Click image for larger version

Name:	8.png
Views:	1
Size:	66.9 KB
ID:	1131546
                      This is my bp , When the program is runing , I pressed button L , from the ue4 ,I can see Click image for larger version

Name:	7.png
Views:	1
Size:	402.3 KB
ID:	1131545 , it indates it indeed receive some data ,but there is nothing display on the screen. and Click image for larger version

Name:	6.png
Views:	1
Size:	3.6 KB
ID:	1131544

                      can u tell me , how to solve it ? thank you
                      Attached Files
                      Last edited by gaofei7439; 07-26-2017, 02:02 AM.

                      Comment


                        #12
                        [MENTION=484398]gaofei7439[/MENTION] That's weird. I did the same setup as you and this is what I got:
                        Click image for larger version

Name:	gaofei.JPG
Views:	1
Size:	24.4 KB
ID:	1131629

                        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 "\r\n".
                        Freelancer Game Dev Generalist and Unreal Consultant | Portfolio
                        Unreal products: Dynamic Picture Frames, Neo Kinect

                        Comment


                          #13
                          Is it worth adding whitelisted platforms to the plugin? For example "WhitelistPlatforms" : [ "Win64", "Win32" ]

                          I have a Windows client acting as a server with the Arduino connection, but an Android app client that does not use but also can't compile the plugin (can't find AllowWindowsPlatformTypes.h )

                          Does this make sense or is there another way to compile an Android build when UE4Duino is included?

                          Comment


                            #14
                            Originally posted by AMIMA View Post
                            Is it worth adding whitelisted platforms to the plugin? For example "WhitelistPlatforms" : [ "Win64", "Win32" ]
                            I have a Windows client acting as a server with the Arduino connection, but an Android app client that does not use but also can't compile the plugin (can't find AllowWindowsPlatformTypes.h )
                            Does this make sense or is there another way to compile an Android build when UE4Duino is included?
                            From what I found so far, WhiteList and BlackList doesn't make a difference on compilation. The only way to make it not try to compile the plugin for Android is to remove the .uplugin file and re-generate visual studio project files, so it ignores the plugin completely. But then, if you are using it in other parts of the project, it'll break your project. I guess you'll have to do a project for PC and another separate one for the Android.
                            Freelancer Game Dev Generalist and Unreal Consultant | Portfolio
                            Unreal products: Dynamic Picture Frames, Neo Kinect

                            Comment


                              #15
                              Hi all UE4Duino users and really thanks for your great work [MENTION=30654]RVillani[/MENTION] .
                              I am testing some arduino + blueprint codes without success so far and I kindly ask for help.
                              Click image for larger version

Name:	blueprint ue4duino.png
Views:	1
Size:	184.6 KB
ID:	1132644Click image for larger version

Name:	arduino ue4duino.png
Views:	1
Size:	24.6 KB
ID:	1132645
                              Those images are my Arduino code and my blueprint code, I do not know what I am doing wrong my main goal is sending from UE4 string ON to Arduino and Arduino must read it and activate 2 digital pins.
                              EDIT: LogTemp:Error: Failed to open port COM3. Error: 00000006 this is what I have achieved, COM port is not opening neither working. Have tried so far, 3 differents usb ports + hub (2 ad 3.0).
                              Any help? Really thanks and best regards!
                              Last edited by HysiK; 08-19-2017, 06:42 PM. Reason: info

                              Comment

                              Working...
                              X