Introduction: RPi2 Curve and Surface Fitting Web Server
This instructable easily turns a Raspberry Pi 2 into a graphical curve fitting and surface fitting powerhouse!
Teachers! Did you use this instructable in your classroom?
Add a Teacher Note to share how you incorporated it into your lesson.
Step 1: Install Supporting Software Packages
Some supporting software packages will be required to glue everything together:
Scipy will do the math
Matplotlib will draw the graphs
Flask will be the simple development web server
To install, run the following at a command prompt:
sudo apt-get install python-scipy python-matplotlib python-flask
Step 2: Download Pyeq2 From the Github Code Repository
The Python language pyeq2 library will do the curve and surface fitting. Download the source code from this Github link:
Unzip the file and rename the top-level directory from pyeq2-master to pyeq2 as Github appends "-master" to the directory name, preventing Python import.
Step 3: Start the Flask Web Server
At a command prompt, cd to the pyeq2/Examples/Web directory and execute the command
You should see the following:
Running on http://0.0.0.0:5000/ * Restarting with reloader
The URL "http://0.0.0.0:5000/" allows the web server to be externally visible on port 5000 if desired.
Step 4: Give It a Try!
From the Pi, open the URL http://0.0.0.0:5000/ in a browser. You should see a web page with example test data and some example curve and surface equations. If you know the RPi's external IP address, you should also be able to open that as [Rpi address]:5000 from another computer on the same network.
Note that the Flask web server must load some of the supporting software to create graphs, etc. on the first fit. After the first run, the web server will have faster performance.
Step 5: On-line Support
If you have any questions, the user group is located on Google Groups at https://groups.google.com/forum/#!forum/zunzun_dot_com - just post there.