Force use of WiFi interface for HTTP Request

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

Moderator: Martin

Wibbly
Posts: 418
Joined: 17 Mar 2014 09:02

Force use of WiFi interface for HTTP Request

Post by Wibbly » 06 Jun 2018 12:57

Context of request:

http://automagic4android.com/forum/view ... 453#p21453

Is forcing use of a specific interface possible as an action option?

User avatar
Martin
Posts: 4468
Joined: 09 Nov 2012 14:23

Re: Force use of WiFi interface for HTTP Request

Post by Martin » 07 Jun 2018 19:33

I'm not yet sure if this is possible for action HTTP Request. It seems that it would be possible to temporarily force Automagic to use the WiFi interface for all network requests on Android 6+ but not for a single HTTP Request so it could have side effects when other actions would try to access the internet at the same time the HTTP Request is executed.
I'll investigate if there's a better way that does not globally affect all network requests by Automagic.

Regards,
Martin

Wibbly
Posts: 418
Joined: 17 Mar 2014 09:02

Re: Force use of WiFi interface for HTTP Request

Post by Wibbly » 08 Jun 2018 07:23

Even a separate action to enable/disable all network requests to use the WiFi interface would be a lot better than trying to rely on Control UI to toggle the network data setting ;-)

User avatar
Martin
Posts: 4468
Joined: 09 Nov 2012 14:23

Re: Force use of WiFi interface for HTTP Request

Post by Martin » 08 Jun 2018 19:00

I could provide a new action to force the use of a particular network interface for network access in Automagic. I've never used this API of Android before so I have no experience if it actually works but let me try to add the action so we can test it.

Regards,
Martin

jordancaver123
Posts: 2
Joined: 19 Jun 2018 11:44

Re: Force use of WiFi interface for HTTP Request

Post by jordancaver123 » 20 Jun 2018 09:10

HTTP is a text-based protocol, in detail to be more correct it is an ASCII based protocol. This means that all the communication is attractive much readable, no decoding, no translation or decryption. Look at an HTTP trace and you'll be attractive much able to read it, separate out all the GET requests and responses and it's not that solid to follow also. Of course, this is slightly upsetting in this world where we are told to encrypt and secure our identities, the method of transport which delivers most personal information operates almost totally in clear text.
Thanks & Regards,
Jordan Caver
Web Development Toronto
Web Development Company

Wibbly
Posts: 418
Joined: 17 Mar 2014 09:02

Re: Force use of WiFi interface for HTTP Request

Post by Wibbly » 20 Jun 2018 10:06

jordancaver123 wrote:HTTP is a text-based protocol, in detail to be more correct it is an ASCII based protocol. This means that all the communication is attractive much readable, no decoding, no translation or decryption. Look at an HTTP trace and you'll be attractive much able to read it, separate out all the GET requests and responses and it's not that solid to follow also. Of course, this is slightly upsetting in this world where we are told to encrypt and secure our identities, the method of transport which delivers most personal information operates almost totally in clear text.
Correct, and this is bit off topic, but in my case it's non-personal data that's being sent by Automagic that's being used to control a relay and it's being sent over an encrypted WiFi connection to the end device (internet not involved) :-)

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

Re: Force use of WiFi interface for HTTP Request

Post by Desmanto » 20 Jun 2018 10:45

I just remember that you can use curl with specific interface. Download the binary for android, extract the binary to /sdcard/Automagic. I don't know if latest android (Oreo 8.1) support to execute command from /sdcard (AFAI try, always fail if without root).

Use the execute command

Code: Select all

curl --interface wlan0 http://192.168.1.100/youriotdeviceaddress.htm
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.

Wibbly
Posts: 418
Joined: 17 Mar 2014 09:02

Re: Force use of WiFi interface for HTTP Request

Post by Wibbly » 02 Jul 2018 10:38

Martin wrote:I could provide a new action to force the use of a particular network interface for network access in Automagic. I've never used this API of Android before so I have no experience if it actually works but let me try to add the action so we can test it.

Regards,
Martin
Was this a no-go, or pending another release of EAP version 1.36.0-dev?

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

Re: Force use of WiFi interface for HTTP Request

Post by Desmanto » 02 Jul 2018 17:56

We don't know yet. Martin probably has his own schedule on implementing various features. It always takes more time at the first addition, as many things need to be taken care. Planning, checking for possible crash, future update, and so many things. Unless it is a critical bug which need immediate attention (such as the last one on Start Activity, EAP 1.36.0). So many planning at first addition is also to reduce the possibility of the critical bug in the future.

I will just wait and use workaround first if possible. Many of my previous requests were added, but not in the order I request it. Some maybe easier (especially if it is just extension of current feature), some may take longer time, as it is new feature.
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
Martin
Posts: 4468
Joined: 09 Nov 2012 14:23

Re: Force use of WiFi interface for HTTP Request

Post by Martin » 05 Jul 2018 19:07

The option to specify the type of network to use in action HTTP Request is available in the EAP version:
added option in trigger HTTP Request to listen for requests on the WiFi interface only
I've not added an action to change the default network type for all network accesses for Automagic since this could have unexpected side effects.

Regards,
Martin

Locked