Re: [mh] Nanoleaf Aurora crashes on latest master

Brian Rudy via misterhouse-users <[email protected]>
Newsgroups gmane.comp.misc.misterhouse.user
Message-ID <[email protected]>
Hi Howard,

I figured this out.

It ends up that /JSON-support_by_pp/ and /JSON::XS/ don't play well 
together.

I had been using /JSON-support_by_pp/ in my alexa.pl code, and as soon 
as it decoded some JSON, all the other modules in MH that I had enabled 
that were using JSON::XS (Nanoleaf_Aurora.pm, Ecobee.pm) started 
misbehaving each time they attempted to decode JSON with 
/JSON::XS->new->decode()/. After switching alexa.pl to use /JSON::XS/ 
the issue went away.

I'm not sure what changed between MH 4.2 and the latest MH master, but 
this had never been an issue before.

Just a word of warning to everyone working with JSON that they should 
stick with /JSON::XS/ and avoid the Pure Perl version of this module....


Cheers!

-Brian


On 7/26/2020 3:46 PM, Brian Rudy via misterhouse-users wrote:
>
> Hi Howard,
>
> I am seeing a strange issue when using the current master branch with 
> Nanoleaf_Aurora that I hadn't seen prior to upgrading MH (I had been 
> using the 4.2 branch but was using the latest Nanoleaf_Aurora.pm prior 
> to this error appearing). Nanoleaf_Aurora runs fine all by itself, but 
> if I POST some JSON to another (completely unrelated) custom 
> Misterhouse CGI endpoint (/bin/alexa.pl that is ultimately serviced 
> via http_server.pl) I get the following error from Nanoloeaf_Aurora.pm 
> (note that I have debug set to 4):
>
> /07/26/2020 15:11:09  [Aurora:1] get_data initiated//
> //07/26/2020 15:11:09  [Aurora:1] Background Polling initiated//
> //07/26/2020 15:11:09  [Aurora:1] Backgrounding 11782 command info, 
> get_url -ua 
> "http://192.168.69.20:16021/api/v1/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx/"//
> //
> //07/26/2020 15:11:10  Oops2: could not pulse break on: Interrupted 
> system call//
> //
> //07/26/2020 15:11:10  [Aurora:1] Background poll info process completed//
> //debug: file_data={"name":"Nanoleaf Light Panels 
> 50:42:08","serialNo":"xxxxxxxxxxxx","manufacturer":"Nanoleaf","firmwareVersion":"3.3.4","hardwareVersion":"1.6-2","model":"NL22","cloudHash":{},"discovery":{},"effects":{"effectsList":["Christmas 
> Lights","Color Burst","Cops","Duo RED 
> EDM","Fireworks","Flames","Forest","Higgs Boson","Inner Peace","Knight 
> Rider","Meteor Shower","Nemo","Northern Lights","Paint 
> Splatter","Patterned Beats","Pulse","Pulse Pop Beats","Rhythmic 
> Northern Lights","Ripple","Romantic","Scanner","Shooting 
> Stars","Snowfall","Sound Bar","Sound Bar Red","Streaking 
> Notes","Triluminox Energy Crystal","Tron Legacy","Vader","Static 
> Radiation"],"select":"Tron 
> Legacy"},"firmwareUpgrade":{},"panelLayout":{"globalOrientation":{"value":0,"max":360,"min":0},"layout":{"numPanels":12,"sideLength":150,"positionData":[{"panelId":1,"x":149,"y":43,"o":180,"shapeType":0},{"panelId":3,"x":149,"y":129,"o":120,"shapeType":0},{"panelId":4,"x":75,"y":173,"o":60,"shapeType":0},{"panelId":5,"x":0,"y":129,"o":240,"shapeType":0},{"panelId":6,"x":74,"y":259,"o":240,"shapeType":0},{"panelId":7,"x":149,"y":303,"o":60,"shapeType":0},{"panelId":8,"x":149,"y":389,"o":120,"shapeType":0},{"panelId":9,"x":224,"y":259,"o":120,"shapeType":0},{"panelId":10,"x":224,"y":173,"o":180,"shapeType":0},{"panelId":11,"x":299,"y":129,"o":240,"shapeType":0},{"panelId":12,"x":299,"y":303,"o":300,"shapeType":0},{"panelId":13,"x":0,"y":303,"o":180,"shapeType":0}]}},"rhythm":{"auxAvailable":false,"firmwareVersion":"2.4.3","hardwareVersion":"1.4","rhythmActive":false,"rhythmConnected":true,"rhythmId":2,"rhythmMode":0,"rhythmPos":{"x":75.00154891541854,"y":0.0003980267930359105,"o":240.0}},"schedules":{},"state":{"brightness":{"value":50,"max":100,"min":0},"colorMode":"effect","ct":{"value":3000,"max":6500,"min":1200},"hue":{"value":0,"max":360,"min":0},"on":{"value":true},"sat":{"value":0,"max":100,"min":0}}}//
> //debug: json_data={"name":"Nanoleaf Light Panels 
> 50:42:08","serialNo":"xxxxxxxxxxx","manufacturer":"Nanoleaf","firmwareVersion":"3.3.4","hardwareVersion":"1.6-2","model":"NL22","cloudHash":{},"discovery":{},"effects":{"effectsList":["Christmas 
> Lights","Color Burst","Cops","Duo RED 
> EDM","Fireworks","Flames","Forest","Higgs Boson","Inner Peace","Knight 
> Rider","Meteor Shower","Nemo","Northern Lights","Paint 
> Splatter","Patterned Beats","Pulse","Pulse Pop Beats","Rhythmic 
> Northern Lights","Ripple","Romantic","Scanner","Shooting 
> Stars","Snowfall","Sound Bar","Sound Bar Red","Streaking 
> Notes","Triluminox Energy Crystal","Tron Legacy","Vader","Static 
> Radiation"],"select":"Tron 
> Legacy"},"firmwareUpgrade":{},"panelLayout":{"globalOrientation":{"value":0,"max":360,"min":0},"layout":{"numPanels":12,"sideLength":150,"positionData":[{"panelId":1,"x":149,"y":43,"o":180,"shapeType":0},{"panelId":3,"x":149,"y":129,"o":120,"shapeType":0},{"panelId":4,"x":75,"y":173,"o":60,"shapeType":0},{"panelId":5,"x":0,"y":129,"o":240,"shapeType":0},{"panelId":6,"x":74,"y":259,"o":240,"shapeType":0},{"panelId":7,"x":149,"y":303,"o":60,"shapeType":0},{"panelId":8,"x":149,"y":389,"o":120,"shapeType":0},{"panelId":9,"x":224,"y":259,"o":120,"shapeType":0},{"panelId":10,"x":224,"y":173,"o":180,"shapeType":0},{"panelId":11,"x":299,"y":129,"o":240,"shapeType":0},{"panelId":12,"x":299,"y":303,"o":300,"shapeType":0},{"panelId":13,"x":0,"y":303,"o":180,"shapeType":0}]}},"rhythm":{"auxAvailable":false,"firmwareVersion":"2.4.3","hardwareVersion":"1.4","rhythmActive":false,"rhythmConnected":true,"rhythmId":2,"rhythmMode":0,"rhythmPos":{"x":75.00154891541854,"y":0.0003980267930359105,"o":240.0}},"schedules":{},"state":{"brightness":{"value":50,"max":100,"min":0},"colorMode":"effect","ct":{"value":3000,"max":6500,"min":1200},"hue":{"value":0,"max":360,"min":0},"on":{"value":true},"sat":{"value":0,"max":100,"min":0}}}//
> //07/26/2020 15:11:10  [Aurora:1] ERROR! JSON file parser crashed! 
> Can't locate object method "property" via package "JSON::XS" at (eval 
> 105) line 124.//
> // at mh line 31//
> //        main::__ANON__('Can\'t locate object method "property" via 
> package "JSON::XS"...') called at (eval 105) line 124//
> //JSON::Backend::XS::Supportable::_set_for_pp('decode', 
> 'JSON::XS=SCALAR(0x6a4d540)', '{"name":"Nanoleaf Light Panels 
> 50:42:08","serialNo":"xxxxxxxx...') called at (eval 105) line 153//
> //JSON::Backend::XS::Supportable::_decode('JSON::XS=SCALAR(0x6a4d540)', 
> '{"name":"Nanoleaf Light Panels 50:42:08","serialNo":"xxxxxxxx...') 
> called at 
> /home/brudy/projects/misterhouse/mrhouse/misterhouse-07262020/bin/../lib/Nanoleaf_Aurora.pm 
> line 293//
> //        eval {...} called at 
> /home/brudy/projects/misterhouse/mrhouse/misterhouse-07262020/bin/../lib/Nanoleaf_Aurora.pm 
> line 293//
> //Nanoleaf_Aurora::process_check('Nanoleaf_Aurora=HASH(0x60ecd38)') 
> called at mh line 1580//
> //        main::run_hooks_('MainLoop_post') called at (eval 64) line 5//
> //        main::MainLoop_post_hooks() called at mh line 1715//
> //        main::check_for_action called at mh line 3782//
> //        main::monitor_commands called at mh line 7787//
> //
> //
> //07/26/2020 15:11:10  [Aurora:1] Communication Tracking object found. 
> Updating from online to offline.../
>
>
> After this error first appears, it seems to confuse Nanoleaf_Aurora 
> because it happens every time poll_process completes after the time 
> the initial error is shown. It seems like whatever http_server.pl is 
> doing handling the JSON POST is interfering with Nanoleaf_Aurora's 
> /poll_process/.
>
>
> A full (obfuscated) log excerpt with http logging enabled as well is 
> attached.
>
>
>
>
> ________________________________________________________
> To unsubscribe from this list, go to: https://lists.sourceforge.net/lists/listinfo/misterhouse-users
>

________________________________________________________
To unsubscribe from this list, go to: https://lists.sourceforge.net/lists/listinfo/misterhouse-users
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.