vlachoudis / bCNC

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

GRBL0/Smoothie, Always says "Not Connected"; Cant self level #1017

Open collaxd opened 6 years ago

collaxd commented 6 years ago

I'm not able to auto-level my machine I noticed some problems first the connect button is always red, apparently the machine is connected but the button turns red, the motors move normally according to the movement of the machine always starts at the wrong point and the small red dot (zero) does not move Thank you and sorry for the bad english image image

Harvie commented 6 years ago

What was the last version of bCNC with autoleveling that worked for you? Have you ever done autoleveling on your machine?

collaxd commented 6 years ago

Never, it's my first time

collaxd commented 6 years ago

[ probe fail

](url)

on universal gcode sender i found this error

OliverHaak commented 6 years ago

I seem to have the same problem. bCNC 0.9.11 running under Linux Mint 18.1 worked for me beginning of this year, also after updating from GRBL 0.9 to 1.1f. Now after a couple of months I pulled that CNC machine from the shelf again to do some PCB milling and I have a lot of trouble. Meanwhile I upgraded to Linux Mint 18.3:

Something is seriuosly broken. I already tried out bCNC 0.9.14 and updating all the python-modules on my system to the newest version --> no change

Harvie commented 6 years ago

Status is always "Not connected"

This is certainly wrong... It never shows this to me when arduino is connected. Are you sure that you selected the right USB port with the right baudrate and settings?

OliverHaak commented 6 years ago

Attached is a screenshot of bCNC on my laptop. You can see that there is an actual connection between the machine and bCNC (as the button for closing the connection is enabled) and I am also able to move the axes with bCNC. It would even accept and process G-Code. It would simply not display the coordinates (MPos and WPos). Maybe I mixed something up for probing the Z-axis lately but the effect being visible in the screenshot remains... Any suggestions welcome!

bildschirmfoto zu 2018-11-21 08-57-55

Harvie commented 6 years ago

What version of pyserial do you have? Please send output of following command:

python2 --version; pip2 freeze | egrep -i 'serial|pil|numpy|opencv|tk'

I have following versions on my working linux install:

Python 2.7.15
numpy==1.15.4
opencv-python==3.4.2.17
Pillow==5.3.0
pyserial==3.4
Harvie commented 6 years ago

BTW i have the same problem on Windows XP. bCNC always says "not connected" in red. But it kinda communicates with arduino. I am not sure, what is the problem.

Are there any other users who experience this?

ERCOman1 commented 5 years ago

I am having a similar problem in Windows 10 using the most recent version of bCNC and a Smoothie board. Here is the error I get.

error bcnc

ERCOman1 commented 5 years ago

This is what the config file has in it....

[bCNC] width = 900 height = 650 sash = 340 windowstate = normal

[Connection] port = COM3 openserial = 1 controller = SMOOTHIE

which seems right.... Have you seen anything like this recently. Funny thing is that it was working a while ago. From a bit of research I am getting the feeling that I have to update the firmware on the smoothie board, but I'm not sure how to do it....... http://smoothieware.org/bcnc hopefully it's not the Smoothie board itself malfunctioning.

Harvie commented 5 years ago

I really don't know how can i reproduce this bug on Linux and GRBL. Any ideas?

Harvie commented 5 years ago

@ERCOman1 can you try to install different pyserial version? it's kinda mess and i don't know which one works the best...

ERCOman1 commented 5 years ago

Alright thanks. In my opinion the Smoothieboard v1 is not relevant anymore. I just substituted it for an Arduino Uno. bCNC works fine now.

Cheers, Daniel

On Wed, Jan 2, 2019 at 8:33 PM Tomas Mudrunka notifications@github.com wrote:

@ERCOman1 https://github.com/ERCOman1 can you try to install different pyserial version? it's kinda mess and i don't know which one works the best...

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/vlachoudis/bCNC/issues/1017#issuecomment-451036234, or mute the thread https://github.com/notifications/unsubscribe-auth/Arx0RCrvXuerT5jQWwtqSBOa9UNm3yS9ks5u_V4EgaJpZM4X5MZk .

