winleafs/Winleafs

Winleaf is unable to open once connected to device

Closed this issue · 11 comments

Describe the bug
After initial install and pairing of device to Winleaf, the program closes and is unable to start again. Deleting the Settings file in %appdata%/Winleafs enables the program to be started, but you have to go through the pairing process again resulting in a crash.

To Reproduce
Steps to reproduce the behavior:

  1. Pair device
  2. Crash

Logs
System.InvalidOperationException: Sequence contains no elements
at System.Linq.ThrowHelper.ThrowNoElementsException()
at System.Linq.Enumerable.Min[TSource](IEnumerable1 source, Func2 selector)
at Winleafs.Wpf.Api.Layouts.PanelLayout.ConstructPanelsAsPolygons() in C:\Users\easy_\source\repos\winleafs\Winleafs\Winleafs.Wpf\Api\Layouts\PanelLayout.cs:line 87
at Winleafs.Wpf.Api.Layouts.PanelLayout.GetLayout() in C:\Users\easy_\source\repos\winleafs\Winleafs\Winleafs.Wpf\Api\Layouts\PanelLayout.cs:line 50
at Winleafs.Wpf.Api.Layouts.PanelLayout..ctor(Device device) in C:\Users\easy_\source\repos\winleafs\Winleafs\Winleafs.Wpf\Api\Layouts\PanelLayout.cs:line 38
at Winleafs.Wpf.Api.Orchestrator..ctor(Device device) in C:\Users\easy_\source\repos\winleafs\Winleafs\Winleafs.Wpf\Api\Orchestrator.cs:line 39
at Winleafs.Wpf.Api.OrchestratorCollection.AddOrchestratorForDevice(Device device) in C:\Users\easy_\source\repos\winleafs\Winleafs\Winleafs.Wpf\Api\OrchestratorCollection.cs:line 45
at Winleafs.Wpf.Api.OrchestratorCollection.Initialize() in C:\Users\easy_\source\repos\winleafs\Winleafs\Winleafs.Wpf\Api\OrchestratorCollection.cs:line 30
at Winleafs.Wpf.Views.App.NormalStartup(StartupEventArgs startupEventArgs) in C:\Users\easy_\source\repos\winleafs\Winleafs\Winleafs.Wpf\Views\App.xaml.cs:line 106
at Winleafs.Wpf.Views.Setup.SetupWindow.Finish_Click(Object sender, RoutedEventArgs e) in C:\Users\easy_\source\repos\winleafs\Winleafs\Winleafs.Wpf\Views\Setup\SetupWindow.xaml.cs:line 75
at Winleafs.Wpf.Views.Setup.NameDeviceControl.Finish_Click(Object sender, RoutedEventArgs e) in C:\Users\easy_\source\repos\winleafs\Winleafs\Winleafs.Wpf\Views\Setup\NameDeviceControl.xaml.cs:line 26
at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
at System.Windows.Controls.Primitives.ButtonBase.OnClick()
at System.Windows.Controls.Button.OnClick()
at System.Windows.Controls.Primitives.ButtonBase.OnMouseLeftButtonUp(MouseButtonEventArgs e)
at System.Windows.UIElement.OnMouseLeftButtonUpThunk(Object sender, MouseButtonEventArgs e)
at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
at System.Windows.UIElement.ReRaiseEventAs(DependencyObject sender, RoutedEventArgs args, RoutedEvent newEvent)
at System.Windows.UIElement.OnMouseUpThunk(Object sender, MouseButtonEventArgs e)
at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
at System.Windows.UIElement.RaiseTrustedEvent(RoutedEventArgs args)
at System.Windows.Input.InputManager.ProcessStagingArea()
at System.Windows.Input.InputProviderSite.ReportInput(InputReport inputReport)
at System.Windows.Interop.HwndMouseInputProvider.ReportInput(IntPtr hwnd, InputMode mode, Int32 timestamp, RawMouseActions actions, Int32 x, Int32 y, Int32 wheel)
at System.Windows.Interop.HwndMouseInputProvider.FilterMessage(IntPtr hwnd, WindowMessage msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at System.Windows.Interop.HwndSource.InputFilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler) System.Object:

