Page 1 of 1

2-way feedback troubleshooting

Posted: Wed Jan 02, 2013 9:44 pm
by bob3695
Hello,

I am playing around with 2-way feedback from an Apple TV which returns XML as a response. I wrote my RegEx and tested it throughly and it returns the exact data I expect it to. I put that into 2-way feedback and have it assign it to a label. I then setup the command to trigger the response with the data. After doing that I click the button and nothing happens! So I think I might have messed something up... So I do a basic catch all pattern like this:

(.*)

and it returns the first line of a HTTP response which is what I expect. Now, I know what I am expecting the full response to be based on testing done in Hercules but is there any way to actually see the data that is making it's way to DemoPad because there seems to be something messed up because I can take the full HTTP response from hercules and use my reg ex in a reg ex tester and it returns exactly what I want. Here is the regex in question:

<name>([a-zA-Z0-9\s:-]*)

Re: 2-way feedback troubleshooting

Posted: Wed Jan 02, 2013 10:04 pm
by DemoPad
Have you tried sending just the portion of data you are expecting to the app via Hercules, by pointing the device IP address to your PC & using the TCP Server function of Hercules? Either that, or assign the label as you have done, then send out the label as a command to Hercules running on your PC to view it.

Often these problems are caused by having an incorrect response terminator - sometimes xml files have only \x0A line feed characters at the end of each line, and no \x0D. Again Hercules can confirm this.

Re: 2-way feedback troubleshooting

Posted: Wed Jan 02, 2013 10:51 pm
by bob3695
I got it to show me some information with having a general catch all regex pass the info on to Hercules. Here is the regex I used:

