Pathfinder is a Lego Mindstorms based printing system that can generate and solve 2D mazes. Grid size and dimensions are customizable. Maze width and height is limited to 20 tiles to support international A4 sized paper. In addition to draw and solve mazes Pathfinder can also draw simple SVG paths as well. Draw area of the SVG file should be set as 1750x1650.
The heart of the brick is a Debian-Linux based operating system developed by folks at http://www.ev3dev.org/ . Many programming languages can be used with this distribution. Pathfind3r uses python for core functions, php for backend support and query for web interface.
Generating and solving mazes, printing svg files and core printing scripts are seperate classes. A python socket server is used to control these functions. Also feedback from the socket server is written into the console.
Basic flow of data is: Command -> Web Interface -> Php Script -> Python Socket Server -> Execution.
- Ev3 should be started using ev3dev debian linux distribution.
- Local git should be set up on the ev3dev. There is a good tutorial about setting up the development environment at this address -> http://www.ev3dev.org/docs/tutorials/setting-up-python-pycharm/
- Apache.
- Php 5.
Super user permisions are needed to run python scripts from php server.
- Open sudoers using command
sudo visudo
. - Add following entry under "# User privilege specification" after root:
www-data ALL=(ALL) NOPASSWD:ALL
- Hit Ctrl+X, Accept changes and quit.
- Install Ev3dev from http://www.ev3dev.org/docs/getting-started/ . Latest tested and working version is ev3dev-jessie-ev3-generic-2017-02-11
- Follow instructions at http://www.ev3dev.org/docs/tutorials/connecting-to-ev3dev-with-ssh/ and connect to ev3 brick using terminal.
- Run the following commands
sudo apt-get update
sudo apt-get dist-upgrade
sudo apt-get install apache2 php5 libapache2-mod-php5
sudo /etc/init.d/apache2 restart
sudo mkdir /var/www/html/pathfind3r/
sudo git clone https://github.com/okanulas/Pathfind3r.git /var/www/html/pathfind3r/
- Open your browser and goto the http://[ip_of_your_brick]/pathfind3r/info.php . If should see info about php installation. If there is something wrong try installing php again.
- Open http://[ip_of_your_brick]/pathfind3r/
- Connect your motors:
- A > Rail Motor
- B > Paper Feed Motor
- C > Pen Motor
- Connect Touch Sensor to Input 1
- Open
http://[ip_of_your_brick]/pathfind3r/
- Click Start Server button and wait for "Server is started" call.
- Press Display Info button and check if every is ok.
- Use arrow keys and space bar to check motors.
- You need to press calibrate each time you start the server.
- Put the pen in its place and turn the motor by hand until the pen touches the paper. Then press check button next to pen button. You can check pen up and down status using up and down buttons.
Download Inkscape at https://inkscape.org/en/download/. Goto Edit>Preferences. Select Input/Output>SVG Output> Path Data should be Absolute. Create a new document and set size to 1000x1000px. Start drawing with path tool. This version only sports vertical, horizontal and diagonal lines. Curves and circles are not supported. Select Inkscape svg when saving your file. Upload to the brick using web interface. You should see list of uploads when you click "Draw Svg" button. Select one and press print. Thats all.
You can see a PDF of the building instructions here.
You can watch the Pathfind3r in action here -> Youtube Video
For more info please visit the project page. Project Page