Tcp/udp Sending and receiving

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

Moderator: Martin

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

Re: Tcp/udp Sending and receiving

Post by Desmanto » 26 Feb 2019 17:02

@elektroinside : Wow, thanks for the tips. I must really missed that part of set_scene that will turn on the light before. When I tried it, it doesn't work (maybe something wrong during the input choice). I even remove that from the choice afterward.

Thanks to your tip, that means I don't need the extra querying for power again, just directly use the set_scene. My finished flow will be much simplified. But I still put the whole map there, since probably I might use it one day. Why erasing something I have done for a week. And I still can reuse it to switch to set_scene method. The difference only that the set_scene doesn't use the duration when turning on, but that's fine. We can easily replace the effect by using color flowing.
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.

elektroinside
Posts: 69
Joined: 14 Feb 2019 15:04

Re: Tcp/udp Sending and receiving

Post by elektroinside » 26 Feb 2019 19:13

Sure thing, you're very welcome, glad i helped. For me, this was mandatory, as for incoming important calls a speedy reaction was critical :-)

elektroinside
Posts: 69
Joined: 14 Feb 2019 15:04

Re: Tcp/udp Sending and receiving

Post by elektroinside » 18 Apr 2019 16:17

Well.. recently purchased a Xiaomi Aqara gateway and a few sensors.
It has a "developer mode" which opens up its API. But commands have to be sent to a UDP port, responses are sent to the sender's IP and custom UDP port, muticast messages are sent to an IP and an UDP port...

Another example where Automagic cannot be used.. unfortunately :(
I need to put my Raspberry Pi to work, send http queries to something like Pushbullet, and then listen to messages using Automagic. Probably the best way for "multicast listening" anyway, but still, sending udp packets for this scenario from Automagic would still be great :-)

BoBo
Posts: 112
Joined: 05 May 2014 12:45

Re: Tcp/udp Sending and receiving

Post by BoBo » 15 Mar 2020 20:17

No idea if this is still of interest/help (eg. to integrate its base funchionality to AutoMagic): https://github.com/hastarin/android-udpsender ?? :)
PS. check out its Tasker option too!
PPS. Found/installed today. Very nice! https://play.google.com/store/apps/deta ... UDP_Widget

Just out of curiosity, do you know any Android UDP/TCP socket app that acts as a 'command line interface', means it can be triggered (preferably with Automagic) without opening a GUI ?? Would be OK if its user interface is provided in the notification bar (?) like it's done here: https://play.google.com/store/apps/deta ... tay Alive]. Thx for listening and any advice :)

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

Re: Tcp/udp Sending and receiving

Post by Desmanto » 21 Mar 2020 17:46

I used to use UDPsender too, but then I switch to nc binary, which I use mainly for my yeelight.

Automagic can host a command center, using trigger HTTP request. I use it all the time at home, to mirror the phone, sync clipboard and do stuff. At the PC, the sender is done using eventghost. It also have webserver which I can POST to using 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.

BoBo
Posts: 112
Joined: 05 May 2014 12:45

Re: Tcp/udp Sending and receiving

Post by BoBo » 21 Mar 2020 20:33

While doing research for a "man in the middle"-option for Android to get triggered by AutoMagic I found these Windows CMD tools too ...
http://sanyei-imports.com/scott/repo/UD ... isten.html (Win32Bit)
http://sanyei-imports.com/scott/repo/UD ... psend.html (Win32Bit)
http://woshub.com/portqry-tcp-udp-open- ... t-scanner/ (checks if a UDP port is in listening mode)

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

Re: Tcp/udp Sending and receiving

Post by Desmanto » 22 Mar 2020 17:45

You can use nc to listen to incoming UDP too : https://www.thegeekstuff.com/2012/04/nc ... -examples/
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.

Post Reply