([A-Za-z0-9<>/.\s\n\?"=,:;&-]*)

Here is the expected data:

HTTP/1.1 200 OK
Content-Length: 1629
Date: Wed, 02 Jan 2013 21:29:40 GMT
Accept-Ranges: bytes

<?xml version="1.0" encoding="UTF-8" ?>
<nowplaying>
<backDropURL>http://cf2.imgobject.com/t/p/w1280/8RkL ... ackDropURL>
<type>video</type>
<genre>Action, Adventure, Crime, Thriller</genre>
<tagline>How Fast Do You Want It?</tagline>
<released>2003-06-03</released>
<credits>
<cast>
<person job="Actor" name="Paul Walker" />
<person job="Actor" name="Tyrese Gibson" />
<person job="Actor" name="Eva Mendes" />
<person job="Actor" name="Cole Hauser" />
<person job="Actor" name="Ludacris" />
<person job="Actor" name="Thom Barry" />
<person job="Actor" name="James Remar" />
<person job="Actor" name="Devon Aoki" />
<person job="Actor" name="Amaury Nolasco" />
<person job="Actor" name="Michael Ealy" />
<person job="Actor" name="Jin Auyeung" />
<person job="Actor" name="Edward Finlay" />
<person job="Actor" name="Mark Boone Junior" />
<person job="Actor" name="Mo Gallini" />
<person job="Director" name="John Singleton" />
<person job="Producer" name="Heather Lieberman" />
</cast>
</credits>
<coverArtURL>http://cf2.imgobject.com/t/p/w342/3CrNP ... overArtURL>
<certification>PG-13</certification>
<overview>It&apos;s a major double-cross when former police officer Brian O&apos;Conner teams up with his ex-con buddy Roman Pearce to transport a shipment of "dirty" money for shady Miami-based import-export dealer Carter Verone. But the guys are actually working with undercover agent Monica Clemente to bring Verone down.</overview>
<runtime>107</runtime>
<name>2 Fast 2 Furious</name>
</nowplaying>

Here is what Hercules reports:

Date: Wed, 02 Jan 2013 21:49:24 GMT

Accept-Ranges: bytes



<?xml version="1.0" encoding="UTF-8" ?>

<nowplaying>

<backDropURL>http://cf2.imgobject.com/t/p/w1280/8RkL ... ackDropURL>

<type>video</type>

<genre>Action, Adventure, Crime, Thriller</genre>

<tagline>How Fast Do You Want It?</tagline>

<released>2003-06-03</released>

<credits>

<cast>

<person job="Actor" name="Paul Walker" />

<person job="Actor" name="Tyrese Gibson" />

<person job="Actor" name="Eva Mendes" />

<person job="Actor" name="Cole Hauser" />

<person job="Actor" name="Ludacris" />

<person job="Actor" name="Thom Barry" />

<person job="Actor" name="James Remar" />

<person job="Actor" name="Devon Aoki" />

<person job="Actor" name="Amaury Nolasco" />

<person job="Actor" name="Michael Ealy" />

<person job="Actor" name="Jin Auyeung" />

<person job="Actor" name="Edward Finlay" />

<person job="Actor" name="Mark Boone Junior" />

<person job="Actor" name="Mo Gallini" />

<person job="Director" name="John Singleton" />

<person job="Producer" name="Heather Lieberman" />

</cast>

</credits>

<coverArtURL>http://cf2.imgobject.com/t/p/w342/3CrNP ... overArtURL>

<certification>PG-13</certification>

<overview>It&apos;s a major double-cross when former police officer Brian O&apos;Conner teams up with his ex-con buddy Roman Pearce to transport a shipment of "dirty" money for shady Miami-based import-export dealer Carter Verone. But the guys are actually working with undercover agent Monica Clemente to bring Verone down.</overview>

<runtime>107</runtime>

<name>2 Fast 2 Furious</name>

</nowplaying>

(note that I cut off the top, it was sent as expected)

I have tested with response terminator

\x0A

This is really throwing me off because it seems to be getting all the right data when using a generic catch all RegEx and nothing is getting returned with the real RegEx

Re: 2-way feedback troubleshooting

Posted: Wed Jan 02, 2013 11:05 pm
by bob3695
And this is the part when I go crawl back under a rock...

It seems I need to double check what I type because title != name :cry:

Thanks for giving me the hercules tip about the server, never thought about that!

Re: 2-way feedback troubleshooting

Posted: Fri Jan 04, 2013 8:40 pm
by bob3695
So back with another problem...

I am writing my own web server. I set it to put dump "Bla Bla Bla" to a response. I hit it with a web browser, it responds correctly. I point Hercules toward it and it returns this:

Code: Select all

HTTP/1.1 200 OK
X-Powered-By: Express
Content-Type: text/html; charset=utf-8
Content-Length: 11
Date: Fri, 04 Jan 2013 19:22:14 GMT
Connection: close

Bla Bla Bla
Which is the expected response. Next step was to have DemoPad hit it and dump the info it gets to Hercules and this is what is getting sent to Hercules in that test:

Code: Select all

HTTP/1.1 200 OK
X-Powered-By: Express
Content-Type: text/html; charset=utf-8
Content-Length: 11
Date: Fri, 04 Jan 2013 19:21:33 GMT
Connection: close
Note the missing response.

I then have it return a JSON object for testing (only thing that changes server side is instead of writing a little bit of test I return a JSON object) and this is the response I get:

Code: Select all

HTTP/1.1 200 OK
X-Powered-By: Express
Content-Type: application/json; charset=utf-8
Content-Length: 86
Date: Fri, 04 Jan 2013 19:35:45 GMT
Connection: close
{
  "name": "MasterBed",
  "val": 2,
  "_id": "50e62cf1152827d016000001",
  "__v": 0
That gives me more information but still cuts off a little bit of information. I tested with \x0D, \x0A and \x0D\x0A as terminators for the 2-way feedback with \x0A being used in the above tests. Any ideas why DemoPad would be dropping off that part of the response?

It is worth it to note I can put stuff into the HTTP header and that makes it to DemoPad but anything else besides JSON objects don't make it.

Re: 2-way feedback troubleshooting

Posted: Sat Jan 05, 2013 11:01 am
by DemoPad
How are you sending the data from DemoPad to Hercules? If you are using a catch all (.*) then firing that as a command, then I'd expect problems - because DemoPad will be reading in each line one at once, assigning it to the label, which you are then sending out. Depending on the speed of the events, sometimes a label might be set to a blank line (ie if it encounters \x0D\x0A\x0D\x0A) before it had chance to send out the previous line etc.

For testing, suggest you put in as the response terminator something like "<end>" - and include that in your data - that way DemoPad should read in everything in one go...

If you still have problems, this might be one for support@demopad.com - if you send in your project they should be able to duplicate.

Re: 2-way feedback troubleshooting

Posted: Sat Jan 05, 2013 3:30 pm
by bob3695
I actually was able to figure it out. I left the response terminator as \x0A and simply put '\n' at the end of the response in my server and suddenly it starts working! Thanks for the help!