Welcome! Log In Create A New Profile

Advanced

New Ormerod Web Interface - WIP

Posted by iamburny 
Re: New Ormerod Web Interface - WIP
January 11, 2014 08:45AM
Quote
droftarts
The network framework is something we're looking at, but changing it drastically could introduce other problems. One left-field suggestion is the QP framework [en.wikipedia.org]
I know some people on here have experience of these sort of chips *cough* dc42 *cough* winking smiley . Any other preferences/suggestions?

I'm not familiar with QP, but it looks interesting. It may be overkill for this application, but that doesn't necessarily matter.

My field is the more critical end of safety-critical software. In these apps we tend to avoid RTOS where possible because it is very difficult to avoid Heisenbugs. There are bugs that crop up regularly in running systems - especially when there are a lot of running systems - but take months to reproduce just once during extensive testing, and are therefore all but impossible to debug. Usually, we use a timed-triggered architecture instead. This is a variant of cooperative multitasking. The existing Duet firmware would not need many changes to fit into this architecture, except that any of the Arduino library functions it uses that are not non-blocking would have to be rewritten. QP looks like it runs mainly as a cooperative system too. My main concern would be if it uses dynamic memory allocation outside the initialization phase. Using dynamic memory allocation is generally a bad idea in embedded systems - see my blog entry on critical.eschertech.com (also reproduced here) for why.

What I've seen of the Duet network infrastructure so far is that it's missing quite a lot of functionality at the higher layers. This functionality needs to be added regardless of whether a new framework is used.



Large delta printer [miscsolutions.wordpress.com], E3D tool changer, Robotdigg SCARA printer, Crane Quad and Ormerod

Disclosure: I design Duet electronics and work on RepRapFirmware, [duet3d.com].
Re: New Ormerod Web Interface - WIP
January 11, 2014 09:01AM
Quote
iamburny
Going to try Printing via Web sent Gcodes see how that goes.

I suggest you try "printing" circle.g initially. If it works but in jerky steps, I have some firmware changes that may fix that. I made them to get print via USB working properly (it turned out that Pronterface needs fixing too), but they are applicable to printing over the web interface too.



Large delta printer [miscsolutions.wordpress.com], E3D tool changer, Robotdigg SCARA printer, Crane Quad and Ormerod

Disclosure: I design Duet electronics and work on RepRapFirmware, [duet3d.com].
Re: New Ormerod Web Interface - WIP
January 11, 2014 09:46AM
Quote
dc42
Quote
iamburny
Going to try Printing via Web sent Gcodes see how that goes.

I suggest you try "printing" circle.g initially. If it works but in jerky steps, I have some firmware changes that may fix that. I made them to get print via USB working properly (it turned out that Pronterface needs fixing too), but they are applicable to printing over the web interface too.

I think the main problem with this is going to be lack of feedback, as i'm not going to be able to tell if the buffer is full or able to accept another command, i'd thought about estimating the time each command will take based on feed rate and distance to travel, this however is hardly ideal. getting web responses from G codes seems to be key to unlocking alot of enchanced functionality.

Matt


Limited Edition Red RS Ormerod 1 #144 of 200 - RRP 1.09fw
iamburnys Ormerod Upgrades Github
Follow me on ThingiVerse My Designs
Re: New Ormerod Web Interface - WIP
January 11, 2014 09:50AM
Quote
iamburny
I think the main problem with this is going to be lack of feedback, as i'm not going to be able to tell if the buffer is full or able to accept another command, i'd thought about estimating the time each command will take based on feed rate and distance to travel, this however is hardly ideal. getting web responses from G codes seems to be key to unlocking alot of enchanced functionality.

I'm not familiar with JSON, but shouldn't the Duet respond to each JSON request only after it has processed it, meaning when it has been put in the buffer? Alternatively, couldn't it send back a "buffer full" response if the buffer remains full for e.g. more than a second?

Edited 2 time(s). Last edit at 01/11/2014 09:51AM by dc42.



Large delta printer [miscsolutions.wordpress.com], E3D tool changer, Robotdigg SCARA printer, Crane Quad and Ormerod

Disclosure: I design Duet electronics and work on RepRapFirmware, [duet3d.com].
Re: New Ormerod Web Interface - WIP
January 12, 2014 03:14AM
It would be great if it did all of those thing, however every gcode sent via the /rr_gcode?gcode= url will currently only ever send back an empty json response of {} the only useful data responses come from /rr_poll

FYI JSON is simply a standard to convert variables and arrays of variables to a text string for easy transmission over http, it's cross language and most languages have a json decode to convert the text back to useful variables.

Matt


Limited Edition Red RS Ormerod 1 #144 of 200 - RRP 1.09fw
iamburnys Ormerod Upgrades Github
Follow me on ThingiVerse My Designs
Re: New Ormerod Web Interface - WIP
January 12, 2014 05:24AM
OK, I've read up on JSON now. How about I make a couple of changes to the responses:

1. The poll request currently sends back a single array called "poll". This contains all the temps and positions. A comment in the code suggests that the positions of the extra extruders will be added to this array. How about I add an extra variable for the z-probe reading? So the response would look like:

{poll:[....],probe:"123"}

where ... represents the existing data. I presume they are sending the other data back as strings rather than numbers because the JSON number format doesn't appear to allow for negative numbers. A future modulated z-probe could return a negative value in theory, so I'll use a string here too.

2. Change the response to the gcode request from {} to {cmd:N,buf:B} where N and B are nonnegative integers. N is 0 to indicate that the command was accepted, or 1 if the command was rejected due to buffer full (can add other error codes later). B indicates that the server can accept a new gcode at least B characters long. So if B is zero or small, a pause is in order before sending the next gcode.



Large delta printer [miscsolutions.wordpress.com], E3D tool changer, Robotdigg SCARA printer, Crane Quad and Ormerod

Disclosure: I design Duet electronics and work on RepRapFirmware, [duet3d.com].
Re: New Ormerod Web Interface - WIP
January 12, 2014 06:50AM
@dc42

Sounds like a great start and will help greatly with further development of the web interface.

Ultimately I'd like to receive via a JSON requests the same as i would get via the SerialUSB interface when sending a G code.

Matt


Limited Edition Red RS Ormerod 1 #144 of 200 - RRP 1.09fw
iamburnys Ormerod Upgrades Github
Follow me on ThingiVerse My Designs
Re: New Ormerod Web Interface - WIP
January 14, 2014 01:24PM
More functionality added,

Progress bar (based on manually entered print height and current Z axis)
SD File uploading, drag gfile and drop on target. (working however no status, locks browser, and painfully slow - mostly caused by duet web server implementation)
SD File deletion (trash icon)
Added "remote" version which doesn't require a local web server at all.
Added minified versions which halves the file size of "reprap.htm" (down to 11k) so halves the load time from the duet.

https://github.com/iamburny/OrmerodWebControl/tree/master

Install instructions available on Github in Readme.md

Matt

Edited 2 time(s). Last edit at 01/14/2014 01:37PM by iamburny.


Limited Edition Red RS Ormerod 1 #144 of 200 - RRP 1.09fw
iamburnys Ormerod Upgrades Github
Follow me on ThingiVerse My Designs
Re: New Ormerod Web Interface - WIP
January 18, 2014 03:36AM
I'm now solely using the new web interface to print, the only annoyance is the restriction to file uploads, hopefully this will be resolved soon.
Any suggestions for improvements are welcomed

You no longer need to "faff" about with a local web server, all code sources are pointed to remote CDN's or github.

Simply copy reprap.remote.min.htm to the www directory on the sd card and rename it to reprap.htm, this is the only file you need.

Other Changes:-

A few minor bugs ironed out,
Default temps changed
Refresh button for g file list

Matt

Edited 2 time(s). Last edit at 01/18/2014 03:38AM by iamburny.


Limited Edition Red RS Ormerod 1 #144 of 200 - RRP 1.09fw
iamburnys Ormerod Upgrades Github
Follow me on ThingiVerse My Designs
Re: New Ormerod Web Interface - WIP
January 18, 2014 05:23AM
Thanks Matt! I put this on a Duet board yesterday, looks good and seems to work well. I'll update to the latest on Monday.

Ian
RepRapPro tech support

Edited 1 time(s). Last edit at 01/18/2014 05:23AM by droftarts.
Re: New Ormerod Web Interface - WIP
January 18, 2014 01:00PM
Hi Matt
I'm lovin it! Thanks for your effort!
> SD File uploading,.... and painfully slow
Can you give an indication on "how slow"?
e.g. 100k bytes of G-code will take "N" minutes?
Does SD File uploading now also work from pronterface? If yes what's the speed to be expected there?
best regards
Re: New Ormerod Web Interface - WIP
January 18, 2014 01:08PM
Glad you like my work, many more features are planned :-)

The upload works by sending a special gcode so the Duet writes all subsequent gcode sent to a file on the set, then another special code to finish and write. So I'm basically sending 1000's of separate Web requests, rather than one stream of data bytes like normal file transfers.

I'll do some speed tests later at report back, I believe the pronterface upload operates at about 2.2mb/s since dc42's changes to the firmware.

Matt


Limited Edition Red RS Ormerod 1 #144 of 200 - RRP 1.09fw
iamburnys Ormerod Upgrades Github
Follow me on ThingiVerse My Designs
Woohooo! Thank you Matt!
January 21, 2014 05:06AM
Hi Matt, I hadn't seen your new interface until it was brought to my attention.

It is so much better, everything is fantastic and one of my favourite things about it is that the buttons "grey" out when you've sent a command until they are ready to be used again.

I have not tested it fully yet but I'm looking forward to doing so.

The only thing I found somewhat confusing was the instructions... I used to develop myself back in the day (asp then PHP) and the concept of having a local webserver NOT running on the actual duet board confused me something silly... once I "clicked" it was easy to install since I have a webserver running on my machine anyway.

I love the fact you can drop a gcode file in without restarting... I've had huge problems with getting my bed right and at the moment I tend to do a manual calibration before each print so that is fantastic in the case if I wanted to do another or simply uploaded the wrong file in the first place.

So thank you!!

G

Edited 1 time(s). Last edit at 01/21/2014 05:08AM by gregstah.
Re: Woohooo! Thank you Matt!
January 21, 2014 05:43AM
@Gregstah - Your very welcome also happy that it is useful to you. The decision regard the local web server approach was forced upon me really as currently the Duet's on board web server isn't capable of serving javascript/css/images etc, it can just about cope with one htm file if its small (hence the minified version), so my only alternative to a local web server was to host the JS ans Css files on an remote internet CDN (i.e github) which then requires you have an always active internet connection, so i decided to provide both version, local & remote and let the user choose.

Matt


Limited Edition Red RS Ormerod 1 #144 of 200 - RRP 1.09fw
iamburnys Ormerod Upgrades Github
Follow me on ThingiVerse My Designs
Re: New Ormerod Web Interface - WIP
January 21, 2014 02:10PM
First, thanks a huge amount for doing this and helping make the promise of network controlled printer a reality. I haven't had too many issues with build and after early Duet swap out, initial printing has been working OK via pronterface. However, I was very keen to get web control of the device.

My question is to do with the local and remote versions of reprap.htm. I can run either as machine is on internet capable network and my local Ubuntu USB control PC has a web server. Currently there seems to be some functional differences between the two versions as well as the secondary links. For example, the local version has extra bed compensation controls.

Is it correct to say the local one has more recent updates?

Also the remote minimised version still seemed to have local link addresses at the moment.

One longer term suggestion which would be nice would be to be able to update any of the SD card files, e.g changing things like config.g. That would then avoid the need to take the card in and out. I expect that would need firmware changes as well.


Ormerod 130
Re: New Ormerod Web Interface - WIP
January 21, 2014 02:29PM
Quote
bobtidey
One longer term suggestion which would be nice would be to be able to update any of the SD card files, e.g changing things like config.g. That would then avoid the need to take the card in and out. I expect that would need firmware changes as well.

There are specific gcodes to allow sys/config.g and www/reprap.htm to be uploaded (M559 and M560), which is why you can upload these files from Pronterface. So it should be possible to update these via the web interface too.



Large delta printer [miscsolutions.wordpress.com], E3D tool changer, Robotdigg SCARA printer, Crane Quad and Ormerod

Disclosure: I design Duet electronics and work on RepRapFirmware, [duet3d.com].
Re: New Ormerod Web Interface - WIP
January 21, 2014 03:08PM
Hi Bob,

Quote
bobtidey
My question is to do with the local and remote versions of reprap.htm. I can run either as machine is on internet capable network and my local Ubuntu USB control PC has a web server. Currently there seems to be some functional differences between the two versions as well as the secondary links. For example, the local version has extra bed compensation controls.

