Serial plugin doesn't process repeat data?

If you have a question or need help, this is the place to be.
Post Reply
sofakng
Posts: 8
Joined: Thu Feb 10, 2011 2:26 pm

Serial plugin doesn't process repeat data?

Post by sofakng » Tue Jan 29, 2019 3:45 pm

I'm using EventGhost 0.5 rc4 and the built-in Serial plugin but I'm having some problems.

When the serial port receives repeat data in a short amount of time, it will only process the first command. For example, I send the ASCII string "KBD_RIGHT\r" from another device to my PC running EventGhost. If I send the data slowly then it will successfully create events for each string sent. However, I send them every 500ms or so then it will only process the first one and then stop processing for a while. It's not frozen or anything, but it just seems to ignore the repeat data.

I've checked with PuTTy that the serial data is being received correctly, but EventGhost just doesn't seem to process all of it.

User avatar
kgschlosser
Site Admin
Posts: 4623
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: Serial plugin doesn't process repeat data?

Post by kgschlosser » Tue Jan 29, 2019 6:28 pm

I ran a test against the serial plugin and this is what I get

Serial.test[TEST NUMBER]-[MILLISECONDS BETWEEN DATA SENDS]

pay attention to the log times there are 100 tests that I ran and all 100 of them completed in about 1.5 seconds total.
the last line is the total time between data sends. it matched the event times in the log perfectly.
I am not sure what you have going on. But the issue is not going to be with the serial plugin. it is most likely going to be with the macro.

send me a copy of your save file in a PM and i will take a look at it. you will have to zip it up to send it to me.

Code: Select all

11:26:13   Serial.test0-0.0
11:26:13   Serial.test1-16.0000324249
11:26:13   Serial.test2-15.0001049042
11:26:13   Serial.test3-15.9997940063
11:26:13   Serial.test4-15.0001049042
11:26:13   Serial.test5-16.0000324249
11:26:13   Serial.test6-16.0000324249
11:26:13   Serial.test7-14.9998664856
11:26:13   Serial.test8-16.0000324249
11:26:13   Serial.test9-15.0001049042
11:26:13   Serial.test10-16.0000324249
11:26:13   Serial.test11-15.9997940063
11:26:13   Serial.test12-15.0001049042
11:26:13   Serial.test13-16.0000324249
11:26:13   Serial.test14-14.9998664856
11:26:13   Serial.test15-16.0000324249
11:26:13   Serial.test16-16.0000324249
11:26:13   Serial.test17-15.0001049042
11:26:13   Serial.test18-16.0000324249
11:26:13   Serial.test19-14.9998664856
11:26:13   Serial.test20-16.0000324249
11:26:13   Serial.test21-16.0000324249
11:26:13   Serial.test22-14.9998664856
11:26:13   Serial.test23-16.0000324249
11:26:13   Serial.test24-15.0001049042
11:26:13   Serial.test25-16.0000324249
11:26:13   Serial.test26-16.0000324249
11:26:13   Serial.test27-14.9998664856
11:26:13   Serial.test28-16.0000324249
11:26:13   Serial.test29-14.9998664856
11:26:13   Serial.test30-16.0000324249
11:26:13   Serial.test31-16.0000324249
11:26:13   Serial.test32-15.0001049042
11:26:13   Serial.test33-16.0000324249
11:26:13   Serial.test34-14.9998664856
11:26:13   Serial.test35-16.0000324249
11:26:13   Serial.test36-16.0000324249
11:26:13   Serial.test37-14.9998664856
11:26:13   Serial.test38-16.0000324249
11:26:13   Serial.test39-15.0001049042
11:26:13   Serial.test40-16.0000324249
11:26:14   Serial.test41-16.0000324249
11:26:14   Serial.test42-14.9998664856
11:26:14   Serial.test43-16.0000324249
11:26:14   Serial.test44-15.0001049042
11:26:14   Serial.test45-15.9997940063
11:26:14   Serial.test46-16.0000324249
11:26:14   Serial.test47-15.0001049042
11:26:14   Serial.test48-16.0000324249
11:26:14   Serial.test49-14.9998664856
11:26:14   Serial.test50-16.0000324249
11:26:14   Serial.test51-16.0000324249
11:26:14   Serial.test52-15.0001049042
11:26:14   Serial.test53-15.9997940063
11:26:14   Serial.test54-15.0001049042
11:26:14   Serial.test55-16.0000324249
11:26:14   Serial.test56-16.0000324249
11:26:14   Serial.test57-14.9998664856
11:26:14   Serial.test58-16.0000324249
11:26:14   Serial.test59-15.0001049042
11:26:14   Serial.test60-16.0000324249
11:26:14   Serial.test61-15.9997940063
11:26:14   Serial.test62-15.0001049042
11:26:14   Serial.test63-16.0000324249
11:26:14   Serial.test64-14.9998664856
11:26:14   Serial.test65-16.0000324249
11:26:14   Serial.test66-16.0000324249
11:26:14   Serial.test67-15.0001049042
11:26:14   Serial.test68-16.0000324249
11:26:14   Serial.test69-14.9998664856
11:26:14   Serial.test70-16.0000324249
11:26:14   Serial.test71-16.0000324249
11:26:14   Serial.test72-14.9998664856
11:26:14   Serial.test73-16.0000324249
11:26:14   Serial.test74-15.0001049042
11:26:14   Serial.test75-16.0000324249
11:26:14   Serial.test76-16.0000324249
11:26:14   Serial.test77-14.9998664856
11:26:14   Serial.test78-16.0000324249
11:26:14   Serial.test79-15.0001049042
11:26:14   Serial.test80-15.9997940063
11:26:14   Serial.test81-16.0000324249
11:26:14   Serial.test82-15.0001049042
11:26:14   Serial.test83-16.0000324249
11:26:14   Serial.test84-14.9998664856
11:26:14   Serial.test85-16.0000324249
11:26:14   Serial.test86-16.0000324249
11:26:14   Serial.test87-15.0001049042
11:26:14   Serial.test88-15.9997940063
11:26:14   Serial.test89-15.0001049042
11:26:14   Serial.test90-16.0000324249
11:26:14   Serial.test91-16.0000324249
11:26:14   Serial.test92-14.9998664856
11:26:14   Serial.test93-16.0000324249
11:26:14   Serial.test94-15.0001049042
11:26:14   Serial.test95-16.0000324249
11:26:14   Serial.test96-15.9997940063
11:26:14   Serial.test97-15.0001049042
11:26:14   Serial.test98-16.0000324249
11:26:14   Serial.test99-14.9998664856
11:26:14   1.54399991035
If you like the work I have been doing then feel free to Image

