Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 14 Next capture
2021 2022 2023
2 captures
12 Jun 22 - 14 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
  • Help Room /
avatar image
0
Question by infinitesunrise · Mar 20, 2016 at 10:21 PM · androidnetworkingcommunicationbike

Unity (PC/Mac) communication with Non-Unity (Android/iOS) over LAN?

I'm developing a PC/Mac game where you fly a pedal-powered glider around the countryside, controlled by a smart indoor bike trainer. Sort of a modern clone of Namco's arcade game PropCycle. The bike trainer is a Wahoo Kickr Snap and I already have it interacting with an Android app using Wahoo's own Android API, controlling resistance and reporting wattage. The Unity game on the desktop is also working well. My problem is that I just don't know how to get the two applications to communicate with each other over the LAN.

I'm aware that for Unity-to-Unity communication you can use the HLAPI, and that you can define custom communication with the Transport Layer API. But I have no idea if either of these can help me talk to a regular old Android app, and if so how. I'm of intermediate skill and have never done any network programming so I don't really know where to start. But I know that this trainer-app-desktop bridge setup has been done before by Zwift via their Zwift Mobile Link for Android/iOS, I just can't find info on how they did it. I'd only need to communicate a few floats between the app and desktop, roughly once per second. And I assume the app would have to discover the desktop game on the network, or vice versa.

Is there a standard way of doing this unity-to-non-unity connection / communication? Or maybe a plugin / library that can facilitate, either on the Android or Unity side? Those would both be ideal, but if the correct way forward is to educate myself about sockets or something low-level like that I'd just as much appreciate being pointed in the right direction for my research.

PS if anyone is curious as to why I have the bike connected to an Android app and not just an ANT+ dongle on the PC it's because I just don't own one nor do many others, but everyone has a Bluetooth-capable phone, and I can make the app talk to more trainer APIs besides the Wahoo in the future.

Comment
Add comment · Show 1
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image leer7512 · Apr 28 at 02:53 AM 0
Share

Now, I am going to develop the Unity video game using Wahoo Kickr bike and HR.

It seems like you are connected Wahoo Kickr with Unity game.

I hope to know if you can help us.

Looking forward to hearing back from you.

Best regards

Robert

2 Replies

· Add your reply
  • Sort: 
avatar image
0

Answer by WazzaM · Aug 14, 2016 at 12:37 AM

Hello, @infinitesunrise your question was posted about 5 months ago so I don't know if you're still looking for an answer but here's a one anyway.

The Unity Networking Low Level API lets you send messages between Unity games/apps running on Android and PC - that is both running some Unity app you build. Not necessarily same app but both built with Unity. Android <-> PC very doable. See Scripting reference for UnityEngine.Networking.NetworkTransport for details. https://docs.unity3d.com/ScriptReference/Networking.NetworkTransport.html

The Unity API documentation is not super great and the API itself gives bad names for things ('AddHost' which should be "CreateSocket") so I've written a wrapper and have a nice demo for it. My wrapper go beyond the the static NetworkTransport class and has classes for LowLevelClient and LowLevelServer that make that easier and there's a nice demo that's a chat client using this library.

Here's a short video of me running it on my PC. (PC EXE file to Unity Editor Run). https://www.youtube.com/watch?v=VTA83d52MY4

I have also tried building the project for Android and it runs great on my mobile - discovering PC server via broadcasting, connecting, sending and disconnecting just the same from Android as on PC.

Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Beatn1ck · Aug 19, 2016 at 05:17 PM 0
Share

Hi Wazza$$anonymous$$, do you have any examples of the code you linked in the video?

avatar image
0

Answer by SyafiqBahrin · Jan 17 at 03:32 AM

Hi @infinitesunrise , this is a very old post, so I hope that you have solved your problem.

I'm here to ask you you a question instead, for research purpose. I have trouble to get the data from the wahoo kickr into my unity for dekstop game development. Couldn't find the UUID from the wahoo fitness equipment services provided in here https://docplayer.net/42079050-Wahoo-fitness-equipment-profile.html

How did you managed to get it done in Unity for desktop?

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

89 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

(C#) UDP broadcast between unity editor and windows phone 0 Answers

How to add realtime game events without updating build? 1 Answer

[HELP] Problem in multiplayer networking code in c# 0 Answers

HELP! Interactive instalation- networking 0 Answers

Photon synchronization on different devices failes 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges