serial communication

186 views
Skip to first unread message

tjwan

unread,
Dec 23, 2016, 3:28:26 AM12/23/16
to simavr
I got the arduino example from the simavr examples working with a modified grbl (3 Axis-CNC-Controller) firmware. I can connect the pts with picocom an can communicate with the console interface of the software. I also managed to generate VCD-Files and analyse the signals for the stepper motors. Very cool so far.
Put when I paste more than just a few lines of gcode into the picocom console the CNC controller stops answering. This might be because of the missing of flow control.
In this case the sender (picocom) has to wait for carriagereturn from the emulated CNC controller after each command.
There exist some specific programs to fullfil this task, one of them is universalgcodesender (java). And now to my question: I can connect to /dev/pts/24 with picocom but not with the java program universalgcodesender. It seems not to accept the virtual serial device as a valid uart and complains with something like "not driver found for..."
Im a working under ubuntu 16.04. I know there is socat, but as it works with picocom without it I dont't know how to use it in this case. 
Connecting the pts given from simavr with a python programm would also do the job, as one cloud implement an alternative to universalgcodesender.
Any hints what to do next ?

Thanks Tjwan

M P

unread,
Dec 23, 2016, 7:39:35 AM12/23/16
to simavr
Thats cool!

I don't have a LOT of suggestion for you, apart from tweaking that
gcode sender to make it work with a pts. A PTS *is* a UART as far as
the system is concerted really, it has a baudrate and all..

On a side note, have you seen my simreprap?
https://github.com/buserror/simreprap -- emulates a 3d printer. The
repo hasn't changed in a long while, but I've in fact played with it
fairly recently, so i should cleanup my act and push that stuff...

M
> --
> You received this message because you are subscribed to the Google Groups
> "simavr" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to simavr+un...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

M P

unread,
Dec 23, 2016, 7:42:39 AM12/23/16
to simavr
oh that makes me think -- on my CNC I use http://chilipeppr.com/ but
there's also xybots.com, and perhaps others

M

hovercraft-google

unread,
Dec 23, 2016, 4:48:17 PM12/23/16
to simavr
I am using latest Fedora Linux 25 x86_64 release,
latest simavr with simutron GUI built from trunk sources,
latest stable UniversalGcodeSender.jar v1.0.9 .

UniversalGcodeSender connects to simavr-linked PTY port without a problem.
May be problem is somehow Ubuntu-specific?
Or user rights related?
Sometimes adding user to some specific group ( dialout or something ) may be helpful.

hovercraft-google

unread,
Dec 23, 2016, 11:40:27 PM12/23/16
to simavr
Also I'd advise connect not to pty device directly (/dev/pts/24 or something), but to the symlink, created by simavr.
If you use sole simavr it should be /tmp/simavr-uart0,
if you use simavr via simutron it shold be /tmp/simavr1-uart0 .
This way you can avoid mistakes arising from that pty device name can very from session to session.

hovercraft-google

unread,
Dec 24, 2016, 12:37:10 AM12/24/16
to simavr
More advises:
Don't use OpenJDK. Download and install latest Oracle JDK from there http://www.oracle.com/technetwork/java/javase/downloads/index-jsp-138363.html , then substitute it using alternatives tool.

Steve Kwee

unread,
Dec 24, 2016, 5:08:30 AM12/24/16
to sim...@googlegroups.com
Thanks for many hints. Will try them when christmas is over.

Am 24.12.2016 6:37 vorm. schrieb "hovercraft-google" <hover...@yandex.ru>:
More advises:
Don't use OpenJDK. Download and install latest Oracle JDK from there http://www.oracle.com/technetwork/java/javase/downloads/index-jsp-138363.html , then substitute it using alternatives tool.

--
You received this message because you are subscribed to a topic in the Google Groups "simavr" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/simavr/tF8roWrzY0E/unsubscribe.
To unsubscribe from this group and all its topics, send an email to simavr+unsubscribe@googlegroups.com.

tjwan

unread,
Dec 27, 2016, 10:46:15 AM12/27/16
to simavr
Thanks for the advice.

I found this
and together with this hint here
it is working.
This did the trick:

serial.Serial('/dev/pts/2', 9600, rtscts=True,dsrdtr=True)

hovercraft-google

unread,
Dec 27, 2016, 11:14:54 AM12/27/16
to simavr
Glad you found the solution, at least using python. But it is still unclear to me, why java frontend (
UniversalGcodeSender) didn't working on your computer, and seems working on my? And what was exact error, when you tried to compile simutron from sources on Ubuntu 16.04 (as in your post in the "GUI for simavr" topic)? I would be very grateful, if you tell is your Ubuntu 32-bit or 64-bit? and what is an exact gcc version? This can help me to understand the problem in general.

tjwan

unread,
Dec 27, 2016, 6:55:41 PM12/27/16
to simavr
Hi,

many things at once...

To explain what all this is for:
I did some modifcations to grbl to use this excellent firmware for my 4 axis hotwire foam cutter: https://github.com/skwee/grbl-xyuv
And now I am trying to simulate the firmware. This works great (gcode parsing and waveform output) for the older grbl-0.8 branch an my grbl-xyuv which is based on grbl-0.8.
Unfortunatly it works only in parts for the newer grbl-0.9 and the latest grbl-1.1 which have some major improvments. The simulator just stops after a few lines of gcode that pass without any hassle for for 0.8-formware.

So far I am happy to run simavr from a modified examples/board_simduino and I have a connection with a python script to send the gcode to the arduino.
So at the moment I do not need simutron or it's successor(?) simulide. I will check with JAVR again for debugging with eclipse.
I followed your advice to use /tmp/simavr-uart0 and that works nice with the python script. 

Anyway. I am running ubuntu 16.04 and to isolate my machine from the dependencies I now do all my tests in a docker container.
This way it is very simple to switch to any debian or ubuntu version
I am not that used to fedora but that should also be simple with docker

I managed to compile simutron on ubuntu 16.04.
I had to change the definition for CXX in the Makefile
CXX           = g++ -std=c++11

Before that I got an error compiling simulator.cpp: 
/usr/include/qt4 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -Isrc/components/integrated -Isrc/components -Isrc/core -Isrc/gui -Iplugins -Ibuild -Isrc -I/usr/local/include/simavr -Ibuild -o build/simulator.o src/simulator.cpp
In file included from /usr/include/c++/5/cstdint:35:0,
                 from src/simulator.cpp:29:
/usr/include/c++/5/bits/c++0x_warning.h:32:2: error: #error This file requires compiler and library support for the ISO C++ 2011 standard. This support must be enabled with the -std=c++11 or -std=gnu++11 compiler options.

Now I have simutron and can start the gui.
When trying to compile the plugins I get similar errors.
The Makefiles seem to be generated by qt4 and so I changed defpro and added
QMAKE_CXXFLAGS += -std=c++11
The c++2011 errors are gone but now I am running into some qt errors:
In file included from template_plugin.cpp:21:0:
template_plugin.h:35:23: error: ‘IID’ has not been declared
     Q_PLUGIN_METADATA(IID "simutron.FullAdderPlugin")
                       ^

hovercraft-google

unread,
Dec 27, 2016, 10:24:12 PM12/27/16
to simavr
Many thanks for your very valuable feedback!
Reply all
Reply to author
Forward
0 new messages