Harvie commented 5 years ago

@collaxd You have GRBL 0.9, please upload latest GRBL1.1 to your arduino board, i think there is some problem with legacy GRBL 0.9 support right now and i don't have enough time to test it.

BTW probing setup is relatively complex. depends on what kind of probe you use, if it's NO or NC, if you have troubles with shielding, what probing algorithm (g-codes) do you use. Maybe try inverting probe pin in bCNC settings. etc. etc... For example if you try to probe, but probe is already active by the time you start probing, it will fail. It takes evening to learn...

@OliverHaak any news on this one?

In my opinion the Smoothieboard v1 is not relevant anymore.

@ERCOman1 smoothieware should be supported, BUT i never had smoothieboard nor i tried to use it. So if there is some problem with smoothie support, i will need someone to debug it and send us the fix.

OliverHaak commented 5 years ago

@Harvie : sorry, no news so far. Had only little time to take care of it. Will hopefully find some time over the weekend. I have a new PC setup with Kubuntu and will try it with that one.

OliverHaak commented 5 years ago

@Harvie : ok, checked with the new PC under a fresh installed kubuntu 18.04.1 LTS. Installed versions are: Python 2.7.15rc1 numpy==1.13.3 Pillow==5.1.0 pyserial==3.4 (tkinter is installed via the package manager)

Same behavior as before, bCNC connects to the CNC1610 with grbl1.1, big red sign says "Not connected", machine can be controlled manually and processes G-Code, does not show the MPos and WPos, though.

If you think its worthwhile, I can create an account for you on this machine so that you do some tests ...

Harvie commented 5 years ago

@OliverHaak can you please try with pyserial==3.0.1 ?

I currently have it working like this:

Python 2.7.15
numpy==1.15.4
opencv-python==3.4.2.17
Pillow==5.3.0
pyopengltk==0.0.2
pyserial==3.0.1

BTW can you can you check if you have rw permissions to your serial port?

[harvie@anemophobia Temp]$ ls -la /dev/ttyUSB0
crw-rw---- 1 root uucp 188, 0  4. led 17.08 /dev/ttyUSB0
[harvie@anemophobia Temp]$ id
uid=1000(harvie) gid=100(users) skupiny=100(users),5(tty),14(uucp),81(dbus),90(network),91(video),92(audio),93(optical),95(storage),96(scanner),98(power),109(fuse),982(docker)

How do you execute bCNC? do you execute it like python2 -m bCNC ? If it's not working please try pip2 install bCNC

OliverHaak commented 5 years ago

Yes, I do have rw access to the tty:

oliver@pandora2:\~$ ls -l /dev/ttyUSB0 crw-rw---- 1 root plugdev 188, 0 Jan 6 12:03 /dev/ttyUSB0 oliver@pandora2:~$ id uid=1000(oliver) gid=1000(oliver) Gruppen=1000(oliver),4(adm),24(cdrom),27(sudo),30(dip),46(plugdev),116(lpadmin),126(sambashare)

With pyserial==3.0.1. the results are not any different. Screenshot attached. Funny thing is that the red button says "No connection" and when you click on it, the dialog window says "Connection established".

BTW, both ways executing bCNC work: running it via python2 -m bCNC and also starting the "bCNC"-script from the distribution directory.

Still, I can offer you to login in to my machine and see the problem onsite.

screenshot_20190106_123338

Harvie commented 5 years ago

Maybe some scope related race condition. This already happend to me once. This gonna be hell to debug.

@OliverHaak Can you try if this happens using GRBL-sim? Or at least using this fake-grbl script of mine: https://github.com/vlachoudis/bCNC/blob/master/tests/fake-grbl.sh

You need socat installed and it will create fake serial called /tmp/ttyFAKE, you can then enter that into bCNC and connect.

