vlachoudis / bCNC

GRBL CNC command sender, autoleveler and g-code editor
GNU General Public License v2.0
1.57k stars 533 forks source link

Pendant requests. #13

Open chamnit opened 9 years ago

chamnit commented 9 years ago

@vlachoudis : New issues thread on the web server pendant. I have to say I keep uncovering amazing features that you have every time I use bCNC. This pendant approach is an amazing solution. It has made my day. This coupled with an RPi installation could make Grbl and personal CNCing so much more accessible.

A couple of comments/requests on this:

chamnit commented 9 years ago

@vlachoudis : I also tested the pendant as well. There were some bugs I did notice:

vlachoudis commented 9 years ago

@chamnit I've implemented your suggestions, moving the Home/Unlock/Reset buttons above the status and add a command line. Even though the G28 was hidden inside the WGS settings :) I never used this command before, but thanks to you I will try it out!

Connecting from my Nexus7 on my linux box (a very old (10y) laptop that I use for my CNC) the buttons are operating normally without any lag. I don't know if it is related to the RPi or the telephone you connect from. Maybe its a question of multiple threads and synchronization. I open one new thread for the server and one for every connection (unfortunately). Once it receives a message it appends it to a Queue() and will be handled from the serial receiver timed method (every 250ms) in the main program.

The jogging for me behaves correctly. It cannot be inches or mm, the program is agnostic on the units. The index.html page prepares a gcode and it sends it to the device. Could it be that your telephone browser is sending multiple commands. If you want I could put a dump on the screen of the received commands so you could test it, since I don't have any RPi to test. Or you could do your self if you prefer. In the CNCPendant.py in the do_GET method there is a "elif key=="cmd"", just add "print value" below.

chamnit commented 9 years ago

@vlachoudis : Thanks! I missed that G28 was in the WGS settings. It's typically used to move the machine to a ready position after homing, like I said. The other one, G30, is used for moving to a set tool touch plate location to determine tool length offsets and to automate tool changes. (We could discuss that another time on how to implement that. I haven't yet written up the recommended way to do it.)

I'll check if the lag is coming from the Wifi dongle on the RPi and the overhead involved with using VNC. I'll connect everything to ethernet and a monitor tonight.

I also forgot to check if the RPi was running in hard float. (I need to start making a list! :) )

chamnit commented 9 years ago

@vlachoudis : Pendant testing results.

I'll continue testing over the weekend. Let me know if you want to look at anything in particular.

vlachoudis commented 9 years ago

@chamnit Why safari is sending 3 commands??

I was using my Nexus 7 tablet in portrait mode. I don't use any longer the pendant since I connected an old laptop next to my CNC.

bCNC is opening a web server, serving all .html pages in the directory of bCNC. One option could be to write a second page one for portrait and one for landscape. Another option would be if the javascript is able to detect the orientation to change the page However I am newbie in javascript, so I would need some time to understand how to do it.

chamnit commented 9 years ago

@vlachoudis : That's a good question that I have no answer to. I recall seeing some issues related to the touch interface and perhaps a bug in iOS and mobile Safari. I'd probably think it's due to the latter.

After some reading, the touch interface on smartphones and tablets have this standard lag to separate a single tap from a double tap for zooming. On iOS, it's about 300ms. I think this is the primary lag that I'm seeing, especially when jogging. It's impossible to quickly button press and the lag is slow enough to accidentally press more than once or skip one by the interface zooming in.

Perhaps, the virtual pendant isn't quite the answer.. Or at least, the implementation isn't conducive to how touch interfaces work. I'll have to mull on that over the weekend. It's almost as if you need a native app to get around these problems, unless there is a way to force touch-based web-browser to become more responsive and ensure cross-platform compatibility.

vlachoudis commented 9 years ago

@chamnit I've tried it again the pendant with the nexus 7 and the galaxy s3, both are quite responsive, however what I don't like is that you don't have any tactile feedback before pressing the button to see if it is the correct one.

One option would be to check if it is the "vibrate" function when a key is pressed or the setInterval() for getting the status in the index.html, is causing the multiple clicks on Safari

chamnit commented 9 years ago

Remembered to check if the vibrate() command in the index.html was the cause of the three button push problem with the Pendant and an iPhone. No change. It still commanded everything 3 times...

vlachoudis commented 9 years ago

I found on the web https://github.com/ftlabs/fastclick To eliminate the 300ms delay, maybe could work for safari?

chamnit commented 9 years ago

@vlachoudis : I don't have much web programming background, but I'll look into it.

chamnit commented 9 years ago

@vlachoudis : Tried to get something to work, but failed in most respects to get any different behavior. I did verify that Safari on my Mac does the 3 clicks per button push, while Chrome on my Mac doesn't. It seems it's something with Safari itself.

jarretluft commented 9 years ago

@vlachoudis I took a look at trying to port the index.html file to use jquery and a basic css framework to simplify the ajax requests and take advantage of all the different browser specific issues that jquery corrects automatically. I discovered that I cannot reference the jquery.js file from inside the index.html file, presumably due to how you have set up the basic http server. Is there a way to modify this server so that something like this Githubissues.

  • Githubissues is a development platform for aggregating issues.