This repository has been archived by the owner on Aug 27, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 199
/
README.sim
43 lines (30 loc) · 1.81 KB
/
README.sim
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
##############################################################################
# #
# Simulator of AVR-targetted code on a PC #
# #
##############################################################################
To compile the simulation code, use
$ make -f Makefile-SIM
The simulator can run in one of two modes. It can connect to a serial port
in order to simulate a real printer or it can read in a file of gcodes as if
they were provided over the serial port.
=== Gcode file ===
Run the simulator with the name of one or more the gcode files as the command
arguments. The simulator will read gcodes from each file in turn until all
commands are exhausted. Responses normally sent to the serial port will only
be written to the console.
$ ./sim testcases/curves.gcode
=== Serial port ===
The simulator will open a serial port for communication. If you don't want to
connect a null modem cable, you can use 'socat' to connect two serial ports:
socat -d -d PTY,raw,echo=0 PTY,raw,echo=0
2013/10/24 17:42:04 socat[3375] N PTY is /dev/pts/12
2013/10/24 17:42:04 socat[3375] N PTY is /dev/pts/13
2013/10/24 17:42:04 socat[3375] N starting data transfer loop with FDs [3,3] and [5,5]
On the first line of output, socat will tell you the name of the virtual serial
port. Pass this as an argument to the simulator (in another terminal):
$ ./sim /dev/pts/12
Give the other virtual serial port to an application like pronterface.
Now you can send G-codes from the socat terminal. The simulation code will
print any data sent via the firmware's serial interface. Stepper positions
will be shown in green, counting a rising slope on the pin as one step.