Also can you try if it gets different when you execute bCNC using single CPU core? like this: taskset -c 0 python2 -m bCNC

roamerP commented 5 years ago

I have the same problem on Windows 10 x64. bCNC always says "not connected" in red. But it communicates with arduino. I am not sure, what is the problem.

This is the error I get in command prompt:

Traceback (most recent call last): File "D:\bCNC-master\ToolsPage.py", line 973, in init exec("import %s"%(name)) File "", line 1, in File "D:\bCNC-master\plugins\slicemesh.py", line 32, in import stl #FIXME: write smaller STL parser File "D:\bCNC-master\lib\stl__init__.py", line 1, in from .stl import BUFFER_SIZE File "D:\bCNC-master\lib\stl\stl.py", line 12, in from . import base File "D:\bCNC-master\lib\stl\base.py", line 21, in class Dimension(enum.IntEnum): AttributeError: 'module' object has no attribute 'IntEnum'

OliverHaak commented 5 years ago

@Harvie : Sorry, I was unable to get GRBL-sim running. It seems very complex to get it compiled. Or is there a binary version somewhere? Also no luck with your fake-grbl script, bCNC would just display an error-message window saying [Errno 22] Invalid argument. Starting bCNC with taskset also showed no difference: I can connect to the machine via /dev/ttyUSB0, it accepts and processes G-Code, but no display of MPos and WPos. Shows always "Not connected"

Harvie commented 5 years ago

Sorry, I was unable to get GRBL-sim running. It seems very complex to get it compiled. @OliverHaak It's not really that hard.

git clone git@github.com:gnea/grbl.git
cd grbl/grbl
git clone git@github.com:grbl/grbl-sim.git
cd grbl-sim
make
./simport.sh

Then while the simport is running you connect bCNC to /tmp/ttyFAKE

But i have to say, there seems to be some issues with how it performs... It's still development. Maybe use older version...

Also i was trying to run grbl.hex and grbl.elf in various AVR and arduino simulators. It kinda works, but is even worse. One thing that works reliably is this script i've made:

https://github.com/vlachoudis/bCNC/blob/master/tests/fake-grbl.sh

But it only contains absolute minimum of grbl interface, so bCNC can connect to it.

What also seems to work very nicely is this script made by @coddingtonbear : https://pypi.org/project/gcode-receiver/

It's kinda like fake-grbl.sh, but much more advanced. This is what we currently use for automatic testing of each bCNC commit and pull request.

coddingtonbear commented 5 years ago

Just to note, in case it's helpful, I didn't have much trouble either getting grbl-sim to or to run grbl on a generic arduino simulator, exactly, but I did absolutely have encounter an unexplained problem in which the simulator would stop responding after a certain number of commands. I'm still not exactly sure what the problem might be, but I'm just a little suspicious that it might have something to do with overflowing the RX buffer, maybe?

Harvie commented 5 years ago

grbl-sim to or to run grbl on a generic arduino simulator

I've managed to get both to work. But there are bugs. Grbl-sim is alpha and grbl in simulator is not really happy. I've tried yesterday. There was strange behaviour in both. Some of it was caused by using latest GRBL master, which is buggy. But even after checking out stable tag it was not completely identical to GRBL running on arduino.

RStaunlich commented 5 years ago

I found (after many hours) a very simple solution for the problem mentioned at the beginning of the thread (status and axis positions not updated): It was a wrong value for the reporting mask setting. I came from SerialComCNC (www.serialcominstruments.com/cnc.php) where I had to change the $10-value to 0. Changing it back to the default ($10 = 1) did the trick. Now (nearly) everything works perfect.

Harvie commented 5 years ago

Changing it back to the default ($10 = 1) did the trick.

Yes. we need better documentation for this. Maybe even automated check.

OliverHaak commented 5 years ago

Sorry, took me a while to be able to test: Awesome, that also did it for me! Thanks to @Harvie and @RStaunlich for the efforts! bCNC rocks!