Asked — Edited

Errors When Trying To Save To Ez-Robot

Anyone else getting this error when trying to save to the EZ-Cloud App Store ? This just started to happening. I have been able to save in the past.

Thank you Rich

Version: 2018.05.01.00

System.NullReferenceException: Object reference not set to an instance of an object. at EZ_Builder.UCForms.FormCameraDevice.GetConfiguration() at EZ_Builder.UCForms.FormMaster.get_ConfigurationForm() at EZ_Builder.FormMain.z1HXSaOIKq() at EZ_Builder.FormMain.jGMXdLptVn() at EZ_Builder.FormMain.SSK5Dl5wsq(Object , EventArgs ) at System.EventHandler.Invoke(Object sender, EventArgs e) at System.Windows.Forms.RibbonItem.OnClick(EventArgs e) at System.Windows.Forms.RibbonButton.OnClick(EventArgs e) at System.Windows.Forms.RibbonMouseSensor.Control_MouseClick(Object sender, MouseEventArgs e) at System.Windows.Forms.MouseEventHandler.Invoke(Object sender, MouseEventArgs e) at System.Windows.Forms.Control.OnMouseClick(MouseEventArgs e) at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks) at System.Windows.Forms.Control.WndProc(Message& m) at System.Windows.Forms.Ribbon.WndProc(Message& m) at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m) at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m) at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)


ARC Pro

Upgrade to ARC Pro

Get access to the latest features and updates before they're released. You'll have everything that's needed to unleash your robot's potential!

PRO
Synthiam
#1  

Take a look at your project and find out where the value of 0 is being set to a camera setting via ControlCommand...

This is from your diagnostic log:

Quote:

6/26/2018 8:52:44 PMError Setting Camera Configuration: System.ArgumentOutOfRangeException: Value of '0' is not valid for 'Value'. 'Value' should be between 'Minimum' and 'Maximum'. Parameter name: Value

Unfortunately i don't know where the code is being called - so you'll have to look through your project and find what ControlCommand is sending a 0 to a parameter of the camera.

#2  

Thank you DJ. I will do that this evening and report back.

PRO
Synthiam
#3  

And if you need additional help - post your project and i'll take a look. This is a super rare error, so i'd like to see what was done so i can add a more detailed response for this scenario.

#4  

Ok, No problem. I will post the code that is causing the issue, how I found the bad code using your suggestion. Then I will post the corrected code that no longer contains the error. I have a post for this project it is the 18" Tall R2D2. I just have never posted any code, only pictures and how it was going. That will take a couple of days. I will put the code on this post as well as the project posting. That was it can be referenced in a couple of different ways. Where did you find the diag log ?

Rich

#5  

Still trying to diagnose the error. DJ suggested that it was a ControlCommand() that was sending a zero to a camera function. I have saved the original project files to a different name to preserve the error state. I do not have any ControlCommands that I have specifically written for the camera. I pulled the Camera add on into my project at the very beginning(approx 3 months ago). Since I added the camera add on, the major thing that I have done is go from EZB connecting directly to my network at home, to using a WIFI connection. The thing that I noticed is that the video device box with the camera add was set to the wrong IP address from the network I am using now. It was set to EZB:\10.0.0.8, which was the old address I was using with the direct connect. I am using a 192.168.1.1 WiFi address. I have taken screen shot of everything thing that has been done and the errors or non errors that followed. When I connect to my EZB I notice an error regarding the camera at the bottom screen in green. In Summary I have changed the video device box to be EZB:\192.186.1.1 and the errors upon connection to the EZB are gone, however I get no video from the camera with it connected. I will be attaching the word document that I have created, and the project file, later on tonight when I get home from work. The project file will be the copy of the original issue. Also I am going to start a new project with just the camera function to see if there is something wrong with the camera add on. I believe that is has something to do with the fact that I changed from direct connect to WIFI. More tonight.

PRO
Synthiam
#6  

Can you post your project here and i'll take a look? Use the Attach File option

#8  

It's the camera control that seems to be the issue... I downloaded your app and noticed the same issue when trying to save the project to the cloud... I also got the same error when trying to access the camera's settings... I deleted the camera control and then re-added it. It then saved to the cloud no problem...

#9  

Thank you Richard. That was what I was going to try next. I was looking at other things that might have caused the camera app to get bad data in it.

DJ Attached here is the things that I tried and the errors that I still received. Please review this also.

EZBCloudApp_Errors_V2-07082018.pdf

#11  

Thank you @PTP.

I will download and test tonight. Could you enlighten us as to what you did that should resolve the issue ? Added code, removed code, etc.

RSmith

PRO
USA
#12  

@Rsmith,

If it helps.

troubleshooting:

The error occurs when you open the project:

User-inserted image


Error Setting Camera Configuration: System.ArgumentOutOfRangeException: Value of '0' is not valid for 'Value'. 'Value' should be between 'Minimum' and 'Maximum'.
Parameter name: Value
   at System.Windows.Forms.TrackBar.set_Value(Int32 value)
   at EZ_Builder.UCForms.FormCameraDevice.SetConfiguration(ConfigurationFormV2 cf)

So there is no code i.e. script execution must be something on the file.

