New Android plugin - Wifi transfer

Support for Android version of Total Commander

Moderators: sheep, Hacker, Stefan2, white

AlexKniga
Junior Member
Junior Member
Posts: 10
Joined: 2010-03-24, 10:57 UTC

Re: New Android plugin - Wifi transfer

Post by *AlexKniga »

I connect the Android to the PC with a usb-cable. In the smartphone settings in the "Mobile hotspot and modem" section, I turn on the USB modem. The phone now has an internet gateway for the PC. A new device "Remote NDIS based Internet Sharing Device" has appeared on the PC. The PC IP address 192.168.42.220; The gateway IP address is 192.168.42.129. The android and the computer are on the same network. I need to run FTP or WebDAV server on the android for access the files. I love your WebDAV server when connected over WiFi. I want to use your WebDAV server over LAN. But your server won't start without WiFi. If I turn on WiFi, then your server starts on the 192.168.43.1 network, and this is a different subnet. Without root, I can't get WiFi and LAN to be on the same network (e.g. 192.168.42.0/24). How to run "Wifi transfer" on a LAN subnet?
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 40180
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: New Android plugin - Wifi transfer

Post by *ghisler(Author) »

I don't seem to be getting any IP address on my Samsung with Android 10 and WiFi disabled. Can you check whether Total Commander can see an IP address on your device?
1. Add a new button to the lower toolbar
Function type: Internal command
Command: Click on >> and pick command nr 133
2. Connect WiFi
3. Click button 133 -> it should show your WiFi address, e.g. 192.168.43.1
4. Disconnect WiFi
5. Connect the phone to your PC
6. Click button 133 -> does it show the 192.168.42.129? Here it doesn't show any IP address at all.
Author of Total Commander
http://www.ghisler.com
AlexKniga
Junior Member
Junior Member
Posts: 10
Joined: 2010-03-24, 10:57 UTC

Re: New Android plugin - Wifi transfer

Post by *AlexKniga »

1) WiFi turn on:
IPv4=192.168.43.78 (wlan0),192.168.42.129 (rndis0)

2) WiFi turn on, but no connect:
IPv4=10.21.124.240 (rmnet0),192.168.42.129 (rndis0)

3) WiFi turn off:
IPv4=10.21.124.240 (rmnet0),192.168.42.129 (rndis0)

4) WiFi hotspot turn on:
IPv4=192.168.43.1 (swlan0),10.21.124.240 (rmnet0),192.168.42.129 (rndis0)

In all of the above cases, the usb-modem (rndis) is turned on.

Same info:
Manufacturer=samsung
Model=SM-G930F
Device=herolte
Android=8.0.0: O (26)
OS=Linux
width=1920
height=1080
pixelFormat=1
refreshRate=59.0fps
metrics.density=x3.0 xxhpi
metrics.scaledDensity=x3.0
metrics.widthPixels=1920
metrics.heightPixels=1080
metrics.xdpi=435.42822
metrics.ydpi=431.57474
RAM=3537MB
App Free=188MB/192MB
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 40180
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: New Android plugin - Wifi transfer

Post by *ghisler(Author) »

I found an option named "USB tethering". This seems to work as you describe it. It was also possible to connect to the WiFi plugin! I just had to modify the URL myself. For example, the plugin shows
http://192.168.1.9:8081/1234
and the tethering address is 192.168.42.129. Then the URL to enter in the WiFi plugin would be
192.168.42.129:8081/1234

In one test it didn't work. Then I had to:
1. Turn off USB tethering
2. Turn on WiFi
3. Share the files via plugin
4. Turn on USB tethering
5. Connect
Author of Total Commander
http://www.ghisler.com
AlexKniga
Junior Member
Junior Member
Posts: 10
Joined: 2010-03-24, 10:57 UTC

Re: New Android plugin - Wifi transfer

Post by *AlexKniga »

"USB tethering" = "USB modem".

Is your WebDAV-server listening on all network interfaces? rmnet (gsm) too? Can the cellular operator connect to the WebDAV-server too?

It looks strange, but the server works with absent WiFi or WiFi tethering. When the server shows the message "No WiFi connection" and does not show the url, it is already working! I am accessing from rndis by guessing url.
It seems wrong to me to bind the url display to WiFi work.
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 40180
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: New Android plugin - Wifi transfer

Post by *ghisler(Author) »

Yes, it's listening on all interfaces, but it refuses access from public routable addresses. It only works for client in local networks.
Author of Total Commander
http://www.ghisler.com
Hurdet
Power Member
Power Member
Posts: 559
Joined: 2003-05-10, 18:02 UTC

