[ANSWERED]Indigo errors in /var/log/system.log

Posted on
Fri Dec 13, 2013 4:08 pm
berkinet offline
User avatar
Posts: 3297
Joined: Nov 18, 2008
Location: Berkeley, CA, USA & Mougins, France

[ANSWERED]Indigo errors in /var/log/system.log

I started seeing Indigo errors in the console log (/var/log/system.log) after making a change in a message the Phidgets plugin displays on a TextLCD screen and saves in a state for the Indigo TextLCD device. These messages can contain non-printable ascii characters and that is what was causing the problem. I fixed the code to remove non-printable characters from the state value, so all is well.

However, what I really wanted to report is that these errors did not show up in the Indigo log. Had I not been tracking down some other issue I might not have seen them. Not really a big deal, but it does seem Indigo should log something to alert the user.

Here is an example of the system.log messages:
Code: Select all
Dec 13 11:51:06 Richards-Mac-mini.local IndigoPluginHost[12461]: XML writer: dropped invalid character 08
Dec 13 11:51:06 --- last message repeated 1 time ---
Dec 13 11:51:06 Richards-Mac-mini.local IndigoPluginHost[12461]: XML writer: packet dump
Dec 13 11:51:06 Richards-Mac-mini.local IndigoPluginHost[12461]:   hex dump: 3C 50 61 63 6B 65 74 20 74 79 70 65 3D 22 64 69 63 74 22 3E 3C 54 79 70 65 20 74 79 70 65 3D 22 73 74 72 69 6E 67 22 3E 43 6F 6D 6D 61 6E 64 3C 2F 54 79 70 65 3E 3C 54 61 72 67 65 74 20 74 79 70 65 3D 22 73 74 72 69 6E 67 22 3E 53 65 72 76 65 72 3C 2F 54 61 72 67 65 74 3E 3C 4E 61 6D 65 20 74 79 70 65 3D 22 73 74 72 69 6E 67 22 3E 55 70 64 61 74 65 44 65 76 69 63 65 53 74 61 74 65 56 61 6C 75 65 3C 2F 4E 61 6D 65 3E 3C 44 61 74 61 20 74 79 70 65 3D 22 64 69 63 74 22 3E 3C 43 6C 65 61 72 45 72 72 6F 72 53 74 61 74 65 20 74 79 70 65 3D 22 62 6F 6F 6C 22 3E 74 72 75 65 3C 2F 43 6C 65 61 72 45 72 72 6F 72 53 74 61 74 65 3E 3C 44 65 63 69 6D 61 6C 50 6C 61 63 65 73 20 74 79 70 65 3D 22 69 6E 74 65 67 65 72 22 3E 2D 31 3C 2F 44 65 63 69 6D 61 6C 50 6C 61 63 65 73 3E 3C 49 44 20 74 79 70 65 3D 22 69 6E 74 65 67 65 72 22 3E 31 34 33 31 35 38 34 35 37 3C 2F 49 44 3E 3C 4E 61 6D 65 20 74 79 70 65 3D 22 73 74 72 69 6E 67 22 3E 4B 69 74 63 68 65 6E 2D 54 65 78 74 44 69 73 70 6C 61 79 3C 2F 4E 61 6D 65 3E 3C 53 74 61 74 65 4B 65 79 20 74 79 70 65 3D 22 73 74 72 69 6E 67 22 3E 6C 61 73 74 55 70 64 61 74 65 3C 2F 53 74 61 74 65 4B 65 79 3E 3C 53 74 61 74 65 56 61 6C 75 65 20 74 79 70 65 3D 22 73 74 72 69 6E 67 22 3E 32 30 31 33 2D 31 32 2D 31 33 20 31 31 3A 35 31 3A 30 36 3C 2F 53 74 61 74 65 56 61 6C 75 65 3E 3C 2F 44 61 74 61 3E 3C 2F 50 61 63 6B 65 74 3E 00 3C 50 61 63 6B 65 74 20 74 79 70 65 3D 22 64 69 63 74 22 3E 3C 54 79 70 65 20 74 79 70 65 3D 22 73 74 72 69 6E 67 22 3E 43 6F 6D 6D 61 6E 64 3C 2F 54 79 70 65 3E 3C 54 61 72 67 65 74 20 74 79 70 65 3D 22 73 74 72 69 6E 67 22 3E 53 65 72 76 65 72 3C 2F 54 61 72 67 65 74 3E 3C 4E 61 6D 65 20 74 79 70 65 3D 22 73 74 72 69 6E 67 22 3E 55 70 64 61 74 65 44 65 76 69 63 65 53 74 61 74 65 56 61 6C 75 65 3C 2F 4E 61 6D 65 3E 3C 44 61 74 61 20 74 79 70 65 3D 22 64 69 63 74 22 3E 3C 43 6C 65 61 72 45 72 72 6F 72 53 74 61 74 65 20 74 79 70 65 3D 22 62 6F 6F 6C 22 3E 74 72 75 65 3C 2F 43 6C 65 61 72 45 72 72 6F 72 53 74 61 74 65 3E 3C 44 65 63 69 6D 61 6C 50 6C 61 63 65 73 20 74 79 70 65 3D 22 69 6E 74 65 67 65 72 22 3E 2D 31 3C 2F 44 65 63 69 6D 61 6C 50 6C 61 63 65 73 3E 3C 49 44 20 74 79 70 65 3D 22 69 6E 74 65 67 65 72 22 3E 31 34 33 31 35 38 34 35 37 3C 2F 49 44 3E 3C 4E 61 6D 65 20 74 79 70 65 3D 22 73 74 72 69 6E 67 22 3E 4B 69 74 63 68 65 6E 2D 54 65 78 74 44 69 73 70 6C 61 79 3C 2F 4E 61 6D 65 3E 3C 53 74 61 74 65 4B 65 79 20 74 79 70 65 3D 22 73 74 72 69 6E 67 22 3E 74 65 78 74 4C 69 6E 65 5F 30 3C 2F 53 74 61 74 65 4B 65 79 3E 3C 53 74 61 74 65 56 61 6C 75 65 20 74 79 70 65 3D 22 73 74 72 69 6E 67 22 3E 47 3A 20 34 34 2E 32 20 54 3A 20 36 32 2E 39
Dec 13 11:51:06 Richards-Mac-mini.local IndigoPluginHost[12461]: ascii dump: <Packet type="dict"><Type type="string">Command</Type><Target type="string">Server</Target><Name type="string">UpdateDeviceStateValue</Name><Data type="dict"><ClearErrorState type="bool">true</ClearErrorState><DecimalPlaces type="integer">-1</DecimalPlaces><ID type="integer">143158457</ID><Name type="string">Kitchen-TextDisplay</Name><StateKey type="string">lastUpdate</StateKey><StateValue type="string">2013-12-13 11:51:06</StateValue></Data></Packet> <NULL> <Packet type="dict"><Type type="string">Command</Type><Target type="string">Server</Target><Name type="string">UpdateDeviceStateValue</Name><Data type="dict"><ClearErrorState type="bool">true</ClearErrorState><DecimalPlaces type="integer">-1</DecimalPlaces><ID type="integer">143158457</ID><Name type="string">Kitchen-TextDisplay</Name><StateKey type="string">textLine_0</StateKey><StateValue type="string">G: 44.2 T: 62.9