2) Can't be a generic corruption, otherwise the Project content i.e. XML can't be correctly loaded/parsed.

3)


Error Setting Camera Configuration: 
...
EZ_Builder.UCForms.FormCameraDevice

Is related to the camera control

4)


System.Windows.Forms.TrackBar.set_Value(Int32 value)

ARC is trying to assign a value to an UI component i.e. TrackBar

5)


System.ArgumentOutOfRangeException: Value of '0' is not valid for 'Value'. 'Value' should be between 'Minimum' and 'Maximum'.

The invalid value is a "0" and is not between a Minimum and Maximum. Maybe the minimum is more than zero, maybe a "1" ?

6) I opened the your project with a text editor, and i copied the camera code to another file.


<ConfigurationFormV2>
      <FormType>CameraDevice</FormType>
      <Title>Camera</Title>
      .... (xml removed for brevity)
    </ConfigurationFormV2>

Then i searched for a zero value parameter (constrained to the camera settings content file): ">0< "

User-inserted image

we are looking for a TrackBar UI component: CameraImageBrigtness and GridTransparency match our search.

The next step: discover the minimum values, so i created a new project with a camera control with all the trackbars set to the minimum value, then isolated the camera settings to a file, search for zero parameter again.

User-inserted image

As you can see both are not there:

minimum values: <CameraImageBrightness>-150</CameraImageBrightness> <GridTransparency>1</GridTransparency>

So using "Sherlock Holmes" deduction method: i assumed the zero is between CameraImageBrightness (-150;150) and GridTransparency has an invalid value.

Changing the original project to "1" fixes the load and as consequence the save process. Save requests Camera control's get configuration and during the execution tries to set the trackbar again with zero failing to save, but the problem is already seen during the initial load.

The next question: Why is broken ?

If you didn't change the value by hand... my guess is: zero is the default value for an integer, ARC code during the save/Serialization process allowed the zero to go through to the file, and after that the camera settings became invalid.

It's only a guess... DJ has access to the code:) maybe he can find a better explanation.

#13  

@PTP,

That explanation was great, that was what I was hoping for. As I have been a programmer for 6 years and now doing Powershell and VBScript it makes sense. Also thank you for letting me know that we can open the project in a text or other editor (Visual Studio, Notepad++) I will look at that along the way now. So that we I make major changes to something else in the code I can verify these and other settings.

I do remember turning the grid off/on several times during the project length. I might have adjusted the camera brightness once. It is hard to remember doing that one. Could these setting have changed when I went from Direct network connection to WIFI ? If you noticed that the connect blue button is at a 192.168.1.1 address and Video Device is at 10.0.0.8. Thought that this box should match the current IP scheme. The 192.168 is my WIFI address, and the 10.0 is when the EZB connected directly to my home network.

I loaded the fixed version here in my office on a laptop with a freshly installed ARC and It let me save to the Cloud and directly on the laptop. The bigger test is when I get home and have it hooked up the the EZB controller and camera. I will keep up to date with everyone on that tonight.

@Richard R I did what you did by taking out the camera control and putting it back into the project. However now I can't connect to the EZB using my WIFI connection. I am going to work on this some more tonight. I am not sure if I was to tired or just frustrated with the whole thing to see the real picture. That is why I am going to work on it more tonight. I connected the WIFI from EZB to my laptop first then tried to connect using ARC. It would always error out and never connect. the only thing that I didn't do was reboot the laptop several times. I re-connected about 6 times and no luck.

Thank you for your assistance.

#14  

I have good news the issue is resolved.

@Richard R Your fix of removing the camera app and added it back would fix the issue. The not connecting issue was an IP address conflict between Spectrum and EZB. Both are using the 192.168.1.1 IP address. Anyway I have resolved that IP address conflict and the camera is working and I can save to the cloud and locally.

@PTP Your fix by removing the zero within the camera code also fixed the issue. I had to adjust the video device box IP to match what I was using for the connection button box string. To get the camera working again.

@Richard fix was the quick fix for the issue. @PTP was more of a programmers fix for the issue. Since DJ is involved I am glad for the programmer fix. Both fixes will help others in the long run.

I hope that DJ has an answer as to what might have happened to cause this. Waiting to hear from you DJ.

I want to thank @DJ, @Richard and @PTP for help in resolving this issue. It is a good feeling that there are other that are will to jump in and help.

#15  

UPDATE: Last night I received the camera error again last night when trying to save my project to local disk. I simply removed the camera device app and I was able to save as normal. I then saved to the cloud also. I thought that is was very odd to see this error again. I will report any other errors that I received related to the camera.

I have installed a fresh copy of ARC. I installed that just a few days ago. I also renamed my project to shorten its name.

@DJ, is there an issues with the path name and file name being longer that 256 characters total ? Microsoft had/has that limitation. I know it was a limitation with Windows 7 and Windows Server 2008. The reason that I mention this is I am sure that I am very close to this limitation with my path name where my project is located.

Just try to think out loud and use the 30 plus year experience within the IT Technology field.

PRO
Synthiam
#16  

I'm watching this thread - still unsure how these values happened. I'm wondering if a ControlCommand() changed a value outside the range.