rasProject_01 / weSweetHome  R. 240
process control       /     RasPi software         by   weinert-automation
Loading...
Searching...
No Matches
hometersConsol.c File Reference

A console program to co-operate with hometersControl. More...

#include "sweetHome.h"
#include "weUtil.h"
#include "weModbus.h"
#include "weShareMem.h"
#include <errno.h>
#include <getopt.h>

Functions

int main (int argc, char **argv)
 The program. More...
 

Variables

char const prgNamPure []
 The pure program name. More...
 
char const prgSVNdat []
 The complete SVN date string. More...
 
char const prgSVNrev []
 The complete SVN revision string. More...
 

Detailed Description

A console program to co-operate with hometersControl.

This program gets values from hometersControl.c via shared memory and displays them on console. This is mainly for local test. The operational HMI is by (Apache 2.4) web interface via CGI and AJAX by meteRead.c.

Copyright (c) 2017 Albrecht Weinert
weinert-automation.de a-weinert.de
/ / /\
/ /___ / \ |
\ /____\ /____\ | _|__
\ /\ / \ / \| |
\/ \/ \__/ \__/|_

Revision history

Rev. 244 28.09.2022
Rev. 73+ 29.11.2017 : new; derived from hometersControl.c
Rev. 75 30.11.2017 : first operable
Rev. 188 15.10.2018 : deprecated, use the web interface
Rev. 214 15.08.2019 : corrections in Doxygen comments, loopCnt
Rev. 229 23.07.2020 : valFil (CSV) removed

Client functions

This program gets values from hometersControl via shared memory synchronised by a set of semaphores: sem # 0: exclusive (short!) lock of shared memory sem # 1: signal from from hometersControl to (this) hometersConsol sem # 2: signal from from hometersControl to other (CGI etc.) programs

Library usage

The program uses the libraries (lib...): pthread, pigpiod_if2 and modbus The (weRasp/..c, include/..h) weModbus, weGPIOd and sysUtil libraries are linked in. They may be converted to and used as (.so) library, also.

cross-compile by:

make PROGRAM=hometersConsol TARGET=meterPi clean all

program respectively transfer to target machine by:

make PROGRAM=hometersConsol TARGET=raspi61 FTPuser=pi:secret progapp

The building of this application is governed by the make include makeProg_hometersConsol_settings.mk:

# A makefile include for raspberry projects
# program include for one program
# makeProg_hometersConsol_settings.mk
# Copyright 2017 Albrecht Weinert < a-weinert.de >
MAKE_INCLUDE_PROGRAM = hometersConsol
MAKE_PROGRAM_LAST_CHANGE = '$Date: 2021-02-02 18:11:02 +0100 (Di, 02 Feb 2021) $ '
MAKE_PROGRAM_REVISION = '$Revision: 236 $ '
ifndef COPYRIGHT_YEAR
$(error includefile $(MAKE_INCLUDE_PROGRAM) used directly.)
endif
# PROGRAM or MAIN_F might have been given in wrong case (at least on Windows)
override MAIN_F = $(MAKE_INCLUDE_PROGRAM)
# An optional short multiline description of this program's specifica.
# May be empty. But, do not change the three lines define endef and export.
define PROG_DES_TEXT
Program hometersConsol
This program is a accompaining client to hometersControl.
endef
export PROG_DES_TEXT
extraLDFLAGS = -lrt -pthread
extraSOURCES = weRasp/sysBasic.c weRasp/weUtil.c weRasp/weShareMem.c
extraSOURCES += weRasp/sweetHome.c

Function Documentation

◆ main()

int main ( int  argc,
char **  argv 
)

The program.

run by: hometersConsol [options
for help: hometersConsol -h

Variable Documentation

◆ prgNamPure

char const prgNamPure[]

The pure program name.

To be provided in the application's / program's source.

See also
progNam() progNamB()

◆ prgSVNrev

char const prgSVNrev[]

The complete SVN revision string.

To be provided in the application's / program's source.

See also
progRev()

◆ prgSVNdat

char const prgSVNdat[]

The complete SVN date string.

To be provided in the application's / program's source.

See also
progDat()