Recording RPICT Serial stream on local file: Difference between revisions

From lechacal
Jump to navigation Jump to search
No edit summary
No edit summary
Line 4: Line 4:
We are proposing a basic script template which can be installed as below.
We are proposing a basic script template which can be installed as below.


wget lechacal.com/RPICT/tools/lcl-gateway.py.zip
Get the lcl-gateway tool and install it this way.
unzip lcl-gateway.py.zip
 
  wget lechacal.com/RPICT/tools/gateway.conf
  wget lechacal.com/RPICT/tools/lcl-gateway_1.3.0_armhf.deb
  sudo apt-get install python-requests
  sudo dpkg -i lcl-gateway_1.3.0_armhf.deb
sudo mv lcl-gateway.py /usr/local/bin/
 
sudo mv gateway.conf /etc/
   
   
Edit the gateway.conf file to reflect your own setting.  
Edit the gateway.conf file to reflect your own setting.  
  nano /etc/gateway.conf
  nano /etc/lcl-gateway.conf


In this file you should turn off Emoncms and Influxdb. Then turn on localsave. Also edit the directory if needed.
In this file you should turn off Emoncms and Influxdb. Then turn on localsave. Also edit the directory if needed.
Line 42: Line 41:
Insert the RPICT and run
Insert the RPICT and run


  lcl-gateway.py -d
  /usr/local/bin/lcl-gateway.py -d


The data will be stored in the /tmp directory. One file per day in csv format. Titled with the epoch time when it started.
The data will be stored in the /tmp directory. One file per day in csv format. Titled with the epoch time when it started.
Note that rebooting the pi will erase all that is inside /tmp. Use /home/pi/data if you need to preserve the data between reboots.

Revision as of 19:54, 12 August 2021

This is to record the data from a RPICT series board in a plain CSV file that can be opened with excel or else later on.

We are proposing a basic script template which can be installed as below.

Get the lcl-gateway tool and install it this way.

wget lechacal.com/RPICT/tools/lcl-gateway_1.3.0_armhf.deb
sudo dpkg -i lcl-gateway_1.3.0_armhf.deb


Edit the gateway.conf file to reflect your own setting.

nano /etc/lcl-gateway.conf

In this file you should turn off Emoncms and Influxdb. Then turn on localsave. Also edit the directory if needed.

[system]
port=/dev/ttyAMA0
baud=38400

[emoncms]
enabled = False
hostname = emoncms.org
apikey = --apikey-from-emoncms-goes-here--
node = 20

[influxdb]
enabled = False
url = http://10.10.15.26:8086/write   # https://corlysis.com:8086/write
dbname = mydb
user = token
passwd = -optional-password-goes-here----
measurement = rpict3t1           # Modify this to match your board

[localsave]
enabled = True
directory = /tmp/


Insert the RPICT and run

/usr/local/bin/lcl-gateway.py -d

The data will be stored in the /tmp directory. One file per day in csv format. Titled with the epoch time when it started.

Note that rebooting the pi will erase all that is inside /tmp. Use /home/pi/data if you need to preserve the data between reboots.