loading
 
Not a JPEG error when using read_HTTP module
Darathian from United States  [21 posts]
3 years
When using the read_HTTP module to pull an image from a URL generated by EZ-Robots's EZ-Builder software I get a "Return Image was not a JPEG" message".

Using a web browser to get the image works fine.

When using the EZ-Builder software I am using both the Camera control and HTTP server control.

Any help would be appreciated. I can provide more information if required.
Steven Gentner from United States  [1371 posts] 3 years
What's the url that you are using into EZ?

STeven.
Darathian from United States  [21 posts] 3 years
The URL is dependent on the machine IP address  but takes this format.

http://192.168.1.8:80/CameraImage.jpg?c=Camera

or http://192.168.1.8:80/CameraImage.jpg?c=Camera&Password=admin

If you use the first form in a browser you must authenticate if you use the second you don't.

I tried what worked in the browser and a number of different variations of the above in the read_HTTP module but so far no luck.

To properly test this you will most likely need the EZ-Builder software.

Steven Gentner from United States  [1371 posts] 3 years
Darathian,

Looks like EZrobot doesn't include a content-type tag when returning its HTTP query. This tag normally identifies the type of content you are working with which is why the RR module didn't understand it. Instead, if that tag is missing, we know check to see the first couple bytes of the data coming back to see if its an image.

While this now works with EZBuilder ... it doesn't seem to last very long and causes EZBuilder to crash. Not sure if we are just overtaxing the app or whatever is going on. Can you give the url that includes the Password-admin a try and see if that works for you?

Also, we have released a beta version of the EZRobotVariables module which allows variable to and from EZRobot to be exchanged. You just need to be sure that the Connection->Setting icon->Settings tab->TCP Server Settings on Port 6666 is on within EZBuilder and that should turn on the TCP server that the module uses to communicate with EZBuilder. You can then use the Watch module in RR and the Variable Watcher within EZBuilder to see the variables change.

You'll have to download the latest RR version for these updates.

STeven.
Darathian from United States  [21 posts] 3 years
Thank you very much STeven.

While the read_HTTP module seems to be working now it does not seem to work very well as you stated.

Perhaps you and DJ Sures can come up with a better way to integrate the video into RR from EZ-Builder/EZB.

So far the variable passing works good. I will keep testing it and let you know if I run into any issues.
Darathian from United States  [21 posts] 3 years
Hi STeven,

After the latest EZ-Builder update the read_HTTP module seems to work at least with the testing I have done.

Do you have any idea when exporting Array variables will be supported for the EZRobot Variables control?
Steven Gentner from United States  [1371 posts] 3 years
Darathian,

That's good news!

I think for the arrays, we may be a bit delayed as both myself and DJ are out of the country.

Have you used arrays in the scripting console for EZBuilder? We're actually not sure how they are even used in EZBuilder.

STeven.
Darathian from United States  [21 posts] 3 years
The NV_ARR_OBJ_NAME variable is not sent to EZ-Builder.

Can you please confirm that this is because the variable is an array.

The DefineArray command in ez-script seems to create a basic index /value array. You specify the array size when using the command. For example: DefineArray($myvariable, 5) seems to create 5 variables name $myvariable[0] , $myvariable[1] etc.

Perhaps discuss this with DJ if something needs to be added or adjusted in EZ-Builder for it to work.
Steven Gentner from United States  [1371 posts] 3 years
Latest version has the sending of arrays using the DefineArray command that you mention. Any idea on how to loop through an existing array to print out all the values? We'd need that to read arrays back into RR.

We have contacted EZrobot with these types of questions but haven't heard back yet with regards to those changes (i.e. easy way to send/receive images). So for now, we'll update as we can. As these types of requests come at random times its not always possible to have time to work on these updates which are much more involved on the EZRobot side (as we have done many integrations to other software systems we already have a lot already implemented and easy to adapt). So eventually we may have a better connection with EZRobot when those updates are made but that will depend on their availability.