Re: New Android plugin - Wifi transfer

Post by *Hurdet »

Do it have a intent to start and stop the server programmatically?
Do it is possible to add a option to send intent via script in folder?
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 40180
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: New Android plugin - Wifi transfer

Post by *ghisler(Author) »

The server accepts files via Intent.ACTION_SEND and Intent.ACTION_SEND_MULTIPLE. This will also start the server if it wasn't running.

To stop the server, send Intent.ACTION_SEND with setData set to URI: "content://stop".
Author of Total Commander
http://www.ghisler.com
Hurdet
Power Member
Power Member
Posts: 559
Joined: 2003-05-10, 18:02 UTC

Re: New Android plugin - Wifi transfer

Post by *Hurdet »

You could be more specific?
I tryed but not work:

Code: Select all

adb shell am broadcast -a Intent.ACTION_SEND -d "content://stop" com.ghisler.android.TotalCommander
Hurdet
Power Member
Power Member
Posts: 559
Joined: 2003-05-10, 18:02 UTC

Re: New Android plugin - Wifi transfer

Post by *Hurdet »

Also with Tasker not work.
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 40180
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: New Android plugin - Wifi transfer

Post by *ghisler(Author) »

1. Why do you send this to Total Commander and not to the WiFi send activity?
2. am broadcast sends a broadcast to all receivers with a specific name. You need to use am start to send a command to a specific activity

Try this:
adb shell am start -n "com.ghisler.tcplugins.wifitransfer/com.ghisler.tcplugins.wifitransfer.WifiSendActivity" -a android.intent.action.SEND -d "content://stop"
Author of Total Commander
http://www.ghisler.com
Hurdet
Power Member
Power Member
Posts: 559
Joined: 2003-05-10, 18:02 UTC

Re: New Android plugin - Wifi transfer

Post by *Hurdet »

This work fine. ty.
Som30ne
Junior Member
Junior Member
Posts: 17
Joined: 2019-08-28, 15:37 UTC

Re: New Android plugin - Wifi transfer

Post by *Som30ne »

Yesterday, I tried to send files from Redmi7a device to my PC using the wifi transfer, and got 404 error.

I performed the following steps (2 different scenarios, ended the same):
1. selected the file(s) in gallery app / selected the files in total commander
2. selected share via total commander wifi / copy -> via wifi
3. opened the url in my PC's browser
4. saw the files listed in the browser
5. Clicked on any of the files to download
6 --- got a 404 error and was unable to download any file.

I tried that several times, with stopping/restarting the wifi transfer server.
Nothing seemed to resolve the issue.
Some files were large 200+ MB, so I tried with smaller files,
I tried files from internal memory, and from external SD card,
but still - nothing.
I also tried to "download as zip" - without compression,
and got 404 error.

What steps should I do to check/fix this ?

Thanks.
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 40180
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: New Android plugin - Wifi transfer

Post by *ghisler(Author) »

It can happen when the WiFi transfer plugin received content URLs which then expired. Try closing the Wifi plugin completely, and then re-open the files from Total Commander.
Author of Total Commander
http://www.ghisler.com
Som30ne
Junior Member
Junior Member
Posts: 17
Joined: 2019-08-28, 15:37 UTC

Re: New Android plugin - Wifi transfer

Post by *Som30ne »

ghisler(Author) wrote: 2020-12-11, 15:07 UTC It can happen when the WiFi transfer plugin received content URLs which then expired. Try closing the Wifi plugin completely, and then re-open the files from Total Commander.
First of all I wanted to thank you for the reply.
Second - well, it did not solve the issue, but - - -

After a lot of trial and a lot of error(s, mostly 404 errors), I was able to get it to work (Which is all that matters).
I tried the following:
Close the wifi app - nothing changed
Uninstalled/Reinstalled the wifi plugin app - nothing changed
Uninstalled/Reinstalled TC and WiFi altogether - nothing changed
Cleared app data for TC/WiFi - Nothing changed
But - when I opened the TC app, I was asked to allow access permissions to the storage.
I then tried to send files over via WiFi - and for some reason I was not asked to allow storage access permissions.
I checked the permissions via the android/MIUI settings - and there is specified TC as allowed to access storage, but WiFi plugin as disAllowed.
Setting WiFi plugin permissions to access storage, resolved the issue.

=== Bottom line -
It was permissions issue.
Post Reply