Posted on
Fri Dec 13, 2013 4:14 pm
matt (support) offline
Site Admin
User avatar
Posts: 21426
Joined: Jan 27, 2003
Location: Texas

Re: Indigo errors in /var/log/system.log

Looks like it doesn't like the encoding of your textLine_0 state value. Probably a degree symbol isn't UTF8 encoded?

I agree those errors need to be better logged. A bit problematic because they occur in the plugin sandbox process and not the Indigo Server (so logging them to the Event Log file is harder).

Image

Posted on
Fri Dec 13, 2013 6:46 pm
berkinet offline
User avatar
Posts: 3297
Joined: Nov 18, 2008
Location: Berkeley, CA, USA & Mougins, France

Re: Indigo errors in /var/log/system.log

matt (support) wrote:
...Probably a degree symbol isn't UTF8 encoded?...

Actually, it is a couple of arbitrary hex bytes which point to a custom character defined in the TextLCD unit. Otherwise the displayed message is printable-ascii.

Posted on
Wed Feb 19, 2014 8:03 pm
DaveL17 offline
User avatar
Posts: 6782
Joined: Aug 20, 2013
Location: Chicago, IL, USA

Re: Indigo errors in /var/log/system.log

Don't mean to hijack the thread, but the other one I found was locked. Has there been a solution found for writing the degree symbol to the log? I can display the symbol just fine to the UI, variables and control pages no problem. When I try:

Code: Select all
indigo.server.log(str('°'))  # Shift-Option-8

Indigo prints the degree symbol to the log just fine. But when I try to log the device dict:

Code: Select all
indigo.server.log(str(indigo.devices[70268800]))

Indigo throws an exception. If it makes a difference, I'm writing this to a plugin sensor device:

Code: Select all
dev.updateStateOnServer("sensorValue", value = owsTemp, decimalPlaces=2,  uiValue=owsTemp + u' °' + prefDegrees)

Everything runs just fine and the value displays in the UI as expected; it's just a bit of work to get to the dict. Not a super huge deal, just curious.

I came here to drink milk and kick ass....and I've just finished my milk.

[My Plugins] - [My Forums]

Posted on
Wed Feb 19, 2014 8:36 pm
matt (support) offline
Site Admin
User avatar
Posts: 21426
Joined: Jan 27, 2003
Location: Texas

Re: Indigo errors in /var/log/system.log

Instead of using str() above try using unicode().

Image

Posted on
Wed Feb 19, 2014 8:59 pm
DaveL17 offline
User avatar
Posts: 6782
Joined: Aug 20, 2013
Location: Chicago, IL, USA

Re: Indigo errors in /var/log/system.log

Pow! Worked like a charm.

Code: Select all
indigo.server.log(unicode(indigo.devices[70268800]))

Thanks Matt!

I came here to drink milk and kick ass....and I've just finished my milk.

[My Plugins] - [My Forums]

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 11 guests