Page 1 of 4

Tcp/udp Sending and receiving

Posted: 24 Aug 2017 05:17
by Dvir Hamami
Please add these options

Re: Tcp/udp Sending and receiving

Posted: 24 Aug 2017 08:48
by bogdyro
Hi. There's a Tasker plug-in that sends\receives tcp packets. Works with automagic too.
Haven't figured out how to use it properly though. Maybe you can give it a try.
https://play.google.com/store/apps/deta ... sendexpect

Re: Tcp/udp Sending and receiving

Posted: 24 Aug 2017 13:36
by Desmanto
+1 for this feature. For example of TCP send/receive, as stated above, there is plugin Send/Expect
https://play.google.com/store/apps/deta ... sendexpect
This is a paid plugin.

While for UDP sender, there is plugin UDP sender
https://play.google.com/store/apps/deta ... .udpsender
It is free, but it doesn't support receiver, so maybe need to add the listener function to it.

This is different with HTTP request, which probably are the most common protocol we use.

The use case of this is quite niche, mostly in IoT or home automation. I have a wifi smart socket (Orvibo S20), but it doesn't support any automation app. So I craft a UDP packet as the command to turn it on/off. But UDP sender doesn't support receiver, so I don't get the feedback after sending the command. TCP is used if the IoT device use TCP.

The main point of this feature is we are able to craft raw TCP/UDP packet and receive the raw feedback/response. Of coz, it must support variable at the IP, port and packet sent/received. It will be nice to have some example use also, such as : DNS, DHCP, ARP, MQTT, SNMP, NTP, telnet and etc.

Re: Tcp/udp Sending and receiving

Posted: 30 Aug 2017 22:40
by BoBo
+1
Was able to send a text using an Autohotkey script to my android device via UDP (kinda coincidence as I've done this for the first time ever, today!)
That way I could return status messages about running business processes to my mobile.
Would love if A4A could push a string via UDP (eg to trigger several other things like my live stream recording VLC scripts on my PC).

A nice sample of a minimalistic UDP app :arrow: UDP Tool

Re: Tcp/udp Sending and receiving

Posted: 31 Aug 2017 17:18
by Desmanto
BoBo wrote:+1
Was able to send a text using an Autohotkey script to my android device via UDP (kinda coincidence as I've done this for the first time ever, today!)
That way I could return status messages about running business processes to my mobile.
Would love if A4A could push a string via UDP (eg to trigger several other things like my live stream recording VLC scripts on my PC).

A nice sample of a minimalistic UDP app :arrow: UDP Tool
Can share the link to the example of your Autohotkey UDP server? Just to make sure we are on the same page.

If you want only to communicate to your PC, you can just use web server. It is easier. (I planned to type the tutorial, but I still have another tutorial for other user in our local forum.)
I have done it via EventGhost, no need UDP, just HTTP. But still can't find ways to have the eventghost to receive the uploaded file from automagic.
For clipboard sharing (between PC and Phone) and uploading file from PC to phone have been done. Only uploading file to PC still in progress.

Re: Tcp/udp Sending and receiving

Posted: 18 Sep 2017 11:56
by BoBo
Desmanto wrote:
BoBo wrote:Can share the link to the example of your Autohotkey UDP server? Just to make sure we are on the same page.

If you want only to communicate to your PC, you can just use web server. It is easier. (I planned to type the tutorial, but I still have another tutorial for other user in our local forum.)
I have done it via EventGhost, no need UDP, just HTTP. But still can't find ways to have the eventghost to receive the uploaded file from automagic.
For clipboard sharing (between PC and Phone) and uploading file from PC to phone have been done. Only uploading file to PC still in progress.
[Android] MyControl - trigger your (compiled) scripts via your mobile phone
AHKSock Implementation (TCP for AHK): :mrgreen:

Re: Tcp/udp Sending and receiving

Posted: 02 Jan 2018 15:17
by thewild
Hi all

I would also love to have this UDP sending+listener action.
This would be very useful for IoT scripts.
A very simple example : send a UDP multicast packet for service discovery (i.e. SSDP, mDNS/ZeroConf, ...).

Re: Tcp/udp Sending and receiving

Posted: 21 Jan 2018 22:54
by TraianC
+1
I would love to have UDP send feature.

Re: Tcp/udp Sending and receiving

Posted: 17 Feb 2019 07:18
by elektroinside
Hi guys,

My first post, so I first would like to express my gratitude for this project and app, it's simply phenomenal and made my life way easier.
I'm using it to automate my house, phone and generally my life.

I would love to see this feature. I'm using the send/expect tasker plugin to manipulate some Yeelight led strips, but because the plugin is using tasker variables to return the results.. well, i dont have any in Automagic.

Thanks again :)

Re: Tcp/udp Sending and receiving

Posted: 17 Feb 2019 10:09
by Desmanto
I have been testing this since yesterday using netcat binary. Manual is here : https://linux.die.net/man/1/nc
It is provided by busybox nc command, so non root user should be able to install busybox non root version to get the tool. I still struggle with the ssdp discovery service, because nc drop the packet when the response doesn't come from the same IP address. It was stated to use tcpdump to get the discovery info. But if you know the IP address already of the yeelight, you can use the similar as mine.

Code: Select all

toggle = '{"id":0,"method":"toggle","params":[]}\r\n';
cmd = "( echo -ne '{toggle}'; sleep 0.5 ) | nc -w1 192.168.1.100 55443";
Use {cmd} in execute root command. (or execute command for non root user).

This command will toggle the yeelight bulb 800 lumen, on or off. Replace the IP with the IP of the bulb. It will be of course much better to have this function built-in.