Search Unity

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:
    741
  3. neginfinity

    neginfinity

    Joined:
    Jan 27, 2013
    Posts:
    13,566
    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,769
    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,566
    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.