STeven.
Darathian from United States  [21 posts] 3 years
Thanks STeven.

I appreciate your assistance.

I will test the latest addition and let you know.
Darathian from United States  [21 posts] 3 years
With the last update the Array's are now created in EZ-Builder

I did notice that for some reason when using the object recognition module the OBJECT_FILENAME and OBJECT_NAME variables are not sent to EZ-Builder but the other values seems to be.

I am looking into the options of retrieving the array values per your request.
Darathian from United States  [21 posts] 3 years
I have a request in for perhaps a better method but perhaps this will work.

When the array is created in EZ-Builder I see it created like this:

$RR_OBJECTS[0]
$RR_OBJECTS[1]

etc.  It used the variable name from RR and appends the index.

If you connect via a telnet session for example to the TCP server and do print($RR_OBJECTS[0]) you get the value returned.
Darathian from United States  [21 posts] 3 years
I spoke with DJ and he said he will create a "dump variables" option for you that will make this easier.
Darathian from United States  [21 posts] 3 years
In the next update of EZ-Builder there will be a DumpVariables() command that will dump all variable names and their values.

That should make it easier to get the return values.
Steven Gentner from United States  [1371 posts] 3 years
Darathian,

Thanks for the test. Those variables (and others like it) have been corrected and should now send correctly if you install the latest version.

We are familiar with the array[x] notation within EZBuilder but didn't see anything that would indicate the size of the array ... and thus we would not know how large an array is and would not be able to loop through all elements. The DumpVariables would be better for that.

Ideally, they would also add a check to see if the value has changed and only send changes (like RR does when it sends variables) which helps to reduce network load. As the variables are typically quite short, this isn't a huge issue ... just a nice to have.

Seems like you are getting better communication about updates than we are so we'll keep tabs on this thread for the next EZ release.

STeven.
Darathian from United States  [21 posts] 3 years
Thanks STeven

I tested the latest update and the variables are now being sent and working great.

I will let you know when the next update is released.
David Cochran from United States  [2 posts] 3 years
I too am very interested in this and am following.  Just wanted to let you know that you have a couple of customers interested in this link between EZ-Robot and Roborealm.  Thanks for your work on this.
Steven Gentner from United States  [1371 posts] 3 years
David,

Just checking in, I couldn't find anything on the ez-robot site about additional API/SDK parameters ... so if you know of something new (as in a new function to pass images or variables) please let me know. I've not heard anything from ez-robot in a while and as far as I know they are not waiting for us on anything.

STeven.
David Cochran from United States  [2 posts] 3 years
I think they are swamped trying to fulfill the tens of thousands of orders they have back logged.  I am in communication with them and have developed some things with their SDK that the community uses.  They know I am waiting on them to provide the ability to save an array of variable, which is what you are waiting on I believe.  I will let you know when I hear something.  

BTW, they are going to sell their bots in many national resell locations including Best Buy stores.  Their product is priced very right so I would expect them to get a lot of attention.  I think your product would benefit from this partnership.  I dont think they will be lego size anytime soon but they will have a lot of users by Christmas time.
Darathian from United States  [21 posts] 3 years
STeven

There is now a Dumpvariables() command.
There is also a GetArraySize() command.

DumpVariables( )
Prints a list of all variables and their respective values separated by CRLF.
This is used for the TCP Server clients which require a collection of variables.
Example: DumpVariables()

GetArraySize( variable )
Returns the size of the specified array variable.
The variable passed as a parameter must be in quotations.
Example: $x = GetArraySize(“$myArray”)

Hope that gives you what you need.

Thanks
Steven Gentner from United States  [1371 posts] 3 years
Redirecting this to

http://www.roborealm.com/forum/index.php?thread_id=5386

since this thread is quite long.

This forum thread has been closed due to inactivity (more than 4 months) or number of replies (more than 50 messages). Please start a New Post and enter a new forum thread with the appropriate title.

 New Post   Forum Index