Announcement

Collapse
No announcement yet.

UE4Duino - Arduino to UE4 plugin Release!

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

  • #31
    Originally posted by grizly32 View Post
    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!
    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.

    Comment


    • #32
      Originally posted by wimmm View Post
      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 (https://forums.unrealengine.com/show...in-OSC-for-UE4). 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

      Best,

      wim

      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
      http://www.fusionlabz.com

      Comment


      • #33
        Just wanted to let you all know that I released another update to the plugin....please see the top post for details.
        http://www.fusionlabz.com

        Comment


        • #34
          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.

          Comment


          • #35
            Hi, I have problems with getting serial connection to work reliably.
            Here is the log message:
            Code:
            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.

            Comment


            • #36
              Originally posted by stressless View Post
              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.
              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!
              -Tim


              Originally posted by 7hny View Post
              Hi, I have problems with getting serial connection to work reliably.
              Here is the log message:
              Code:
              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 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
              http://www.fusionlabz.com

              Comment


              • #37
                Originally posted by grizly32 View Post
                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.
                Code:
                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
                Last edited by 7hny; 05-18-2015, 07:01 AM.

                Comment


                • #38
                  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.Click image for larger version

Name:	HR BP.PNG
Views:	1
Size:	96.7 KB
ID:	1078643

                  Comment


                  • #39
                    Originally posted by karanparikhpgl View Post
                    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.[ATTACH=CONFIG]40303[/ATTACH]
                    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!

                    -Tim
                    http://www.fusionlabz.com

                    Comment


                    • #40
                      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

                      Comment


                      • #41
                        Hi,

                        I believe some plugins are not compatible with source builds (Kinect 4 Unreal is one example) I'm trying to use the Leap motion and Kinect plugins together but that is not possible right now. I'm not sure if the same issue applies to the UE4Duino plugin but I have a feeling it is the case.

                        Comment


                        • #42
                          Hi Tim,


                          Thanks, I realized I had forgotten to connect Read Serial to Set. After the connection the Blueprint seems to work but the issue is that HR is always set to 0. I don't know why that is happening. When I open the serial monitor in my Arduino IDE I can see values for Heart Rate being displayed. Also is my method to close serial on pressing J correct? Thanks

                          Comment


                          • #43
                            Hey karanparikhpgl,

                            I tried using your setup and was able to get everything to work right....here is the blueprint:

                            Click image for larger version

Name:	2015-05-23_10-47-36.jpg
Views:	1
Size:	78.3 KB
ID:	1078788

                            I see that you have your baud rate set to 115200...is it set to that in your arduino sketch as well?

                            And you can use a keyboard press to close the serial, but it would probably be better to add it to add it to Event End Play instead just to be sure it is closed.

                            Hope this helps! Let me know if you get it to work!

                            -Tim
                            http://www.fusionlabz.com

                            Comment


                            • #44
                              Forgot to mention that the proper way to use "Is Serial Port Open" node is to use it with a Branch:

                              Click image for larger version

Name:	2015-05-23_11-01-32.jpg
Views:	1
Size:	93.7 KB
ID:	1078789
                              http://www.fusionlabz.com

                              Comment


                              • #45
                                MacOS port?

                                Originally posted by grizly32 View Post
                                Right now it's only for Win64 but I will see if I can port it over to MacOS this weekend.
                                How did you go with the MacOS port?

                                Comment

                                Working...
                                X