Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Question Create HMI in Unity

Discussion in 'HMI & Embedded Systems' started by beckerfr, Jun 6, 2021.

  1. beckerfr

    beckerfr

    Joined:
    Jun 6, 2021
    Posts:
    4
    Hallo everyone,

    I'm new here. I have a short question. I would like to create a HMI in Unity that shows me some data. Currently i have a Raspberry Pi (Python-Script) with different Sensors, I would like to display this sensor data live in the HMI. Is there a way to connect the Raspberry pi to unity?

    Thanks a lot !
     
  2. sxa

    sxa

    Joined:
    Aug 8, 2014
    Posts:
    736
  3. neginfinity

    neginfinity

    Joined:
    Jan 27, 2013
    Posts:
    13,267
    Ethernet, USB, Bluetooth. You can also plug a WIFI dongle into it, apparently.
     
  4. beckerfr

    beckerfr

    Joined:
    Jun 6, 2021
    Posts:
    4
    Thank you very much. Can you give me a tip on how best to process the data in Unity? How can I display the data? Do I have to program this in C#? Please excuse my inexperience, is my first project in Unity
     
  5. Antypodish

    Antypodish

    Joined:
    Apr 29, 2014
    Posts:
    10,512
    If you use network, you can use sockets.
    You will need create communication protocol, between Pi an unity application.
    You would need client-host link, to send messages.

    You can make Pi as host, using python and then client using Unity.

    Also you could use local server, with DB, which is closest thing to the OPC. Then pi and unity can communicate with server.

    There is many ways of doing so. But if you can communicate with a sql server, for example using PHP, that would give you some flexibility. And you can easily store stae of your system. Also historical rending. But may be overcomplicated, depending on the project requirements.
     
    Last edited: Jun 7, 2021
  6. neginfinity

    neginfinity

    Joined:
    Jan 27, 2013
    Posts:
    13,267
    There's no "the best way", you do it however you want.
    You'll have to program this in C# on unity side. You can program it in whatever you want on raspberry pi side.

    If you're going to use networking (ethernet or wifi), you'll be doing sockets programming, just how @Antypodish said.