<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="FeedCreator 1.8" -->
<?xml-stylesheet href="https://ksmith.com/lib/exe/css.php?s=feed" type="text/css"?>
<rdf:RDF
    xmlns="http://purl.org/rss/1.0/"
    xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
    xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
    xmlns:dc="http://purl.org/dc/elements/1.1/">
    <channel rdf:about="https://ksmith.com/feed.php">
        <title>KSmith Wiki code</title>
        <description></description>
        <link>https://ksmith.com/</link>
        <image rdf:resource="https://ksmith.com/lib/tpl/arctic/images/favicon.ico" />
       <dc:date>2026-05-03T08:57:00+00:00</dc:date>
        <items>
            <rdf:Seq>
                <rdf:li rdf:resource="https://ksmith.com/doku.php?id=code:argvindex.c&amp;rev=1671578615&amp;do=diff"/>
                <rdf:li rdf:resource="https://ksmith.com/doku.php?id=code:old_sensor_poll_python&amp;rev=1671677274&amp;do=diff"/>
                <rdf:li rdf:resource="https://ksmith.com/doku.php?id=code:old_sensor_python&amp;rev=1671677122&amp;do=diff"/>
                <rdf:li rdf:resource="https://ksmith.com/doku.php?id=code:powermeter.c&amp;rev=1671677592&amp;do=diff"/>
            </rdf:Seq>
        </items>
    </channel>
    <image rdf:about="https://ksmith.com/lib/tpl/arctic/images/favicon.ico">
        <title>KSmith Wiki</title>
        <link>https://ksmith.com/</link>
        <url>https://ksmith.com/lib/tpl/arctic/images/favicon.ico</url>
    </image>
    <item rdf:about="https://ksmith.com/doku.php?id=code:argvindex.c&amp;rev=1671578615&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2022-12-20T16:23:35+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>code:argvindex.c</title>
        <link>https://ksmith.com/doku.php?id=code:argvindex.c&amp;rev=1671578615&amp;do=diff</link>
        <description>/*

argvindex - Find string s on NULL terminated argv style list argvlist

*/
#include &quot;local.h&quot;
#include &lt;string.h&gt;

int argvindex(argvlist, s, strfunc)
char *argvlist[];
char *s;
int (*strfunc)();
{
    int index;
    for(index = 0; argvlist[index] != NULL; index++ ) {
        if ( (strfunc)(argvlist[index], s, strlen(argvlist[index])) == 0)
            break;
    }
    return(index);
}</description>
    </item>
    <item rdf:about="https://ksmith.com/doku.php?id=code:old_sensor_poll_python&amp;rev=1671677274&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2022-12-21T19:47:54+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>code:old_sensor_poll_python</title>
        <link>https://ksmith.com/doku.php?id=code:old_sensor_poll_python&amp;rev=1671677274&amp;do=diff</link>
        <description>Python Polling Script using minimalmodbus

This was replaced with a more comprehensive C program.  See: Home Solar Project


#!/usr/bin/env python3
#
# powermeter.py
#
# I don&#039;t like python very much
#
import minimalmodbus
import serial
import time
from datetime import datetime
import csv
import psycopg2
import sys

#----------------------------------------------------------------------
# ADD_TABLE_ENTRY
#----------------------------------------------------------------------
def add_table_entry(…</description>
    </item>
    <item rdf:about="https://ksmith.com/doku.php?id=code:old_sensor_python&amp;rev=1671677122&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2022-12-21T19:45:22+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>code:old_sensor_python</title>
        <link>https://ksmith.com/doku.php?id=code:old_sensor_python&amp;rev=1671677122&amp;do=diff</link>
        <description>Python Code to set the sensor id

This was replaced with a more robust program written in C.  See Page: Home Solar Project

This is some code hacked up to set the ID for the sensors.  They start out at &#039;1&#039; so if you forget you&#039;ll have to walk it.  One could clean this up to take parameters, but it&#039;s so one-shot it&#039;s hardly worth it.</description>
    </item>
    <item rdf:about="https://ksmith.com/doku.php?id=code:powermeter.c&amp;rev=1671677592&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2022-12-21T19:53:12+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>code:powermeter.c</title>
        <link>https://ksmith.com/doku.php?id=code:powermeter.c&amp;rev=1671677592&amp;do=diff</link>
        <description>powermeter.c

There is still a bunch of hard-coded cruft in here.  Assuming sensors have id&#039;s 11 and 12 (the default is 1).  This is currently running on my control server.

This is growing.  It is dependent on:

	*  My libax library
	*  libmodbus

Next go-round I will put the dev setup in a zip file.  If I get real motivated I will add it to my fossil repo.</description>
    </item>
</rdf:RDF>
