HefnySco / andruav_android_app

16 stars 7 forks source link

Video connection problem on a GCS app. #8

Closed ghost closed 1 year ago

ghost commented 1 year ago

Hello,

I would like to use this app and potentially support the development of this complex application in the future if I can learn this code structure. Specifically, I am interested in improving the ardupilot's capabilities for use on a maritime drone.

However, I have encountered a problem with this app. When I click the "Video" button on the GCS app, it always displays "Video is connecting" but fails to connect. I installed this app yesterday, it is first time I'm using this app. however, this app was used yesterday for 5 minutes flying, so I don't believe it's a problem with my settings. Yesterday, I also had trouble with the "Video is connecting" message consistently displaying on the screen.

for your reference, telemetry is connecting properly, and I was able to hear the "PreArm: Throttle below failsafe" message on both the GCS and drone card. Additionally, I am able to successfully receive photos from the drone card when I press the "shoot" button on the GCS, so I don't believe it's a connection issue.

I have tried using a mobile hotspot, public wifi, and a portable wifi router that worked well for video streaming on other GCS. Therefore, I don't believe it's a problem with the connection speed.

The only issue seems to be that the video is not connecting now. I tried "ask for help" button but there is no log file automatically attached.

ghost commented 1 year ago

I tried turning off HD options in drone card, but not worked.

I want to modify docs later for more information to be included.

ghost commented 1 year ago

for your reference, I can even swap drone's camera on GCS app.

ghost commented 1 year ago

I also changed android's battery optimization and network optimization settings, but nothing changed.

ghost commented 1 year ago

and I have no anti-virus app on my drone card. there is no security app on drone card.

ghost commented 1 year ago

I turned on "send anonymous data to server" and "logging" option.

HefnySco commented 1 year ago

I tried turning off HD options in drone card, but not worked.

I want to modify docs later for more information to be included.

Did you try to use WebClient ?

HefnySco commented 1 year ago

I am not investing effort in Andruav GCS, as you can use WebClient to make the same functionalities.

ghost commented 1 year ago

I am not investing effort in Andruav GCS, as you can use WebClient to make the same functionalities.

Thank you for your reply. I thought this application concept was great. anyway, I have to test connectivity of phone's modem at sea first. after that I can decide whether to use phone for LTE communication. so, after the test with Web client, I will try this app. thank you.

ghost commented 1 year ago

I tried the webclient as you advised, but the video screen is still blank. It seems that there might be a problem with my connection. However, the other functions worked well, as I was able to turn the flashlight on and off.

Here is a link to a photo that demonstrates the issue: https://drive.google.com/file/d/1AXdtwUX09af47XC-_MmYYWnD5OnxFtt7/view?usp=share_link.

I apologize for asking so many questions, but I really appreciate your help.

ghost commented 1 year ago

After connecting to Mission Planner, I realized that this proejct was a great concept with limitless expandability, and I became very interested in it. and I realized that andruav-ap app is not necessary, as you said.

I was curious about how it works. I just entered "andruav.com" as the host name and "41988" as the port name on the Mission Planner UDPCL connection, and it just worked!

I was surprised that it worked with just a simple URL entry. I found a video (https://cloud.ardupilot.org/webclient-udp-telemetry.html) where you connected to "192.xx.xxx.xx," so I thought I needed to establish an internal server connection with a special tool. However, it turned out that I didn't need to do that.

I'm still curious about how the website can pass data to Mission Planner automatically. Specifically, I wonder how It can distinguish my connection from that of other users on other laptops worldwide. There could be other people who type in the same URL "andruav.com."

and for your reference, video is still not coming in the webclient.

HefnySco commented 1 year ago

Regarding telemetry please refer to this video for more detailshttps://youtu.be/C_AcmUGXFVQ

HefnySco commented 1 year ago

Please feel free to ask. BTW I have just retested now the video over LTE to make sure that my phone is not using my home wifi and I could receive the video from the mobile.

ghost commented 1 year ago

Thank you for your kind response. I hope to use this app to benefit the maritime industry worldwide.

I had planned to capture a video that demonstrates the situation I encountered(the video is not coming through even though the telemetry connection is established.)

However, when I attempted to connect the web client today, the situation became worse. Now, even after clicking the connect button, the connection is not established, whereas before, I could access the telemetry service without any issues.

I attempted to retrieve the passcode again, but it failed with the message "Operation Failed: Cannot Reach Server."

Please find the screenshot link that fails to regenerate key on the web client below: https://drive.google.com/file/d/1tgQVYbwr85vuOUV8P_kyAfd05sheKXoH/view?usp=share_link

I reviewed the WebRTC Log, but I couldn't find any clues. Please find the HTML error log screenshot in Chrome below:

https://drive.google.com/file/d/1WkP5c5KeHoTdUQCxhvvcJuXWfFByK2A4/view?usp=share_link

https://drive.google.com/file/d/1RK_j2CPqyPc-K06nML-NjCb2U5R5HOsl/view?usp=share_link

this is the video link that failed to connect on webclient :

https://drive.google.com/file/d/1TON3xPTeeT7WMdpsRtqC-4VWRaPEcm-r/view?usp=share_link

ghost commented 1 year ago

If these operations in daily basis require a lot of traffic on the ArduPilot server, I am willing to use my existing AWS server instead.

ghost commented 1 year ago

Please feel free to ask. BTW I have just retested now the video over LTE to make sure that my phone is not using my home wifi and I could receive the video from the mobile.

Here is the video link that describes the symptom. Unfortunately, I have been unable to connect to the web client. Therefore, I uploaded the video using the Andruav GCS app. As you can see in the video, taking photos is possible, but the video does not come through. I have tried different networks, but the issue persists.

If I cannot solve this problem, I am considering creating a server and app based on your code. However, I anticipate that this will be a difficult and long-long time task.

https://drive.google.com/file/d/1DiGmMcfWaSfw9yIDuRGQD6G0Ph3Bawqo/view?usp=share_link

ghost commented 1 year ago

Please feel free to ask. BTW I have just retested now the video over LTE to make sure that my phone is not using my home wifi and I could receive the video from the mobile.

I've discovered that I can't connect to 'cloud.ardupilot.org:8001/webclient.html' through Safari. Is this normal, or could it be an issue with my internet carrier?

HefnySco commented 1 year ago

Please feel free to ask. BTW I have just retested now the video over LTE to make sure that my phone is not using my home wifi and I could receive the video from the mobile.

I've discovered that I can't connect to 'cloud.ardupilot.org:8001/webclient.html' through Safari. Is this normal, or could it be an issue with my internet carrier?

WebClient is developed for Chrome & FireFox. Never tested it on Safari or Edge.

HefnySco commented 1 year ago

BTW I can help you to create your own server on aws. please contact me mohammad.hefny@gmail.com

ghost commented 1 year ago

I attempted to access 'cloud.ardupilot.org:8001/webclient.html' on my friends' iPad and iPhone, but it was unsuccessful. I am uncertain if this is due to a network or iOS issue. If it were in America, I suspect it would be able to connect.

ghost commented 1 year ago

BTW I can help you to create your own server on aws. please contact me mohammad.hefny@gmail.com

Earlier, I shared with you a video that demonstrated the failure of the "andruav_ap" app. Now, I would like to share another video link that demonstrates the issue of failed connections on "webclient.html". :

https://drive.google.com/file/d/1A9_j_X-C6GUc70EOzcLVJFCSMW93vwR6/view?usp=share_link

As you can see in the video, the telemetry connection (drone's attitude) is alive, but the video is dead. When I first installed the app, I was able to get the videos to work, but only for 5 minutes flying.

and there is another problem for your reference. whenever I click the recording button on the web client or touch the recording button on the Andruav_ap app, the drone card app resets the connection (lost connection once) and fails to record.

I will send you an email with the details on using my AWS server to transfer the video and telemetry data. Thank you.

ghost commented 1 year ago

BTW I can help you to create your own server on aws. please contact me mohammad.hefny@gmail.com

also, I noticed that the Chrome mobile app on Android was unable to connect to "https://cloud.ardupilot.org:8001/webclient.html". Is it only possible to connect from a desktop for now? during ship delivery, we are now need to move to take-off locations where mobile phone may be the easiest option to use. we didn't have static stations yet. However, for now, a desktop connection is sufficient. I will email you to establish a connection on my own AWS server. Thank you.

HefnySco commented 1 year ago

I think we need to conduct a video session. I can help you with this. The system is easy to work.

ghost commented 1 year ago

It turns out that the reason for the connection failure on Safari or Mobile Chrome was due to the missing 'https://' in the address. now I can connect on mobile well. However, I am still unable to connect to the video.

Thank you for suggesting a video session, but for now, I am using ChatGPT to refine my grammar and expressions. While I may not be proficient in English, I can do basic conversations without elegant expressions.

and I'm very glad to hear that the work is straightforward. I am currently using an EC2 t2 micro instance, which has limited resources (1GB RAM and moderate network performance). If it turns out to be insufficient during the actual UAV test, I will switch to a higher-class AWS Instance.

ghost commented 1 year ago

I think we need to conduct a video session. I can help you with this. The system is easy to work.

It's been a while now, and I'm still unable to receive videos. I've tried to regenerate my access code using my email [sseaeagle2@gmail.com], but I haven't received anything in my inbox including spam folder. I've tried on both my laptop and cell phone.

I suspect I may have requested the code too many times before. I tried about 10 times previously because something wasn't working and I couldn't get the code.

Could you please confirm whether I've been banned from the server?

ghost commented 1 year ago

I think we need to conduct a video session. I can help you with this. The system is easy to work.

I was able to generate a code using my other email account. However, the code is only visible within the app and did not arrive in my email inbox. The pop-up message stated that the access code was also sent by email, but I have not received it.

ghost commented 1 year ago

I think we need to conduct a video session. I can help you with this. The system is easy to work.

I successed to connect video once. I regenerated code with my other email, and click "FPV" button on the cell phone, after that, I clicked "live stream" on laptop twice. only click "live stream" twice or third time not works. it is my weird solution, hard to found.

but, now it is not connected again.

ghost commented 1 year ago

this is the error message on chrome browser developer tool, there is error related to video click :

You are using the in-browser Babel transformer. Be sure to precompile your scripts for production - https://babeljs.io/docs/setup/ runScripts @ babel.js:43976 Warning: Each child in a list should have a unique "key" prop.

Check the render method of CLSS_AndruavUnitList. See https://fb.me/react-warning-keys for more information. in ul (created by CLSS_AndruavUnitList) in CLSS_AndruavUnitList printWarning @ react.development.js:401 Warning: Each child in a list should have a unique "key" prop.

Check the render method of CLSS_AndruavUnitListArray. See https://fb.me/react-warning-keys for more information. in div (created by CLSS_AndruavUnitListArray) in CLSS_AndruavUnitListArray printWarning @ react.development.js:401 Warning: Each child in a list should have a unique "key" prop. See https://fb.me/react-warning-keys for more information. in CLSS_LoginControl (created by CLSS_HeaderControl) in div (created by CLSS_HeaderControl) in div (created by CLSS_HeaderControl) in CLSS_HeaderControl printWarning @ react-dom.development.js:82 Warning: Can't call setState on a component that is not yet mounted. This is a no-op, but it might indicate a bug in your application. Instead, assign to this.state directly or define a state = {}; class property with the desired state in the CLSS_GlobalSettings component. printWarning @ react.development.js:401 Warning: Each child in a list should have a unique "key" prop.

Check the render method of CLSS_CTRL_UDP_PROXY_TELEMETRY. See https://fb.me/react-warning-keys for more information. in div (created by CLSS_CTRL_UDP_PROXY_TELEMETRY) in CLSS_CTRL_UDP_PROXY_TELEMETRY (created by CLSS_AndruavUnit_Drone) in div (created by CLSS_AndruavUnit_Drone) in div (created by CLSS_AndruavUnit_Drone) in div (created by CLSS_AndruavUnit_Drone) in div (created by CLSS_AndruavUnit_Drone) in div (created by CLSS_AndruavUnit_Drone) in div (created by CLSS_AndruavUnit_Drone) in CLSS_AndruavUnit_Drone (created by CLSS_AndruavUnitList) in div (created by CLSS_AndruavUnitList) in div (created by CLSS_AndruavUnitList) in div (created by CLSS_AndruavUnitList) in CLSS_AndruavUnitList printWarning @ react.development.js:401 Warning: Each child in a list should have a unique "key" prop.

Check the render method of CLSS_CTRL_SETTINGS. See https://fb.me/react-warning-keys for more information. in span (created by CLSS_CTRL_SETTINGS) in CLSS_CTRL_SETTINGS (created by CLSS_AndruavUnit_Drone) in div (created by CLSS_AndruavUnit_Drone) in div (created by CLSS_AndruavUnit_Drone) in div (created by CLSS_AndruavUnit_Drone) in CLSS_AndruavUnit_Drone (created by CLSS_AndruavUnitList) in div (created by CLSS_AndruavUnitList) in div (created by CLSS_AndruavUnitList) in div (created by CLSS_AndruavUnitList) in CLSS_AndruavUnitList printWarning @ react.development.js:401 webclient.html:1 Uncaught (in promise) Error: A listener indicated an asynchronous response by returning true, but the message channel closed before a response was received 3jsc_videoDisplayComponent.jsx:610 Uncaught TypeError: Cannot read properties of undefined (reading 'click') at Object.fn_videoStarted [as callback] (:831:125) at CEventEmitter.fn_dispatch (js_eventEmitter.js:17:26) at Object.onWEBRTCSessionStarted [as onDisplayVideo] (js_main.js:359:36) at talk.pc.ontrack (js_webrtcthin.js:247:26)

ghost commented 1 year ago

if I turn on "advanced option" and "Show connected GCS", there is error like below :

Warning: Can't call forceUpdate on a component that is not yet mounted. This is a no-op, but it might indicate a bug in your application. Instead, assign to this.state directly or define a state = {}; class property with the desired state in the CLSS_FireEvent component. printWarning @ react.development.js:401 error @ react.development.js:373 warnNoop @ react.development.js:428 enqueueForceUpdate @ react.development.js:466 Component.forceUpdate @ react.development.js:576 fn_advancedMode @ jsc_globalSettings.jsx:16 fn_dispatch @ js_eventEmitter.js:17 fn_enableAdvanced @ jsc_globalSettings.jsx:189 onClick @ jsc_globalSettings.jsx:256 callCallback @ react-dom.development.js:182 invokeGuardedCallbackDev @ react-dom.development.js:231 invokeGuardedCallback @ react-dom.development.js:286 invokeGuardedCallbackAndCatchFirstError @ react-dom.development.js:300 executeDispatch @ react-dom.development.js:383 executeDispatchesInOrder @ react-dom.development.js:408 executeDispatchesAndRelease @ react-dom.development.js:3401 executeDispatchesAndReleaseTopLevel @ react-dom.development.js:3410 forEachAccumulated @ react-dom.development.js:3380 runEventsInBatch @ react-dom.development.js:3427 runExtractedPluginEventsInBatch @ react-dom.development.js:3637 handleTopLevel @ react-dom.development.js:3681 batchedEventUpdates$1 @ react-dom.development.js:22006 batchedEventUpdates @ react-dom.development.js:792 dispatchEventForLegacyPluginEventSystem @ react-dom.development.js:3691 attemptToDispatchEvent @ react-dom.development.js:4390 dispatchEvent @ react-dom.development.js:4312 unstable_runWithPriority @ react.development.js:2685 runWithPriority$1 @ react-dom.development.js:11174 discreteUpdates$1 @ react-dom.development.js:22022 discreteUpdates @ react-dom.development.js:803 dispatchDiscreteEvent @ react-dom.development.js:4291 Warning: Can't perform a React state update on an unmounted component. This is a no-op, but it indicates a memory leak in your application. To fix, cancel all subscriptions and asynchronous tasks in the componentWillUnmount method. in CLSS_AndruavUnit_Drone_Row (created by CLSS_AndruavUnitListArray) in div (created by CLSS_AndruavUnitListArray) in div (created by CLSS_AndruavUnitListArray)

ghost commented 1 year ago

also it seems that there is memory leak :

react-dom.development.js:82 Warning: Can't perform a React state update on an unmounted component. This is a no-op, but it indicates a memory leak in your application. To fix, cancel all subscriptions and asynchronous tasks in the componentWillUnmount method. in CLSS_AndruavUnit_Drone_Row (created by CLSS_AndruavUnitListArray) in div (created by CLSS_AndruavUnitListArray) in div (created by CLSS_AndruavUnitListArray)

HefnySco commented 1 year ago

BTW I can help you to create your own server on aws. please contact me mohammad.hefny@gmail.com

also, I noticed that the Chrome mobile app on Android was unable to connect to "https://cloud.ardupilot.org:8001/webclient.html". Is it only possible to connect from a desktop for now? during ship delivery, we are now need to move to take-off locations where mobile phone may be the easiest option to use. we didn't have static stations yet. However, for now, a desktop connection is sufficient. I will email you to establish a connection on my own AWS server. Thank you.

AndruavAP connects to Communcation Server. and you need to use the same account to access your mobile from webclient.

ghost commented 1 year ago

sorry but you said you cannot login to cloud.ardupilot.org:8001/webclient.html

Thank means you have a severe connection problem. If you cannot see the website you will not be able to do anything.

use airgap ... download latest version and change the turnserver addresses.

I can login with other mail account. I can see websites. but every email account cannot regenerate code.

I will try airgap, thank you


edited: Im using cell phone instead of RPI4. if I have to use RPI4, I will rather use jetson board

HefnySco commented 1 year ago

Please use AirGap Server on local RPI4 and make sure to change the turnserver addess in the webclient. Airgap works even without Internet at all you can even cache maps. The video should work then with no problems.

ghost commented 1 year ago

BTW I can help you to create your own server on aws. please contact me mohammad.hefny@gmail.com

also, I noticed that the Chrome mobile app on Android was unable to connect to "https://cloud.ardupilot.org:8001/webclient.html". Is it only possible to connect from a desktop for now? during ship delivery, we are now need to move to take-off locations where mobile phone may be the easiest option to use. we didn't have static stations yet. However, for now, a desktop connection is sufficient. I will email you to establish a connection on my own AWS server. Thank you.

AndruavAP connects to Communcation Server. and you need to use the same account to access your mobile from webclient.

this problem already solved as I said above. attaching Https:// in address solved the problem

ghost commented 1 year ago

Please use AirGap Server on local RPI4 and make sure to change the turnserver addess in the webclient. Airgap works even without Internet at all you can even cache maps. The video should work then with no problems.

Im using cell phone instead of RPI4... if I have to use RPI4, I will rather use jetson board

ghost commented 1 year ago

sorry but you said you cannot login to cloud.ardupilot.org:8001/webclient.html

Thank means you have a severe connection problem. If you cannot see the website you will not be able to do anything.

use airgap ... download latest version and change the turnserver addresses.

all the error message I attahced is related to video button. I can see website.

ghost commented 1 year ago

BTW I can help you to create your own server on aws. please contact me mohammad.hefny@gmail.com

also, I noticed that the Chrome mobile app on Android was unable to connect to "https://cloud.ardupilot.org:8001/webclient.html". Is it only possible to connect from a desktop for now? during ship delivery, we are now need to move to take-off locations where mobile phone may be the easiest option to use. we didn't have static stations yet. However, for now, a desktop connection is sufficient. I will email you to establish a connection on my own AWS server. Thank you.

AndruavAP connects to Communcation Server. and you need to use the same account to access your mobile from webclient.

of course, Im using same account. it is too basic thing. the question was, cant connect to web client via safari, and the reason was not attaching https:// on address, as I said before

ghost commented 1 year ago

Please use AirGap Server on local RPI4 and make sure to change the turnserver addess in the webclient. Airgap works even without Internet at all you can even cache maps. The video should work then with no problems.

could I know the airgap server's basic meaning? could I run it on aws server, with similar way for RPI4?

HefnySco commented 1 year ago

Please use AirGap Server on local RPI4 and make sure to change the turnserver addess in the webclient. Airgap works even without Internet at all you can even cache maps. The video should work then with no problems.

could I know the airgap server's basic meaning? could I run it on aws server, with similar way for RPI4?

yes you can. you need aws machine with a domain and that is it.

ghost commented 1 year ago

Please use AirGap Server on local RPI4 and make sure to change the turnserver addess in the webclient. Airgap works even without Internet at all you can even cache maps. The video should work then with no problems.

could I know the airgap server's basic meaning? could I run it on aws server, with similar way for RPI4?

yes you can. you need aws machine with a domain and that is it.

Thank you. for simple clarification, my problem is like below :

  1. Despite attempting hundreds of methods, the video is still not displaying. Please refer to the error message above, which appears when the video button is clicked.
  2. In an attempt to resolve the above issue, I tried to regenerate the access code. However, the standard procedure to regenerate a access code with existing e-mail was unsuccessful on both my cell phone and desktop. the message says I will get access code via e-mail, but no e-mail message is coming, including spam box. I discovered that a new access code with new e-mail can be generated via my cell phone, and getting a new access code via new e-mail did solve my problem once.(video displayed only one time after generating new access code via new e-mail) However, the issue has since reoccurred, and creating a new account third time didn't help
ghost commented 1 year ago

Please use AirGap Server on local RPI4 and make sure to change the turnserver addess in the webclient. Airgap works even without Internet at all you can even cache maps. The video should work then with no problems.

could I know the airgap server's basic meaning? could I run it on aws server, with similar way for RPI4?

yes you can. you need aws machine with a domain and that is it.

I initially attempted to install your scripts on AWS Linux 2, but encountered issues with the 'sudo apt-get' command and found no easy way to install 'coturn' on the platform.

Therefore, I switched to Ubuntu OS and tried running your script. However, it appears that something went wrong during the process.

ubuntu log.txt ubuntu error ubuntu error 2

ghost commented 1 year ago

Please use AirGap Server on local RPI4 and make sure to change the turnserver addess in the webclient. Airgap works even without Internet at all you can even cache maps. The video should work then with no problems.

could I know the airgap server's basic meaning? could I run it on aws server, with similar way for RPI4?

yes you can. you need aws machine with a domain and that is it.

Today, I discovered an interesting phenomenon.

Until this morning, I had a hard time resolving Andruav's connectivity issue. I tried various solutions, but none of them worked. However, this morning, I successfully connected the video connection using a WiFi.

I connected the drone card to WiFi and was able to send video data multiple times with several reboots. Until now, I had only tried using a WiFi connection with the ground station card and not the drone card.

Unfortunately, the problem remains unresolved since the drone card cannot use WiFi because it will be used at sea. Nevertheless, I hope this discovery will provide a useful clue for solving this issue.

Additionally, I noticed that the red-colored text in the video is not displayed when the video is not sent via LTE. However, I can see "video on" displayed on the drone card's video screen now, with WIFI connection.

Furthermore, the ping is the same as LTE, which leads me to believe that something on the drone card's LTE carrier may be blocking the connection since a WiFi connection was successful.

I tried turboVPN app on drone card, hoping for bypass the restriction via LTE, but with that setting, even initialization of andruav was not possible

ghost commented 1 year ago

Please use AirGap Server on local RPI4 and make sure to change the turnserver addess in the webclient. Airgap works even without Internet at all you can even cache maps. The video should work then with no problems.

could I know the airgap server's basic meaning? could I run it on aws server, with similar way for RPI4?

yes you can. you need aws machine with a domain and that is it.

I'm very sorry for too much frequent question.

I solved problem. I turned off some program on laptop and video is received well on laptop.

I already tried turning off vaccine before, but the problem was force-installed program from my university.

HefnySco commented 1 year ago

If you are operating your own server, you will need to configure the turnserver address to utilize your turnserver that is running on either your airgap or AWS, and ensure that the necessary ports are open. While WVideo can operate on WIFI (local LAN) by utilizing a direct connection, this is not the case when the connection is remote, and a turnserver is utilized instead. Any issues experienced with the connection could be attributed to network, SIM/LTE, or turnserver problems.

HefnySco commented 1 year ago

Please use AirGap Server on local RPI4 and make sure to change the turnserver addess in the webclient. Airgap works even without Internet at all you can even cache maps. The video should work then with no problems.

could I know the airgap server's basic meaning? could I run it on aws server, with similar way for RPI4?

yes you can. you need aws machine with a domain and that is it.

I'm very sorry for too much frequent question.

I solved problem. I turned off some program on laptop and video is received well on laptop.

I already tried turning off vaccine before, but the problem was force-installed program from my university.

glad to hear that it is working.