Transform a RPICT into a web scope: Difference between revisions

From lechacal
Jump to navigation Jump to search
Line 18: Line 18:
=Upload the Sketch=
=Upload the Sketch=


The RPICT will require a different sketch. Download the appropriate sketch that applies.
The RPICT will require a different sketch depending on the model. Download the appropriate sketch that applies.


RPICT4T4 RPICT3V1 <br>
==RPICT4T4 RPICT3V1==
[http://lechacal.com/RPICT/scope/RPICT_SCOPE_ATTINY_v1_0.ino RPICT Scope Attiny Version 1.0]
[http://lechacal.com/RPICT/scope/RPICT_SCOPE_ATTINY_v1_0.ino RPICT Scope Attiny Version 1.0]


RPICT3T1<br>
==RPICT3T1==
coming soon.
coming soon.


RPICT7V1 RPICT4V3 RPICT8<br>
==RPICT7V1 RPICT4V3 RPICT8==
[http://lechacal.com/RPICT/scope/RPICT_SCOPE_MCP3208_v1_0.ino RPICT Scope Mcp3208 Version 1.0]<br>
Prepare the Raspberrypi for uploading new firmwares.
[http://lechacal.com/RPICT/scope/RPICT_SCOPE_MCP3208_v1_1.ino RPICT Scope Mcp3208 Version 1.1]
 
[[Upload Arduino sketch from Raspberrypi to RPICT]]
 
Get the scope sketch.
 
wget lechacal.com/RPICT/sketch/RPICT_SCOPE_MCP3208_v1_4.ino.hex
 
Upload it to the RPICT unit.
 
lcl-upload-sketch.sh RPICT_SCOPE_MCP3208_v1_4.ino.hex


=Setup the web server=
=Setup the web server=

Revision as of 21:53, 3 March 2022


Overview

This is to show the waveform on a web browser using the RPICT in a special configuration. We will use the Raspberrypi to collect the analogue data from the RPICT and serve them as a HTTP server.

IMPORTANT. This is not a substitute for a scope. This is just a playground for demonstration.

Preliminaries

Make sure you have a fresh Raspbian image installed.

Setup the Raspbian to enable the serial port. See the guide below to complete this.
Howto setup Raspbian for serial read

Upload the Sketch

The RPICT will require a different sketch depending on the model. Download the appropriate sketch that applies.

RPICT4T4 RPICT3V1

RPICT Scope Attiny Version 1.0

RPICT3T1

coming soon.

RPICT7V1 RPICT4V3 RPICT8

Prepare the Raspberrypi for uploading new firmwares.

Upload Arduino sketch from Raspberrypi to RPICT

Get the scope sketch.

wget lechacal.com/RPICT/sketch/RPICT_SCOPE_MCP3208_v1_4.ino.hex

Upload it to the RPICT unit.

lcl-upload-sketch.sh RPICT_SCOPE_MCP3208_v1_4.ino.hex

Setup the web server

Install lighthttp to configure the Raspberrypi as a web server.

sudo apt-get install lighttpd
sudo wget lechacal.com/repo/emonwrt3/lighttpd.conf -O /tmp/lighttpd.conf

Make sure the previous command is successful before entering the following one.

sudo cp /tmp/lighttpd.conf /etc/lighttpd/lighttpd.conf


Now navigate to the http public folder and install the scope webserver.

cd /var/www/html/
sudo wget lechacal.com/RPICT/scope/rpict-scope-v1.0.zip
sudo unzip rpict-scope-v1.0.zip

This will create a folder called scope. There is a configuration file inside called rpict-scope.conf which should not need to be modified.

At time of writing lighttpd need a small fix. The 2 commands below are for this.

cd /usr/share/lighttpd
sudo ln -s create-mime.conf.pl create-mime.assign.pl

Restart the service using

sudo /etc/init.d/lighttpd restart

Run the service and view the data

From the raspberrypi run the following command.

cd /var/www/html/scope/
sudo ./lcl-rpict-scope.py

Then now open a web browser and go to address

http://raspberrypi/scope/scope.html?yrange=4100

Modify yrange in the address as required.