There should be no differences between the local and remote versions. The web interface is in heavy development at the moment so its possible that the version have slipped out of sync. I have recently (minutes ago) made some updates and definitely did update the remote and minified version to reflect the changes.

Quote
bobtidey
Is it correct to say the local one has more recent updates?

I develop the local one first as it the one i use, but try to keep them all in sync with all the changes I commit.

Quote
bobtidey
Also the remote minimised version still seemed to have local link addresses at the moment.

probably my error, its correct as of now.

Quote
bobtidey
One longer term suggestion which would be nice would be to be able to update any of the SD card files, e.g changing things like config.g. That would then avoid the need to take the card in and out. I expect that would need firmware changes as well.

I'll take a look at this improvement.

Many thanks for the feedback and suggestion, both warmly received =)

Matt


Limited Edition Red RS Ormerod 1 #144 of 200 - RRP 1.09fw
iamburnys Ormerod Upgrades Github
Follow me on ThingiVerse My Designs
Re: New Ormerod Web Interface - WIP
January 21, 2014 03:53PM
One thing I have found which may save others time: you cannot upload reprap.remote.min.htm via the Pronterface facility. I suspect that Pronterface is uploading a line at a time, and the single long line in that file confuses it. However, you can upload reprap.remote.htm via Pronterface, after renaming it to reprap.htm.



Large delta printer [miscsolutions.wordpress.com], E3D tool changer, Robotdigg SCARA printer, Crane Quad and Ormerod

Disclosure: I design Duet electronics and work on RepRapFirmware, [duet3d.com].
Re: New Ormerod Web Interface - WIP
January 22, 2014 06:34AM
I have made some improvements to the web server firmware, which in conjunction with Matt's latest web interface, provide the following features:

- Z probe reading is displayed in the web interface. So you no longer need to use Pronterface or serial monitor to do the G31 calibration, you can do it via Ethernet
- Response to the last g-code sent is displayed in the web interface
- Number of files on the SD card that can be displayed is increased from 24 to 42

Also fixed are some buffer overflow issues when you send an invalid heater number in a gcode.

The binary can be found at [github.com].



Large delta printer [miscsolutions.wordpress.com], E3D tool changer, Robotdigg SCARA printer, Crane Quad and Ormerod

Disclosure: I design Duet electronics and work on RepRapFirmware, [duet3d.com].
Re: New Ormerod Web Interface - WIP
January 22, 2014 07:20AM
Great! Pull request?

Ian
RepRapPro tech support
Re: New Ormerod Web Interface - WIP
January 22, 2014 07:31AM
Quote
droftarts
Great! Pull request?

Ian
RepRapPro tech support

I was going to wait until I have some feedback before submitting the pull request, in case the code needs some improvement. So far I think only Matt and I have tried it.



Large delta printer [miscsolutions.wordpress.com], E3D tool changer, Robotdigg SCARA printer, Crane Quad and Ormerod

Disclosure: I design Duet electronics and work on RepRapFirmware, [duet3d.com].
Re: New Ormerod Web Interface - WIP
January 22, 2014 03:27PM
I have flashed the new firmware and put the latest reprap.htm on (minimised running local web server mode).

Basic functionality is still fine but I am struggling with the new feedback features. I can't see gcode responses and the Z probe display is stuck at 0.

If I attach Pronterface as well I can see the poll requests and the JSOn reponses which have meaningful zprobe values in.

This is as viewed in Chrome running on Ubuntu 12.04. I can try later from Chrome Win 7 to see if that makes a difference.

Update: I see what I did wrong. The js was updated as well. I'm trying again with that update don the local server.

Edited 1 time(s). Last edit at 01/22/2014 04:31PM by bobtidey.
Re: New Ormerod Web Interface - WIP
January 22, 2014 03:49PM
@Bob - i'll give it a try on My unbuntu VM see if i can replicate your problem, if you browse to "http://*ormerodip*/rr_poll" do you get result similar to the following?

{"poll":["I","20.3","-273.1","55.00","0.00","1.00","0.0000"],"probe":"901","resp":"FIRMWARE_NAME:RepRapFirmware FIRMWARE_VERSION:0.57a-dc42 ELECTRONICSgrinning smileyuet DATE:2014-01-21"}


Limited Edition Red RS Ormerod 1 #144 of 200 - RRP 1.09fw
iamburnys Ormerod Upgrades Github
Follow me on ThingiVerse My Designs
Re: New Ormerod Web Interface - WIP
January 22, 2014 04:48PM
Updating the js and other sever folders didn't change anything.

Response to rr_poll is

{"poll":["I","19.0","8.4","1.98","0.00","1.00","0.0000"],"probe":"314","resp":"T:3.6 B:18.7"}

I have seen the firmware version in the pronterface debug lines

I've also tried browsing from Windows but server still on Ubuntu - same result

Edited 1 time(s). Last edit at 01/22/2014 04:48PM by bobtidey.
Re: New Ormerod Web Interface - WIP
January 22, 2014 04:57PM
All I did to get it working was download Matt's latest reprap.remote.htm from [github.com], renamed it locally to reprap.htm, and uploaded it to the SD card via Pronterface.



Large delta printer [miscsolutions.wordpress.com], E3D tool changer, Robotdigg SCARA printer, Crane Quad and Ormerod

Disclosure: I design Duet electronics and work on RepRapFirmware, [duet3d.com].
Re: New Ormerod Web Interface - WIP
January 22, 2014 05:23PM
@bob - the poll results look fine so dc's firmware is working correctly, could you try putting the remote version on the sd and renaming to reprap.htm, if that version works then there is a problem with the local Web server files or the pointers to them in the local reprap.htm

Matt


Limited Edition Red RS Ormerod 1 #144 of 200 - RRP 1.09fw
iamburnys Ormerod Upgrades Github
Follow me on ThingiVerse My Designs
Re: New Ormerod Web Interface - WIP
January 22, 2014 05:50PM
Remote version is working OK. The response panel in light blue shows up and shows the response and ZProbe now is showing the value.

If you need further tests to see what the difference is with local one then let me know.

Looking at differences I see the local files are lower cased, e.g fileDrop. I wonder whether that might be causing an issue with a Linux webserver where case sensitivity kicks in. The links are lower case as well so its not obvious this is the cause.

So I edited the local reprap.htm to link to /reprap/js/jQuery.FileDrop.min.js instead of /reprap/js/jquery.filedrop.min.js and renamed the local corresponding file on the Ubuntu server to be the same and it all sprang into life showing the response box and ZProbe. It must be resolving the function call via the filename. I hadn't tried out file drop before so I don't know whether that was non-functional on local before.

Edited 2 time(s). Last edit at 01/22/2014 06:30PM by bobtidey.
Re: New Ormerod Web Interface - WIP
January 23, 2014 02:17PM
Thank you ! thumbs up

Been printing for 2 days now with pronterface (after finishing building), had e few trouble with slow USB/printing and not wanting to take the SD out all the time (just realized that you can upload to SD from pronterface).
So today I tried your new web-interface, it is absolutely fantastic (upload still verey very slow) but it is very convenient and my print quality is much better, I will never look back ;-)
Im using latest build of today (remote minimized) on firmware 57a, works like a charm, creating G-codes with Sliz3r (reprap provided profiles) and checking the paths in repetier.

Wishlist: Faster upload, uploading config files, firmware update, onboard webcam.
Re: New Ormerod Web Interface - WIP
January 23, 2014 03:25PM
@SlinBin - Your very welcome, glad you like it, I'm working on Faster upload (with dc42), also modifying of config files and and auto bed compensation wizard =)

Matt


Limited Edition Red RS Ormerod 1 #144 of 200 - RRP 1.09fw
iamburnys Ormerod Upgrades Github
Follow me on ThingiVerse My Designs
Re: New Ormerod Web Interface - WIP
January 23, 2014 03:56PM
>...Faster upload (with dc42), also modifying of config files and and auto bed compensation wizard =)
Yes please!
if I get "decent" upload speed I'l finally no longer need to neither "digg" out the sd-card (it's a pain for may fat fingers),
nor use USB for upload which seems suspectible to mooving of the usb cable here (I'm a bit afraid that the usb connector works loose, even if I'm only plugging / unplugging the "PC-End" of the cable...
anyhow: thanks a lot for the worke done so far Matt and dc42
Sorry, only registered users may post in this forum.

Click here to login