Maslow Home Maslow Community Garden Newsletter

WebControl Open Beta

@dlang Yep, I tried the slider in both directions. With it off it prompt me to move it. With it on the motor buzzes but does not move and then it prompts me.

does this only work with a certain firmware? I’m using 1.27 from the MaslowCNC GitHub.

yes, it has not yet been updated to work with the 1.27 firmware

I am using 1.26. I got the message about moving Z, but after updating the Z-enabled setting, it worked for me.

I would add that I started with a Raspbian Buster lite and then proceeded with docker image. I don’t think this has an effect, but thought I’d mention it.

Sometimes, for some reasons I haven’t tracked down, setting updates don’t sync between webcontrol and the controller. I’m hoping to rewrite that code, yet again, to see if I can make it more reliable. Sometimes calling Actions->Sync Settings will correct the problem.

this is something that holey triangulation did a lot of work on, you may want to
look at what is done there. (every startup it compares the values and asks you
which you want if they differ)

The way I have to do settings in webcontrol is entirely different than ground control. ground control uses kivy’s built-in setting routine (real nice and easy to use) but I had to roll my own from scratch. Generally pressing sync settings fixes any issues (sends the ‘$$’ command). I’ve thought about just calling that function after the setting form is submitted and webcontrol updates its copy of the settings but I’ve tried to mirror how ground control works by only sending changed values to the controller.

2 Likes

So interesting thing about this. As you may know, I reuse a lot of code from groundcontrol and when you change the home position, it modifies the gcode by applying the offset. So when you then go to edit it, all the x,y positions are modified as well. For example,

G1 X0, Y0
G1 X10, Y10

with a home of 4,4 becomes

G1 X4, Y4
G1 X14, Y14

So, when you go to edit gcode, do you want to see the re-homed gcode or the un-homed gcode?

Then the problem is that when you go to save the file, it will save as a re-homed file unless its de-home.
Do you want to save the edited re-homed gcode or edited un-homed gcode?

we really need to implement G54 and similar in the firmware and stop re-writing
the g-code in GC/WC http://linuxcnc.org/docs/html/gcode/coordinates.html

editing g-code would ideally be the code as loaded into WC/GC

David Lang

Well, in the meantime… I can try to de-home it for the editor and saving routines.

I added the editor with save features and homes/dehomes as needed (last part was more challenging than would appear it to be on the surface). I incorporated ace.js code editor that supports syntax highlighting. Per their website

Creating a new syntax highlighter for Ace is extremely simple. You’ll need to define two pieces of code: a new mode, and a new set of highlighting rules.

I found a already built gcode mode for it, but apparently its not the same gcode we are talking about.
Anyway, I am clueless as to how to make it work regardless of what the website says, it uses one of my nemeses, regex, and therefore I am at a lost.

It’s currently just in the holey calibration branch, so stay tuned.

2 Likes

pro tip: make sure your date and time is correct otherwise the auto download and setup will not be happy. Big Thanks to @johnboiles for pointing that out in the log file.

1 Like

I’m really surprised that NTP didn’t pull the correct time on your pi. I’m not sure why that would be. Perhaps there’s a race condition where if NTP is slow enough and Docker is fast enough you can end up with Docker running before the NTP update

Unless you add NTP yourself then the pi doesn’t use NTP to set time. Much to my surprise it uses a little shell script and makes a call to Google. Not sure how reliable that is. My guess is it may be one and done at boot and isn’t resilient not support slew if the first call fails.

For my home dvr front-end I added NTP manually using these instructions http://raspberrypi.tomasgreno.cz/ntp-client-and-server.html

I used the NRC stratum 2 servers in Canada and have super accurate time.

Jeff

1 Like

I thought the Raspbian lite image this is based on included NTP. I’ve never manually set the time on my Pi and is pretty sure the time has been correct. I’ll have to talks a look sometime when I’m home.

1 Like

Tl;Dr If time is important on your Pi then install NTP. Otherwise you may experience incorrect time for a variety of reasons. NTP is resilient as best I can be in the absence of a real time clock and battery to maintain time across reboots.

Yeah it tries to set it. Basically it has no real time clock but they write out the time on shut down as a backup and during boot apparently they make a call to Google to get time but not sure what the exact method is. I think it’s http. If that fails I believe they fall back to last known time and if unavailable start at the epoch of Jan 1 1970 I think.

I didn’t review the scripts but went down the rabbit hole researching when doing MythTV work and what I said above surprised me and also explained weird time issues at different points. If you are relying on time you need ntp and even then it slews the clock slowly if you are way off the reference so it can take a bit to arrive at accurate time.

Jeff

modern versions of ntpd support the -g flag which allows the first adjustment to
be big rather than slewing slowly or giving up (prior to this, we used to have
to run ntpdate before starting ntpd to get the clock close)

I haven’t looked at raspian to see if it uses the -g flag by default.

David Lang

For auto-zero the z-axis, this is the command in ground control:

“G20 G90 G38.2 Z-” + plungeDepth + " F1 G20 G90 M02"

where plungeDepth is the Advanced Settings->maxTouchProbePlungeDistance value.

For webcontrol functionality, do you want it to plunge to touch and then you manually tell it to set z to zero or do you want it to plunge to touch and automatically set z to zero? I’m pretty sure I can do either way.

I think it makes sense to auto-zero

David Lang

I put this into the holeywebcontrol branch, which I hope to merge into main branch soon. I don’t know if it works though, but it’s there for someone to test if they are setup for it and inclined to do so. There’s a setting in advanced to enable the use of a touch plate.

1 Like