IMPORTANT:

All Oculus Quest developers MUST PASS the concept review prior to gaining publishing access to the Quest Store and additional resources. Submit a concept document for review as early in your Quest application development cycle as possible: https://developer.oculus.com/quest-pitch/

For additional information and context, please see "Submitting Your App to the Oculus Quest Store".
Welcome to the Oculus Developer Forums!

Your participation on the forum is subject to the Oculus Code of Conduct.

In general, please be respectful and kind. If you violate the Oculus Code of Conduct, your access to the developer forums may be revoked at the discretion of Oculus staff.

How to send data(0,1,2,3) to an Arduino or Raspberry via Bluetooth or Wifi.

leagamedevleagamedev Posts: 3
NerveGear
edited October 15 in Oculus Quest Development
Hello readers!.
i am working on a medical project that uses VR for rehabilitation of people with certain kinds of traumas, physical and emotional (cant reveal more info about it).

I would like to know if there is a way to pair an Arduino or Raspberry with a Bluetooth module, so when i hit an object or do something in VR, the raspberry or arduino can read a 1,2,3,4 or a couple of chars.

My guess is 
1) Pair the oculus quest android to the arduino (can this be done?, or is it only for gamepads)
2) Use a wifi server and send messages over HTTP or OSC.
3) connecting directly to USB if possible, a long usb cable wouldn't bother that much.
To me, bluetooth would be the best one because it wouldnt require to use an external wifi , router, and extra program.

Any ideas? someone tried this already?.

Im working with Unity and Oculus SDK, but this is a platform agnostic solution, and there are many people already asking about this.

Also, can the arduino be seen as a "gamepad" somehow? so i send and receive input , like cheating the quest.

Comments

  • motorsepmotorsep Posts: 1,435 Oculus Start Member
    There are quite a few assets on UE4's Marketplace for this, but that UE4, not Unity.
  • DarkTableDarkTable Posts: 27
    Brain Burst
    You should investigate BLE (Bluetooth Low Energy). There are BLE modules that will work with Arduino, and there are several plugins in the Unity Asset Store that can communicate with BLE devices.
    (Here's one, I haven't used it, so can't endorse:
    https://assetstore.unity.com/packages/tools/network/bluetooth-le-for-ios-tvos-and-android-26661 )

    The main advantage of BLE is also it's disadvantage: You don't have to pair the BLE device with the Android device (Oculus Quest should behave the same as an Android device). The BLE device advertises a service and the Android devices requests a connection with a device advertising a particular service. Once the devices are connected you can send low bandwidth data over a serial connection (that should be handled by the Unity plugin).

    Since you don't have to pair the two devices it saves you the hassle of figuring out how to do that with Oculus' UI, but you will have to find and connect to the BLE device each session. That can be simplified by having your app remember the GUID of the last device it connected to and always try to reconnect to that one if it's available.

    (Of course this is assuming that since BLE (Bluetooth 4.0) is part of standard Android and Oculus Quest is an Android device it "should just work.")
  • DarkTableDarkTable Posts: 27
    Brain Burst
    If Bluetooth won't work another way this could be done is with a Raspberry PI running a websocket server over WiFi. The Unity app could connect to that server either manually by entering an IP address, or automatically using Bonjour/ZeroConf. I did a prototype Android TV app that did this, it should work the same on a Quest.
  • casey.kawamuracasey.kawamura Posts: 10
    NerveGear
    @DarkTable Are you saying that the Quest doesn't need to connect with the BLE to send a signal? I am struggling to try to get my HC-05 to connect over Bluetooth. I can't input a PIN code to connect because no keyboard is available on the screen. 


  • dmendmen Posts: 1
    NerveGear
    Adafruit makes bluetooth modules for Arduino that you can connect to from Unity. We used one for a home run derby game that had an Arduino and BT module housed in a plastic bat. But the app ran on a laptop - not on a Quest. I would think it should be doable though but I have no proof of this. :)
Sign In or Register to comment.