comoc / TelloForUnity

Ryze Tech/DJI Tello application development resources for Unity
The Unlicense
41 stars 19 forks source link

Error getting video stream #1

Closed navsgit closed 6 years ago

navsgit commented 6 years ago

I'm using Unity 2018.1.5f1 When the project first loads, In Master scene, TelloVideo gameobject is missing two scripts and TelloBatteryStatus gameobject is missing one script. I assigned TelloController and TelloVideoTexturel and TextUpdater to respective objects. Now I'm able to control the drone no no video stream is showing. Editor throws following error Failed to load 'Assets/Plugins/x86_64/TelloVideoDecoder.dll', expected x64 architecture, but was Unknown architecture. You must recompile your plugin for x64 architecture. UnityEngine.SetupCoroutine:InvokeMoveNext(IEnumerator, IntPtr)

Any idea whats going on? thansk

comoc commented 6 years ago

Hi, Thank you for checking!

I rebuilt the DLL and added the prefab so as not to loose the script reference.
This is the commit id: 81be02e86fea0150eb124c411f16b5acd4d231e7 So could you try this one again?

Thanks,

comoc commented 6 years ago

I added TelloUnityDemo.unitypackage for easier creating new scene. in 8dbf1c21a4e4add6ef8b94c8c5ac163dd2ef3d1b

navsgit commented 6 years ago

Thanks for your response, I downloaded the project and loaded in Unity, it didn't work same error, but then I tried the unitypackage file, and now no error. However still no video feed. I think the problem might be Line 30 in Tello.cs file. The compiler show the event onVideoData is never used. Do i need to run ffmpeg from cmd prompt or anything like that?

comoc commented 6 years ago

Thank you for trying!

I've forgotten to include *.meta files into the repository. Now the problem was fixed.

The video data is received and processed by the TelloVideoDecoder.dll. So we do not need handle the onVideoData.

About the no video feed problem, please double-check the firewall settings of your Unity Editor. Public network access is required to receive the Tello's video stream. But in most case, the default settings of it is only "Private". Because Unity Editor's installation process, user cannot choose the permission of public network access setting.

joshferns commented 6 years ago

Hi @comoc Thank so much for this plugin. I am not able to get the video stream. I enabled public and private access to the Untiy Editor in the firewall settings. (how did you get the firewall popup again?.. I modified it from 'Allow an app through Windows Firewall' setting)

Battery status shows up fine. Do build settings/player settings need to be modified(other than scripting runtime version)?

Unity version 2018.1.5 OS Windows 10

Thanks.

Update: I noticed in the TelloVideoDecoder.cpp line 495.. the TELLO_ADDRESS is set to '192.168.0.1' instead of '192.168.10.1' (as I assume it should be) could this possibly be the cause?

joshferns commented 6 years ago

Update 2: I got it working.. had to turn off my firewall completely.. not really sure why this was needed. I originally followed the steps along the lines of https://www.dummies.com/computers/operating-systems/windows-7/how-to-allow-programs-through-the-windows-7-firewall/ but apparently that still wasn't enough.

I have multiple versions of unity, maybe that messed things up If anyone can point out my mistake I'll be really thankful.

@navsgit you could maybe test this out and close the issue

comoc commented 6 years ago

Hi @joshferns ,

Could you try to modify the "Inbound Rules" of your Unity Editor like this picture. image

Thanks,

carter-james89 commented 6 years ago

This fixed it for me, thanks a lot. Turning the firewall off and on was super annoying.

joshferns commented 6 years ago

@comoc success, it worked! I had no idea about this option. Thank you so much.

comoc commented 6 years ago

I am happy to hear that!