sofakng
Posts: 8
Joined: Thu Feb 10, 2011 2:26 pm

Re: Serial plugin doesn't process repeat data?

Post by sofakng » Tue Jan 29, 2019 8:08 pm

Thanks very much for testing this.

Did you create a COM port (virtual or otherwise) and then send actual serial commands to it?

I've sent you a PM with more information and my egtree file. Thanks so much for any help!

User avatar
kgschlosser
Site Admin
Posts: 4623
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: Serial plugin doesn't process repeat data?

Post by kgschlosser » Tue Jan 29, 2019 9:40 pm

i used com0com to create a virtual pair. so they are linked together. then I installed the serial plugin 2 times one attached to each of thee ports. and I had one send data into the comport while the other generated events when it received it.

I am going to run a quick test and generate the same event over and over again. because I used completely different events when i did the test.
If you like the work I have been doing then feel free to Image

User avatar
kgschlosser
Site Admin
Posts: 4623
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: Serial plugin doesn't process repeat data?

Post by kgschlosser » Tue Jan 29, 2019 9:45 pm

it is what I thought it is. that single event is an enduring event. it looks as tho thee timeout is set to 200 milliseconds.

what an enduring event is. if the same command keeps on coming in instead of generating an event for each of the commands. an enduring event is generated. the enduring event will end if one of 2 things happens. 200 milliseconds passes. or another keys gets pressed.

the purpose to it is for using the repeat action. that action can only use enduring events. the repeat will cause thee macro to loop until the event ends.
If you like the work I have been doing then feel free to Image

sofakng
Posts: 8
Joined: Thu Feb 10, 2011 2:26 pm

Re: Serial plugin doesn't process repeat data?

Post by sofakng » Tue Jan 29, 2019 9:58 pm

I just replied but deleted it since I didn't see your response.

Thanks for researching it. I somewhat understand what you're saying but can you give me advice for my problem or how I can solve it?

Is it possible for me to change the default behavior or implement a workaround?

I'd like to be able to press my remote control arrows several times in a row and have each keypress (ie. serial command) generate a keypress (up+down). The purpose is that I'm controlling a HTPC (ie. Steam Big Picture) with my remote and I navigate the menus using the remote control.

Does that make sense?

User avatar
kgschlosser
Site Admin
Posts: 4623
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: Serial plugin doesn't process repeat data?

Post by kgschlosser » Wed Jan 30, 2019 1:16 am

It does make sense. It is how I have my system set up. I dislike the enduring events. Because there is only a single thread that the events get run in. So while an enduring event is taking place. If you have it looping a macro no other events will get processed until it is finished. So if you wanted to use EG to control your whole house from a single EG session. It could cause problems. I will take a look at the plugin to verify that is what is going on. And I will alter it to do what you want.
If you like the work I have been doing then feel free to Image

sofakng
Posts: 8
Joined: Thu Feb 10, 2011 2:26 pm

Re: Serial plugin doesn't process repeat data?

Post by sofakng » Wed Jan 30, 2019 5:59 pm

Great, thanks so much!

Also, the TCP Events (a fork of Network Sender/Receiver) doesn't seem to have this problem so I'm not sure if that is helpful or not?

Anyways, thanks again so much for the help.

User avatar
kgschlosser
Site Admin
Posts: 4623
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: Serial plugin doesn't process repeat data?

Post by kgschlosser » Thu Jan 31, 2019 7:01 pm

TCP Events is not a serial plugin it is a network plugin. and it was not coded to use enduring events.
If you like the work I have been doing then feel free to Image

sofakng
Posts: 8
Joined: Thu Feb 10, 2011 2:26 pm

Re: Serial plugin doesn't process repeat data?

Post by sofakng » Thu Jan 31, 2019 8:27 pm

Yeah, I know that TCP Events is for network communcation but I just thought I’d mention it in case it was helpful. Thanks again

User avatar
kgschlosser
Site Admin
Posts: 4623
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: Serial plugin doesn't process repeat data?

Post by kgschlosser » Fri Feb 01, 2019 5:14 am

it is simply how the author of the plugin decided to handle the events.


I am curious tho.

If you place that event into a macro that has a Python script action with the following code in it. will it start generating repetitive events.

Code: Select all

eg.event.SetShouldEnd()
this will end the enduring event. the big question is will it generate another since this one has ended.
If it does then there is your solution. place this python script at the end of your macros.
If you like the work I have been doing then feel free to Image

Post Reply