A simple P1 Reader build with Freepascal.
- Install Freepascal
apt-get install fpc
(Version 2.6.4 of higher) - Install mariadb client
apt-get install libmariadb-client-lgpl-dev-compat
- run
./build
in the project root
p1reader needs an configuration file in order to run. Look for an example and a description of all the options in the conf
directory.
Run the app by specifying the configuration file as the first parameter:
p1reader ../myconfig.ini
Press [ESC] to stop.
p1reader needs to store the received telegrams. You can set the storage through the generic.storage
option.
The currently supported storagedrivers are:
log
- Write an csv file. Specify the filename with thegeneric.log
entry.mysql
- Use this option to save the readout in an MySQL or MariaDB database. The app is linked againts the mysql 5.5 lib but you can change this in unitsrc/Storage/MySQL.pas
. Look for themysql55conn
import and theTMySQL55Connection
classname. A table scheme can be found inconf/db/meter_readings.sql
.external
- Starts an external tool and passes the telegram in csv form through stdin. Use thecmd
andargs
configuration options to specifify a program. See my related project Piphome for an example.
The parser currently reads the following DSMR4 field:
- 1-3:0.2.8
- 1-0:1.8.1
- 1-0:1.8.2
- 1-0:1.7.0
- 1-0:21.7.0
You can add more fields in the TelegramParser
class (look for the ParseLine
method).
- Synapse v40 (modified) for serial communication http://synapse.ararat.cz/
- Demon version (or just run it in a screen session)