How to set Action START/STOP FTP Server by Automagic

Post your feature requets for new triggers, conditions, actions and other improvements.

Moderator: Martin

Locked
User avatar
JurGraf
Posts: 4
Joined: 31 Mar 2015 09:23

How to set Action START/STOP FTP Server by Automagic

Post by JurGraf » 24 Feb 2018 22:43

Hello, :)
Can I ask for help me with to resolve problem:
I want to START / STOP FTP Server (using android application like this: https://play.google.com/store/apps/deta ... .ftpserver) by Automagic's Action.
This "FTP Server" has many smart functions, and this one:

"√ Has public intents to support scripting/tasker
• Class name: net.xnano.android.ftpserver.receivers.CustomBroadcastReceiver
• Actions:
- net.xnano.android.ftpserver.START_SERVER
- net.xnano.android.ftpserver.STOP_SERVER"

I have made many attempts to find a solution, but all fails… I can't find right configuration, class names etc., only "FTP Server .mainActivity".
My favorite file-manager "Solid Explorer" is available with "SE FTP Server". Can I set Action START/STOP SE FTP Server?

I used to enjoy working with Automagic every day.
Regards,
Jerzy

User avatar
Desmanto
Posts: 2709
Joined: 21 Jul 2017 17:50

Re: How to set Action START/STOP FTP Server by Automagic

Post by Desmanto » 25 Feb 2018 04:53

It stated it use CustomBroadcastReceiver. So you should use action "Send Broadcast" instead. Some app use activity (Start Activity), some use service (Start Service). You have to use approriate one defined by the dev.
It seems the app doesn't support custom parameter. So you simply put net.xnano.android.ftpserver.START_SERVER in the action field.

I used to use ES File Explorer, before it gone rogue. I use the FTP service by using Start Activity. I have switched to MiXplorer then (not long after I use Automagic). MiXplore has deeper integration with automation. It also support the same FTP intent start/stop action, with custom path too (It also has http and tcp server too). The dev has the documentation for it, Turning Servers ON/OFF. Example at mine, I use :
Action Send Broadcast
Action: com.mixplorer.ACTION_SERVER
Package: com.mixplorer
Class: com.mixplorer.BroadcastReceiver
Extras:
putString("type", "ftp");
putString("on", true); //optional
putString("path", "/storage/emulated/0");

You can also use it to copy file to SMB server too (or basically any location). Example, I can take screenshot with automagic and directly copy it to my PC RAM drive for further processing. There are still many things you can do with it, example open shortcut, open image, sound file, video and etc. Easily become the best file manager I ever use (as it also integrate nicely with Automagic)
Index of Automagic useful thread List of my other useful posts (and others')
Xiaomi Redmi Note 5 (whyred), AOSP Extended v6.7 build 20200310 Official, Android Pie 9.0, Rooted.

User avatar
JurGraf
Posts: 4
Joined: 31 Mar 2015 09:23

Re: How to set Action START/STOP FTP Server by Automagic

Post by JurGraf » 19 Apr 2018 15:59

Thank you! :D
Now I can use Automagic to manage FTP Server and some new (for me) functions.
You make my better understand this functions. Automagic is GREAT.
Best regards,
Jerzy

Sorry my bad English…

ewill
Posts: 67
Joined: 20 Jul 2015 16:42

Re: How to set Action START/STOP FTP Server by Automagic

Post by ewill » 31 Dec 2018 15:34

I have just begun using mixplorer and wanted to start the ftp server with automagic as well.

I am trying the action described - and the server is not starting.

Any ideas of what I can be doing wrong?

Edit:
I have done some additional experimentation and discovered as follows.

If I have just recently started mixplorer, the broadcast works perfectly. If however it has been a few minutes, the broadcast doesn't activate the ftp server.

I did discover a dirty work around, if i do the following
Start Activity
Explicit Component
Package Name = com.mixplorer
Class Name = com.mixplorer.activities.ClipboardActivity

Right before the broadcast, the activity silently fails, but seems to wake up mixplorer so that it responds to the broadcast.

Perhaps there is a more elegant way that you can suggest, at least this seems to work.

User avatar
Desmanto
Posts: 2709
Joined: 21 Jul 2017 17:50

Re: How to set Action START/STOP FTP Server by Automagic

Post by Desmanto » 02 Jan 2019 05:56

What phone do you use? Android version and ROM type? Even though MiXplorer is not excluded from battery optimization, the broadcast should passed properly. It seems the ROM is too aggressive in killing the background app. Try to exclude MiXplorer from battery optimization and see if the broadcast works properly all the time.

At mine, even if I force stop MiXplorer, and start the FTP via the broadcast, it starts immediately. I am using Redmi Note 5, ROM RR 6.2.0 Oreo 8.1; and have excluded MiXplorer from battery optimization.
Index of Automagic useful thread List of my other useful posts (and others')
Xiaomi Redmi Note 5 (whyred), AOSP Extended v6.7 build 20200310 Official, Android Pie 9.0, Rooted.

ewill
Posts: 67
Joined: 20 Jul 2015 16:42

Re: How to set Action START/STOP FTP Server by Automagic

Post by ewill » 02 Jan 2019 08:02

Thanks for the help.

My phone is a HTC U11 with a Leedroid ROM (which is based on stock). If I exclude MiXplorer from battery optimization, it starts. I guess the optimization is quite aggressive in my case.

Locked