Screenshots
If applicable, add screenshots to help explain your problem.

Additional context
Add any other context about the problem here.

Hey, thanks for the report. With the logs, we should be able to fix the crash. I will let you know when the fix is ready, most likely in a few days

@justinknguyen thank you for the bug report, a quick question before we look too far into this, are you using the new hexagon panels?

That is indeed what we are scared off, Nanoleaf doesn't acknowledge our application and no warning has been sent to other developers. We would like to add support for the new lights and will try to fix any bug you submit but we can unfortunately not say if any feature will work for your device (for example screen mirror is impossible to add due to not having a test device)

Fixed, however we are not yet able to guarantee Winleafs works with the new hexagon panels.
It would be nice if you could try what works and what doesn't, let us know if you'd like to help.

You can download the latest release with the fix here: https://github.com/winleafs/Winleafs/releases

Hey, thanks for checking. Could you send us your logs again? I expect it is a new error somwhere further in the start up process.

2020-09-15 08:18:34.5368|INFO|Winleafs.Wpf.Views.Setup.SetupWindow|Discovered following device: OpenWrt, IPs: System.Collections.Generic.List1[System.Net.IPAddress], Port: 16021 2020-09-15 08:19:00.3496|INFO|Winleafs.Api.Endpoints.NanoleafEndpoint|Sending following request to Nanoleaf: Address: http://"my IP address"/, URL: api/v1/g9FwEwIQde9NN807syhxrvUyqJTE9muU/identify, Method: PUT, Body: 2020-09-15 08:19:00.7571|INFO|Winleafs.Api.Endpoints.NanoleafEndpoint|Sending following request to Nanoleaf: Address: http://"my IP address"/, URL: api/v1/g9FwEwIQde9NN807syhxrvUyqJTE9muU/effects/effectsList, Method: GET, Body: 2020-09-15 08:19:01.3125|INFO|Winleafs.Api.Endpoints.NanoleafEndpoint|Sending following request to Nanoleaf: Address: http://"my IP address"/, URL: api/v1/Z1kWNwH0KctSZWc3CaLwnpRH7viDyzhO/identify, Method: PUT, Body: 2020-09-15 08:19:01.5480|INFO|Winleafs.Api.Endpoints.NanoleafEndpoint|Sending following request to Nanoleaf: Address: http://"my IP address"/, URL: api/v1/Z1kWNwH0KctSZWc3CaLwnpRH7viDyzhO/effects/effectsList, Method: GET, Body: 2020-09-15 08:19:06.6744|INFO|Winleafs.Wpf.Views.Setup.SetupWindow|Successfully added device Shapes 2020-09-15 08:19:06.7167|INFO|Winleafs.Api.Endpoints.NanoleafEndpoint|Sending following request to Nanoleaf: Address: http://"my IP address"/, URL: api/v1/Z1kWNwH0KctSZWc3CaLwnpRH7viDyzhO/panelLayout/layout, Method: GET, Body: 2020-09-15 08:19:07.0964|INFO|Winleafs.Api.Endpoints.NanoleafEndpoint|Sending following request to Nanoleaf: Address: http://"my IP address"/, URL: api/v1/Z1kWNwH0KctSZWc3CaLwnpRH7viDyzhO/panelLayout/globalOrientation, Method: GET, Body: 2020-09-15 08:19:07.6619|FATAL|Winleafs.Wpf.Views.App|Unhandled exception occurred System.InvalidOperationException: Sequence contains no elements at System.Linq.ThrowHelper.ThrowNoElementsException() at System.Linq.Enumerable.Min[TSource](IEnumerable1 source, Func`2 selector)
at Winleafs.Wpf.Api.Layouts.PanelLayout.ConstructPanelsAsPolygons() in C:\Users\easy_\source\repos\winleafs\Winleafs\Winleafs.Wpf\Api\Layouts\PanelLayout.cs:line 89
at Winleafs.Wpf.Api.Layouts.PanelLayout.GetLayout() in C:\Users\easy_\source\repos\winleafs\Winleafs\Winleafs.Wpf\Api\Layouts\PanelLayout.cs:line 53
at Winleafs.Wpf.Api.Layouts.PanelLayout..ctor(Device device) in C:\Users\easy_\source\repos\winleafs\Winleafs\Winleafs.Wpf\Api\Layouts\PanelLayout.cs:line 38
at Winleafs.Wpf.Api.Orchestrator..ctor(Device device) in C:\Users\easy_\source\repos\winleafs\Winleafs\Winleafs.Wpf\Api\Orchestrator.cs:line 39
at Winleafs.Wpf.Api.OrchestratorCollection.AddOrchestratorForDevice(Device device) in C:\Users\easy_\source\repos\winleafs\Winleafs\Winleafs.Wpf\Api\OrchestratorCollection.cs:line 45
at Winleafs.Wpf.Api.OrchestratorCollection.Initialize() in C:\Users\easy_\source\repos\winleafs\Winleafs\Winleafs.Wpf\Api\OrchestratorCollection.cs:line 30
at Winleafs.Wpf.Views.App.NormalStartup(StartupEventArgs startupEventArgs) in C:\Users\easy_\source\repos\winleafs\Winleafs\Winleafs.Wpf\Views\App.xaml.cs:line 106
at Winleafs.Wpf.Views.Setup.SetupWindow.Finish_Click(Object sender, RoutedEventArgs e) in C:\Users\easy_\source\repos\winleafs\Winleafs\Winleafs.Wpf\Views\Setup\SetupWindow.xaml.cs:line 75
at Winleafs.Wpf.Views.Setup.NameDeviceControl.Finish_Click(Object sender, RoutedEventArgs e) in C:\Users\easy_\source\repos\winleafs\Winleafs\Winleafs.Wpf\Views\Setup\NameDeviceControl.xaml.cs:line 26
at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
at System.Windows.Controls.Primitives.ButtonBase.OnClick()
at System.Windows.Controls.Button.OnClick()
at System.Windows.Controls.Primitives.ButtonBase.OnMouseLeftButtonUp(MouseButtonEventArgs e)
at System.Windows.UIElement.OnMouseLeftButtonUpThunk(Object sender, MouseButtonEventArgs e)
at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
at System.Windows.UIElement.ReRaiseEventAs(DependencyObject sender, RoutedEventArgs args, RoutedEvent newEvent)
at System.Windows.UIElement.OnMouseUpThunk(Object sender, MouseButtonEventArgs e)
at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
at System.Windows.UIElement.RaiseTrustedEvent(RoutedEventArgs args)
at System.Windows.Input.InputManager.ProcessStagingArea()
at System.Windows.Input.InputProviderSite.ReportInput(InputReport inputReport)
at System.Windows.Interop.HwndMouseInputProvider.ReportInput(IntPtr hwnd, InputMode mode, Int32 timestamp, RawMouseActions actions, Int32 x, Int32 y, Int32 wheel)
at System.Windows.Interop.HwndMouseInputProvider.FilterMessage(IntPtr hwnd, WindowMessage msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at System.Windows.Interop.HwndSource.InputFilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler) System.Object:

Hey there,

I'm currently getting in contact with one of the Nanoleaf developers to try and resolve the issues with Winleafs and the Hexagon panels. I was told that the change in the panel layout API was the only breaking change that was done. I can't give you an estimated time when this is done but I'm hoping to resolve this as soon as possible.

I'm hoping this newfound contact with Nanoleaf will help us improve the app for Hexagon users and want to thank you for sticking by us and being helpful by reporting these issues with the logs.

@justinknguyen
We have added UI support for hexagons, would you mind testing it for us? You can find the installer here:
https://github.com/winleafs/Winleafs/releases/tag/v1.1.4-alpha

Make sure to uninstall the previous version first.

@StijnOostdam works like a charm now. Thank you so much!