RVillani/UE4Duino

UE4Duino Windows only

Closed this issue · 4 comments

Just by curiosity why is it Windows only?

Good question... I was wondering how much work would it take to port it to linux

Because the Serial connection is using Windows' Win32 APIs. It's not UE4 portable code only.
To port it to other OSs the work, for each, would be:

  • I'd need to install them (either by multi-booting or VM);
  • Figure out how to use that OS;
  • Install Unreal;
  • Install an IDE;
  • Find out how to do Serial comms for said system;
  • Hope to not have to change the plugin's existent Blueprint API.

My wife works with embedded stuff using VM, and says usb ports work fine. Provided it's ok that you can't open the same usb device in both OSs at the same time, or you might break something.

But yeah, I didn't think about the native development vs cross-compiling, I only had in mind Linux as a target platform.
I also develop on Windows, but often I cross compile to Linux target device. I worked on a plugin recently that compiles for Linux arm64 (aka LinuxAArch64 or armv8, new platform for arm64 boards like nvidia jetson/raspberry pi 4b+). It's tricky to debug if the code is different on the target platform than on the workstation, but generally works fine.

Maybe something like execve("/bin/cat", ["/bin/cat", "/dev/hidraw4"], NULL) would do? Not sure how it would work with sudo / elevated permissions on execve, though.

I don't know much about the windows APIs for serial communication, but perhaps you don't need any API for linux, it's all exposed. Just opening a terminal it's possible to see the arduino's data by typing
sudo cat /dev/hidraw4 (or the number of the device, instead of 4)

As for the blueprint API, it works great, so it would be nice if it worked the same way...

Well, let us know if you happen to do some work on it, if I could be of any help just give me a shout too ;)

That's very nice of you :)
I'm not very familiar with Linux. I'm a tech artist most of the time and I mostly use Windows software for modeling, drawing etc. I'm working on a plugin with a team and one of the guys takes care of Linux (so even there I managed to avoid it LOL). But if you'd like to implement it, I'd appreciate a pull request. You seem to be very familiar with it. If you open Serial.h and Serial.cpp you'll see everything is quite straight forward. Perhaps the only adjustment needed would be to concentrate OS specific calls in their own functions, so all the #ifdef for system stuff would be close to each other.