Wish B4A Bridge working over NAT

MarcRB

Active Member
Licensed User
Longtime User
Hi,

Recently I moved all my work related software to a Windows cloud VPS. I connect to my cloud vps by a chromebook. All programs work very well in the cloud. I only have some troubles with debugging to a real device in B4A. However I'm traveling at daytime and use my vps from different places (read different ip adresses), I do use B4A most of the time from my home adress with static ip.
Basicly I will connect for debugging from my cloud VPS to my Android device in localnetwork.
That makes me think portforwarding could help me.

Simple plan: B4A ide connect from cloud VPS to my home modem. The modem routes the data to the fixed ip of my Android Device. Done!

Tested:
The connection between IDE and B4A Bridge works! I can compile the app from my VPS over the internet to my local running Android Device. The APK installer pops up and the app can be used when compiled in release mode.
But....
When I use debug mode the app will be installed succesfull, But at start it tries to connect with the ide. After a few seconds the app crashed / is closed.
I think the communication only works from ide to app and not from app to ide.
Maybe there is an other port for backwards communication.

My IP situation is:

  • Home External IP: 77.161.xxx.xxx
  • Home Internal range 192.168.2.xxx
  • Cloud VPS: 141.138.xxx.xxx
Steps I made:
  1. I installed B4A on my cloud vps.
  2. I gave my testing device a fixed ip 192.168.2.9 (set in modem)
  3. I openend my modem/router settingspage on NAT/Portforwarding and set portforwarding to local ip 192.168.2.9 at port 6789, (6906 and 8192 maybe not neccessary)
  4. I connect the IDE to B4a Bridge on 77.161.xxx.xxx (home ip)
  5. I start my Adnroid tablet for listning in my local network
    The connection over NAT with my cloud VPS is made.
  6. Installing APK works.
  7. Running app stops in debug mode
Question:
Is there a way to solve this, or is it possible for Erel and his team to create some function in the ide for debugging on device over the internet.

Best regards,
Marc
 

Cableguy

Expert
Licensed User
Longtime User
Also, just curious.. where do you save your ongoing projects? Locally or in the cloud?
I used for a few weeks a local NAT but the ide at compile time would sometimes complain about missing stuff, like the key store or some resources... I guess it was a latency thing...
 

MarcRB

Active Member
Licensed User
Longtime User
@Erel:
Even if the project is very small like 'hello world' it doesn't debug. The connection is made very fast and the apk installer is also fast on screen.
I have a 100Mb/s (80Mb/s effective) glassfiber internetspeed and the cloud server is hosted at a professional datacenter.
So there is a fast connection, but maybe not fast enough or to much points in networktraffic.
I have to search other ways to debug my app. Probably i have to use my old Windows Laptop only for this task.:(

@Cableguy:
My Windows VPS contains both the project datafiles and the B4A ide. Because it is the same server it works good. just as a local installation.
If you only have the data on cloud side it is possible not all files could be found fast enough.
Try putting them on the same location.

I noticed that communicate with the local system is the bottle neck. I my case I only need the local systeem for debugging.

Best regards,
Marc
 
Top