Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add cordova-chrome-sockets-tcp #2568

Merged
merged 1 commit into from Aug 24, 2021
Merged

Conversation

InsanePrawn
Copy link
Contributor

Makes tcp://$IP:$PORT work on android.

First contribution, only tested against netcat, not a real board.

Ref to #1685 as that's what I always found while looking for info on Android and TCP functionality.

Signed-off-by: InsanePrawn <insane.prawny@gmail.com>
@sonarcloud
Copy link

sonarcloud bot commented Aug 17, 2021

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@haslinghuis haslinghuis added this to the 10.8.0 milestone Aug 17, 2021
@haslinghuis
Copy link
Member

Can you please provide information about the Android device (including OS version) you have tested this on?

@InsanePrawn
Copy link
Contributor Author

Just the standard Android (11) emulator, a friend was able to confirm this working with a Poco F1 (Android 10) and his speedybee f7 v2 through USB and socat though.

@asizon
Copy link
Member

asizon commented Aug 20, 2021

@InsanePrawn how I can test this functionality?

@InsanePrawn
Copy link
Contributor Author

InsanePrawn commented Aug 20, 2021

@asizon:

@InsanePrawn how I can test this functionality?

Acquire any serial<->tcp converter for your drone.
We are targetting the ESP8266 for this, but for testing, a PC with a unixlike OS (I'll assume a Debian-based Linux, e.g. a Ubuntu installer environment) and some way for it to speak serial to a drone (e.g. over USB) will do fine:

  1. Acquire socat, e.g. sudo apt-get update && sudo apt-get install socat
  2. Connect the drone to the PC. Figure out what the serial device is called, e.g. consult sudo dmesg | tail -n 50. For Linux and a USB device, it'll usually be /dev/ttyUSB0. OSX probably uses different names.
  3. Find out your LAN IP. ip a s.
  4. Expose the serial device as a TCP socket: sudo socat TCP-LISTEN:8888 UNIX-CONNECT:/dev/ttyUSB0
  5. Connect to tcp://your_ip:8888 from the app.

If you just want to confirm that it's working in principle, skip steps 0-3, open a tcp socket with netcat (sudo apt-get install netcat-openbsd && nc -l -p 8888) and connect the app to it, you'll see the app's raw data of trying to talk to a controller, while the master version does not connect to TCP at all.

@asizon
Copy link
Member

asizon commented Aug 22, 2021

@InsanePrawn thankyou for the steps! This feature is really interesting, maybe we can make it more visual and easy configuration for the users? Definitelly it is wifi conection for android apk, maybe we can made some Wiki page with steps to use it?

@asizon asizon added the Android label Aug 22, 2021
@asizon
Copy link
Member

asizon commented Aug 22, 2021

@WalcoFPV what do you think about this feature?

@InsanePrawn
Copy link
Contributor Author

@InsanePrawn thankyou for the steps! This feature is really interesting, maybe we can make it more visual and easy configuration for the users? Definitelly it is wifi conection for android apk, maybe we can made some Wiki page with steps to use it?

I appreciate and support these efforts, but for now I'd be happy to see this existing functionality work on android nightlies (again?) by merging this.
Beyond that, I'm not involved enough with betaflight and cordova development to make these changes. As of now, I don't even own a drone myself :)

@WalcoFPV
Copy link
Contributor

@asizon I agree with you. There is a real potential. If this cordova plugin works well, it could be useful on Android as well as IOS as the documentation mentioned

@asizon asizon self-assigned this Aug 24, 2021
@asizon asizon added the Tested label Aug 24, 2021
@blckmn
Copy link
Member

blckmn commented Aug 24, 2021

AUTOMERGE: (PASS)

  • github identifies PR as mergeable -> PASS
  • assigned to a milestone -> PASS
  • cooling off period lapsed -> PASS
  • commit count less or equal to three -> PASS
  • Don't merge label NOT found -> PASS
  • at least one RN: label found -> PASS
  • Tested label found -> PASS
  • assigned to an approver -> PASS
  • approver count at least three -> PASS

@blckmn blckmn merged commit 515f650 into betaflight:master Aug 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants