Sending a "|" not a "pipe = CRLF" to a touchpanel
HARMAN_icraigie
Posts: 660
Anyone know how to send the "|" character as the "|" character and not the new line trigger?
Found its needed for updating the path of some dynamic image stuff I'm working with on Google Charts and I'm getting some funky results
"||" doesn't seem to cut it.
Found its needed for updating the path of some dynamic image stuff I'm working with on Google Charts and I'm getting some funky results
"||" doesn't seem to cut it.
0
Comments
A pipe is one of the characters (like a space or a quotation mark) that should never be used in a URL and it needs to be encoded. If you want to URL encode a character you need to use a percent sign (%) followed by the 2 digit hex value.
For example you’ll sometimes see %20 in a URL which is an URL encoded space character.
A | = 0x7C so if you want the pipe try:
%7C
I think someone posted a function someplace on the forum that will URL encode a string but if you only need to worry about the pipe then %7C should do the trick.
HTH
Here's the link:
http://amxforums.com/showthread.php?t=5345&highlight=url+encoding
Issues isn't in the URL encoding, the panel is seeing the "|" as a new line escape character even though its not embedded in a text change command string.
I?m curious, how do you know it?s doing that?
It seems strange that the filename requires an illegal character. Or am I just misunderstanding your problem?
Here's the url:
http://chart.apis.google.com/chart?&cht=bvs&chs=530x200&chco=b4ecb4&chbh=20,0,0&chf=bg,s,EEF3FAFF&chlr=1.5kWh|0.75|0.0&chd=s:0gbdeYebZYe341pfnekckwuy&/Chart.png
If that data is entered as is into the static dynamic image properties (or a browser), it works fine, but send it to a touchpanel with an ^RMF command and it fails, specifically the axis labels that are delimited with the "|" character.
Guess I could sniff what the panel is sending out after getting the ^RMF string, maybe later.
1) It should only happen with text send_commands.
2) If you?re using %7C it won?t be interpreted as a pipe so the conversion won?t happen. That can be verified by doing a text send_command with %7C. You just get %7C as the text, not a crlf.
I?m guessing you must have some sort of other problem setting up the dynamic image (or a dynamic image undocumented feature) or possibly a URL encoding issue. Since you posted a link I will try it out myself and see what I get if I get a chance later tonight. If you happen to get it working before then let us know.
You said you get funky results. So that means you get some sort of image but not the correct one?
Can you post the actual dynamic image commands that your using? Do the commands look right going out to the panel if you monitor with notifications?
If the send_command is greater than 200 or so characters it will get lopped off. Just throwing that out as an idea.
Probably was going to end up here anyways because of that 200 byte limit - which I was aware of.
Few more tweaks should see a fairly respectful implimentation of Google powermeter on the touch panel.