Maker Pro
Maker Pro

Android Windows Remote Control

Gryd3

Jun 25, 2014
4,098
Joined
Jun 25, 2014
Messages
4,098
it should still be fine, but i'm curious what happens with machines with 2 ip's ..

all i can think of without rewiting the server is to uncheck the broadcast option, but that wont help if it's hanging when getting the IP!

alright, i'll rewrite the server and give it a couple of problems and see if i can get to the root cause and let you know why it does what it does....

frustrating!
How do you get it to check for IP addresses?
I should also mention that the assigned IP address in my house is in the range 10.12.12.1-254
 

cjdelphi

Oct 26, 2011
1,166
Joined
Oct 26, 2011
Messages
1,166
ok, i've zipped up the code and app.

basically it now exits out if it can't detect the IP.

ohh 10.12.12.x

it should be fine though...

i've attached the code and app, if this stops it crashing i'll check what happens in the 10.12.12 range as it will broadcast to 10.12.12.255 which may not even be possible on that subnet..

if you're experienced with coding please feel free to take a look otherwise just try the new relay in the zip..

i'll assign a new ip later otherwise and try myself.
 

Attachments

  • Delphi Android Relay Remote.zip
    390.5 KB · Views: 73

Gryd3

Jun 25, 2014
4,098
Joined
Jun 25, 2014
Messages
4,098
This one no longer hangs, but gives me an "Error with network" message instead of an IP.
 

cjdelphi

Oct 26, 2011
1,166
Joined
Oct 26, 2011
Messages
1,166
ah well ok good...

it means it's having difficulty with your ip address, ok i'll do my best to fix it in the next couple of hours, sorry about that i did not expect this issue at all .
 

cjdelphi

Oct 26, 2011
1,166
Joined
Oct 26, 2011
Messages
1,166
so what's happening is that the app is not able to get your ip address, so it began broadcasting to a false ip .255 it should be 192.168.1.255 or if you were 10.0.6.6 ... 10.0.6.255 but it's simply not detecting it..

turning off broadcast and manually typing in your IP will fix it (from android, save butto), but i'm looking into it now, under windows 8 the routine to get your ip may be gone, tested only on win7.
 

cjdelphi

Oct 26, 2011
1,166
Joined
Oct 26, 2011
Messages
1,166
alrighty then, progress, I think i found the problem :) - fingers crossed lol

if this works, i'll copy it across to the APK ... thanks for the help :)

Also, if there's an error [x]Broadcast is turned off, so simply just check the box again if this works without any network error....

v1.3 inc source...
 

Attachments

  • Delphi Android Relay Remote v1.3.zip
    389.3 KB · Views: 70

Gryd3

Jun 25, 2014
4,098
Joined
Jun 25, 2014
Messages
4,098
alrighty then, progress, I think i found the problem :) - fingers crossed lol

if this works, i'll copy it across to the APK ... thanks for the help :)

Also, if there's an error [x]Broadcast is turned off, so simply just check the box again if this works without any network error....

v1.3 inc source...
Seems to work better so far...

Status line is empty.
Broadcast is checked, Detected IP belongs to by VPN, and not my home network though...

Started the apk on my phone, and manually keyed in the network address belonging to my PC, but the keys did not respond.

Does your relay.exe broadcast/listen to on all IPs on the PC, or just one?
 

cjdelphi

Oct 26, 2011
1,166
Joined
Oct 26, 2011
Messages
1,166
it listens on 8966 of your ip address..

manually typing in your ip and click on save will override your detected ip (wrong one though as its your vpn! ugh)

type in the ip of the machine you're running on hit save... does it work then? if not ..

start > run > cmd

ipconfig

to get the real ip.... also what is the vpn ip vs real ip? (i could simply filter the vpn from showing)
 

Gryd3

Jun 25, 2014
4,098
Joined
Jun 25, 2014
Messages
4,098
it listens on 8966 of your ip address..

manually typing in your ip and click on save will override your detected ip (wrong one though as its your vpn! ugh)

type in the ip of the machine you're running on hit save... does it work then? if not ..

start > run > cmd

ipconfig

to get the real ip.... also what is the vpn ip vs real ip? (i could simply filter the vpn from showing)


LAN IP: 10.12.12.200
VPN IP: 25.40.35.98

Manually keying in 10.12.12.200 to the Android App and hitting save did not resolve anything..
 

Gryd3

Jun 25, 2014
4,098
Joined
Jun 25, 2014
Messages
4,098
LAN IP: 10.12.12.200
VPN IP: 25.40.35.98

Manually keying in 10.12.12.200 to the Android App and hitting save did not resolve anything..
Correction. Was a typo in the manually keyed IP address.
Launching the 1.3 relay.exe and manually keying in the IP address of my machine worked.
Controls operate Windows Media Player as expected.

