Notice: This forum has been recovered from an old backup, so some content, links, and dates may be outdated. The forum is currently read-only while we restore sign-in and registration functionality. Details
If you find this forum valuable and would like to help keep it online, donations to help cover hosting and domain costs are greatly appreciated, but never expected. You can support the forum through Buy Me a Coffee or Ko-fi. Thank you for helping preserve the EventGhost community.
If you find this forum valuable and would like to help keep it online, donations to help cover hosting and domain costs are greatly appreciated, but never expected. You can support the forum through Buy Me a Coffee or Ko-fi. Thank you for helping preserve the EventGhost community.
TCPEvents : A better Network Event Receiver/Sender plugin
- kgschlosser
- Site Admin
- Posts: 5190
- Joined: Fri Jun 05, 2015 5:43 am
- Location: Rocky Mountains, Colorado USA
Re: TCPEvents : A better Network Event Receiver/Sender plugi
look for an x86 port of android. i can't remember who makes it. but you can install it on hyper-v or a virtual box. it's a little cumbersome to use because of how it handles the mouse and not having a touch interface.. it just takes a bit of getting used to.. this way you get a nice big screen and a keyboard.. but you can also do all of your testing without having to mess with your primary android device.
Re: TCPEvents : A better Network Event Receiver/Sender plugi
I didn't know that x86 Android project existed. Looks cool! I actually do sometimes plug my keyboard and mouse into the tablet. Seems to work well for everything except pinch gestures. Unfortunately I need my PC running Windows so I can use EventGhost to send or the Serial Monitor to see the output of the Arduino when I'm testing EtherEvent. I guess I need to set up a VM or something but that's a bit more involved than I want to get in this project, it's already resulted in a ton of yak shaving. The Android device isn't really something I use, I just bought it so I can make an occasional post on Instagram for my business. I do have an old Android phone that I should probably use for testing one of the apps to avoid the conflict. It's interesting that there are three EventGhost Android apps that use this protocol, one for Windows phone, but a fair bit of searching for compatible apps a couple years ago found not a single one for iOS.
- kgschlosser
- Site Admin
- Posts: 5190
- Joined: Fri Jun 05, 2015 5:43 am
- Location: Rocky Mountains, Colorado USA
Re: TCPEvents : A better Network Event Receiver/Sender plugi
well it's good to have VM set up anyways. this is what i have as you know. it only takes me a few minutes to duplicate a VM so I have a base image and then go from there. but android would be really simple and it's small too. 2 gig maybe. it's just a nice way to test things. I am trying to think of a way I can set you up. because Hyper-V support is not built into Android. so the RDP stuff isn't available. but you can console in. Let me check and see if I can get an administrative package to run on windows 7 for 2012 hyper-v if i can i will just send ya over the Hyper-V admin cpl. going to have to set up a vpn for this. which is fairly simple.
That is if you want.
That is if you want.
Re: TCPEvents : A better Network Event Receiver/Sender plugi
Cool! I've been thinking about figuring out this VM thing lately. I've been doing a lot of Linux work to set up Travis CI on a bunch of repositories and have been SSHing into a Raspberry Pi or using an online Bash emulator for testing just because I don't have Linux set up on my desktop. I was watching a youtube video of someone jumping back and forth from macOS to Windows to Linux using VMware and thinking it could really be of benefit to me right now. Now with the Android thing added on it's more motivation.
-
justahotbag2
- Experienced User
- Posts: 68
- Joined: Fri Jan 27, 2017 8:16 pm
- Location: New York, NY
Re: TCPEvents : A better Network Event Receiver/Sender plugi
kgschlosser, you sir are correct, I was using the wrong action. I now have them talking in somewhat peace, although pearbear I am finding that it cries/crashes like a baby, if I get anything wrong, if my syntax is wrong, and it always is, and if I send things back-to-back too quickly. It is far from robust, are you finding the same?
The Hoeck App has never crashed, and although they are running side by side, if treated gently it seems to work, but the constantly crashing if I get something wrong is hurting my head while trying to learn. That said, I'm going to 'cheat' and just ask either one of you what I'm doing wrong when I type
into the fields of other plugins, including the suffix field of TCPEvents (don't understand why it's not the payload field but ok...), that won't work either in 'File Operations' to hold the value between reboots, not any field in the Snarl plugin. I realize it's code, but so does EG since it's calling BS on my syntax, it wouldn't if it saw it as a string, no?
Neither does just 'Print Vol', where 'Vol' is the Variable holding a hex code from my AVR.
into any text field. I've tried enclosing it in all kinds of brackets and quotes, and I always get a wrong syntax error. I'm confused because something like
does work in text fields in other occasions, and I've tried those magic curly brackets.
Please Help, I promise to study in reverse why the answer works. I know nothing about coding yet, but I'm slowly learning the concepts, I've actually pressed (F1) perhaps the first time in 30 years, and watching a video a day. However I am also dying a bit each day/getting older, and would like to smile again before I die. EG used to make me smile. It's kinda' like a wife in that way.
The Hoeck App has never crashed, and although they are running side by side, if treated gently it seems to work, but the constantly crashing if I get something wrong is hurting my head while trying to learn. That said, I'm going to 'cheat' and just ask either one of you what I'm doing wrong when I type
Code: Select all
print (int(Vol, 16))
Neither does just 'Print Vol', where 'Vol' is the Variable holding a hex code from my AVR.
into any text field. I've tried enclosing it in all kinds of brackets and quotes, and I always get a wrong syntax error. I'm confused because something like
Code: Select all
{eg.event.payload[1]}
Please Help, I promise to study in reverse why the answer works. I know nothing about coding yet, but I'm slowly learning the concepts, I've actually pressed (F1) perhaps the first time in 30 years, and watching a video a day. However I am also dying a bit each day/getting older, and would like to smile again before I die. EG used to make me smile. It's kinda' like a wife in that way.
- kgschlosser
- Site Admin
- Posts: 5190
- Joined: Fri Jun 05, 2015 5:43 am
- Location: Rocky Mountains, Colorado USA
Re: TCPEvents : A better Network Event Receiver/Sender plugi
It is like a wife. You have to remember what happens In s marriage?? You ever seen an old married couple smiling? Together? As in at each other? Nope that's what happens after decades lol
When I get home I will key up a book for you on. What is who and how and why.. with this portion. Of EG. There is no easy way to explain. But I do have some questions what is the purpose to setting the suffix of an event to Print Vol? Is this being sent from the app to EG?
When I get home I will key up a book for you on. What is who and how and why.. with this portion. Of EG. There is no easy way to explain. But I do have some questions what is the purpose to setting the suffix of an event to Print Vol? Is this being sent from the app to EG?
- kgschlosser
- Site Admin
- Posts: 5190
- Joined: Fri Jun 05, 2015 5:43 am
- Location: Rocky Mountains, Colorado USA
Re: TCPEvents : A better Network Event Receiver/Sender plugi
Oh yeah and I forgot to mention. EG causes loss of hair. Just like a wife does.
- kgschlosser
- Site Admin
- Posts: 5190
- Joined: Fri Jun 05, 2015 5:43 am
- Location: Rocky Mountains, Colorado USA
Re: TCPEvents : A better Network Event Receiver/Sender plugi
I am assuming you are trying to send actual python commands from the app to EG. or vice versa.
if you want to send python code to EG from another device or computer running EG. you will enter the code you want to run into the payload field.
you will need to create a macro to handle the incoming event with a PythonScript in it. and in that python script you will need to put in the following code.
This is going to be pseudo code but it will give the general idea
the above will run python code if it is sent in the payload.
the use of the curly braces {} is for EG only. and only some plugins allow for it. typically if the plugin has an option for parsing then it will allow for it.
what the {}'s do is it is an identifier that the information inside of them needs to be evaluated. just like the above example. the braces get stripped off and then the entered value gets run through the evaluator. what the evaluator does is it tries to determine if the actual text is code or just text. it does this by trying to run the value as if it was a .py file so it tries to compile it.
is not a string to be attached to a suffix. the whole event string is just that a string. the example you have provided is a python statement and cannot be turned into a string.
so if you wanted the hex value added to the event string as the suffix then this would be the correct thing to do and the value would have to be stored in eg.globals as well
this will convert the int that is stored in eg.globals.volume if eg.globals.volume is an int.
if it is not then we need to convert it to one like so
the reason why the volume has to be stored in eg.globals is because eg has been added to the builtin functions of the python interpreter and can be accessed from anywhere inside of EventGhost. Vol would be only locally accessible. so when you pass the information to an action if Vol is not in the same function/method as where the evaluation is taking place then it will throw a traceback error. so because eg is available everywhere so is eg.globals
if you want to send python code to EG from another device or computer running EG. you will enter the code you want to run into the payload field.
you will need to create a macro to handle the incoming event with a PythonScript in it. and in that python script you will need to put in the following code.
This is going to be pseudo code but it will give the general idea
Code: Select all
from ast import literal_eval
literal_eval(eg.event.payload[0])
the use of the curly braces {} is for EG only. and only some plugins allow for it. typically if the plugin has an option for parsing then it will allow for it.
what the {}'s do is it is an identifier that the information inside of them needs to be evaluated. just like the above example. the braces get stripped off and then the entered value gets run through the evaluator. what the evaluator does is it tries to determine if the actual text is code or just text. it does this by trying to run the value as if it was a .py file so it tries to compile it.
Code: Select all
print (int(Vol, 16))
so if you wanted the hex value added to the event string as the suffix then this would be the correct thing to do and the value would have to be stored in eg.globals as well
this will convert the int that is stored in eg.globals.volume if eg.globals.volume is an int.
Code: Select all
{hex(eg.globals.volume)}
Code: Select all
{hex(int(eg.globals.volume))}
- kgschlosser
- Site Admin
- Posts: 5190
- Joined: Fri Jun 05, 2015 5:43 am
- Location: Rocky Mountains, Colorado USA
Re: TCPEvents : A better Network Event Receiver/Sender plugi
***NOTE***
you cannot send python commands to any of the android apps. as those apps are not running a python interpreter and has no means to compile the code that has been sent.
you cannot send python commands to any of the android apps. as those apps are not running a python interpreter and has no means to compile the code that has been sent.
Re: TCPEvents : A better Network Event Receiver/Sender plugi
Yes exactly, that's the main reason why I use Tim Hoeck's Android app over EG lite app, just because we can use shortcuts on the Android desktop, it's very handy....other than stop using the desktop shortcuts that Tim Hoeck's Android app provides
That's really too bad we can't have a 100% compatibility between the two, Tim Hoeck's Android app and the TCPEvents plugin (which is wonderful compared to the Network Event Sender and Receiver plugins). For example, lately I discovered that when we send an event with a payload to Tim Hoeck's Android app, the payload is discarded, it only sees the event itself not the payload. So if one wants to work with the same event with different payloads, he can't do it because it's impossible to distinguish them.
Well nothing is perfect in this world
Re: TCPEvents : A better Network Event Receiver/Sender plugi
I definitely plan to work towards improving the compatibility of TCPEvents with the eventghost-android app. It seems to be a popular app. This issue has only been brought to my attention recently. So it's on my "to do" list but I need to finish up a couple other project first and then get caught up on work so I can free up some time for this project. I will update the thread when there is progress. Until then the patched version of the plugin can be used:
https://github.com/per1234/TCPEvents/fi ... ssue_6.zip
https://github.com/per1234/TCPEvents/fi ... ssue_6.zip
-
justahotbag2
- Experienced User
- Posts: 68
- Joined: Fri Jan 27, 2017 8:16 pm
- Location: New York, NY
Re: TCPEvents : A better Network Event Receiver/Sender plugi
I very, very, very much look forward, to any progress you make on compatibility with it, I've fallen further in love with the app, since I've been trying to deal with the "alternative" EGRemote, which I've grown to hate, when you messed around with EGRemote, it did you ever have any luck getting it to display/acknowledge any payloads?pearbear wrote:I definitely plan to work towards improving the compatibility of TCPEvents with the eventghost-android app. It seems to be a popular app.
For the record, Tim Hoeck's App in-spite of being abandoned, has never crashed on me, is far more functional and works from gingerbread to nougat versions of Android.
I'll thank you again later, but I'd like to pre-thank you any work you're doing on TCPEvents.
-
justahotbag2
- Experienced User
- Posts: 68
- Joined: Fri Jan 27, 2017 8:16 pm
- Location: New York, NY
Re: TCPEvents : A better Network Event Receiver/Sender plugi
Okay, you probably already came across this, but in the off chance you haven't, it had taken me forever to come across it, and I can't even remember where I found it on this forum, but I've attached a modified version of the native network plugins, I think that's what it said. Anyway, it's modified by Tim Hoeck, so I can only imagine it has some leads in it. It doesn't seem to work at all anymore. Hope this helps.
Re: TCPEvents : A better Network Event Receiver/Sender plugi
I had it on my "to do" list to find that plugin and check if it's compatible with a different project of mine. He seems to have had the same idea of merging the two plugins into one but didn't add the extra data actions that miljbee did.
