RetinaEngrave Ethernet API

Specific Support Related to the RetinaEngrave USB Processor

RetinaEngrave Ethernet API

Postby fullspeceng » Mon Aug 06, 2012 12:00 pm

We have written a basic API to allow advanced customers to automate some tasks when using the RetinaEngrave Ethernet interface. The idea was to allow a simple interface to load jobs from the microSD, run jobs, move the laser to various positions on the bed, testfire, as well as possibly controlling some basic external devices (pallet changer, indexer, etc). The API only works over the Ethernet interface (not available over USB). Jobs must be precalculated by the PC and stored as jobs on the microSD card. You must be familiar with socket programming over Ethernet to use the API.

Attached is example code in VS2010 C# 4.0. Since it relies only on network sockets, it requires no drivers and can be used under any OS (PC, Mac, Linux, Android, etc).

Currently this is the specification. This is subject to change.

Connection is over Telnet to port 12345

Command : Description
GOTOXYZ x y z : where x y z are in number of steps
GOHOME : goes home
TSTFIRE x : where x is duration in 0.1ms eg TSTFIRE 50 = 5ms pulse
CURPOS : returns current position in steps
LS : list files on SD Card
FXJOB : enter file mode
FILE filename : load filename (must be in FILE mode first)
RUN : runs the job
PAUSE : pauses job
RESUME : resumes job
ABORT : aborts job
PIN x IN : set pin as input
PIN x OUT : set pin as output
PIN x GET : get state of pin (works for input or output)
PIN x SET: where x = 1 or 2 or 3, which will set a digital pin level high (3.3v, 4mA). You must buffer this pin or risk damaging the board. Do not hook up devices directly to this pin.
PIN x CLR: where x = 1 or 2 or 3, sets the logic level low on that particular pin
STATUS : returns RUNNING if job is still running or IDLE if job is finished

Example:
CURPOS
GOTOXYZ -1000 -1000 0
FXJOB
FILE test.bin
RUN
PIN 1 OUT
PIN 1 SET

this will get the current position, move left 1000 steps, down 1000 steps then load and run the job "test.bin" then raise pin 1 to +3.3v
Attachments
FSL-RE-API.zip
(43.14 KiB) Downloaded 159 times
fullspeceng
Site Admin
 
Posts: 900
Joined: Tue Aug 17, 2010 1:59 pm

Re: RetinaEngrave Ethernet API

Postby Scatterplot » Mon Aug 06, 2012 4:35 pm

Wow, this is very, very cool. With the introduction of the gen 5 laser with removable bed, it will actually be possible to build an autoloader to change out materials- just replace the floor with a material conveyor of some type. Can't wait to get the new one in :)
Scatterplot
 
Posts: 221
Joined: Fri Jan 28, 2011 12:25 pm

Re: RetinaEngrave Ethernet API

Postby TheKackler » Wed Aug 29, 2012 2:12 pm

I am curious... Has anyone used this API for anything clever?

I will have time to play with it soon!

-TheKackler
TheKackler
 
Posts: 84
Joined: Thu Oct 13, 2011 10:36 pm
Location: San Diego

Re: RetinaEngrave Ethernet API

Postby TheKackler » Wed Aug 29, 2012 9:50 pm

I tried using PuTTY. I was able to connect (I saw the welcome screen) but every response was an error.

Even GOHOME returned an error.

LS did say 'not SD card... and then returned an error'

Some functions like STATUS crashed PuTTY all together.

Suggestions?
-TheKackler
TheKackler
 
Posts: 84
Joined: Thu Oct 13, 2011 10:36 pm
Location: San Diego

Re: RetinaEngrave Ethernet API

Postby fullspeceng » Thu Aug 30, 2012 9:32 am

Ethernet API requires API capable firmware. This should be included in RE 4.3+. If putty crashes, that has nothing to do with the API itself and probably a bug in putty. That's like going to a webpage and having your web browser crash. It may not work but it shouldn't crash regardless of whatever the website is sending to the web browser.
fullspeceng
Site Admin
 
Posts: 900
Joined: Tue Aug 17, 2010 1:59 pm

Re: RetinaEngrave Ethernet API

Postby hockeyrink » Tue Sep 18, 2012 2:59 pm

Very intriguing feature! Almost ripe for hacking...

I tried Putty too, and had it blow up. Then I enabled the telnet client on my Win7 PC, got in and got:
100 Hello 192.168.2.4. FSL Laser Ready, your session ID 00000009

But as soon as I type anything, it loses the session, which explains why Putty closes out (thinks the session has ended):

100 Hello 192.168.2.4. FSL Laser Ready, your session ID 00000009
s501 INVALID REQ
UEST


Connection to host lost.


I'm really looking forward to this getting ironed out - it's a really nice way to access the laser!
hockeyrink
 
Posts: 2
Joined: Tue Sep 04, 2012 10:53 am

Re: RetinaEngrave Ethernet API

Postby TheKackler » Sat Oct 06, 2012 1:05 pm

I tried this again and it still doesn't work. I wrote a program and I get a response on connection:
>>>>>100 Hello 169.254.187.10. FSL Laser Ready, your session ID 0

Sending commands responds with:
>>>>>>501 INVALID REQUEST

FSL: Please help.

Thanks,
-TheKackler
TheKackler
 
Posts: 84
Joined: Thu Oct 13, 2011 10:36 pm
Location: San Diego

Re: RetinaEngrave Ethernet API

Postby fullspeceng » Sat Oct 06, 2012 7:24 pm

You need to load the Stellaris firmware from v4.3+
fullspeceng
Site Admin
 
Posts: 900
Joined: Tue Aug 17, 2010 1:59 pm

Re: RetinaEngrave Ethernet API

Postby TheKackler » Sat Oct 06, 2012 9:02 pm

Ah...

It is working now. :)

Now all I need is an SD Card!

Thanks,
-TheKackler
TheKackler
 
Posts: 84
Joined: Thu Oct 13, 2011 10:36 pm
Location: San Diego

Re: RetinaEngrave Ethernet API

Postby TheKackler » Mon May 27, 2013 8:23 pm

I wanted to ask if the API is still officially supported. I haven't seen any updated documentation.

It took me awhile but I finally installed a memory card and I am back to playing with this API via PUTTY and LabVIEW.

A few comments...
GOTOXYZ doesn't always work... it works after startup but eventually it reports "invalid parameter".

I can't run a job from the SDRAM:
* I have saved a .BIN file to SDRAM
* I can see the .BIN file with 'LS' command
* I enter 'FXJOB' and it responds " 103 JOB_OK, JobID 00000001 SessionID 00000001"
* I can't load the bin file. I enter 'FILE MyJob.bin' and it returns: 509 NO_SUCH_FILE

Let me know if there is any additional infomation I can provide.
TheKackler
 
Posts: 84
Joined: Thu Oct 13, 2011 10:36 pm
Location: San Diego

Next

Return to RetinaEngrave USB

Who is online

Users browsing this forum: No registered users and 1 guest