Good job.
 

cjdelphi

Oct 26, 2011
1,166
Joined
Oct 26, 2011
Messages
1,166
ok well again thanks for the help i can now go back and research into vpn's and detect not to use them and write it in!

i'll get it to broadcast correctly lol
 

cjdelphi

Oct 26, 2011
1,166
Joined
Oct 26, 2011
Messages
1,166
another option is to list all the IP's and the user selects one (i was aiming for ease of use....) good to know i can sort it which i will be in the next few hours

but anyway thanks, invaluable feedback....
 

Gryd3

Jun 25, 2014
4,098
Joined
Jun 25, 2014
Messages
4,098
ok well again thanks for the help i can now go back and research into vpn's and detect not to use them and write it in!

i'll get it to broadcast correctly lol
Actually, a potential fix for you would be to broadcast on all ips on the PC.
So in my particular case...
My PC would broadcast on 10.12.12.255, and 25.40.35.255
The Android Client would only see the broadcast on the 10.12.12.X network though, and could then auto-enter the IP address it came from.
(Edit: Even though the v1.3 relay showed the wrong IP, it was still listening on BOTH IP addresses, is it really necessary to show the IP address to the user?)

Additionally, you could reverse the way of doing things... and have the Android device send out the broadcast, and the PC respond to the broadcast with the IP address it got the broadcast from.

Ultimately, I think it would be difficult to filter out VPN addresses, as they are configured in so many different ways they can make your head spin... that and the vast majority of users typically only have one IP address. So although it caused a little confusion at first, the v1.3 relay works just fine. (If a user has the skill to configure multiple IPs, they can manually key their IP into your remote ;))
 

cjdelphi

Oct 26, 2011
1,166
Joined
Oct 26, 2011
Messages
1,166
ok, well, after a typo confusing myself no end.... version 1.6 of the relay.exe now should only accept IP's from from a non VPN source properly this time. ..

try this version and it should now autodetect without any issues... :-s
 

Attachments

  • Delphi Android Relay Remote 1.6.zip
    389.4 KB · Views: 100
Last edited:

cjdelphi

Oct 26, 2011
1,166
Joined
Oct 26, 2011
Messages
1,166
regarding broadcast to 2 ip's .255 problem is you need to be on the same subnet your android is on or it wont be seen..

in the good ole days 255.255.255.255 would broadcast to everyone on every subnet :)
 

Gryd3

Jun 25, 2014
4,098
Joined
Jun 25, 2014
Messages
4,098
regarding broadcast to 2 ip's .255 problem is you need to be on the same subnet your android is on or it wont be seen..

in the good ole days 255.255.255.255 would broadcast to everyone on every subnet :)
I am aware all of the devices must be on the same subnet for a broadcast to be seen. In order to broadcast on all IPs that a machine has, your program would need to detect each IP first, then broadcast on each connected subnet. I don't think it's necessary though unless a lot more people run a machine that is connected to multiple networks.

I loaded up 1.6, and it indeed correctly identified my LAN IP instead of my VPN.
That said, I was unable to get the 'broadcast' to work to auto-fill the IP address on the Android device.
I backspaced the manually entered IP address I had used in previous steps, then killed the app and re-launched it. On the relay.exe, I selected the 'broadcast' checkbox.
I opened up wireshark to see if the problem was with the APK or relay.exe, and it does not appear to be sending the broadcast. I checked the LAN interface and VPN interface. The only broadcasts were being sent by Dropbox and window's Name query. (relay.exe was granted a firewall exception and still functions fine when the IP address is manually punched into the Android App)
 

cjdelphi

Oct 26, 2011
1,166
Joined
Oct 26, 2011
Messages
1,166
it sounds like your router is not rebroadcasting like it should... there might be an option on your router that's set to drop broadcasts as a security setting...

wireshark should indeed see the broadcast :(
 

cjdelphi

Oct 26, 2011
1,166
Joined
Oct 26, 2011
Messages
1,166
long shot... did you by any chance restart the program after hitting broadcast, the program requires a re-run....

?

(it does not start broadcasting until it starts up)
 

Gryd3

Jun 25, 2014
4,098
Joined
Jun 25, 2014
Messages
4,098
it sounds like your router is not rebroadcasting like it should... there might be an option on your router that's set to drop broadcasts as a security setting...

wireshark should indeed see the broadcast :(
Well, the issue was that the relay.exe was not broadcasting, and the router cant rebroadcast if it never gets it in the first place :p
I did restart the app after setting broadcast on, and it is indeed broadcasting now.
I am still not however getting the IP to autofil into the Android App though :s
 
Top