<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>http://wiki.breedveld.net/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Roland</id>
	<title>wiki.breedveld.net - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="http://wiki.breedveld.net/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Roland"/>
	<link rel="alternate" type="text/html" href="http://wiki.breedveld.net/index.php?title=Special:Contributions/Roland"/>
	<updated>2026-12-01T19:08:18Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.44.2</generator>
	<entry>
		<id>http://wiki.breedveld.net/index.php?title=File:Pi_Cluster.jpg&amp;diff=7316</id>
		<title>File:Pi Cluster.jpg</title>
		<link rel="alternate" type="text/html" href="http://wiki.breedveld.net/index.php?title=File:Pi_Cluster.jpg&amp;diff=7316"/>
		<updated>2025-11-18T19:09:34Z</updated>

		<summary type="html">&lt;p&gt;Roland: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Roland</name></author>
	</entry>
	<entry>
		<id>http://wiki.breedveld.net/index.php?title=File:Pi_Cluster_Running.jpg&amp;diff=7315</id>
		<title>File:Pi Cluster Running.jpg</title>
		<link rel="alternate" type="text/html" href="http://wiki.breedveld.net/index.php?title=File:Pi_Cluster_Running.jpg&amp;diff=7315"/>
		<updated>2025-11-18T19:09:15Z</updated>

		<summary type="html">&lt;p&gt;Roland: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Roland</name></author>
	</entry>
	<entry>
		<id>http://wiki.breedveld.net/index.php?title=Instructions_and_HOWTO_page&amp;diff=7312</id>
		<title>Instructions and HOWTO page</title>
		<link rel="alternate" type="text/html" href="http://wiki.breedveld.net/index.php?title=Instructions_and_HOWTO_page&amp;diff=7312"/>
		<updated>2025-10-23T14:48:01Z</updated>

		<summary type="html">&lt;p&gt;Roland: /* Instructions: */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[485solar-get]]&lt;br /&gt;
[[Category:485solar-get]]&lt;br /&gt;
&amp;lt;BR&amp;gt;&lt;br /&gt;
Instructions and HOWTO page&lt;br /&gt;
&amp;lt;BR&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Instructions:==&lt;br /&gt;
Command line options for 485solar-get&amp;lt;br&amp;gt;&lt;br /&gt;
485solar-get for 123Solar&amp;lt;br&amp;gt;&lt;br /&gt;
based on libyasdi from SMA Solar Technology ag&amp;lt;br&amp;gt;&lt;br /&gt;
v1.002 2025-10-23 by roland@breedveld.net&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Config file: /etc/yasdi.ini&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Options:&amp;lt;br&amp;gt;&lt;br /&gt;
-h show this help&lt;br /&gt;
-d show data&lt;br /&gt;
-b show debug information, written to errout&lt;br /&gt;
-i show info&lt;br /&gt;
-e show events&lt;br /&gt;
-c show data with comments&lt;br /&gt;
-a show alarms&lt;br /&gt;
-s show possible status fields&lt;br /&gt;
-r show state of Daemon&lt;br /&gt;
-S synchrone detection, default is asynchrone&lt;br /&gt;
-D start 485solar-get as daemon&lt;br /&gt;
-m monitor loop&lt;br /&gt;
-x send exit to daemon&lt;br /&gt;
-n0-9 deviceNr, default -n0&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 485solar-get project: https://sourceforge.net/projects/solarget/&lt;br /&gt;
 123Solar project: https://github.com/jeanmarc77/123solar&lt;br /&gt;
 YASDI Sources: https://www.sma.de/en/products/apps-software/yasdi&lt;br /&gt;
&lt;br /&gt;
When running 485solar-get as a daemon:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
The client is communicating to the sever by shared memory, actually an IPC-socket, so both should run as the same user.&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
When starting daemon mode always give the highest device_nr in the command, otherwise it only communicates with the first inverter.&amp;lt;br&amp;gt;&lt;br /&gt;
example if using 4 SMA inverters: 485solar-get -D -n3&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
A client process, such as &amp;quot;485solar-get -d&amp;quot;, always looks if a daemon is running, if not, it will communicate directly to the SMA device.&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
The daemon will shutdown when communication to one of the inverters is interrupted.&amp;lt;br&amp;gt;&lt;br /&gt;
This is because the initialization to all invertes should be done again, after one is comming back online again.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Release Notes:==&lt;br /&gt;
v0.91 2012-10-14 beta version&lt;br /&gt;
 initial test version&lt;br /&gt;
&lt;br /&gt;
v0.92 2012-10-15 beta version&lt;br /&gt;
 introduced: -b option&lt;br /&gt;
 this the same as -d (datacollecting) but extended with debug info.&lt;br /&gt;
 debug info is send to stderr&lt;br /&gt;
 Device-scan is now async, with a wait loop after it.&lt;br /&gt;
 This not optimal yet, but it is much faster&lt;br /&gt;
&lt;br /&gt;
v0.93 2012-10-16 beta version&lt;br /&gt;
 max exit in detection waitloop, prevents for endless loop&lt;br /&gt;
&lt;br /&gt;
v0.94 2012-10-21 beta version&lt;br /&gt;
 mutiple inverters (-n)&lt;br /&gt;
 improved debugging options&lt;br /&gt;
 date and events printout with comments (-c)&lt;br /&gt;
 show possible status fields (-s)&lt;br /&gt;
 some minor bigfixes&lt;br /&gt;
&lt;br /&gt;
v0.95 2012-10-24 beta version&lt;br /&gt;
 minor bugfixes&lt;br /&gt;
 include yasdi libs in compiled version&lt;br /&gt;
 install.sh and make_distribution.sh scripts added&lt;br /&gt;
&lt;br /&gt;
v0.972 2012-11-28 beta version&lt;br /&gt;
 Pdc in stead of Pac (bug)&lt;br /&gt;
 possible to do a synchronous call in stead off async.&lt;br /&gt;
 deamon mode, will speed-up requests&lt;br /&gt;
 monitor mode added&lt;br /&gt;
 much more debugging&lt;br /&gt;
 send stop signal to the daemon&lt;br /&gt;
 requesting the daemon state&lt;br /&gt;
&lt;br /&gt;
v0.980 2012-11-29 beta version&lt;br /&gt;
 deamon request for multiple sma inverters&lt;br /&gt;
&lt;br /&gt;
v0.981 2012-12-02 beta version&lt;br /&gt;
 minor bug-fix for 32bit compile&lt;br /&gt;
&lt;br /&gt;
v0.982 2013-02-13 beta version&lt;br /&gt;
 not existing inverter in daemon mode will result as 0, - bugfix for coredump with some SMA models - detection of A or mA, output will be in Amps&lt;br /&gt;
&lt;br /&gt;
v1.000 2014-09-04 version&lt;br /&gt;
 New name, going to production version&lt;br /&gt;
&lt;br /&gt;
v1.002 2025-10-25 version&lt;br /&gt;
 Bugfix, for the arm32, which contains 64bit yasdi libs&lt;br /&gt;
 URL and comment changes&lt;br /&gt;
&lt;br /&gt;
==485solar-get Installation:==&lt;br /&gt;
Install 485solar-get&amp;lt;br&amp;gt;&lt;br /&gt;
needed packages: libaio&amp;lt;br&amp;gt;&lt;br /&gt;
for Ubuntu 12.04LTS&amp;lt;br&amp;gt;&lt;br /&gt;
also tested on Ubuntu 10.04LTS&amp;lt;br&amp;gt;&lt;br /&gt;
download the latest compiled 485solar-get &amp;lt;version&amp;gt;_x86_64_Ubuntu_12_04.tgz from this site,&amp;lt;br&amp;gt;&lt;br /&gt;
(or for 32bit systems 485solar-get_&amp;lt;version&amp;gt;_i386_Ubuntu_12_04.tgz)&amp;lt;br&amp;gt;&lt;br /&gt;
place is somewhere like /tmp&amp;lt;br&amp;gt;&lt;br /&gt;
extract it:&lt;br /&gt;
 tar xzvf 485solar-get_&amp;lt;version&amp;gt;_x86_64_Ubuntu_12_04.tgz&lt;br /&gt;
run the install script:&lt;br /&gt;
 sudo ./install.sh&lt;br /&gt;
For other Linux distributions:&amp;lt;br&amp;gt;&lt;br /&gt;
compiling and installing YASDI&amp;lt;br&amp;gt;&lt;br /&gt;
needed packages: gcc cmake libaio&amp;lt;br&amp;gt;&lt;br /&gt;
Download YASDI from the SMA site:&amp;lt;br&amp;gt;&lt;br /&gt;
https://www.sma.de/en/products/apps-software/yasdi&amp;lt;br&amp;gt;&lt;br /&gt;
extract it to /usr/local/src/libyasdi_1_8_1&lt;br /&gt;
 cd /usr/local/src/libyasdi_1_8_1/&lt;br /&gt;
 cd projects/generic-cmake&lt;br /&gt;
 mkdir build-gcc&lt;br /&gt;
 cd build-gcc&lt;br /&gt;
 cmake ..&lt;br /&gt;
 make&lt;br /&gt;
 sudo make install&lt;br /&gt;
 export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib&lt;br /&gt;
 sudo ldconfig /usr/local/lib&lt;br /&gt;
&lt;br /&gt;
test it:&lt;br /&gt;
 yasdishell /etc/yasdi.ini &lt;br /&gt;
&lt;br /&gt;
compiling and installing 485solar-get&amp;lt;br&amp;gt;&lt;br /&gt;
download the latest 485solar-get_&amp;lt;version&amp;gt;_sources.tgz source from this site&amp;lt;br&amp;gt;&lt;br /&gt;
extract it:&lt;br /&gt;
 cd /usr/local/src/libyasdi_1_8_1/&lt;br /&gt;
 tar xzvf &amp;lt;location&amp;gt;/485solar-get_&amp;lt;version&amp;gt;_sources.tgz&lt;br /&gt;
 cd /usr/local/src/libyasdi_1_8_1/sma_485solar-get_&amp;lt;version&amp;gt;&lt;br /&gt;
 sudo ./make.sh&lt;br /&gt;
example for /etc/yasdi.ini&lt;br /&gt;
 [DriverModules]&lt;br /&gt;
 Driver0=yasdi_drv_serial&lt;br /&gt;
 [COM1]&lt;br /&gt;
 Device=/dev/ttyUSB0&lt;br /&gt;
 Media=RS485&lt;br /&gt;
 Baudrate=1200&lt;br /&gt;
 Protocol=SMANet&lt;br /&gt;
 [Misc]&lt;br /&gt;
 DebugOutput=/dev/stderr&lt;br /&gt;
compiling, installing and generating your own distribution&amp;lt;br&amp;gt;&lt;br /&gt;
download the latest 485solar-get_&amp;lt;version&amp;gt;_sources.tgz source from this site&amp;lt;br&amp;gt;&lt;br /&gt;
extract it:&lt;br /&gt;
 cd /usr/local/src/libyasdi_1_8_1/&lt;br /&gt;
 tar xzvf &amp;lt;location&amp;gt;/485solar-get_&amp;lt;version&amp;gt;_sources.tgz&lt;br /&gt;
 cd /usr/local/src/libyasdi_1_8_1/485solar-get_&amp;lt;version&amp;gt;&lt;br /&gt;
change PACKAGE_PAD in make_distribution.sh to your own choice&lt;br /&gt;
 sudo ./make_distribution.sh&lt;br /&gt;
&lt;br /&gt;
==Problem Solving:==&lt;br /&gt;
 general&lt;br /&gt;
 When encountering issues, first every should be fine without using the Daemon mode.&lt;br /&gt;
 stop the daemon with&lt;br /&gt;
 485solar-get -x&lt;br /&gt;
 be shure there are no alter commands running, so stop all software which is using the same interface, like 123solar, etc.&lt;br /&gt;
 bind address in use&lt;br /&gt;
 If you change the user which 485solar-get (and Daemon) runs, you have to remove the socket file:&lt;br /&gt;
 rm -f /var/tmp/485solar-get_socket&lt;br /&gt;
 debug 485solar-get&lt;br /&gt;
 use the -b option to show debug output:&lt;br /&gt;
 485solar-get -s -b &lt;br /&gt;
 or:&lt;br /&gt;
 485solar-get -b -d -i -e -a -s &lt;br /&gt;
&lt;br /&gt;
 try synchronous detection, by adding the -S option&lt;br /&gt;
 first test Yasdi itself, while 485solar-get is using its library&#039;s&lt;br /&gt;
 yasdishell /etc/yasdi.ini&lt;br /&gt;
 b1&lt;br /&gt;
 when device is detected:&lt;br /&gt;
 z&lt;br /&gt;
 look at the outputs of:&lt;br /&gt;
 d&lt;br /&gt;
 a1&lt;br /&gt;
 p1&lt;br /&gt;
 t1 (probably empty)&lt;br /&gt;
 When the rs485 interface won&#039;t respond, try to zero it:&lt;br /&gt;
 setserial -z /dev/ttyUSB0&lt;br /&gt;
 Get state of rs485 device:&lt;br /&gt;
 setserial -G /dev/ttyUSB0&lt;br /&gt;
 this wil give something like:&lt;br /&gt;
 /dev/ttyUSB0 uart unknown port 0x0000 irq 0 baud_base 24000000 spd_normal low_latency&lt;br /&gt;
 Check baudrate:&lt;br /&gt;
 stty -F /dev/ttyUSB0&lt;br /&gt;
 Set baudrate:&lt;br /&gt;
 stty -F /dev/ttyUSB0 1200&lt;br /&gt;
 cannot open shared object&lt;br /&gt;
 if you get this message after installing the binary version:&lt;br /&gt;
 485solar-get: error while loading shared libraries: libyasdimaster.so.1: cannot open shared object file: No such file or directory&lt;br /&gt;
&lt;br /&gt;
 This means /usr/local/lib is not in the library path.&lt;br /&gt;
 there are 2 solutions:&lt;br /&gt;
&lt;br /&gt;
 setting the path before running, only for this session:&lt;br /&gt;
 export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib&lt;br /&gt;
 Make it permanent:&lt;br /&gt;
 sudo ldconfig /usr/local/lib&lt;br /&gt;
 Debugging and tracing&lt;br /&gt;
 If you can&#039;t get enough data from the -b (debug) option, you can use strace:&lt;br /&gt;
 strace -f -o 485solar-get.strace 485solar-get -d -b&lt;br /&gt;
 All trace info will be written to 485solar-get.strace&lt;br /&gt;
 For monitoring the serial data:&lt;br /&gt;
 strace -s9999 -o 485solar-get.strace -eread,write,ioctl 485solar-get -d -b&lt;br /&gt;
&lt;br /&gt;
==Output Examples:==&lt;br /&gt;
output examples for 485solar-get&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
485solar-get -d (request data)&lt;br /&gt;
 20130712-15:32:55 172.000000 3.107000 534.404000 0.000000 0.000000 0.000000 234.400003 2.083000 488.000000 49.989999 91.364437 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 889.486042 0.000000 OK&lt;br /&gt;
&lt;br /&gt;
485solar-get -d -c (request data in column format)&lt;br /&gt;
 Date 20130712-15:39:04&lt;br /&gt;
 Upv-Ist V 172.000000 &lt;br /&gt;
 Ipv A 3.494000 &lt;br /&gt;
 Pdc 600.968000 &lt;br /&gt;
 dummy 0.000000 &lt;br /&gt;
 dummy 0.000000 &lt;br /&gt;
 dummy 0.000000 &lt;br /&gt;
 Uac V 234.000003 &lt;br /&gt;
 Iac-Ist A 2.346000 &lt;br /&gt;
 Pac W 549.000000 &lt;br /&gt;
 Fac Hz 49.989999 &lt;br /&gt;
 Effcy 91.346629 &lt;br /&gt;
 dummy 0.000000 &lt;br /&gt;
 dummy 0.000000 &lt;br /&gt;
 dummy 0.000000 &lt;br /&gt;
 dummy 0.000000 &lt;br /&gt;
 dummy 0.000000 &lt;br /&gt;
 dummy 0.000000 &lt;br /&gt;
 dummy 0.000000 &lt;br /&gt;
 E-Total kWh 889.537042 &lt;br /&gt;
 dummy 0.000000 &lt;br /&gt;
 State OK&lt;br /&gt;
&lt;br /&gt;
485solar-get -e (events)&lt;br /&gt;
 169.000000 169.000000 0.000000 0.000000 169.000000 0.000000 0.000000 3.000000 233.900003 233.900003 233.900003 49.989999 1200.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 466.000000 0.000000 0.000000 0.000000 0.000000 0.000000 OK&lt;br /&gt;
&lt;br /&gt;
485solar-get -c -e (events in column format)&lt;br /&gt;
 Upv-Ist 172.000000&lt;br /&gt;
 Upv-Ist 172.000000&lt;br /&gt;
 dummy 0.000000&lt;br /&gt;
 dummy 0.000000&lt;br /&gt;
 Upv-Ist 172.000000&lt;br /&gt;
 dummy 0.000000&lt;br /&gt;
 dummy 0.000000&lt;br /&gt;
 Riso 3.000000&lt;br /&gt;
 Uac 234.000003&lt;br /&gt;
 Uac 234.000003&lt;br /&gt;
 Uac 234.000003&lt;br /&gt;
 Fac 49.959999&lt;br /&gt;
 Plimit 1200.000000&lt;br /&gt;
 dummy 0.000000&lt;br /&gt;
 dummy 0.000000&lt;br /&gt;
 dummy 0.000000&lt;br /&gt;
 dummy 0.000000&lt;br /&gt;
 dummy 0.000000&lt;br /&gt;
 dummy 0.000000&lt;br /&gt;
 dummy 0.000000&lt;br /&gt;
 dummy 0.000000&lt;br /&gt;
 dummy 0.000000&lt;br /&gt;
 dummy 0.000000&lt;br /&gt;
 dummy 0.000000&lt;br /&gt;
 dummy 0.000000&lt;br /&gt;
 Pac 582.000000&lt;br /&gt;
 dummy 0.000000&lt;br /&gt;
 dummy 0.000000&lt;br /&gt;
 dummy 0.000000&lt;br /&gt;
 dummy 0.000000&lt;br /&gt;
 dummy 0.000000&lt;br /&gt;
 State OK&lt;br /&gt;
&lt;br /&gt;
485solar-get -i (info)&lt;br /&gt;
 1 WR12-061 SN:2002116358&lt;br /&gt;
 Software-BFR 4.090000 &lt;br /&gt;
 SMA-SN 2002116358.000000 &lt;br /&gt;
 Default 8.000000 BE/C10/11&lt;br /&gt;
 Status Mpp&lt;br /&gt;
 Betriebsart Mpp-Betrieb&lt;br /&gt;
 485solar-get v1.000 daemon: Running&lt;br /&gt;
 485solar-get -a (alarms)&lt;br /&gt;
 Fehler -------&lt;br /&gt;
&lt;br /&gt;
485solar-get -s (possible status fields)&lt;br /&gt;
 All possible status texts for Status:&lt;br /&gt;
 ( 0): &#039;Offset&#039;&lt;br /&gt;
 ( 1): &#039;Stop&#039;&lt;br /&gt;
 ( 2): &#039;Netzueb.&#039;&lt;br /&gt;
 ( 3): &#039;Warten&#039;&lt;br /&gt;
 ( 4): &#039;U-Konst&#039;&lt;br /&gt;
 ( 5): &#039;Turbine&#039;&lt;br /&gt;
 ( 6): &#039;Mpp-Such&#039;&lt;br /&gt;
 ( 7): &#039;Mpp&#039;&lt;br /&gt;
 ( 8): &#039;Stoer.&#039;&lt;br /&gt;
 ( 9): &#039;Fehler&#039;&lt;br /&gt;
 (10): &#039;Mpp-Peak&#039;&lt;br /&gt;
 (11): &#039;Derating&#039;&lt;br /&gt;
 All possible status texts for Fehler:&lt;br /&gt;
 ( 0): &#039;-------&#039;&lt;br /&gt;
 ( 1): &#039;NUW-UAC&#039;&lt;br /&gt;
 ( 2): &#039;NUW-FAC&#039;&lt;br /&gt;
 ( 3): &#039;B3&#039;&lt;br /&gt;
 ( 4): &#039;K1-Trenn&#039;&lt;br /&gt;
 ( 5): &#039;B5&#039;&lt;br /&gt;
 ( 6): &#039;EEPROM dBh&#039;&lt;br /&gt;
 ( 7): &#039;ROM&#039;&lt;br /&gt;
 ( 8): &#039;B8&#039;&lt;br /&gt;
 ( 9): &#039;B9&#039;&lt;br /&gt;
 (10): &#039;B10&#039;&lt;br /&gt;
 (11): &#039;B11&#039;&lt;br /&gt;
 (12): &#039;B12&#039;&lt;br /&gt;
 (13): &#039;EeRestore&#039;&lt;br /&gt;
 (14): &#039;B14&#039;&lt;br /&gt;
 (15): &#039;B15&#039;&lt;br /&gt;
 (16): &#039;B16&#039;&lt;br /&gt;
 (17): &#039;B17&#039;&lt;br /&gt;
 (18): &#039;AC&#039;&lt;br /&gt;
&lt;br /&gt;
==Interface Hardware:==&lt;br /&gt;
The Sunny-Boy&#039;s don&#039;t have an interface from stock, you have to buy the add-on-board for your device from SMA, the 485PB-NR or, 485PB-MS-NR.&amp;lt;br&amp;gt;&lt;br /&gt;
Tip: sometimes you&#039;ll see them on ebay much cheaper.&amp;lt;br&amp;gt;&lt;br /&gt;
For the server or box you can use a USB-RS485-Kabel, I bought one from Conrad, item 975604, very cheap and works out-the-box.&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Before buying, check if your Linux version will work with the serial adapter.&amp;lt;br&amp;gt;&lt;br /&gt;
There are known problemens between Linux kernel 2.6.31 and serial adapters which use the PL2303 chip&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
To connect to the SMA and Aurora, I used a simple cat5 cable, take 1 twisted pair for GND and another for data:&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 Aurora Sunny-Boy  wire                PC&lt;br /&gt;
 GND        5      brown+brown-white   GND&lt;br /&gt;
 r+,w+      2      orange              RS485+&lt;br /&gt;
 r-,w-      7      orange-white        RS485-&lt;br /&gt;
&lt;br /&gt;
Mark 1, if r and w are separate, you can put + together and - together.&amp;lt;br&amp;gt;&lt;br /&gt;
Mark 2, the cable should not in star, but in one line, you can add as many devices you like, but only the devices on both ends can have termination.&amp;lt;br&amp;gt;&lt;br /&gt;
On all devices between, you have to switch termination off.&amp;lt;br&amp;gt;&lt;br /&gt;
on some devices it&#039;s a switch close to the connector, on other devices you should remove resistors from the pcb, it should be explained in the manual.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==USB Devices after system reboot:==&lt;br /&gt;
Using multiple serial USB tty devices&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Serial USB devices are swapped after reboot&amp;lt;br&amp;gt;&lt;br /&gt;
If you use multiple serial USB adapters, it will happen tat they are assigned from /dev/USBtty1 to /dev/USBtty0 after reboot.&amp;lt;br&amp;gt;&lt;br /&gt;
I use a simple script, which is runned before starting 123solar and metern, this will create 2 symlink&#039;s:&amp;lt;br&amp;gt;&lt;br /&gt;
for my smart electricity meter: /dev/ttyUSBp1&amp;lt;br&amp;gt;&lt;br /&gt;
for my solar devices: /dev/ttyUSBsl&amp;lt;br&amp;gt;&lt;br /&gt;
these links I configured in the applications.&amp;lt;br&amp;gt;&lt;br /&gt;
run:&lt;br /&gt;
 dmesg|grep ttyUSB&amp;lt;br&amp;gt;&lt;br /&gt;
and see which strings you can use to see which is which.&amp;lt;br&amp;gt;&lt;br /&gt;
In my case:&lt;br /&gt;
 usb 2-2: pl2303 converter now attached to ttyUSB0&lt;br /&gt;
 usb 3-1: FTDI USB Serial Device converter now attached to ttyUSB1&lt;br /&gt;
&lt;br /&gt;
put this somewhere in your startup script, or in /etc/rc.local:&lt;br /&gt;
 rm -f /dev/ttyUSBp1 /dev/ttyUSBsl&lt;br /&gt;
 P1_DEV=$(dmesg|grep &amp;quot;to ttyUSB&amp;quot;|grep pl2303 |tail -1|awk &#039;{print $NF}&#039;)&lt;br /&gt;
 SL_DEV=$(dmesg|grep &amp;quot;to ttyUSB&amp;quot;|grep FTDI |tail -1|awk &#039;{print $NF}&#039;)&lt;br /&gt;
 ln -s /dev/${P1_DEV} /dev/ttyUSBp1&lt;br /&gt;
 ln -s /dev/${SL_DEV} /dev/ttyUSBsl&lt;/div&gt;</summary>
		<author><name>Roland</name></author>
	</entry>
	<entry>
		<id>http://wiki.breedveld.net/index.php?title=Instructions_and_HOWTO_page&amp;diff=7311</id>
		<title>Instructions and HOWTO page</title>
		<link rel="alternate" type="text/html" href="http://wiki.breedveld.net/index.php?title=Instructions_and_HOWTO_page&amp;diff=7311"/>
		<updated>2025-10-23T14:46:37Z</updated>

		<summary type="html">&lt;p&gt;Roland: /* Release Notes: */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[485solar-get]]&lt;br /&gt;
[[Category:485solar-get]]&lt;br /&gt;
&amp;lt;BR&amp;gt;&lt;br /&gt;
Instructions and HOWTO page&lt;br /&gt;
&amp;lt;BR&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Instructions:==&lt;br /&gt;
Command line options for 485solar-get&amp;lt;br&amp;gt;&lt;br /&gt;
485solar-get for 123Solar&amp;lt;br&amp;gt;&lt;br /&gt;
based on libyasdi from SMA Solar Technology ag&amp;lt;br&amp;gt;&lt;br /&gt;
v1.002 2025-10-23 by roland@breedveld.net&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Config file: /etc/yasdi.ini&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Options:&amp;lt;br&amp;gt;&lt;br /&gt;
-h show this help&lt;br /&gt;
-d show data&lt;br /&gt;
-b show debug information, written to errout&lt;br /&gt;
-i show info&lt;br /&gt;
-e show events&lt;br /&gt;
-c show data with comments&lt;br /&gt;
-a show alarms&lt;br /&gt;
-s show possible status fields&lt;br /&gt;
-r show state of Daemon&lt;br /&gt;
-S synchrone detection, default is asynchrone&lt;br /&gt;
-D start 485solar-get as daemon&lt;br /&gt;
-m monitor loop&lt;br /&gt;
-x send exit to daemon&lt;br /&gt;
-n0-9 deviceNr, default -n0&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 485solar-get project: https://sourceforge.net/projects/solarget/&lt;br /&gt;
 123Solar project: https://github.com/jeanmarc77/123solar&lt;br /&gt;
 YASDI software: https://www.sma.de/en/products/apps-software/yasdi&lt;br /&gt;
&lt;br /&gt;
When running 485solar-get as a daemon:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
The client is communicating to the sever by shared memory, actually an IPC-socket, so both should run as the same user.&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
When starting daemon mode always give the highest device_nr in the command, otherwise it only communicates with the first inverter.&amp;lt;br&amp;gt;&lt;br /&gt;
example if using 4 SMA inverters: 485solar-get -D -n3&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
A client process, such as &amp;quot;485solar-get -d&amp;quot;, always looks if a daemon is running, if not, it will communicate directly to the SMA device.&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
The daemon will shutdown when communication to one of the inverters is interrupted.&amp;lt;br&amp;gt;&lt;br /&gt;
This is because the initialization to all invertes should be done again, after one is comming back online again.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Release Notes:==&lt;br /&gt;
v0.91 2012-10-14 beta version&lt;br /&gt;
 initial test version&lt;br /&gt;
&lt;br /&gt;
v0.92 2012-10-15 beta version&lt;br /&gt;
 introduced: -b option&lt;br /&gt;
 this the same as -d (datacollecting) but extended with debug info.&lt;br /&gt;
 debug info is send to stderr&lt;br /&gt;
 Device-scan is now async, with a wait loop after it.&lt;br /&gt;
 This not optimal yet, but it is much faster&lt;br /&gt;
&lt;br /&gt;
v0.93 2012-10-16 beta version&lt;br /&gt;
 max exit in detection waitloop, prevents for endless loop&lt;br /&gt;
&lt;br /&gt;
v0.94 2012-10-21 beta version&lt;br /&gt;
 mutiple inverters (-n)&lt;br /&gt;
 improved debugging options&lt;br /&gt;
 date and events printout with comments (-c)&lt;br /&gt;
 show possible status fields (-s)&lt;br /&gt;
 some minor bigfixes&lt;br /&gt;
&lt;br /&gt;
v0.95 2012-10-24 beta version&lt;br /&gt;
 minor bugfixes&lt;br /&gt;
 include yasdi libs in compiled version&lt;br /&gt;
 install.sh and make_distribution.sh scripts added&lt;br /&gt;
&lt;br /&gt;
v0.972 2012-11-28 beta version&lt;br /&gt;
 Pdc in stead of Pac (bug)&lt;br /&gt;
 possible to do a synchronous call in stead off async.&lt;br /&gt;
 deamon mode, will speed-up requests&lt;br /&gt;
 monitor mode added&lt;br /&gt;
 much more debugging&lt;br /&gt;
 send stop signal to the daemon&lt;br /&gt;
 requesting the daemon state&lt;br /&gt;
&lt;br /&gt;
v0.980 2012-11-29 beta version&lt;br /&gt;
 deamon request for multiple sma inverters&lt;br /&gt;
&lt;br /&gt;
v0.981 2012-12-02 beta version&lt;br /&gt;
 minor bug-fix for 32bit compile&lt;br /&gt;
&lt;br /&gt;
v0.982 2013-02-13 beta version&lt;br /&gt;
 not existing inverter in daemon mode will result as 0, - bugfix for coredump with some SMA models - detection of A or mA, output will be in Amps&lt;br /&gt;
&lt;br /&gt;
v1.000 2014-09-04 version&lt;br /&gt;
 New name, going to production version&lt;br /&gt;
&lt;br /&gt;
v1.002 2025-10-25 version&lt;br /&gt;
 Bugfix, for the arm32, which contains 64bit yasdi libs&lt;br /&gt;
 URL and comment changes&lt;br /&gt;
&lt;br /&gt;
==485solar-get Installation:==&lt;br /&gt;
Install 485solar-get&amp;lt;br&amp;gt;&lt;br /&gt;
needed packages: libaio&amp;lt;br&amp;gt;&lt;br /&gt;
for Ubuntu 12.04LTS&amp;lt;br&amp;gt;&lt;br /&gt;
also tested on Ubuntu 10.04LTS&amp;lt;br&amp;gt;&lt;br /&gt;
download the latest compiled 485solar-get &amp;lt;version&amp;gt;_x86_64_Ubuntu_12_04.tgz from this site,&amp;lt;br&amp;gt;&lt;br /&gt;
(or for 32bit systems 485solar-get_&amp;lt;version&amp;gt;_i386_Ubuntu_12_04.tgz)&amp;lt;br&amp;gt;&lt;br /&gt;
place is somewhere like /tmp&amp;lt;br&amp;gt;&lt;br /&gt;
extract it:&lt;br /&gt;
 tar xzvf 485solar-get_&amp;lt;version&amp;gt;_x86_64_Ubuntu_12_04.tgz&lt;br /&gt;
run the install script:&lt;br /&gt;
 sudo ./install.sh&lt;br /&gt;
For other Linux distributions:&amp;lt;br&amp;gt;&lt;br /&gt;
compiling and installing YASDI&amp;lt;br&amp;gt;&lt;br /&gt;
needed packages: gcc cmake libaio&amp;lt;br&amp;gt;&lt;br /&gt;
Download YASDI from the SMA site:&amp;lt;br&amp;gt;&lt;br /&gt;
https://www.sma.de/en/products/apps-software/yasdi&amp;lt;br&amp;gt;&lt;br /&gt;
extract it to /usr/local/src/libyasdi_1_8_1&lt;br /&gt;
 cd /usr/local/src/libyasdi_1_8_1/&lt;br /&gt;
 cd projects/generic-cmake&lt;br /&gt;
 mkdir build-gcc&lt;br /&gt;
 cd build-gcc&lt;br /&gt;
 cmake ..&lt;br /&gt;
 make&lt;br /&gt;
 sudo make install&lt;br /&gt;
 export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib&lt;br /&gt;
 sudo ldconfig /usr/local/lib&lt;br /&gt;
&lt;br /&gt;
test it:&lt;br /&gt;
 yasdishell /etc/yasdi.ini &lt;br /&gt;
&lt;br /&gt;
compiling and installing 485solar-get&amp;lt;br&amp;gt;&lt;br /&gt;
download the latest 485solar-get_&amp;lt;version&amp;gt;_sources.tgz source from this site&amp;lt;br&amp;gt;&lt;br /&gt;
extract it:&lt;br /&gt;
 cd /usr/local/src/libyasdi_1_8_1/&lt;br /&gt;
 tar xzvf &amp;lt;location&amp;gt;/485solar-get_&amp;lt;version&amp;gt;_sources.tgz&lt;br /&gt;
 cd /usr/local/src/libyasdi_1_8_1/sma_485solar-get_&amp;lt;version&amp;gt;&lt;br /&gt;
 sudo ./make.sh&lt;br /&gt;
example for /etc/yasdi.ini&lt;br /&gt;
 [DriverModules]&lt;br /&gt;
 Driver0=yasdi_drv_serial&lt;br /&gt;
 [COM1]&lt;br /&gt;
 Device=/dev/ttyUSB0&lt;br /&gt;
 Media=RS485&lt;br /&gt;
 Baudrate=1200&lt;br /&gt;
 Protocol=SMANet&lt;br /&gt;
 [Misc]&lt;br /&gt;
 DebugOutput=/dev/stderr&lt;br /&gt;
compiling, installing and generating your own distribution&amp;lt;br&amp;gt;&lt;br /&gt;
download the latest 485solar-get_&amp;lt;version&amp;gt;_sources.tgz source from this site&amp;lt;br&amp;gt;&lt;br /&gt;
extract it:&lt;br /&gt;
 cd /usr/local/src/libyasdi_1_8_1/&lt;br /&gt;
 tar xzvf &amp;lt;location&amp;gt;/485solar-get_&amp;lt;version&amp;gt;_sources.tgz&lt;br /&gt;
 cd /usr/local/src/libyasdi_1_8_1/485solar-get_&amp;lt;version&amp;gt;&lt;br /&gt;
change PACKAGE_PAD in make_distribution.sh to your own choice&lt;br /&gt;
 sudo ./make_distribution.sh&lt;br /&gt;
&lt;br /&gt;
==Problem Solving:==&lt;br /&gt;
 general&lt;br /&gt;
 When encountering issues, first every should be fine without using the Daemon mode.&lt;br /&gt;
 stop the daemon with&lt;br /&gt;
 485solar-get -x&lt;br /&gt;
 be shure there are no alter commands running, so stop all software which is using the same interface, like 123solar, etc.&lt;br /&gt;
 bind address in use&lt;br /&gt;
 If you change the user which 485solar-get (and Daemon) runs, you have to remove the socket file:&lt;br /&gt;
 rm -f /var/tmp/485solar-get_socket&lt;br /&gt;
 debug 485solar-get&lt;br /&gt;
 use the -b option to show debug output:&lt;br /&gt;
 485solar-get -s -b &lt;br /&gt;
 or:&lt;br /&gt;
 485solar-get -b -d -i -e -a -s &lt;br /&gt;
&lt;br /&gt;
 try synchronous detection, by adding the -S option&lt;br /&gt;
 first test Yasdi itself, while 485solar-get is using its library&#039;s&lt;br /&gt;
 yasdishell /etc/yasdi.ini&lt;br /&gt;
 b1&lt;br /&gt;
 when device is detected:&lt;br /&gt;
 z&lt;br /&gt;
 look at the outputs of:&lt;br /&gt;
 d&lt;br /&gt;
 a1&lt;br /&gt;
 p1&lt;br /&gt;
 t1 (probably empty)&lt;br /&gt;
 When the rs485 interface won&#039;t respond, try to zero it:&lt;br /&gt;
 setserial -z /dev/ttyUSB0&lt;br /&gt;
 Get state of rs485 device:&lt;br /&gt;
 setserial -G /dev/ttyUSB0&lt;br /&gt;
 this wil give something like:&lt;br /&gt;
 /dev/ttyUSB0 uart unknown port 0x0000 irq 0 baud_base 24000000 spd_normal low_latency&lt;br /&gt;
 Check baudrate:&lt;br /&gt;
 stty -F /dev/ttyUSB0&lt;br /&gt;
 Set baudrate:&lt;br /&gt;
 stty -F /dev/ttyUSB0 1200&lt;br /&gt;
 cannot open shared object&lt;br /&gt;
 if you get this message after installing the binary version:&lt;br /&gt;
 485solar-get: error while loading shared libraries: libyasdimaster.so.1: cannot open shared object file: No such file or directory&lt;br /&gt;
&lt;br /&gt;
 This means /usr/local/lib is not in the library path.&lt;br /&gt;
 there are 2 solutions:&lt;br /&gt;
&lt;br /&gt;
 setting the path before running, only for this session:&lt;br /&gt;
 export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib&lt;br /&gt;
 Make it permanent:&lt;br /&gt;
 sudo ldconfig /usr/local/lib&lt;br /&gt;
 Debugging and tracing&lt;br /&gt;
 If you can&#039;t get enough data from the -b (debug) option, you can use strace:&lt;br /&gt;
 strace -f -o 485solar-get.strace 485solar-get -d -b&lt;br /&gt;
 All trace info will be written to 485solar-get.strace&lt;br /&gt;
 For monitoring the serial data:&lt;br /&gt;
 strace -s9999 -o 485solar-get.strace -eread,write,ioctl 485solar-get -d -b&lt;br /&gt;
&lt;br /&gt;
==Output Examples:==&lt;br /&gt;
output examples for 485solar-get&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
485solar-get -d (request data)&lt;br /&gt;
 20130712-15:32:55 172.000000 3.107000 534.404000 0.000000 0.000000 0.000000 234.400003 2.083000 488.000000 49.989999 91.364437 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 889.486042 0.000000 OK&lt;br /&gt;
&lt;br /&gt;
485solar-get -d -c (request data in column format)&lt;br /&gt;
 Date 20130712-15:39:04&lt;br /&gt;
 Upv-Ist V 172.000000 &lt;br /&gt;
 Ipv A 3.494000 &lt;br /&gt;
 Pdc 600.968000 &lt;br /&gt;
 dummy 0.000000 &lt;br /&gt;
 dummy 0.000000 &lt;br /&gt;
 dummy 0.000000 &lt;br /&gt;
 Uac V 234.000003 &lt;br /&gt;
 Iac-Ist A 2.346000 &lt;br /&gt;
 Pac W 549.000000 &lt;br /&gt;
 Fac Hz 49.989999 &lt;br /&gt;
 Effcy 91.346629 &lt;br /&gt;
 dummy 0.000000 &lt;br /&gt;
 dummy 0.000000 &lt;br /&gt;
 dummy 0.000000 &lt;br /&gt;
 dummy 0.000000 &lt;br /&gt;
 dummy 0.000000 &lt;br /&gt;
 dummy 0.000000 &lt;br /&gt;
 dummy 0.000000 &lt;br /&gt;
 E-Total kWh 889.537042 &lt;br /&gt;
 dummy 0.000000 &lt;br /&gt;
 State OK&lt;br /&gt;
&lt;br /&gt;
485solar-get -e (events)&lt;br /&gt;
 169.000000 169.000000 0.000000 0.000000 169.000000 0.000000 0.000000 3.000000 233.900003 233.900003 233.900003 49.989999 1200.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 466.000000 0.000000 0.000000 0.000000 0.000000 0.000000 OK&lt;br /&gt;
&lt;br /&gt;
485solar-get -c -e (events in column format)&lt;br /&gt;
 Upv-Ist 172.000000&lt;br /&gt;
 Upv-Ist 172.000000&lt;br /&gt;
 dummy 0.000000&lt;br /&gt;
 dummy 0.000000&lt;br /&gt;
 Upv-Ist 172.000000&lt;br /&gt;
 dummy 0.000000&lt;br /&gt;
 dummy 0.000000&lt;br /&gt;
 Riso 3.000000&lt;br /&gt;
 Uac 234.000003&lt;br /&gt;
 Uac 234.000003&lt;br /&gt;
 Uac 234.000003&lt;br /&gt;
 Fac 49.959999&lt;br /&gt;
 Plimit 1200.000000&lt;br /&gt;
 dummy 0.000000&lt;br /&gt;
 dummy 0.000000&lt;br /&gt;
 dummy 0.000000&lt;br /&gt;
 dummy 0.000000&lt;br /&gt;
 dummy 0.000000&lt;br /&gt;
 dummy 0.000000&lt;br /&gt;
 dummy 0.000000&lt;br /&gt;
 dummy 0.000000&lt;br /&gt;
 dummy 0.000000&lt;br /&gt;
 dummy 0.000000&lt;br /&gt;
 dummy 0.000000&lt;br /&gt;
 dummy 0.000000&lt;br /&gt;
 Pac 582.000000&lt;br /&gt;
 dummy 0.000000&lt;br /&gt;
 dummy 0.000000&lt;br /&gt;
 dummy 0.000000&lt;br /&gt;
 dummy 0.000000&lt;br /&gt;
 dummy 0.000000&lt;br /&gt;
 State OK&lt;br /&gt;
&lt;br /&gt;
485solar-get -i (info)&lt;br /&gt;
 1 WR12-061 SN:2002116358&lt;br /&gt;
 Software-BFR 4.090000 &lt;br /&gt;
 SMA-SN 2002116358.000000 &lt;br /&gt;
 Default 8.000000 BE/C10/11&lt;br /&gt;
 Status Mpp&lt;br /&gt;
 Betriebsart Mpp-Betrieb&lt;br /&gt;
 485solar-get v1.000 daemon: Running&lt;br /&gt;
 485solar-get -a (alarms)&lt;br /&gt;
 Fehler -------&lt;br /&gt;
&lt;br /&gt;
485solar-get -s (possible status fields)&lt;br /&gt;
 All possible status texts for Status:&lt;br /&gt;
 ( 0): &#039;Offset&#039;&lt;br /&gt;
 ( 1): &#039;Stop&#039;&lt;br /&gt;
 ( 2): &#039;Netzueb.&#039;&lt;br /&gt;
 ( 3): &#039;Warten&#039;&lt;br /&gt;
 ( 4): &#039;U-Konst&#039;&lt;br /&gt;
 ( 5): &#039;Turbine&#039;&lt;br /&gt;
 ( 6): &#039;Mpp-Such&#039;&lt;br /&gt;
 ( 7): &#039;Mpp&#039;&lt;br /&gt;
 ( 8): &#039;Stoer.&#039;&lt;br /&gt;
 ( 9): &#039;Fehler&#039;&lt;br /&gt;
 (10): &#039;Mpp-Peak&#039;&lt;br /&gt;
 (11): &#039;Derating&#039;&lt;br /&gt;
 All possible status texts for Fehler:&lt;br /&gt;
 ( 0): &#039;-------&#039;&lt;br /&gt;
 ( 1): &#039;NUW-UAC&#039;&lt;br /&gt;
 ( 2): &#039;NUW-FAC&#039;&lt;br /&gt;
 ( 3): &#039;B3&#039;&lt;br /&gt;
 ( 4): &#039;K1-Trenn&#039;&lt;br /&gt;
 ( 5): &#039;B5&#039;&lt;br /&gt;
 ( 6): &#039;EEPROM dBh&#039;&lt;br /&gt;
 ( 7): &#039;ROM&#039;&lt;br /&gt;
 ( 8): &#039;B8&#039;&lt;br /&gt;
 ( 9): &#039;B9&#039;&lt;br /&gt;
 (10): &#039;B10&#039;&lt;br /&gt;
 (11): &#039;B11&#039;&lt;br /&gt;
 (12): &#039;B12&#039;&lt;br /&gt;
 (13): &#039;EeRestore&#039;&lt;br /&gt;
 (14): &#039;B14&#039;&lt;br /&gt;
 (15): &#039;B15&#039;&lt;br /&gt;
 (16): &#039;B16&#039;&lt;br /&gt;
 (17): &#039;B17&#039;&lt;br /&gt;
 (18): &#039;AC&#039;&lt;br /&gt;
&lt;br /&gt;
==Interface Hardware:==&lt;br /&gt;
The Sunny-Boy&#039;s don&#039;t have an interface from stock, you have to buy the add-on-board for your device from SMA, the 485PB-NR or, 485PB-MS-NR.&amp;lt;br&amp;gt;&lt;br /&gt;
Tip: sometimes you&#039;ll see them on ebay much cheaper.&amp;lt;br&amp;gt;&lt;br /&gt;
For the server or box you can use a USB-RS485-Kabel, I bought one from Conrad, item 975604, very cheap and works out-the-box.&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Before buying, check if your Linux version will work with the serial adapter.&amp;lt;br&amp;gt;&lt;br /&gt;
There are known problemens between Linux kernel 2.6.31 and serial adapters which use the PL2303 chip&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
To connect to the SMA and Aurora, I used a simple cat5 cable, take 1 twisted pair for GND and another for data:&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 Aurora Sunny-Boy  wire                PC&lt;br /&gt;
 GND        5      brown+brown-white   GND&lt;br /&gt;
 r+,w+      2      orange              RS485+&lt;br /&gt;
 r-,w-      7      orange-white        RS485-&lt;br /&gt;
&lt;br /&gt;
Mark 1, if r and w are separate, you can put + together and - together.&amp;lt;br&amp;gt;&lt;br /&gt;
Mark 2, the cable should not in star, but in one line, you can add as many devices you like, but only the devices on both ends can have termination.&amp;lt;br&amp;gt;&lt;br /&gt;
On all devices between, you have to switch termination off.&amp;lt;br&amp;gt;&lt;br /&gt;
on some devices it&#039;s a switch close to the connector, on other devices you should remove resistors from the pcb, it should be explained in the manual.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==USB Devices after system reboot:==&lt;br /&gt;
Using multiple serial USB tty devices&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Serial USB devices are swapped after reboot&amp;lt;br&amp;gt;&lt;br /&gt;
If you use multiple serial USB adapters, it will happen tat they are assigned from /dev/USBtty1 to /dev/USBtty0 after reboot.&amp;lt;br&amp;gt;&lt;br /&gt;
I use a simple script, which is runned before starting 123solar and metern, this will create 2 symlink&#039;s:&amp;lt;br&amp;gt;&lt;br /&gt;
for my smart electricity meter: /dev/ttyUSBp1&amp;lt;br&amp;gt;&lt;br /&gt;
for my solar devices: /dev/ttyUSBsl&amp;lt;br&amp;gt;&lt;br /&gt;
these links I configured in the applications.&amp;lt;br&amp;gt;&lt;br /&gt;
run:&lt;br /&gt;
 dmesg|grep ttyUSB&amp;lt;br&amp;gt;&lt;br /&gt;
and see which strings you can use to see which is which.&amp;lt;br&amp;gt;&lt;br /&gt;
In my case:&lt;br /&gt;
 usb 2-2: pl2303 converter now attached to ttyUSB0&lt;br /&gt;
 usb 3-1: FTDI USB Serial Device converter now attached to ttyUSB1&lt;br /&gt;
&lt;br /&gt;
put this somewhere in your startup script, or in /etc/rc.local:&lt;br /&gt;
 rm -f /dev/ttyUSBp1 /dev/ttyUSBsl&lt;br /&gt;
 P1_DEV=$(dmesg|grep &amp;quot;to ttyUSB&amp;quot;|grep pl2303 |tail -1|awk &#039;{print $NF}&#039;)&lt;br /&gt;
 SL_DEV=$(dmesg|grep &amp;quot;to ttyUSB&amp;quot;|grep FTDI |tail -1|awk &#039;{print $NF}&#039;)&lt;br /&gt;
 ln -s /dev/${P1_DEV} /dev/ttyUSBp1&lt;br /&gt;
 ln -s /dev/${SL_DEV} /dev/ttyUSBsl&lt;/div&gt;</summary>
		<author><name>Roland</name></author>
	</entry>
	<entry>
		<id>http://wiki.breedveld.net/index.php?title=Instructions_and_HOWTO_page&amp;diff=7310</id>
		<title>Instructions and HOWTO page</title>
		<link rel="alternate" type="text/html" href="http://wiki.breedveld.net/index.php?title=Instructions_and_HOWTO_page&amp;diff=7310"/>
		<updated>2025-10-23T14:44:51Z</updated>

		<summary type="html">&lt;p&gt;Roland: /* Instructions: */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[485solar-get]]&lt;br /&gt;
[[Category:485solar-get]]&lt;br /&gt;
&amp;lt;BR&amp;gt;&lt;br /&gt;
Instructions and HOWTO page&lt;br /&gt;
&amp;lt;BR&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Instructions:==&lt;br /&gt;
Command line options for 485solar-get&amp;lt;br&amp;gt;&lt;br /&gt;
485solar-get for 123Solar&amp;lt;br&amp;gt;&lt;br /&gt;
based on libyasdi from SMA Solar Technology ag&amp;lt;br&amp;gt;&lt;br /&gt;
v1.002 2025-10-23 by roland@breedveld.net&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Config file: /etc/yasdi.ini&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Options:&amp;lt;br&amp;gt;&lt;br /&gt;
-h show this help&lt;br /&gt;
-d show data&lt;br /&gt;
-b show debug information, written to errout&lt;br /&gt;
-i show info&lt;br /&gt;
-e show events&lt;br /&gt;
-c show data with comments&lt;br /&gt;
-a show alarms&lt;br /&gt;
-s show possible status fields&lt;br /&gt;
-r show state of Daemon&lt;br /&gt;
-S synchrone detection, default is asynchrone&lt;br /&gt;
-D start 485solar-get as daemon&lt;br /&gt;
-m monitor loop&lt;br /&gt;
-x send exit to daemon&lt;br /&gt;
-n0-9 deviceNr, default -n0&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 485solar-get project: https://sourceforge.net/projects/solarget/&lt;br /&gt;
 123Solar project: https://github.com/jeanmarc77/123solar&lt;br /&gt;
 YASDI software: https://www.sma.de/en/products/apps-software/yasdi&lt;br /&gt;
&lt;br /&gt;
When running 485solar-get as a daemon:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
The client is communicating to the sever by shared memory, actually an IPC-socket, so both should run as the same user.&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
When starting daemon mode always give the highest device_nr in the command, otherwise it only communicates with the first inverter.&amp;lt;br&amp;gt;&lt;br /&gt;
example if using 4 SMA inverters: 485solar-get -D -n3&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
A client process, such as &amp;quot;485solar-get -d&amp;quot;, always looks if a daemon is running, if not, it will communicate directly to the SMA device.&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
The daemon will shutdown when communication to one of the inverters is interrupted.&amp;lt;br&amp;gt;&lt;br /&gt;
This is because the initialization to all invertes should be done again, after one is comming back online again.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Release Notes:==&lt;br /&gt;
v0.91 2012-10-14 beta version&lt;br /&gt;
 initial test version&lt;br /&gt;
&lt;br /&gt;
v0.92 2012-10-15 beta version&lt;br /&gt;
 introduced: -b option&lt;br /&gt;
 this the same as -d (datacollecting) but extended with debug info.&lt;br /&gt;
 debug info is send to stderr&lt;br /&gt;
 Device-scan is now async, with a wait loop after it.&lt;br /&gt;
 This not optimal yet, but it is much faster&lt;br /&gt;
&lt;br /&gt;
v0.93 2012-10-16 beta version&lt;br /&gt;
 max exit in detection waitloop, prevents for endless loop&lt;br /&gt;
&lt;br /&gt;
v0.94 2012-10-21 beta version&lt;br /&gt;
 mutiple inverters (-n)&lt;br /&gt;
 improved debugging options&lt;br /&gt;
 date and events printout with comments (-c)&lt;br /&gt;
 show possible status fields (-s)&lt;br /&gt;
 some minor bigfixes&lt;br /&gt;
&lt;br /&gt;
v0.95 2012-10-24 beta version&lt;br /&gt;
 minor bugfixes&lt;br /&gt;
 include yasdi libs in compiled version&lt;br /&gt;
 install.sh and make_distribution.sh scripts added&lt;br /&gt;
&lt;br /&gt;
v0.972 2012-11-28 beta version&lt;br /&gt;
 Pdc in stead of Pac (bug)&lt;br /&gt;
 possible to do a synchronous call in stead off async.&lt;br /&gt;
 deamon mode, will speed-up requests&lt;br /&gt;
 monitor mode added&lt;br /&gt;
 much more debugging&lt;br /&gt;
 send stop signal to the daemon&lt;br /&gt;
 requesting the daemon state&lt;br /&gt;
&lt;br /&gt;
v0.980 2012-11-29 beta version&lt;br /&gt;
 deamon request for multiple sma inverters&lt;br /&gt;
&lt;br /&gt;
v0.981 2012-12-02 beta version&lt;br /&gt;
 minor bug-fix for 32bit compile&lt;br /&gt;
&lt;br /&gt;
v0.982 2013-02-13 beta version&lt;br /&gt;
 not existing inverter in daemon mode will result as 0, - bugfix for coredump with some SMA models - detection of A or mA, output will be in Amps&lt;br /&gt;
&lt;br /&gt;
v1.000 2014-09-04 version&lt;br /&gt;
 New name, going to production version&lt;br /&gt;
&lt;br /&gt;
==485solar-get Installation:==&lt;br /&gt;
Install 485solar-get&amp;lt;br&amp;gt;&lt;br /&gt;
needed packages: libaio&amp;lt;br&amp;gt;&lt;br /&gt;
for Ubuntu 12.04LTS&amp;lt;br&amp;gt;&lt;br /&gt;
also tested on Ubuntu 10.04LTS&amp;lt;br&amp;gt;&lt;br /&gt;
download the latest compiled 485solar-get &amp;lt;version&amp;gt;_x86_64_Ubuntu_12_04.tgz from this site,&amp;lt;br&amp;gt;&lt;br /&gt;
(or for 32bit systems 485solar-get_&amp;lt;version&amp;gt;_i386_Ubuntu_12_04.tgz)&amp;lt;br&amp;gt;&lt;br /&gt;
place is somewhere like /tmp&amp;lt;br&amp;gt;&lt;br /&gt;
extract it:&lt;br /&gt;
 tar xzvf 485solar-get_&amp;lt;version&amp;gt;_x86_64_Ubuntu_12_04.tgz&lt;br /&gt;
run the install script:&lt;br /&gt;
 sudo ./install.sh&lt;br /&gt;
For other Linux distributions:&amp;lt;br&amp;gt;&lt;br /&gt;
compiling and installing YASDI&amp;lt;br&amp;gt;&lt;br /&gt;
needed packages: gcc cmake libaio&amp;lt;br&amp;gt;&lt;br /&gt;
Download YASDI from the SMA site:&amp;lt;br&amp;gt;&lt;br /&gt;
https://www.sma.de/en/products/apps-software/yasdi&amp;lt;br&amp;gt;&lt;br /&gt;
extract it to /usr/local/src/libyasdi_1_8_1&lt;br /&gt;
 cd /usr/local/src/libyasdi_1_8_1/&lt;br /&gt;
 cd projects/generic-cmake&lt;br /&gt;
 mkdir build-gcc&lt;br /&gt;
 cd build-gcc&lt;br /&gt;
 cmake ..&lt;br /&gt;
 make&lt;br /&gt;
 sudo make install&lt;br /&gt;
 export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib&lt;br /&gt;
 sudo ldconfig /usr/local/lib&lt;br /&gt;
&lt;br /&gt;
test it:&lt;br /&gt;
 yasdishell /etc/yasdi.ini &lt;br /&gt;
&lt;br /&gt;
compiling and installing 485solar-get&amp;lt;br&amp;gt;&lt;br /&gt;
download the latest 485solar-get_&amp;lt;version&amp;gt;_sources.tgz source from this site&amp;lt;br&amp;gt;&lt;br /&gt;
extract it:&lt;br /&gt;
 cd /usr/local/src/libyasdi_1_8_1/&lt;br /&gt;
 tar xzvf &amp;lt;location&amp;gt;/485solar-get_&amp;lt;version&amp;gt;_sources.tgz&lt;br /&gt;
 cd /usr/local/src/libyasdi_1_8_1/sma_485solar-get_&amp;lt;version&amp;gt;&lt;br /&gt;
 sudo ./make.sh&lt;br /&gt;
example for /etc/yasdi.ini&lt;br /&gt;
 [DriverModules]&lt;br /&gt;
 Driver0=yasdi_drv_serial&lt;br /&gt;
 [COM1]&lt;br /&gt;
 Device=/dev/ttyUSB0&lt;br /&gt;
 Media=RS485&lt;br /&gt;
 Baudrate=1200&lt;br /&gt;
 Protocol=SMANet&lt;br /&gt;
 [Misc]&lt;br /&gt;
 DebugOutput=/dev/stderr&lt;br /&gt;
compiling, installing and generating your own distribution&amp;lt;br&amp;gt;&lt;br /&gt;
download the latest 485solar-get_&amp;lt;version&amp;gt;_sources.tgz source from this site&amp;lt;br&amp;gt;&lt;br /&gt;
extract it:&lt;br /&gt;
 cd /usr/local/src/libyasdi_1_8_1/&lt;br /&gt;
 tar xzvf &amp;lt;location&amp;gt;/485solar-get_&amp;lt;version&amp;gt;_sources.tgz&lt;br /&gt;
 cd /usr/local/src/libyasdi_1_8_1/485solar-get_&amp;lt;version&amp;gt;&lt;br /&gt;
change PACKAGE_PAD in make_distribution.sh to your own choice&lt;br /&gt;
 sudo ./make_distribution.sh&lt;br /&gt;
&lt;br /&gt;
==Problem Solving:==&lt;br /&gt;
 general&lt;br /&gt;
 When encountering issues, first every should be fine without using the Daemon mode.&lt;br /&gt;
 stop the daemon with&lt;br /&gt;
 485solar-get -x&lt;br /&gt;
 be shure there are no alter commands running, so stop all software which is using the same interface, like 123solar, etc.&lt;br /&gt;
 bind address in use&lt;br /&gt;
 If you change the user which 485solar-get (and Daemon) runs, you have to remove the socket file:&lt;br /&gt;
 rm -f /var/tmp/485solar-get_socket&lt;br /&gt;
 debug 485solar-get&lt;br /&gt;
 use the -b option to show debug output:&lt;br /&gt;
 485solar-get -s -b &lt;br /&gt;
 or:&lt;br /&gt;
 485solar-get -b -d -i -e -a -s &lt;br /&gt;
&lt;br /&gt;
 try synchronous detection, by adding the -S option&lt;br /&gt;
 first test Yasdi itself, while 485solar-get is using its library&#039;s&lt;br /&gt;
 yasdishell /etc/yasdi.ini&lt;br /&gt;
 b1&lt;br /&gt;
 when device is detected:&lt;br /&gt;
 z&lt;br /&gt;
 look at the outputs of:&lt;br /&gt;
 d&lt;br /&gt;
 a1&lt;br /&gt;
 p1&lt;br /&gt;
 t1 (probably empty)&lt;br /&gt;
 When the rs485 interface won&#039;t respond, try to zero it:&lt;br /&gt;
 setserial -z /dev/ttyUSB0&lt;br /&gt;
 Get state of rs485 device:&lt;br /&gt;
 setserial -G /dev/ttyUSB0&lt;br /&gt;
 this wil give something like:&lt;br /&gt;
 /dev/ttyUSB0 uart unknown port 0x0000 irq 0 baud_base 24000000 spd_normal low_latency&lt;br /&gt;
 Check baudrate:&lt;br /&gt;
 stty -F /dev/ttyUSB0&lt;br /&gt;
 Set baudrate:&lt;br /&gt;
 stty -F /dev/ttyUSB0 1200&lt;br /&gt;
 cannot open shared object&lt;br /&gt;
 if you get this message after installing the binary version:&lt;br /&gt;
 485solar-get: error while loading shared libraries: libyasdimaster.so.1: cannot open shared object file: No such file or directory&lt;br /&gt;
&lt;br /&gt;
 This means /usr/local/lib is not in the library path.&lt;br /&gt;
 there are 2 solutions:&lt;br /&gt;
&lt;br /&gt;
 setting the path before running, only for this session:&lt;br /&gt;
 export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib&lt;br /&gt;
 Make it permanent:&lt;br /&gt;
 sudo ldconfig /usr/local/lib&lt;br /&gt;
 Debugging and tracing&lt;br /&gt;
 If you can&#039;t get enough data from the -b (debug) option, you can use strace:&lt;br /&gt;
 strace -f -o 485solar-get.strace 485solar-get -d -b&lt;br /&gt;
 All trace info will be written to 485solar-get.strace&lt;br /&gt;
 For monitoring the serial data:&lt;br /&gt;
 strace -s9999 -o 485solar-get.strace -eread,write,ioctl 485solar-get -d -b&lt;br /&gt;
&lt;br /&gt;
==Output Examples:==&lt;br /&gt;
output examples for 485solar-get&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
485solar-get -d (request data)&lt;br /&gt;
 20130712-15:32:55 172.000000 3.107000 534.404000 0.000000 0.000000 0.000000 234.400003 2.083000 488.000000 49.989999 91.364437 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 889.486042 0.000000 OK&lt;br /&gt;
&lt;br /&gt;
485solar-get -d -c (request data in column format)&lt;br /&gt;
 Date 20130712-15:39:04&lt;br /&gt;
 Upv-Ist V 172.000000 &lt;br /&gt;
 Ipv A 3.494000 &lt;br /&gt;
 Pdc 600.968000 &lt;br /&gt;
 dummy 0.000000 &lt;br /&gt;
 dummy 0.000000 &lt;br /&gt;
 dummy 0.000000 &lt;br /&gt;
 Uac V 234.000003 &lt;br /&gt;
 Iac-Ist A 2.346000 &lt;br /&gt;
 Pac W 549.000000 &lt;br /&gt;
 Fac Hz 49.989999 &lt;br /&gt;
 Effcy 91.346629 &lt;br /&gt;
 dummy 0.000000 &lt;br /&gt;
 dummy 0.000000 &lt;br /&gt;
 dummy 0.000000 &lt;br /&gt;
 dummy 0.000000 &lt;br /&gt;
 dummy 0.000000 &lt;br /&gt;
 dummy 0.000000 &lt;br /&gt;
 dummy 0.000000 &lt;br /&gt;
 E-Total kWh 889.537042 &lt;br /&gt;
 dummy 0.000000 &lt;br /&gt;
 State OK&lt;br /&gt;
&lt;br /&gt;
485solar-get -e (events)&lt;br /&gt;
 169.000000 169.000000 0.000000 0.000000 169.000000 0.000000 0.000000 3.000000 233.900003 233.900003 233.900003 49.989999 1200.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 466.000000 0.000000 0.000000 0.000000 0.000000 0.000000 OK&lt;br /&gt;
&lt;br /&gt;
485solar-get -c -e (events in column format)&lt;br /&gt;
 Upv-Ist 172.000000&lt;br /&gt;
 Upv-Ist 172.000000&lt;br /&gt;
 dummy 0.000000&lt;br /&gt;
 dummy 0.000000&lt;br /&gt;
 Upv-Ist 172.000000&lt;br /&gt;
 dummy 0.000000&lt;br /&gt;
 dummy 0.000000&lt;br /&gt;
 Riso 3.000000&lt;br /&gt;
 Uac 234.000003&lt;br /&gt;
 Uac 234.000003&lt;br /&gt;
 Uac 234.000003&lt;br /&gt;
 Fac 49.959999&lt;br /&gt;
 Plimit 1200.000000&lt;br /&gt;
 dummy 0.000000&lt;br /&gt;
 dummy 0.000000&lt;br /&gt;
 dummy 0.000000&lt;br /&gt;
 dummy 0.000000&lt;br /&gt;
 dummy 0.000000&lt;br /&gt;
 dummy 0.000000&lt;br /&gt;
 dummy 0.000000&lt;br /&gt;
 dummy 0.000000&lt;br /&gt;
 dummy 0.000000&lt;br /&gt;
 dummy 0.000000&lt;br /&gt;
 dummy 0.000000&lt;br /&gt;
 dummy 0.000000&lt;br /&gt;
 Pac 582.000000&lt;br /&gt;
 dummy 0.000000&lt;br /&gt;
 dummy 0.000000&lt;br /&gt;
 dummy 0.000000&lt;br /&gt;
 dummy 0.000000&lt;br /&gt;
 dummy 0.000000&lt;br /&gt;
 State OK&lt;br /&gt;
&lt;br /&gt;
485solar-get -i (info)&lt;br /&gt;
 1 WR12-061 SN:2002116358&lt;br /&gt;
 Software-BFR 4.090000 &lt;br /&gt;
 SMA-SN 2002116358.000000 &lt;br /&gt;
 Default 8.000000 BE/C10/11&lt;br /&gt;
 Status Mpp&lt;br /&gt;
 Betriebsart Mpp-Betrieb&lt;br /&gt;
 485solar-get v1.000 daemon: Running&lt;br /&gt;
 485solar-get -a (alarms)&lt;br /&gt;
 Fehler -------&lt;br /&gt;
&lt;br /&gt;
485solar-get -s (possible status fields)&lt;br /&gt;
 All possible status texts for Status:&lt;br /&gt;
 ( 0): &#039;Offset&#039;&lt;br /&gt;
 ( 1): &#039;Stop&#039;&lt;br /&gt;
 ( 2): &#039;Netzueb.&#039;&lt;br /&gt;
 ( 3): &#039;Warten&#039;&lt;br /&gt;
 ( 4): &#039;U-Konst&#039;&lt;br /&gt;
 ( 5): &#039;Turbine&#039;&lt;br /&gt;
 ( 6): &#039;Mpp-Such&#039;&lt;br /&gt;
 ( 7): &#039;Mpp&#039;&lt;br /&gt;
 ( 8): &#039;Stoer.&#039;&lt;br /&gt;
 ( 9): &#039;Fehler&#039;&lt;br /&gt;
 (10): &#039;Mpp-Peak&#039;&lt;br /&gt;
 (11): &#039;Derating&#039;&lt;br /&gt;
 All possible status texts for Fehler:&lt;br /&gt;
 ( 0): &#039;-------&#039;&lt;br /&gt;
 ( 1): &#039;NUW-UAC&#039;&lt;br /&gt;
 ( 2): &#039;NUW-FAC&#039;&lt;br /&gt;
 ( 3): &#039;B3&#039;&lt;br /&gt;
 ( 4): &#039;K1-Trenn&#039;&lt;br /&gt;
 ( 5): &#039;B5&#039;&lt;br /&gt;
 ( 6): &#039;EEPROM dBh&#039;&lt;br /&gt;
 ( 7): &#039;ROM&#039;&lt;br /&gt;
 ( 8): &#039;B8&#039;&lt;br /&gt;
 ( 9): &#039;B9&#039;&lt;br /&gt;
 (10): &#039;B10&#039;&lt;br /&gt;
 (11): &#039;B11&#039;&lt;br /&gt;
 (12): &#039;B12&#039;&lt;br /&gt;
 (13): &#039;EeRestore&#039;&lt;br /&gt;
 (14): &#039;B14&#039;&lt;br /&gt;
 (15): &#039;B15&#039;&lt;br /&gt;
 (16): &#039;B16&#039;&lt;br /&gt;
 (17): &#039;B17&#039;&lt;br /&gt;
 (18): &#039;AC&#039;&lt;br /&gt;
&lt;br /&gt;
==Interface Hardware:==&lt;br /&gt;
The Sunny-Boy&#039;s don&#039;t have an interface from stock, you have to buy the add-on-board for your device from SMA, the 485PB-NR or, 485PB-MS-NR.&amp;lt;br&amp;gt;&lt;br /&gt;
Tip: sometimes you&#039;ll see them on ebay much cheaper.&amp;lt;br&amp;gt;&lt;br /&gt;
For the server or box you can use a USB-RS485-Kabel, I bought one from Conrad, item 975604, very cheap and works out-the-box.&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Before buying, check if your Linux version will work with the serial adapter.&amp;lt;br&amp;gt;&lt;br /&gt;
There are known problemens between Linux kernel 2.6.31 and serial adapters which use the PL2303 chip&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
To connect to the SMA and Aurora, I used a simple cat5 cable, take 1 twisted pair for GND and another for data:&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 Aurora Sunny-Boy  wire                PC&lt;br /&gt;
 GND        5      brown+brown-white   GND&lt;br /&gt;
 r+,w+      2      orange              RS485+&lt;br /&gt;
 r-,w-      7      orange-white        RS485-&lt;br /&gt;
&lt;br /&gt;
Mark 1, if r and w are separate, you can put + together and - together.&amp;lt;br&amp;gt;&lt;br /&gt;
Mark 2, the cable should not in star, but in one line, you can add as many devices you like, but only the devices on both ends can have termination.&amp;lt;br&amp;gt;&lt;br /&gt;
On all devices between, you have to switch termination off.&amp;lt;br&amp;gt;&lt;br /&gt;
on some devices it&#039;s a switch close to the connector, on other devices you should remove resistors from the pcb, it should be explained in the manual.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==USB Devices after system reboot:==&lt;br /&gt;
Using multiple serial USB tty devices&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Serial USB devices are swapped after reboot&amp;lt;br&amp;gt;&lt;br /&gt;
If you use multiple serial USB adapters, it will happen tat they are assigned from /dev/USBtty1 to /dev/USBtty0 after reboot.&amp;lt;br&amp;gt;&lt;br /&gt;
I use a simple script, which is runned before starting 123solar and metern, this will create 2 symlink&#039;s:&amp;lt;br&amp;gt;&lt;br /&gt;
for my smart electricity meter: /dev/ttyUSBp1&amp;lt;br&amp;gt;&lt;br /&gt;
for my solar devices: /dev/ttyUSBsl&amp;lt;br&amp;gt;&lt;br /&gt;
these links I configured in the applications.&amp;lt;br&amp;gt;&lt;br /&gt;
run:&lt;br /&gt;
 dmesg|grep ttyUSB&amp;lt;br&amp;gt;&lt;br /&gt;
and see which strings you can use to see which is which.&amp;lt;br&amp;gt;&lt;br /&gt;
In my case:&lt;br /&gt;
 usb 2-2: pl2303 converter now attached to ttyUSB0&lt;br /&gt;
 usb 3-1: FTDI USB Serial Device converter now attached to ttyUSB1&lt;br /&gt;
&lt;br /&gt;
put this somewhere in your startup script, or in /etc/rc.local:&lt;br /&gt;
 rm -f /dev/ttyUSBp1 /dev/ttyUSBsl&lt;br /&gt;
 P1_DEV=$(dmesg|grep &amp;quot;to ttyUSB&amp;quot;|grep pl2303 |tail -1|awk &#039;{print $NF}&#039;)&lt;br /&gt;
 SL_DEV=$(dmesg|grep &amp;quot;to ttyUSB&amp;quot;|grep FTDI |tail -1|awk &#039;{print $NF}&#039;)&lt;br /&gt;
 ln -s /dev/${P1_DEV} /dev/ttyUSBp1&lt;br /&gt;
 ln -s /dev/${SL_DEV} /dev/ttyUSBsl&lt;/div&gt;</summary>
		<author><name>Roland</name></author>
	</entry>
	<entry>
		<id>http://wiki.breedveld.net/index.php?title=Instructions_and_HOWTO_page&amp;diff=7309</id>
		<title>Instructions and HOWTO page</title>
		<link rel="alternate" type="text/html" href="http://wiki.breedveld.net/index.php?title=Instructions_and_HOWTO_page&amp;diff=7309"/>
		<updated>2025-10-23T14:30:32Z</updated>

		<summary type="html">&lt;p&gt;Roland: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[485solar-get]]&lt;br /&gt;
[[Category:485solar-get]]&lt;br /&gt;
&amp;lt;BR&amp;gt;&lt;br /&gt;
Instructions and HOWTO page&lt;br /&gt;
&amp;lt;BR&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Instructions:==&lt;br /&gt;
Command line options for 485solar-get&amp;lt;br&amp;gt;&lt;br /&gt;
485solar-get for 123Solar&amp;lt;br&amp;gt;&lt;br /&gt;
based on libyasdi from SMA Solar Technology ag&amp;lt;br&amp;gt;&lt;br /&gt;
v1.000 2014-09-04 by roland@breedveld.net&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Config file: /etc/yasdi.ini&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Options:&amp;lt;br&amp;gt;&lt;br /&gt;
-h show this help&lt;br /&gt;
-d show data&lt;br /&gt;
-b show debug information, written to errout&lt;br /&gt;
-i show info&lt;br /&gt;
-e show events&lt;br /&gt;
-c show data with comments&lt;br /&gt;
-a show alarms&lt;br /&gt;
-s show possible status fields&lt;br /&gt;
-r show state of Daemon&lt;br /&gt;
-S synchrone detection, default is asynchrone&lt;br /&gt;
-D start 485solar-get as daemon&lt;br /&gt;
-m monitor loop&lt;br /&gt;
-x send exit to daemon&lt;br /&gt;
-n0-9 deviceNr, default -n0&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 485solar-get project: https://sourceforge.net/projects/solarget/&lt;br /&gt;
 123Solar project: https://github.com/jeanmarc77/123solar&lt;br /&gt;
 YASDI software: https://www.sma.de/en/products/apps-software/yasdi&lt;br /&gt;
&lt;br /&gt;
When running 485solar-get as a daemon:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
The client is communicating to the sever by shared memory, actually an IPC-socket, so both should run as the same user.&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
When starting daemon mode always give the highest device_nr in the command, otherwise it only communicates with the first inverter.&amp;lt;br&amp;gt;&lt;br /&gt;
example if using 4 SMA inverters: 485solar-get -D -n3&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
A client process, such as &amp;quot;485solar-get -d&amp;quot;, always looks if a daemon is running, if not, it will communicate directly to the SMA device.&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
The daemon will shutdown when communication to one of the inverters is interrupted.&amp;lt;br&amp;gt;&lt;br /&gt;
This is because the initialization to all invertes should be done again, after one is comming back online again.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Release Notes:==&lt;br /&gt;
v0.91 2012-10-14 beta version&lt;br /&gt;
 initial test version&lt;br /&gt;
&lt;br /&gt;
v0.92 2012-10-15 beta version&lt;br /&gt;
 introduced: -b option&lt;br /&gt;
 this the same as -d (datacollecting) but extended with debug info.&lt;br /&gt;
 debug info is send to stderr&lt;br /&gt;
 Device-scan is now async, with a wait loop after it.&lt;br /&gt;
 This not optimal yet, but it is much faster&lt;br /&gt;
&lt;br /&gt;
v0.93 2012-10-16 beta version&lt;br /&gt;
 max exit in detection waitloop, prevents for endless loop&lt;br /&gt;
&lt;br /&gt;
v0.94 2012-10-21 beta version&lt;br /&gt;
 mutiple inverters (-n)&lt;br /&gt;
 improved debugging options&lt;br /&gt;
 date and events printout with comments (-c)&lt;br /&gt;
 show possible status fields (-s)&lt;br /&gt;
 some minor bigfixes&lt;br /&gt;
&lt;br /&gt;
v0.95 2012-10-24 beta version&lt;br /&gt;
 minor bugfixes&lt;br /&gt;
 include yasdi libs in compiled version&lt;br /&gt;
 install.sh and make_distribution.sh scripts added&lt;br /&gt;
&lt;br /&gt;
v0.972 2012-11-28 beta version&lt;br /&gt;
 Pdc in stead of Pac (bug)&lt;br /&gt;
 possible to do a synchronous call in stead off async.&lt;br /&gt;
 deamon mode, will speed-up requests&lt;br /&gt;
 monitor mode added&lt;br /&gt;
 much more debugging&lt;br /&gt;
 send stop signal to the daemon&lt;br /&gt;
 requesting the daemon state&lt;br /&gt;
&lt;br /&gt;
v0.980 2012-11-29 beta version&lt;br /&gt;
 deamon request for multiple sma inverters&lt;br /&gt;
&lt;br /&gt;
v0.981 2012-12-02 beta version&lt;br /&gt;
 minor bug-fix for 32bit compile&lt;br /&gt;
&lt;br /&gt;
v0.982 2013-02-13 beta version&lt;br /&gt;
 not existing inverter in daemon mode will result as 0, - bugfix for coredump with some SMA models - detection of A or mA, output will be in Amps&lt;br /&gt;
&lt;br /&gt;
v1.000 2014-09-04 version&lt;br /&gt;
 New name, going to production version&lt;br /&gt;
&lt;br /&gt;
==485solar-get Installation:==&lt;br /&gt;
Install 485solar-get&amp;lt;br&amp;gt;&lt;br /&gt;
needed packages: libaio&amp;lt;br&amp;gt;&lt;br /&gt;
for Ubuntu 12.04LTS&amp;lt;br&amp;gt;&lt;br /&gt;
also tested on Ubuntu 10.04LTS&amp;lt;br&amp;gt;&lt;br /&gt;
download the latest compiled 485solar-get &amp;lt;version&amp;gt;_x86_64_Ubuntu_12_04.tgz from this site,&amp;lt;br&amp;gt;&lt;br /&gt;
(or for 32bit systems 485solar-get_&amp;lt;version&amp;gt;_i386_Ubuntu_12_04.tgz)&amp;lt;br&amp;gt;&lt;br /&gt;
place is somewhere like /tmp&amp;lt;br&amp;gt;&lt;br /&gt;
extract it:&lt;br /&gt;
 tar xzvf 485solar-get_&amp;lt;version&amp;gt;_x86_64_Ubuntu_12_04.tgz&lt;br /&gt;
run the install script:&lt;br /&gt;
 sudo ./install.sh&lt;br /&gt;
For other Linux distributions:&amp;lt;br&amp;gt;&lt;br /&gt;
compiling and installing YASDI&amp;lt;br&amp;gt;&lt;br /&gt;
needed packages: gcc cmake libaio&amp;lt;br&amp;gt;&lt;br /&gt;
Download YASDI from the SMA site:&amp;lt;br&amp;gt;&lt;br /&gt;
https://www.sma.de/en/products/apps-software/yasdi&amp;lt;br&amp;gt;&lt;br /&gt;
extract it to /usr/local/src/libyasdi_1_8_1&lt;br /&gt;
 cd /usr/local/src/libyasdi_1_8_1/&lt;br /&gt;
 cd projects/generic-cmake&lt;br /&gt;
 mkdir build-gcc&lt;br /&gt;
 cd build-gcc&lt;br /&gt;
 cmake ..&lt;br /&gt;
 make&lt;br /&gt;
 sudo make install&lt;br /&gt;
 export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib&lt;br /&gt;
 sudo ldconfig /usr/local/lib&lt;br /&gt;
&lt;br /&gt;
test it:&lt;br /&gt;
 yasdishell /etc/yasdi.ini &lt;br /&gt;
&lt;br /&gt;
compiling and installing 485solar-get&amp;lt;br&amp;gt;&lt;br /&gt;
download the latest 485solar-get_&amp;lt;version&amp;gt;_sources.tgz source from this site&amp;lt;br&amp;gt;&lt;br /&gt;
extract it:&lt;br /&gt;
 cd /usr/local/src/libyasdi_1_8_1/&lt;br /&gt;
 tar xzvf &amp;lt;location&amp;gt;/485solar-get_&amp;lt;version&amp;gt;_sources.tgz&lt;br /&gt;
 cd /usr/local/src/libyasdi_1_8_1/sma_485solar-get_&amp;lt;version&amp;gt;&lt;br /&gt;
 sudo ./make.sh&lt;br /&gt;
example for /etc/yasdi.ini&lt;br /&gt;
 [DriverModules]&lt;br /&gt;
 Driver0=yasdi_drv_serial&lt;br /&gt;
 [COM1]&lt;br /&gt;
 Device=/dev/ttyUSB0&lt;br /&gt;
 Media=RS485&lt;br /&gt;
 Baudrate=1200&lt;br /&gt;
 Protocol=SMANet&lt;br /&gt;
 [Misc]&lt;br /&gt;
 DebugOutput=/dev/stderr&lt;br /&gt;
compiling, installing and generating your own distribution&amp;lt;br&amp;gt;&lt;br /&gt;
download the latest 485solar-get_&amp;lt;version&amp;gt;_sources.tgz source from this site&amp;lt;br&amp;gt;&lt;br /&gt;
extract it:&lt;br /&gt;
 cd /usr/local/src/libyasdi_1_8_1/&lt;br /&gt;
 tar xzvf &amp;lt;location&amp;gt;/485solar-get_&amp;lt;version&amp;gt;_sources.tgz&lt;br /&gt;
 cd /usr/local/src/libyasdi_1_8_1/485solar-get_&amp;lt;version&amp;gt;&lt;br /&gt;
change PACKAGE_PAD in make_distribution.sh to your own choice&lt;br /&gt;
 sudo ./make_distribution.sh&lt;br /&gt;
&lt;br /&gt;
==Problem Solving:==&lt;br /&gt;
 general&lt;br /&gt;
 When encountering issues, first every should be fine without using the Daemon mode.&lt;br /&gt;
 stop the daemon with&lt;br /&gt;
 485solar-get -x&lt;br /&gt;
 be shure there are no alter commands running, so stop all software which is using the same interface, like 123solar, etc.&lt;br /&gt;
 bind address in use&lt;br /&gt;
 If you change the user which 485solar-get (and Daemon) runs, you have to remove the socket file:&lt;br /&gt;
 rm -f /var/tmp/485solar-get_socket&lt;br /&gt;
 debug 485solar-get&lt;br /&gt;
 use the -b option to show debug output:&lt;br /&gt;
 485solar-get -s -b &lt;br /&gt;
 or:&lt;br /&gt;
 485solar-get -b -d -i -e -a -s &lt;br /&gt;
&lt;br /&gt;
 try synchronous detection, by adding the -S option&lt;br /&gt;
 first test Yasdi itself, while 485solar-get is using its library&#039;s&lt;br /&gt;
 yasdishell /etc/yasdi.ini&lt;br /&gt;
 b1&lt;br /&gt;
 when device is detected:&lt;br /&gt;
 z&lt;br /&gt;
 look at the outputs of:&lt;br /&gt;
 d&lt;br /&gt;
 a1&lt;br /&gt;
 p1&lt;br /&gt;
 t1 (probably empty)&lt;br /&gt;
 When the rs485 interface won&#039;t respond, try to zero it:&lt;br /&gt;
 setserial -z /dev/ttyUSB0&lt;br /&gt;
 Get state of rs485 device:&lt;br /&gt;
 setserial -G /dev/ttyUSB0&lt;br /&gt;
 this wil give something like:&lt;br /&gt;
 /dev/ttyUSB0 uart unknown port 0x0000 irq 0 baud_base 24000000 spd_normal low_latency&lt;br /&gt;
 Check baudrate:&lt;br /&gt;
 stty -F /dev/ttyUSB0&lt;br /&gt;
 Set baudrate:&lt;br /&gt;
 stty -F /dev/ttyUSB0 1200&lt;br /&gt;
 cannot open shared object&lt;br /&gt;
 if you get this message after installing the binary version:&lt;br /&gt;
 485solar-get: error while loading shared libraries: libyasdimaster.so.1: cannot open shared object file: No such file or directory&lt;br /&gt;
&lt;br /&gt;
 This means /usr/local/lib is not in the library path.&lt;br /&gt;
 there are 2 solutions:&lt;br /&gt;
&lt;br /&gt;
 setting the path before running, only for this session:&lt;br /&gt;
 export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib&lt;br /&gt;
 Make it permanent:&lt;br /&gt;
 sudo ldconfig /usr/local/lib&lt;br /&gt;
 Debugging and tracing&lt;br /&gt;
 If you can&#039;t get enough data from the -b (debug) option, you can use strace:&lt;br /&gt;
 strace -f -o 485solar-get.strace 485solar-get -d -b&lt;br /&gt;
 All trace info will be written to 485solar-get.strace&lt;br /&gt;
 For monitoring the serial data:&lt;br /&gt;
 strace -s9999 -o 485solar-get.strace -eread,write,ioctl 485solar-get -d -b&lt;br /&gt;
&lt;br /&gt;
==Output Examples:==&lt;br /&gt;
output examples for 485solar-get&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
485solar-get -d (request data)&lt;br /&gt;
 20130712-15:32:55 172.000000 3.107000 534.404000 0.000000 0.000000 0.000000 234.400003 2.083000 488.000000 49.989999 91.364437 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 889.486042 0.000000 OK&lt;br /&gt;
&lt;br /&gt;
485solar-get -d -c (request data in column format)&lt;br /&gt;
 Date 20130712-15:39:04&lt;br /&gt;
 Upv-Ist V 172.000000 &lt;br /&gt;
 Ipv A 3.494000 &lt;br /&gt;
 Pdc 600.968000 &lt;br /&gt;
 dummy 0.000000 &lt;br /&gt;
 dummy 0.000000 &lt;br /&gt;
 dummy 0.000000 &lt;br /&gt;
 Uac V 234.000003 &lt;br /&gt;
 Iac-Ist A 2.346000 &lt;br /&gt;
 Pac W 549.000000 &lt;br /&gt;
 Fac Hz 49.989999 &lt;br /&gt;
 Effcy 91.346629 &lt;br /&gt;
 dummy 0.000000 &lt;br /&gt;
 dummy 0.000000 &lt;br /&gt;
 dummy 0.000000 &lt;br /&gt;
 dummy 0.000000 &lt;br /&gt;
 dummy 0.000000 &lt;br /&gt;
 dummy 0.000000 &lt;br /&gt;
 dummy 0.000000 &lt;br /&gt;
 E-Total kWh 889.537042 &lt;br /&gt;
 dummy 0.000000 &lt;br /&gt;
 State OK&lt;br /&gt;
&lt;br /&gt;
485solar-get -e (events)&lt;br /&gt;
 169.000000 169.000000 0.000000 0.000000 169.000000 0.000000 0.000000 3.000000 233.900003 233.900003 233.900003 49.989999 1200.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 466.000000 0.000000 0.000000 0.000000 0.000000 0.000000 OK&lt;br /&gt;
&lt;br /&gt;
485solar-get -c -e (events in column format)&lt;br /&gt;
 Upv-Ist 172.000000&lt;br /&gt;
 Upv-Ist 172.000000&lt;br /&gt;
 dummy 0.000000&lt;br /&gt;
 dummy 0.000000&lt;br /&gt;
 Upv-Ist 172.000000&lt;br /&gt;
 dummy 0.000000&lt;br /&gt;
 dummy 0.000000&lt;br /&gt;
 Riso 3.000000&lt;br /&gt;
 Uac 234.000003&lt;br /&gt;
 Uac 234.000003&lt;br /&gt;
 Uac 234.000003&lt;br /&gt;
 Fac 49.959999&lt;br /&gt;
 Plimit 1200.000000&lt;br /&gt;
 dummy 0.000000&lt;br /&gt;
 dummy 0.000000&lt;br /&gt;
 dummy 0.000000&lt;br /&gt;
 dummy 0.000000&lt;br /&gt;
 dummy 0.000000&lt;br /&gt;
 dummy 0.000000&lt;br /&gt;
 dummy 0.000000&lt;br /&gt;
 dummy 0.000000&lt;br /&gt;
 dummy 0.000000&lt;br /&gt;
 dummy 0.000000&lt;br /&gt;
 dummy 0.000000&lt;br /&gt;
 dummy 0.000000&lt;br /&gt;
 Pac 582.000000&lt;br /&gt;
 dummy 0.000000&lt;br /&gt;
 dummy 0.000000&lt;br /&gt;
 dummy 0.000000&lt;br /&gt;
 dummy 0.000000&lt;br /&gt;
 dummy 0.000000&lt;br /&gt;
 State OK&lt;br /&gt;
&lt;br /&gt;
485solar-get -i (info)&lt;br /&gt;
 1 WR12-061 SN:2002116358&lt;br /&gt;
 Software-BFR 4.090000 &lt;br /&gt;
 SMA-SN 2002116358.000000 &lt;br /&gt;
 Default 8.000000 BE/C10/11&lt;br /&gt;
 Status Mpp&lt;br /&gt;
 Betriebsart Mpp-Betrieb&lt;br /&gt;
 485solar-get v1.000 daemon: Running&lt;br /&gt;
 485solar-get -a (alarms)&lt;br /&gt;
 Fehler -------&lt;br /&gt;
&lt;br /&gt;
485solar-get -s (possible status fields)&lt;br /&gt;
 All possible status texts for Status:&lt;br /&gt;
 ( 0): &#039;Offset&#039;&lt;br /&gt;
 ( 1): &#039;Stop&#039;&lt;br /&gt;
 ( 2): &#039;Netzueb.&#039;&lt;br /&gt;
 ( 3): &#039;Warten&#039;&lt;br /&gt;
 ( 4): &#039;U-Konst&#039;&lt;br /&gt;
 ( 5): &#039;Turbine&#039;&lt;br /&gt;
 ( 6): &#039;Mpp-Such&#039;&lt;br /&gt;
 ( 7): &#039;Mpp&#039;&lt;br /&gt;
 ( 8): &#039;Stoer.&#039;&lt;br /&gt;
 ( 9): &#039;Fehler&#039;&lt;br /&gt;
 (10): &#039;Mpp-Peak&#039;&lt;br /&gt;
 (11): &#039;Derating&#039;&lt;br /&gt;
 All possible status texts for Fehler:&lt;br /&gt;
 ( 0): &#039;-------&#039;&lt;br /&gt;
 ( 1): &#039;NUW-UAC&#039;&lt;br /&gt;
 ( 2): &#039;NUW-FAC&#039;&lt;br /&gt;
 ( 3): &#039;B3&#039;&lt;br /&gt;
 ( 4): &#039;K1-Trenn&#039;&lt;br /&gt;
 ( 5): &#039;B5&#039;&lt;br /&gt;
 ( 6): &#039;EEPROM dBh&#039;&lt;br /&gt;
 ( 7): &#039;ROM&#039;&lt;br /&gt;
 ( 8): &#039;B8&#039;&lt;br /&gt;
 ( 9): &#039;B9&#039;&lt;br /&gt;
 (10): &#039;B10&#039;&lt;br /&gt;
 (11): &#039;B11&#039;&lt;br /&gt;
 (12): &#039;B12&#039;&lt;br /&gt;
 (13): &#039;EeRestore&#039;&lt;br /&gt;
 (14): &#039;B14&#039;&lt;br /&gt;
 (15): &#039;B15&#039;&lt;br /&gt;
 (16): &#039;B16&#039;&lt;br /&gt;
 (17): &#039;B17&#039;&lt;br /&gt;
 (18): &#039;AC&#039;&lt;br /&gt;
&lt;br /&gt;
==Interface Hardware:==&lt;br /&gt;
The Sunny-Boy&#039;s don&#039;t have an interface from stock, you have to buy the add-on-board for your device from SMA, the 485PB-NR or, 485PB-MS-NR.&amp;lt;br&amp;gt;&lt;br /&gt;
Tip: sometimes you&#039;ll see them on ebay much cheaper.&amp;lt;br&amp;gt;&lt;br /&gt;
For the server or box you can use a USB-RS485-Kabel, I bought one from Conrad, item 975604, very cheap and works out-the-box.&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Before buying, check if your Linux version will work with the serial adapter.&amp;lt;br&amp;gt;&lt;br /&gt;
There are known problemens between Linux kernel 2.6.31 and serial adapters which use the PL2303 chip&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
To connect to the SMA and Aurora, I used a simple cat5 cable, take 1 twisted pair for GND and another for data:&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 Aurora Sunny-Boy  wire                PC&lt;br /&gt;
 GND        5      brown+brown-white   GND&lt;br /&gt;
 r+,w+      2      orange              RS485+&lt;br /&gt;
 r-,w-      7      orange-white        RS485-&lt;br /&gt;
&lt;br /&gt;
Mark 1, if r and w are separate, you can put + together and - together.&amp;lt;br&amp;gt;&lt;br /&gt;
Mark 2, the cable should not in star, but in one line, you can add as many devices you like, but only the devices on both ends can have termination.&amp;lt;br&amp;gt;&lt;br /&gt;
On all devices between, you have to switch termination off.&amp;lt;br&amp;gt;&lt;br /&gt;
on some devices it&#039;s a switch close to the connector, on other devices you should remove resistors from the pcb, it should be explained in the manual.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==USB Devices after system reboot:==&lt;br /&gt;
Using multiple serial USB tty devices&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Serial USB devices are swapped after reboot&amp;lt;br&amp;gt;&lt;br /&gt;
If you use multiple serial USB adapters, it will happen tat they are assigned from /dev/USBtty1 to /dev/USBtty0 after reboot.&amp;lt;br&amp;gt;&lt;br /&gt;
I use a simple script, which is runned before starting 123solar and metern, this will create 2 symlink&#039;s:&amp;lt;br&amp;gt;&lt;br /&gt;
for my smart electricity meter: /dev/ttyUSBp1&amp;lt;br&amp;gt;&lt;br /&gt;
for my solar devices: /dev/ttyUSBsl&amp;lt;br&amp;gt;&lt;br /&gt;
these links I configured in the applications.&amp;lt;br&amp;gt;&lt;br /&gt;
run:&lt;br /&gt;
 dmesg|grep ttyUSB&amp;lt;br&amp;gt;&lt;br /&gt;
and see which strings you can use to see which is which.&amp;lt;br&amp;gt;&lt;br /&gt;
In my case:&lt;br /&gt;
 usb 2-2: pl2303 converter now attached to ttyUSB0&lt;br /&gt;
 usb 3-1: FTDI USB Serial Device converter now attached to ttyUSB1&lt;br /&gt;
&lt;br /&gt;
put this somewhere in your startup script, or in /etc/rc.local:&lt;br /&gt;
 rm -f /dev/ttyUSBp1 /dev/ttyUSBsl&lt;br /&gt;
 P1_DEV=$(dmesg|grep &amp;quot;to ttyUSB&amp;quot;|grep pl2303 |tail -1|awk &#039;{print $NF}&#039;)&lt;br /&gt;
 SL_DEV=$(dmesg|grep &amp;quot;to ttyUSB&amp;quot;|grep FTDI |tail -1|awk &#039;{print $NF}&#039;)&lt;br /&gt;
 ln -s /dev/${P1_DEV} /dev/ttyUSBp1&lt;br /&gt;
 ln -s /dev/${SL_DEV} /dev/ttyUSBsl&lt;/div&gt;</summary>
		<author><name>Roland</name></author>
	</entry>
	<entry>
		<id>http://wiki.breedveld.net/index.php?title=Instructions_and_HOWTO_page&amp;diff=7308</id>
		<title>Instructions and HOWTO page</title>
		<link rel="alternate" type="text/html" href="http://wiki.breedveld.net/index.php?title=Instructions_and_HOWTO_page&amp;diff=7308"/>
		<updated>2025-10-23T14:29:49Z</updated>

		<summary type="html">&lt;p&gt;Roland: /* Instructions: */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[485solar-get]]&lt;br /&gt;
[[Category:485solar-get]]&lt;br /&gt;
&amp;lt;BR&amp;gt;&lt;br /&gt;
Instructions and HOWTO page&lt;br /&gt;
&amp;lt;BR&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Instructions:==&lt;br /&gt;
Command line options for 485solar-get&amp;lt;br&amp;gt;&lt;br /&gt;
485solar-get for 123Solar&amp;lt;br&amp;gt;&lt;br /&gt;
based on libyasdi from SMA Solar Technology ag&amp;lt;br&amp;gt;&lt;br /&gt;
v1.000 2014-09-04 by roland@breedveld.net&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Config file: /etc/yasdi.ini&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Options:&amp;lt;br&amp;gt;&lt;br /&gt;
-h show this help&lt;br /&gt;
-d show data&lt;br /&gt;
-b show debug information, written to errout&lt;br /&gt;
-i show info&lt;br /&gt;
-e show events&lt;br /&gt;
-c show data with comments&lt;br /&gt;
-a show alarms&lt;br /&gt;
-s show possible status fields&lt;br /&gt;
-r show state of Daemon&lt;br /&gt;
-S synchrone detection, default is asynchrone&lt;br /&gt;
-D start 485solar-get as daemon&lt;br /&gt;
-m monitor loop&lt;br /&gt;
-x send exit to daemon&lt;br /&gt;
-n0-9 deviceNr, default -n0&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 485solar-get project: http://code.google.com/p/sma-get&lt;br /&gt;
 123Solar project: https://github.com/jeanmarc77/123solar&lt;br /&gt;
 YASDI software: https://www.sma.de/en/products/apps-software/yasdi&lt;br /&gt;
&lt;br /&gt;
When running 485solar-get as a daemon:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
The client is communicating to the sever by shared memory, actually an IPC-socket, so both should run as the same user.&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
When starting daemon mode always give the highest device_nr in the command, otherwise it only communicates with the first inverter.&amp;lt;br&amp;gt;&lt;br /&gt;
example if using 4 SMA inverters: 485solar-get -D -n3&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
A client process, such as &amp;quot;485solar-get -d&amp;quot;, always looks if a daemon is running, if not, it will communicate directly to the SMA device.&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
The daemon will shutdown when communication to one of the inverters is interrupted.&amp;lt;br&amp;gt;&lt;br /&gt;
This is because the initialization to all invertes should be done again, after one is comming back online again.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Release Notes:==&lt;br /&gt;
v0.91 2012-10-14 beta version&lt;br /&gt;
 initial test version&lt;br /&gt;
&lt;br /&gt;
v0.92 2012-10-15 beta version&lt;br /&gt;
 introduced: -b option&lt;br /&gt;
 this the same as -d (datacollecting) but extended with debug info.&lt;br /&gt;
 debug info is send to stderr&lt;br /&gt;
 Device-scan is now async, with a wait loop after it.&lt;br /&gt;
 This not optimal yet, but it is much faster&lt;br /&gt;
&lt;br /&gt;
v0.93 2012-10-16 beta version&lt;br /&gt;
 max exit in detection waitloop, prevents for endless loop&lt;br /&gt;
&lt;br /&gt;
v0.94 2012-10-21 beta version&lt;br /&gt;
 mutiple inverters (-n)&lt;br /&gt;
 improved debugging options&lt;br /&gt;
 date and events printout with comments (-c)&lt;br /&gt;
 show possible status fields (-s)&lt;br /&gt;
 some minor bigfixes&lt;br /&gt;
&lt;br /&gt;
v0.95 2012-10-24 beta version&lt;br /&gt;
 minor bugfixes&lt;br /&gt;
 include yasdi libs in compiled version&lt;br /&gt;
 install.sh and make_distribution.sh scripts added&lt;br /&gt;
&lt;br /&gt;
v0.972 2012-11-28 beta version&lt;br /&gt;
 Pdc in stead of Pac (bug)&lt;br /&gt;
 possible to do a synchronous call in stead off async.&lt;br /&gt;
 deamon mode, will speed-up requests&lt;br /&gt;
 monitor mode added&lt;br /&gt;
 much more debugging&lt;br /&gt;
 send stop signal to the daemon&lt;br /&gt;
 requesting the daemon state&lt;br /&gt;
&lt;br /&gt;
v0.980 2012-11-29 beta version&lt;br /&gt;
 deamon request for multiple sma inverters&lt;br /&gt;
&lt;br /&gt;
v0.981 2012-12-02 beta version&lt;br /&gt;
 minor bug-fix for 32bit compile&lt;br /&gt;
&lt;br /&gt;
v0.982 2013-02-13 beta version&lt;br /&gt;
 not existing inverter in daemon mode will result as 0, - bugfix for coredump with some SMA models - detection of A or mA, output will be in Amps&lt;br /&gt;
&lt;br /&gt;
v1.000 2014-09-04 version&lt;br /&gt;
 New name, going to production version&lt;br /&gt;
&lt;br /&gt;
==485solar-get Installation:==&lt;br /&gt;
Install 485solar-get&amp;lt;br&amp;gt;&lt;br /&gt;
needed packages: libaio&amp;lt;br&amp;gt;&lt;br /&gt;
for Ubuntu 12.04LTS&amp;lt;br&amp;gt;&lt;br /&gt;
also tested on Ubuntu 10.04LTS&amp;lt;br&amp;gt;&lt;br /&gt;
download the latest compiled 485solar-get &amp;lt;version&amp;gt;_x86_64_Ubuntu_12_04.tgz from this site,&amp;lt;br&amp;gt;&lt;br /&gt;
(or for 32bit systems 485solar-get_&amp;lt;version&amp;gt;_i386_Ubuntu_12_04.tgz)&amp;lt;br&amp;gt;&lt;br /&gt;
place is somewhere like /tmp&amp;lt;br&amp;gt;&lt;br /&gt;
extract it:&lt;br /&gt;
 tar xzvf 485solar-get_&amp;lt;version&amp;gt;_x86_64_Ubuntu_12_04.tgz&lt;br /&gt;
run the install script:&lt;br /&gt;
 sudo ./install.sh&lt;br /&gt;
For other Linux distributions:&amp;lt;br&amp;gt;&lt;br /&gt;
compiling and installing YASDI&amp;lt;br&amp;gt;&lt;br /&gt;
needed packages: gcc cmake libaio&amp;lt;br&amp;gt;&lt;br /&gt;
Download YASDI from the SMA site:&amp;lt;br&amp;gt;&lt;br /&gt;
https://www.sma.de/en/products/apps-software/yasdi&amp;lt;br&amp;gt;&lt;br /&gt;
extract it to /usr/local/src/libyasdi_1_8_1&lt;br /&gt;
 cd /usr/local/src/libyasdi_1_8_1/&lt;br /&gt;
 cd projects/generic-cmake&lt;br /&gt;
 mkdir build-gcc&lt;br /&gt;
 cd build-gcc&lt;br /&gt;
 cmake ..&lt;br /&gt;
 make&lt;br /&gt;
 sudo make install&lt;br /&gt;
 export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib&lt;br /&gt;
 sudo ldconfig /usr/local/lib&lt;br /&gt;
&lt;br /&gt;
test it:&lt;br /&gt;
 yasdishell /etc/yasdi.ini &lt;br /&gt;
&lt;br /&gt;
compiling and installing 485solar-get&amp;lt;br&amp;gt;&lt;br /&gt;
download the latest 485solar-get_&amp;lt;version&amp;gt;_sources.tgz source from this site&amp;lt;br&amp;gt;&lt;br /&gt;
extract it:&lt;br /&gt;
 cd /usr/local/src/libyasdi_1_8_1/&lt;br /&gt;
 tar xzvf &amp;lt;location&amp;gt;/485solar-get_&amp;lt;version&amp;gt;_sources.tgz&lt;br /&gt;
 cd /usr/local/src/libyasdi_1_8_1/sma_485solar-get_&amp;lt;version&amp;gt;&lt;br /&gt;
 sudo ./make.sh&lt;br /&gt;
example for /etc/yasdi.ini&lt;br /&gt;
 [DriverModules]&lt;br /&gt;
 Driver0=yasdi_drv_serial&lt;br /&gt;
 [COM1]&lt;br /&gt;
 Device=/dev/ttyUSB0&lt;br /&gt;
 Media=RS485&lt;br /&gt;
 Baudrate=1200&lt;br /&gt;
 Protocol=SMANet&lt;br /&gt;
 [Misc]&lt;br /&gt;
 DebugOutput=/dev/stderr&lt;br /&gt;
compiling, installing and generating your own distribution&amp;lt;br&amp;gt;&lt;br /&gt;
download the latest 485solar-get_&amp;lt;version&amp;gt;_sources.tgz source from this site&amp;lt;br&amp;gt;&lt;br /&gt;
extract it:&lt;br /&gt;
 cd /usr/local/src/libyasdi_1_8_1/&lt;br /&gt;
 tar xzvf &amp;lt;location&amp;gt;/485solar-get_&amp;lt;version&amp;gt;_sources.tgz&lt;br /&gt;
 cd /usr/local/src/libyasdi_1_8_1/485solar-get_&amp;lt;version&amp;gt;&lt;br /&gt;
change PACKAGE_PAD in make_distribution.sh to your own choice&lt;br /&gt;
 sudo ./make_distribution.sh&lt;br /&gt;
&lt;br /&gt;
==Problem Solving:==&lt;br /&gt;
 general&lt;br /&gt;
 When encountering issues, first every should be fine without using the Daemon mode.&lt;br /&gt;
 stop the daemon with&lt;br /&gt;
 485solar-get -x&lt;br /&gt;
 be shure there are no alter commands running, so stop all software which is using the same interface, like 123solar, etc.&lt;br /&gt;
 bind address in use&lt;br /&gt;
 If you change the user which 485solar-get (and Daemon) runs, you have to remove the socket file:&lt;br /&gt;
 rm -f /var/tmp/485solar-get_socket&lt;br /&gt;
 debug 485solar-get&lt;br /&gt;
 use the -b option to show debug output:&lt;br /&gt;
 485solar-get -s -b &lt;br /&gt;
 or:&lt;br /&gt;
 485solar-get -b -d -i -e -a -s &lt;br /&gt;
&lt;br /&gt;
 try synchronous detection, by adding the -S option&lt;br /&gt;
 first test Yasdi itself, while 485solar-get is using its library&#039;s&lt;br /&gt;
 yasdishell /etc/yasdi.ini&lt;br /&gt;
 b1&lt;br /&gt;
 when device is detected:&lt;br /&gt;
 z&lt;br /&gt;
 look at the outputs of:&lt;br /&gt;
 d&lt;br /&gt;
 a1&lt;br /&gt;
 p1&lt;br /&gt;
 t1 (probably empty)&lt;br /&gt;
 When the rs485 interface won&#039;t respond, try to zero it:&lt;br /&gt;
 setserial -z /dev/ttyUSB0&lt;br /&gt;
 Get state of rs485 device:&lt;br /&gt;
 setserial -G /dev/ttyUSB0&lt;br /&gt;
 this wil give something like:&lt;br /&gt;
 /dev/ttyUSB0 uart unknown port 0x0000 irq 0 baud_base 24000000 spd_normal low_latency&lt;br /&gt;
 Check baudrate:&lt;br /&gt;
 stty -F /dev/ttyUSB0&lt;br /&gt;
 Set baudrate:&lt;br /&gt;
 stty -F /dev/ttyUSB0 1200&lt;br /&gt;
 cannot open shared object&lt;br /&gt;
 if you get this message after installing the binary version:&lt;br /&gt;
 485solar-get: error while loading shared libraries: libyasdimaster.so.1: cannot open shared object file: No such file or directory&lt;br /&gt;
&lt;br /&gt;
 This means /usr/local/lib is not in the library path.&lt;br /&gt;
 there are 2 solutions:&lt;br /&gt;
&lt;br /&gt;
 setting the path before running, only for this session:&lt;br /&gt;
 export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib&lt;br /&gt;
 Make it permanent:&lt;br /&gt;
 sudo ldconfig /usr/local/lib&lt;br /&gt;
 Debugging and tracing&lt;br /&gt;
 If you can&#039;t get enough data from the -b (debug) option, you can use strace:&lt;br /&gt;
 strace -f -o 485solar-get.strace 485solar-get -d -b&lt;br /&gt;
 All trace info will be written to 485solar-get.strace&lt;br /&gt;
 For monitoring the serial data:&lt;br /&gt;
 strace -s9999 -o 485solar-get.strace -eread,write,ioctl 485solar-get -d -b&lt;br /&gt;
&lt;br /&gt;
==Output Examples:==&lt;br /&gt;
output examples for 485solar-get&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
485solar-get -d (request data)&lt;br /&gt;
 20130712-15:32:55 172.000000 3.107000 534.404000 0.000000 0.000000 0.000000 234.400003 2.083000 488.000000 49.989999 91.364437 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 889.486042 0.000000 OK&lt;br /&gt;
&lt;br /&gt;
485solar-get -d -c (request data in column format)&lt;br /&gt;
 Date 20130712-15:39:04&lt;br /&gt;
 Upv-Ist V 172.000000 &lt;br /&gt;
 Ipv A 3.494000 &lt;br /&gt;
 Pdc 600.968000 &lt;br /&gt;
 dummy 0.000000 &lt;br /&gt;
 dummy 0.000000 &lt;br /&gt;
 dummy 0.000000 &lt;br /&gt;
 Uac V 234.000003 &lt;br /&gt;
 Iac-Ist A 2.346000 &lt;br /&gt;
 Pac W 549.000000 &lt;br /&gt;
 Fac Hz 49.989999 &lt;br /&gt;
 Effcy 91.346629 &lt;br /&gt;
 dummy 0.000000 &lt;br /&gt;
 dummy 0.000000 &lt;br /&gt;
 dummy 0.000000 &lt;br /&gt;
 dummy 0.000000 &lt;br /&gt;
 dummy 0.000000 &lt;br /&gt;
 dummy 0.000000 &lt;br /&gt;
 dummy 0.000000 &lt;br /&gt;
 E-Total kWh 889.537042 &lt;br /&gt;
 dummy 0.000000 &lt;br /&gt;
 State OK&lt;br /&gt;
&lt;br /&gt;
485solar-get -e (events)&lt;br /&gt;
 169.000000 169.000000 0.000000 0.000000 169.000000 0.000000 0.000000 3.000000 233.900003 233.900003 233.900003 49.989999 1200.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 466.000000 0.000000 0.000000 0.000000 0.000000 0.000000 OK&lt;br /&gt;
&lt;br /&gt;
485solar-get -c -e (events in column format)&lt;br /&gt;
 Upv-Ist 172.000000&lt;br /&gt;
 Upv-Ist 172.000000&lt;br /&gt;
 dummy 0.000000&lt;br /&gt;
 dummy 0.000000&lt;br /&gt;
 Upv-Ist 172.000000&lt;br /&gt;
 dummy 0.000000&lt;br /&gt;
 dummy 0.000000&lt;br /&gt;
 Riso 3.000000&lt;br /&gt;
 Uac 234.000003&lt;br /&gt;
 Uac 234.000003&lt;br /&gt;
 Uac 234.000003&lt;br /&gt;
 Fac 49.959999&lt;br /&gt;
 Plimit 1200.000000&lt;br /&gt;
 dummy 0.000000&lt;br /&gt;
 dummy 0.000000&lt;br /&gt;
 dummy 0.000000&lt;br /&gt;
 dummy 0.000000&lt;br /&gt;
 dummy 0.000000&lt;br /&gt;
 dummy 0.000000&lt;br /&gt;
 dummy 0.000000&lt;br /&gt;
 dummy 0.000000&lt;br /&gt;
 dummy 0.000000&lt;br /&gt;
 dummy 0.000000&lt;br /&gt;
 dummy 0.000000&lt;br /&gt;
 dummy 0.000000&lt;br /&gt;
 Pac 582.000000&lt;br /&gt;
 dummy 0.000000&lt;br /&gt;
 dummy 0.000000&lt;br /&gt;
 dummy 0.000000&lt;br /&gt;
 dummy 0.000000&lt;br /&gt;
 dummy 0.000000&lt;br /&gt;
 State OK&lt;br /&gt;
&lt;br /&gt;
485solar-get -i (info)&lt;br /&gt;
 1 WR12-061 SN:2002116358&lt;br /&gt;
 Software-BFR 4.090000 &lt;br /&gt;
 SMA-SN 2002116358.000000 &lt;br /&gt;
 Default 8.000000 BE/C10/11&lt;br /&gt;
 Status Mpp&lt;br /&gt;
 Betriebsart Mpp-Betrieb&lt;br /&gt;
 485solar-get v1.000 daemon: Running&lt;br /&gt;
 485solar-get -a (alarms)&lt;br /&gt;
 Fehler -------&lt;br /&gt;
&lt;br /&gt;
485solar-get -s (possible status fields)&lt;br /&gt;
 All possible status texts for Status:&lt;br /&gt;
 ( 0): &#039;Offset&#039;&lt;br /&gt;
 ( 1): &#039;Stop&#039;&lt;br /&gt;
 ( 2): &#039;Netzueb.&#039;&lt;br /&gt;
 ( 3): &#039;Warten&#039;&lt;br /&gt;
 ( 4): &#039;U-Konst&#039;&lt;br /&gt;
 ( 5): &#039;Turbine&#039;&lt;br /&gt;
 ( 6): &#039;Mpp-Such&#039;&lt;br /&gt;
 ( 7): &#039;Mpp&#039;&lt;br /&gt;
 ( 8): &#039;Stoer.&#039;&lt;br /&gt;
 ( 9): &#039;Fehler&#039;&lt;br /&gt;
 (10): &#039;Mpp-Peak&#039;&lt;br /&gt;
 (11): &#039;Derating&#039;&lt;br /&gt;
 All possible status texts for Fehler:&lt;br /&gt;
 ( 0): &#039;-------&#039;&lt;br /&gt;
 ( 1): &#039;NUW-UAC&#039;&lt;br /&gt;
 ( 2): &#039;NUW-FAC&#039;&lt;br /&gt;
 ( 3): &#039;B3&#039;&lt;br /&gt;
 ( 4): &#039;K1-Trenn&#039;&lt;br /&gt;
 ( 5): &#039;B5&#039;&lt;br /&gt;
 ( 6): &#039;EEPROM dBh&#039;&lt;br /&gt;
 ( 7): &#039;ROM&#039;&lt;br /&gt;
 ( 8): &#039;B8&#039;&lt;br /&gt;
 ( 9): &#039;B9&#039;&lt;br /&gt;
 (10): &#039;B10&#039;&lt;br /&gt;
 (11): &#039;B11&#039;&lt;br /&gt;
 (12): &#039;B12&#039;&lt;br /&gt;
 (13): &#039;EeRestore&#039;&lt;br /&gt;
 (14): &#039;B14&#039;&lt;br /&gt;
 (15): &#039;B15&#039;&lt;br /&gt;
 (16): &#039;B16&#039;&lt;br /&gt;
 (17): &#039;B17&#039;&lt;br /&gt;
 (18): &#039;AC&#039;&lt;br /&gt;
&lt;br /&gt;
==Interface Hardware:==&lt;br /&gt;
The Sunny-Boy&#039;s don&#039;t have an interface from stock, you have to buy the add-on-board for your device from SMA, the 485PB-NR or, 485PB-MS-NR.&amp;lt;br&amp;gt;&lt;br /&gt;
Tip: sometimes you&#039;ll see them on ebay much cheaper.&amp;lt;br&amp;gt;&lt;br /&gt;
For the server or box you can use a USB-RS485-Kabel, I bought one from Conrad, item 975604, very cheap and works out-the-box.&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Before buying, check if your Linux version will work with the serial adapter.&amp;lt;br&amp;gt;&lt;br /&gt;
There are known problemens between Linux kernel 2.6.31 and serial adapters which use the PL2303 chip&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
To connect to the SMA and Aurora, I used a simple cat5 cable, take 1 twisted pair for GND and another for data:&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 Aurora Sunny-Boy  wire                PC&lt;br /&gt;
 GND        5      brown+brown-white   GND&lt;br /&gt;
 r+,w+      2      orange              RS485+&lt;br /&gt;
 r-,w-      7      orange-white        RS485-&lt;br /&gt;
&lt;br /&gt;
Mark 1, if r and w are separate, you can put + together and - together.&amp;lt;br&amp;gt;&lt;br /&gt;
Mark 2, the cable should not in star, but in one line, you can add as many devices you like, but only the devices on both ends can have termination.&amp;lt;br&amp;gt;&lt;br /&gt;
On all devices between, you have to switch termination off.&amp;lt;br&amp;gt;&lt;br /&gt;
on some devices it&#039;s a switch close to the connector, on other devices you should remove resistors from the pcb, it should be explained in the manual.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==USB Devices after system reboot:==&lt;br /&gt;
Using multiple serial USB tty devices&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Serial USB devices are swapped after reboot&amp;lt;br&amp;gt;&lt;br /&gt;
If you use multiple serial USB adapters, it will happen tat they are assigned from /dev/USBtty1 to /dev/USBtty0 after reboot.&amp;lt;br&amp;gt;&lt;br /&gt;
I use a simple script, which is runned before starting 123solar and metern, this will create 2 symlink&#039;s:&amp;lt;br&amp;gt;&lt;br /&gt;
for my smart electricity meter: /dev/ttyUSBp1&amp;lt;br&amp;gt;&lt;br /&gt;
for my solar devices: /dev/ttyUSBsl&amp;lt;br&amp;gt;&lt;br /&gt;
these links I configured in the applications.&amp;lt;br&amp;gt;&lt;br /&gt;
run:&lt;br /&gt;
 dmesg|grep ttyUSB&amp;lt;br&amp;gt;&lt;br /&gt;
and see which strings you can use to see which is which.&amp;lt;br&amp;gt;&lt;br /&gt;
In my case:&lt;br /&gt;
 usb 2-2: pl2303 converter now attached to ttyUSB0&lt;br /&gt;
 usb 3-1: FTDI USB Serial Device converter now attached to ttyUSB1&lt;br /&gt;
&lt;br /&gt;
put this somewhere in your startup script, or in /etc/rc.local:&lt;br /&gt;
 rm -f /dev/ttyUSBp1 /dev/ttyUSBsl&lt;br /&gt;
 P1_DEV=$(dmesg|grep &amp;quot;to ttyUSB&amp;quot;|grep pl2303 |tail -1|awk &#039;{print $NF}&#039;)&lt;br /&gt;
 SL_DEV=$(dmesg|grep &amp;quot;to ttyUSB&amp;quot;|grep FTDI |tail -1|awk &#039;{print $NF}&#039;)&lt;br /&gt;
 ln -s /dev/${P1_DEV} /dev/ttyUSBp1&lt;br /&gt;
 ln -s /dev/${SL_DEV} /dev/ttyUSBsl&lt;/div&gt;</summary>
		<author><name>Roland</name></author>
	</entry>
	<entry>
		<id>http://wiki.breedveld.net/index.php?title=485solar-get&amp;diff=7307</id>
		<title>485solar-get</title>
		<link rel="alternate" type="text/html" href="http://wiki.breedveld.net/index.php?title=485solar-get&amp;diff=7307"/>
		<updated>2025-10-23T14:28:53Z</updated>

		<summary type="html">&lt;p&gt;Roland: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:485solar-get]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;485solar-get Project&#039;&#039;&#039;&amp;lt;BR&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Important notice: because SMA is a registerd trademark, this project is continued from the sma_get from.&amp;lt;BR&amp;gt;&lt;br /&gt;
&lt;br /&gt;
485solar-get is written in C, it is a datacollector for SMA inverters and is developed to work together with other inverters, communication with different protocols and baudrates, on 1 rs485 interface-bus like Power-one&#039;s.&amp;lt;BR&amp;gt;&lt;br /&gt;
I wrote it for Jean-Marc Louviaux&#039;s [http://www.123solar.org/ 123Solar Project]&amp;lt;BR&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;BR&amp;gt;&lt;br /&gt;
485solar-get is communicating directly with the SMA Sunny-Boy devices.&amp;lt;BR&amp;gt;&lt;br /&gt;
The Sunnyboy&#039;s don&#039;t have an interface from stock, &amp;lt;BR&amp;gt;&lt;br /&gt;
you have to buy the add-on-board for your device from SMA, the 485PB-NR or, 485PB-MS-NR.&amp;lt;BR&amp;gt;&lt;br /&gt;
Tip: sometimes you will find it much cheaper on ebay&amp;lt;BR&amp;gt;&lt;br /&gt;
&amp;lt;BR&amp;gt;&lt;br /&gt;
Example of my configuration, with all used components:&amp;lt;BR&amp;gt;&lt;br /&gt;
http://solar.breedveld.net/images/installation/Connections.jpg&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
sma_get is based on the libyasdi librarys from [http://www.sma.de/en/products/monitoring-control/yasdi.html SMA]&amp;lt;BR&amp;gt;&lt;br /&gt;
&amp;lt;BR&amp;gt;&lt;br /&gt;
485solar-get is output compatible with Curt Blank&#039;s [http://www.curtronics.com/Solar/ aurora command-line tool] so it&#039;s easy to implement in applications which are using this tool.&amp;lt;BR&amp;gt;&lt;br /&gt;
YASDI is written by SMA Solar Technology ag under GNU public licences&amp;lt;BR&amp;gt;&lt;br /&gt;
&amp;lt;BR&amp;gt;&lt;br /&gt;
Version 1.000 is the current release now.&amp;lt;BR&amp;gt;&lt;br /&gt;
&amp;lt;BR&amp;gt;&lt;br /&gt;
Check the wiki pages for instructions and tips.&amp;lt;BR&amp;gt;&lt;br /&gt;
&amp;lt;BR&amp;gt;&lt;br /&gt;
For questions tips and ideas, please post it on the [https://groups.google.com/forum/?fromgroups#!forum/485solar-get 485solar-get Google forum]&amp;lt;BR&amp;gt;&lt;br /&gt;
enjoy!&amp;lt;BR&amp;gt;&lt;br /&gt;
Roland&amp;lt;BR&amp;gt;&lt;br /&gt;
&amp;lt;BR&amp;gt;&lt;br /&gt;
You&#039;ll see both an Aurora and a Sunny-boy running on my [http://solar.breedveld.net/ solar site]&amp;lt;BR&amp;gt;&lt;br /&gt;
&amp;lt;BR&amp;gt;&lt;br /&gt;
Download 485solar-get on: [https://sourceforge.net/projects/solarget/files sourceforge]&amp;lt;BR&amp;gt;&lt;br /&gt;
&amp;lt;BR&amp;gt;&lt;br /&gt;
[[Instructions and HOWTO page]]&amp;lt;BR&amp;gt;&lt;/div&gt;</summary>
		<author><name>Roland</name></author>
	</entry>
	<entry>
		<id>http://wiki.breedveld.net/index.php?title=Instructions_and_HOWTO_page&amp;diff=7306</id>
		<title>Instructions and HOWTO page</title>
		<link rel="alternate" type="text/html" href="http://wiki.breedveld.net/index.php?title=Instructions_and_HOWTO_page&amp;diff=7306"/>
		<updated>2025-10-23T14:10:05Z</updated>

		<summary type="html">&lt;p&gt;Roland: /* 485solar-get Installation: */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[485solar-get]]&lt;br /&gt;
[[Category:485solar-get]]&lt;br /&gt;
&amp;lt;BR&amp;gt;&lt;br /&gt;
Instructions and HOWTO page&lt;br /&gt;
&amp;lt;BR&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Instructions:==&lt;br /&gt;
Command line options for 485solar-get&amp;lt;br&amp;gt;&lt;br /&gt;
485solar-get for 123Solar&amp;lt;br&amp;gt;&lt;br /&gt;
based on libyasdi from SMA Solar Technology ag&amp;lt;br&amp;gt;&lt;br /&gt;
v1.000 2014-09-04 by roland@breedveld.net&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Config file: /etc/yasdi.ini&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Options:&amp;lt;br&amp;gt;&lt;br /&gt;
-h show this help&lt;br /&gt;
-d show data&lt;br /&gt;
-b show debug information, written to errout&lt;br /&gt;
-i show info&lt;br /&gt;
-e show events&lt;br /&gt;
-c show data with comments&lt;br /&gt;
-a show alarms&lt;br /&gt;
-s show possible status fields&lt;br /&gt;
-r show state of Daemon&lt;br /&gt;
-S synchrone detection, default is asynchrone&lt;br /&gt;
-D start 485solar-get as daemon&lt;br /&gt;
-m monitor loop&lt;br /&gt;
-x send exit to daemon&lt;br /&gt;
-n0-9 deviceNr, default -n0&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 485solar-get project: http://code.google.com/p/sma-get&lt;br /&gt;
 123Solar project: http://www.123solar.org&lt;br /&gt;
 YASDI software: https://www.sma.de/en/products/apps-software/yasdi&lt;br /&gt;
&lt;br /&gt;
When running 485solar-get as a daemon:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
The client is communicating to the sever by shared memory, actually an IPC-socket, so both should run as the same user.&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
When starting daemon mode always give the highest device_nr in the command, otherwise it only communicates with the first inverter.&amp;lt;br&amp;gt;&lt;br /&gt;
example if using 4 SMA inverters: 485solar-get -D -n3&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
A client process, such as &amp;quot;485solar-get -d&amp;quot;, always looks if a daemon is running, if not, it will communicate directly to the SMA device.&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
The daemon will shutdown when communication to one of the inverters is interrupted.&amp;lt;br&amp;gt;&lt;br /&gt;
This is because the initialization to all invertes should be done again, after one is comming back online again.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Release Notes:==&lt;br /&gt;
v0.91 2012-10-14 beta version&lt;br /&gt;
 initial test version&lt;br /&gt;
&lt;br /&gt;
v0.92 2012-10-15 beta version&lt;br /&gt;
 introduced: -b option&lt;br /&gt;
 this the same as -d (datacollecting) but extended with debug info.&lt;br /&gt;
 debug info is send to stderr&lt;br /&gt;
 Device-scan is now async, with a wait loop after it.&lt;br /&gt;
 This not optimal yet, but it is much faster&lt;br /&gt;
&lt;br /&gt;
v0.93 2012-10-16 beta version&lt;br /&gt;
 max exit in detection waitloop, prevents for endless loop&lt;br /&gt;
&lt;br /&gt;
v0.94 2012-10-21 beta version&lt;br /&gt;
 mutiple inverters (-n)&lt;br /&gt;
 improved debugging options&lt;br /&gt;
 date and events printout with comments (-c)&lt;br /&gt;
 show possible status fields (-s)&lt;br /&gt;
 some minor bigfixes&lt;br /&gt;
&lt;br /&gt;
v0.95 2012-10-24 beta version&lt;br /&gt;
 minor bugfixes&lt;br /&gt;
 include yasdi libs in compiled version&lt;br /&gt;
 install.sh and make_distribution.sh scripts added&lt;br /&gt;
&lt;br /&gt;
v0.972 2012-11-28 beta version&lt;br /&gt;
 Pdc in stead of Pac (bug)&lt;br /&gt;
 possible to do a synchronous call in stead off async.&lt;br /&gt;
 deamon mode, will speed-up requests&lt;br /&gt;
 monitor mode added&lt;br /&gt;
 much more debugging&lt;br /&gt;
 send stop signal to the daemon&lt;br /&gt;
 requesting the daemon state&lt;br /&gt;
&lt;br /&gt;
v0.980 2012-11-29 beta version&lt;br /&gt;
 deamon request for multiple sma inverters&lt;br /&gt;
&lt;br /&gt;
v0.981 2012-12-02 beta version&lt;br /&gt;
 minor bug-fix for 32bit compile&lt;br /&gt;
&lt;br /&gt;
v0.982 2013-02-13 beta version&lt;br /&gt;
 not existing inverter in daemon mode will result as 0, - bugfix for coredump with some SMA models - detection of A or mA, output will be in Amps&lt;br /&gt;
&lt;br /&gt;
v1.000 2014-09-04 version&lt;br /&gt;
 New name, going to production version&lt;br /&gt;
&lt;br /&gt;
==485solar-get Installation:==&lt;br /&gt;
Install 485solar-get&amp;lt;br&amp;gt;&lt;br /&gt;
needed packages: libaio&amp;lt;br&amp;gt;&lt;br /&gt;
for Ubuntu 12.04LTS&amp;lt;br&amp;gt;&lt;br /&gt;
also tested on Ubuntu 10.04LTS&amp;lt;br&amp;gt;&lt;br /&gt;
download the latest compiled 485solar-get &amp;lt;version&amp;gt;_x86_64_Ubuntu_12_04.tgz from this site,&amp;lt;br&amp;gt;&lt;br /&gt;
(or for 32bit systems 485solar-get_&amp;lt;version&amp;gt;_i386_Ubuntu_12_04.tgz)&amp;lt;br&amp;gt;&lt;br /&gt;
place is somewhere like /tmp&amp;lt;br&amp;gt;&lt;br /&gt;
extract it:&lt;br /&gt;
 tar xzvf 485solar-get_&amp;lt;version&amp;gt;_x86_64_Ubuntu_12_04.tgz&lt;br /&gt;
run the install script:&lt;br /&gt;
 sudo ./install.sh&lt;br /&gt;
For other Linux distributions:&amp;lt;br&amp;gt;&lt;br /&gt;
compiling and installing YASDI&amp;lt;br&amp;gt;&lt;br /&gt;
needed packages: gcc cmake libaio&amp;lt;br&amp;gt;&lt;br /&gt;
Download YASDI from the SMA site:&amp;lt;br&amp;gt;&lt;br /&gt;
https://www.sma.de/en/products/apps-software/yasdi&amp;lt;br&amp;gt;&lt;br /&gt;
extract it to /usr/local/src/libyasdi_1_8_1&lt;br /&gt;
 cd /usr/local/src/libyasdi_1_8_1/&lt;br /&gt;
 cd projects/generic-cmake&lt;br /&gt;
 mkdir build-gcc&lt;br /&gt;
 cd build-gcc&lt;br /&gt;
 cmake ..&lt;br /&gt;
 make&lt;br /&gt;
 sudo make install&lt;br /&gt;
 export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib&lt;br /&gt;
 sudo ldconfig /usr/local/lib&lt;br /&gt;
&lt;br /&gt;
test it:&lt;br /&gt;
 yasdishell /etc/yasdi.ini &lt;br /&gt;
&lt;br /&gt;
compiling and installing 485solar-get&amp;lt;br&amp;gt;&lt;br /&gt;
download the latest 485solar-get_&amp;lt;version&amp;gt;_sources.tgz source from this site&amp;lt;br&amp;gt;&lt;br /&gt;
extract it:&lt;br /&gt;
 cd /usr/local/src/libyasdi_1_8_1/&lt;br /&gt;
 tar xzvf &amp;lt;location&amp;gt;/485solar-get_&amp;lt;version&amp;gt;_sources.tgz&lt;br /&gt;
 cd /usr/local/src/libyasdi_1_8_1/sma_485solar-get_&amp;lt;version&amp;gt;&lt;br /&gt;
 sudo ./make.sh&lt;br /&gt;
example for /etc/yasdi.ini&lt;br /&gt;
 [DriverModules]&lt;br /&gt;
 Driver0=yasdi_drv_serial&lt;br /&gt;
 [COM1]&lt;br /&gt;
 Device=/dev/ttyUSB0&lt;br /&gt;
 Media=RS485&lt;br /&gt;
 Baudrate=1200&lt;br /&gt;
 Protocol=SMANet&lt;br /&gt;
 [Misc]&lt;br /&gt;
 DebugOutput=/dev/stderr&lt;br /&gt;
compiling, installing and generating your own distribution&amp;lt;br&amp;gt;&lt;br /&gt;
download the latest 485solar-get_&amp;lt;version&amp;gt;_sources.tgz source from this site&amp;lt;br&amp;gt;&lt;br /&gt;
extract it:&lt;br /&gt;
 cd /usr/local/src/libyasdi_1_8_1/&lt;br /&gt;
 tar xzvf &amp;lt;location&amp;gt;/485solar-get_&amp;lt;version&amp;gt;_sources.tgz&lt;br /&gt;
 cd /usr/local/src/libyasdi_1_8_1/485solar-get_&amp;lt;version&amp;gt;&lt;br /&gt;
change PACKAGE_PAD in make_distribution.sh to your own choice&lt;br /&gt;
 sudo ./make_distribution.sh&lt;br /&gt;
&lt;br /&gt;
==Problem Solving:==&lt;br /&gt;
 general&lt;br /&gt;
 When encountering issues, first every should be fine without using the Daemon mode.&lt;br /&gt;
 stop the daemon with&lt;br /&gt;
 485solar-get -x&lt;br /&gt;
 be shure there are no alter commands running, so stop all software which is using the same interface, like 123solar, etc.&lt;br /&gt;
 bind address in use&lt;br /&gt;
 If you change the user which 485solar-get (and Daemon) runs, you have to remove the socket file:&lt;br /&gt;
 rm -f /var/tmp/485solar-get_socket&lt;br /&gt;
 debug 485solar-get&lt;br /&gt;
 use the -b option to show debug output:&lt;br /&gt;
 485solar-get -s -b &lt;br /&gt;
 or:&lt;br /&gt;
 485solar-get -b -d -i -e -a -s &lt;br /&gt;
&lt;br /&gt;
 try synchronous detection, by adding the -S option&lt;br /&gt;
 first test Yasdi itself, while 485solar-get is using its library&#039;s&lt;br /&gt;
 yasdishell /etc/yasdi.ini&lt;br /&gt;
 b1&lt;br /&gt;
 when device is detected:&lt;br /&gt;
 z&lt;br /&gt;
 look at the outputs of:&lt;br /&gt;
 d&lt;br /&gt;
 a1&lt;br /&gt;
 p1&lt;br /&gt;
 t1 (probably empty)&lt;br /&gt;
 When the rs485 interface won&#039;t respond, try to zero it:&lt;br /&gt;
 setserial -z /dev/ttyUSB0&lt;br /&gt;
 Get state of rs485 device:&lt;br /&gt;
 setserial -G /dev/ttyUSB0&lt;br /&gt;
 this wil give something like:&lt;br /&gt;
 /dev/ttyUSB0 uart unknown port 0x0000 irq 0 baud_base 24000000 spd_normal low_latency&lt;br /&gt;
 Check baudrate:&lt;br /&gt;
 stty -F /dev/ttyUSB0&lt;br /&gt;
 Set baudrate:&lt;br /&gt;
 stty -F /dev/ttyUSB0 1200&lt;br /&gt;
 cannot open shared object&lt;br /&gt;
 if you get this message after installing the binary version:&lt;br /&gt;
 485solar-get: error while loading shared libraries: libyasdimaster.so.1: cannot open shared object file: No such file or directory&lt;br /&gt;
&lt;br /&gt;
 This means /usr/local/lib is not in the library path.&lt;br /&gt;
 there are 2 solutions:&lt;br /&gt;
&lt;br /&gt;
 setting the path before running, only for this session:&lt;br /&gt;
 export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib&lt;br /&gt;
 Make it permanent:&lt;br /&gt;
 sudo ldconfig /usr/local/lib&lt;br /&gt;
 Debugging and tracing&lt;br /&gt;
 If you can&#039;t get enough data from the -b (debug) option, you can use strace:&lt;br /&gt;
 strace -f -o 485solar-get.strace 485solar-get -d -b&lt;br /&gt;
 All trace info will be written to 485solar-get.strace&lt;br /&gt;
 For monitoring the serial data:&lt;br /&gt;
 strace -s9999 -o 485solar-get.strace -eread,write,ioctl 485solar-get -d -b&lt;br /&gt;
&lt;br /&gt;
==Output Examples:==&lt;br /&gt;
output examples for 485solar-get&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
485solar-get -d (request data)&lt;br /&gt;
 20130712-15:32:55 172.000000 3.107000 534.404000 0.000000 0.000000 0.000000 234.400003 2.083000 488.000000 49.989999 91.364437 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 889.486042 0.000000 OK&lt;br /&gt;
&lt;br /&gt;
485solar-get -d -c (request data in column format)&lt;br /&gt;
 Date 20130712-15:39:04&lt;br /&gt;
 Upv-Ist V 172.000000 &lt;br /&gt;
 Ipv A 3.494000 &lt;br /&gt;
 Pdc 600.968000 &lt;br /&gt;
 dummy 0.000000 &lt;br /&gt;
 dummy 0.000000 &lt;br /&gt;
 dummy 0.000000 &lt;br /&gt;
 Uac V 234.000003 &lt;br /&gt;
 Iac-Ist A 2.346000 &lt;br /&gt;
 Pac W 549.000000 &lt;br /&gt;
 Fac Hz 49.989999 &lt;br /&gt;
 Effcy 91.346629 &lt;br /&gt;
 dummy 0.000000 &lt;br /&gt;
 dummy 0.000000 &lt;br /&gt;
 dummy 0.000000 &lt;br /&gt;
 dummy 0.000000 &lt;br /&gt;
 dummy 0.000000 &lt;br /&gt;
 dummy 0.000000 &lt;br /&gt;
 dummy 0.000000 &lt;br /&gt;
 E-Total kWh 889.537042 &lt;br /&gt;
 dummy 0.000000 &lt;br /&gt;
 State OK&lt;br /&gt;
&lt;br /&gt;
485solar-get -e (events)&lt;br /&gt;
 169.000000 169.000000 0.000000 0.000000 169.000000 0.000000 0.000000 3.000000 233.900003 233.900003 233.900003 49.989999 1200.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 466.000000 0.000000 0.000000 0.000000 0.000000 0.000000 OK&lt;br /&gt;
&lt;br /&gt;
485solar-get -c -e (events in column format)&lt;br /&gt;
 Upv-Ist 172.000000&lt;br /&gt;
 Upv-Ist 172.000000&lt;br /&gt;
 dummy 0.000000&lt;br /&gt;
 dummy 0.000000&lt;br /&gt;
 Upv-Ist 172.000000&lt;br /&gt;
 dummy 0.000000&lt;br /&gt;
 dummy 0.000000&lt;br /&gt;
 Riso 3.000000&lt;br /&gt;
 Uac 234.000003&lt;br /&gt;
 Uac 234.000003&lt;br /&gt;
 Uac 234.000003&lt;br /&gt;
 Fac 49.959999&lt;br /&gt;
 Plimit 1200.000000&lt;br /&gt;
 dummy 0.000000&lt;br /&gt;
 dummy 0.000000&lt;br /&gt;
 dummy 0.000000&lt;br /&gt;
 dummy 0.000000&lt;br /&gt;
 dummy 0.000000&lt;br /&gt;
 dummy 0.000000&lt;br /&gt;
 dummy 0.000000&lt;br /&gt;
 dummy 0.000000&lt;br /&gt;
 dummy 0.000000&lt;br /&gt;
 dummy 0.000000&lt;br /&gt;
 dummy 0.000000&lt;br /&gt;
 dummy 0.000000&lt;br /&gt;
 Pac 582.000000&lt;br /&gt;
 dummy 0.000000&lt;br /&gt;
 dummy 0.000000&lt;br /&gt;
 dummy 0.000000&lt;br /&gt;
 dummy 0.000000&lt;br /&gt;
 dummy 0.000000&lt;br /&gt;
 State OK&lt;br /&gt;
&lt;br /&gt;
485solar-get -i (info)&lt;br /&gt;
 1 WR12-061 SN:2002116358&lt;br /&gt;
 Software-BFR 4.090000 &lt;br /&gt;
 SMA-SN 2002116358.000000 &lt;br /&gt;
 Default 8.000000 BE/C10/11&lt;br /&gt;
 Status Mpp&lt;br /&gt;
 Betriebsart Mpp-Betrieb&lt;br /&gt;
 485solar-get v1.000 daemon: Running&lt;br /&gt;
 485solar-get -a (alarms)&lt;br /&gt;
 Fehler -------&lt;br /&gt;
&lt;br /&gt;
485solar-get -s (possible status fields)&lt;br /&gt;
 All possible status texts for Status:&lt;br /&gt;
 ( 0): &#039;Offset&#039;&lt;br /&gt;
 ( 1): &#039;Stop&#039;&lt;br /&gt;
 ( 2): &#039;Netzueb.&#039;&lt;br /&gt;
 ( 3): &#039;Warten&#039;&lt;br /&gt;
 ( 4): &#039;U-Konst&#039;&lt;br /&gt;
 ( 5): &#039;Turbine&#039;&lt;br /&gt;
 ( 6): &#039;Mpp-Such&#039;&lt;br /&gt;
 ( 7): &#039;Mpp&#039;&lt;br /&gt;
 ( 8): &#039;Stoer.&#039;&lt;br /&gt;
 ( 9): &#039;Fehler&#039;&lt;br /&gt;
 (10): &#039;Mpp-Peak&#039;&lt;br /&gt;
 (11): &#039;Derating&#039;&lt;br /&gt;
 All possible status texts for Fehler:&lt;br /&gt;
 ( 0): &#039;-------&#039;&lt;br /&gt;
 ( 1): &#039;NUW-UAC&#039;&lt;br /&gt;
 ( 2): &#039;NUW-FAC&#039;&lt;br /&gt;
 ( 3): &#039;B3&#039;&lt;br /&gt;
 ( 4): &#039;K1-Trenn&#039;&lt;br /&gt;
 ( 5): &#039;B5&#039;&lt;br /&gt;
 ( 6): &#039;EEPROM dBh&#039;&lt;br /&gt;
 ( 7): &#039;ROM&#039;&lt;br /&gt;
 ( 8): &#039;B8&#039;&lt;br /&gt;
 ( 9): &#039;B9&#039;&lt;br /&gt;
 (10): &#039;B10&#039;&lt;br /&gt;
 (11): &#039;B11&#039;&lt;br /&gt;
 (12): &#039;B12&#039;&lt;br /&gt;
 (13): &#039;EeRestore&#039;&lt;br /&gt;
 (14): &#039;B14&#039;&lt;br /&gt;
 (15): &#039;B15&#039;&lt;br /&gt;
 (16): &#039;B16&#039;&lt;br /&gt;
 (17): &#039;B17&#039;&lt;br /&gt;
 (18): &#039;AC&#039;&lt;br /&gt;
&lt;br /&gt;
==Interface Hardware:==&lt;br /&gt;
The Sunny-Boy&#039;s don&#039;t have an interface from stock, you have to buy the add-on-board for your device from SMA, the 485PB-NR or, 485PB-MS-NR.&amp;lt;br&amp;gt;&lt;br /&gt;
Tip: sometimes you&#039;ll see them on ebay much cheaper.&amp;lt;br&amp;gt;&lt;br /&gt;
For the server or box you can use a USB-RS485-Kabel, I bought one from Conrad, item 975604, very cheap and works out-the-box.&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Before buying, check if your Linux version will work with the serial adapter.&amp;lt;br&amp;gt;&lt;br /&gt;
There are known problemens between Linux kernel 2.6.31 and serial adapters which use the PL2303 chip&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
To connect to the SMA and Aurora, I used a simple cat5 cable, take 1 twisted pair for GND and another for data:&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 Aurora Sunny-Boy  wire                PC&lt;br /&gt;
 GND        5      brown+brown-white   GND&lt;br /&gt;
 r+,w+      2      orange              RS485+&lt;br /&gt;
 r-,w-      7      orange-white        RS485-&lt;br /&gt;
&lt;br /&gt;
Mark 1, if r and w are separate, you can put + together and - together.&amp;lt;br&amp;gt;&lt;br /&gt;
Mark 2, the cable should not in star, but in one line, you can add as many devices you like, but only the devices on both ends can have termination.&amp;lt;br&amp;gt;&lt;br /&gt;
On all devices between, you have to switch termination off.&amp;lt;br&amp;gt;&lt;br /&gt;
on some devices it&#039;s a switch close to the connector, on other devices you should remove resistors from the pcb, it should be explained in the manual.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==USB Devices after system reboot:==&lt;br /&gt;
Using multiple serial USB tty devices&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Serial USB devices are swapped after reboot&amp;lt;br&amp;gt;&lt;br /&gt;
If you use multiple serial USB adapters, it will happen tat they are assigned from /dev/USBtty1 to /dev/USBtty0 after reboot.&amp;lt;br&amp;gt;&lt;br /&gt;
I use a simple script, which is runned before starting 123solar and metern, this will create 2 symlink&#039;s:&amp;lt;br&amp;gt;&lt;br /&gt;
for my smart electricity meter: /dev/ttyUSBp1&amp;lt;br&amp;gt;&lt;br /&gt;
for my solar devices: /dev/ttyUSBsl&amp;lt;br&amp;gt;&lt;br /&gt;
these links I configured in the applications.&amp;lt;br&amp;gt;&lt;br /&gt;
run:&lt;br /&gt;
 dmesg|grep ttyUSB&amp;lt;br&amp;gt;&lt;br /&gt;
and see which strings you can use to see which is which.&amp;lt;br&amp;gt;&lt;br /&gt;
In my case:&lt;br /&gt;
 usb 2-2: pl2303 converter now attached to ttyUSB0&lt;br /&gt;
 usb 3-1: FTDI USB Serial Device converter now attached to ttyUSB1&lt;br /&gt;
&lt;br /&gt;
put this somewhere in your startup script, or in /etc/rc.local:&lt;br /&gt;
 rm -f /dev/ttyUSBp1 /dev/ttyUSBsl&lt;br /&gt;
 P1_DEV=$(dmesg|grep &amp;quot;to ttyUSB&amp;quot;|grep pl2303 |tail -1|awk &#039;{print $NF}&#039;)&lt;br /&gt;
 SL_DEV=$(dmesg|grep &amp;quot;to ttyUSB&amp;quot;|grep FTDI |tail -1|awk &#039;{print $NF}&#039;)&lt;br /&gt;
 ln -s /dev/${P1_DEV} /dev/ttyUSBp1&lt;br /&gt;
 ln -s /dev/${SL_DEV} /dev/ttyUSBsl&lt;/div&gt;</summary>
		<author><name>Roland</name></author>
	</entry>
	<entry>
		<id>http://wiki.breedveld.net/index.php?title=Instructions_and_HOWTO_page&amp;diff=7305</id>
		<title>Instructions and HOWTO page</title>
		<link rel="alternate" type="text/html" href="http://wiki.breedveld.net/index.php?title=Instructions_and_HOWTO_page&amp;diff=7305"/>
		<updated>2025-10-23T14:09:26Z</updated>

		<summary type="html">&lt;p&gt;Roland: /* Instructions: */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[485solar-get]]&lt;br /&gt;
[[Category:485solar-get]]&lt;br /&gt;
&amp;lt;BR&amp;gt;&lt;br /&gt;
Instructions and HOWTO page&lt;br /&gt;
&amp;lt;BR&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Instructions:==&lt;br /&gt;
Command line options for 485solar-get&amp;lt;br&amp;gt;&lt;br /&gt;
485solar-get for 123Solar&amp;lt;br&amp;gt;&lt;br /&gt;
based on libyasdi from SMA Solar Technology ag&amp;lt;br&amp;gt;&lt;br /&gt;
v1.000 2014-09-04 by roland@breedveld.net&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Config file: /etc/yasdi.ini&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Options:&amp;lt;br&amp;gt;&lt;br /&gt;
-h show this help&lt;br /&gt;
-d show data&lt;br /&gt;
-b show debug information, written to errout&lt;br /&gt;
-i show info&lt;br /&gt;
-e show events&lt;br /&gt;
-c show data with comments&lt;br /&gt;
-a show alarms&lt;br /&gt;
-s show possible status fields&lt;br /&gt;
-r show state of Daemon&lt;br /&gt;
-S synchrone detection, default is asynchrone&lt;br /&gt;
-D start 485solar-get as daemon&lt;br /&gt;
-m monitor loop&lt;br /&gt;
-x send exit to daemon&lt;br /&gt;
-n0-9 deviceNr, default -n0&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 485solar-get project: http://code.google.com/p/sma-get&lt;br /&gt;
 123Solar project: http://www.123solar.org&lt;br /&gt;
 YASDI software: https://www.sma.de/en/products/apps-software/yasdi&lt;br /&gt;
&lt;br /&gt;
When running 485solar-get as a daemon:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
The client is communicating to the sever by shared memory, actually an IPC-socket, so both should run as the same user.&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
When starting daemon mode always give the highest device_nr in the command, otherwise it only communicates with the first inverter.&amp;lt;br&amp;gt;&lt;br /&gt;
example if using 4 SMA inverters: 485solar-get -D -n3&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
A client process, such as &amp;quot;485solar-get -d&amp;quot;, always looks if a daemon is running, if not, it will communicate directly to the SMA device.&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
The daemon will shutdown when communication to one of the inverters is interrupted.&amp;lt;br&amp;gt;&lt;br /&gt;
This is because the initialization to all invertes should be done again, after one is comming back online again.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Release Notes:==&lt;br /&gt;
v0.91 2012-10-14 beta version&lt;br /&gt;
 initial test version&lt;br /&gt;
&lt;br /&gt;
v0.92 2012-10-15 beta version&lt;br /&gt;
 introduced: -b option&lt;br /&gt;
 this the same as -d (datacollecting) but extended with debug info.&lt;br /&gt;
 debug info is send to stderr&lt;br /&gt;
 Device-scan is now async, with a wait loop after it.&lt;br /&gt;
 This not optimal yet, but it is much faster&lt;br /&gt;
&lt;br /&gt;
v0.93 2012-10-16 beta version&lt;br /&gt;
 max exit in detection waitloop, prevents for endless loop&lt;br /&gt;
&lt;br /&gt;
v0.94 2012-10-21 beta version&lt;br /&gt;
 mutiple inverters (-n)&lt;br /&gt;
 improved debugging options&lt;br /&gt;
 date and events printout with comments (-c)&lt;br /&gt;
 show possible status fields (-s)&lt;br /&gt;
 some minor bigfixes&lt;br /&gt;
&lt;br /&gt;
v0.95 2012-10-24 beta version&lt;br /&gt;
 minor bugfixes&lt;br /&gt;
 include yasdi libs in compiled version&lt;br /&gt;
 install.sh and make_distribution.sh scripts added&lt;br /&gt;
&lt;br /&gt;
v0.972 2012-11-28 beta version&lt;br /&gt;
 Pdc in stead of Pac (bug)&lt;br /&gt;
 possible to do a synchronous call in stead off async.&lt;br /&gt;
 deamon mode, will speed-up requests&lt;br /&gt;
 monitor mode added&lt;br /&gt;
 much more debugging&lt;br /&gt;
 send stop signal to the daemon&lt;br /&gt;
 requesting the daemon state&lt;br /&gt;
&lt;br /&gt;
v0.980 2012-11-29 beta version&lt;br /&gt;
 deamon request for multiple sma inverters&lt;br /&gt;
&lt;br /&gt;
v0.981 2012-12-02 beta version&lt;br /&gt;
 minor bug-fix for 32bit compile&lt;br /&gt;
&lt;br /&gt;
v0.982 2013-02-13 beta version&lt;br /&gt;
 not existing inverter in daemon mode will result as 0, - bugfix for coredump with some SMA models - detection of A or mA, output will be in Amps&lt;br /&gt;
&lt;br /&gt;
v1.000 2014-09-04 version&lt;br /&gt;
 New name, going to production version&lt;br /&gt;
&lt;br /&gt;
==485solar-get Installation:==&lt;br /&gt;
Install 485solar-get&amp;lt;br&amp;gt;&lt;br /&gt;
needed packages: libaio&amp;lt;br&amp;gt;&lt;br /&gt;
for Ubuntu 12.04LTS&amp;lt;br&amp;gt;&lt;br /&gt;
also tested on Ubuntu 10.04LTS&amp;lt;br&amp;gt;&lt;br /&gt;
download the latest compiled 485solar-get &amp;lt;version&amp;gt;_x86_64_Ubuntu_12_04.tgz from this site,&amp;lt;br&amp;gt;&lt;br /&gt;
(or for 32bit systems 485solar-get_&amp;lt;version&amp;gt;_i386_Ubuntu_12_04.tgz)&amp;lt;br&amp;gt;&lt;br /&gt;
place is somewhere like /tmp&amp;lt;br&amp;gt;&lt;br /&gt;
extract it:&lt;br /&gt;
 tar xzvf 485solar-get_&amp;lt;version&amp;gt;_x86_64_Ubuntu_12_04.tgz&lt;br /&gt;
run the install script:&lt;br /&gt;
 sudo ./install.sh&lt;br /&gt;
For other Linux distributions:&amp;lt;br&amp;gt;&lt;br /&gt;
compiling and installing YASDI&amp;lt;br&amp;gt;&lt;br /&gt;
needed packages: gcc cmake libaio&amp;lt;br&amp;gt;&lt;br /&gt;
Download YASDI from the SMA site:&amp;lt;br&amp;gt;&lt;br /&gt;
http://www.sma.de/en/products/monitoring-systems/yasdi.html&amp;lt;br&amp;gt;&lt;br /&gt;
extract it to /usr/local/src/libyasdi_1_8_1&lt;br /&gt;
 cd /usr/local/src/libyasdi_1_8_1/&lt;br /&gt;
 cd projects/generic-cmake&lt;br /&gt;
 mkdir build-gcc&lt;br /&gt;
 cd build-gcc&lt;br /&gt;
 cmake ..&lt;br /&gt;
 make&lt;br /&gt;
 sudo make install&lt;br /&gt;
 export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib&lt;br /&gt;
 sudo ldconfig /usr/local/lib&lt;br /&gt;
&lt;br /&gt;
test it:&lt;br /&gt;
 yasdishell /etc/yasdi.ini &lt;br /&gt;
&lt;br /&gt;
compiling and installing 485solar-get&amp;lt;br&amp;gt;&lt;br /&gt;
download the latest 485solar-get_&amp;lt;version&amp;gt;_sources.tgz source from this site&amp;lt;br&amp;gt;&lt;br /&gt;
extract it:&lt;br /&gt;
 cd /usr/local/src/libyasdi_1_8_1/&lt;br /&gt;
 tar xzvf &amp;lt;location&amp;gt;/485solar-get_&amp;lt;version&amp;gt;_sources.tgz&lt;br /&gt;
 cd /usr/local/src/libyasdi_1_8_1/sma_485solar-get_&amp;lt;version&amp;gt;&lt;br /&gt;
 sudo ./make.sh&lt;br /&gt;
example for /etc/yasdi.ini&lt;br /&gt;
 [DriverModules]&lt;br /&gt;
 Driver0=yasdi_drv_serial&lt;br /&gt;
 [COM1]&lt;br /&gt;
 Device=/dev/ttyUSB0&lt;br /&gt;
 Media=RS485&lt;br /&gt;
 Baudrate=1200&lt;br /&gt;
 Protocol=SMANet&lt;br /&gt;
 [Misc]&lt;br /&gt;
 DebugOutput=/dev/stderr&lt;br /&gt;
compiling, installing and generating your own distribution&amp;lt;br&amp;gt;&lt;br /&gt;
download the latest 485solar-get_&amp;lt;version&amp;gt;_sources.tgz source from this site&amp;lt;br&amp;gt;&lt;br /&gt;
extract it:&lt;br /&gt;
 cd /usr/local/src/libyasdi_1_8_1/&lt;br /&gt;
 tar xzvf &amp;lt;location&amp;gt;/485solar-get_&amp;lt;version&amp;gt;_sources.tgz&lt;br /&gt;
 cd /usr/local/src/libyasdi_1_8_1/485solar-get_&amp;lt;version&amp;gt;&lt;br /&gt;
change PACKAGE_PAD in make_distribution.sh to your own choice&lt;br /&gt;
 sudo ./make_distribution.sh&lt;br /&gt;
&lt;br /&gt;
==Problem Solving:==&lt;br /&gt;
 general&lt;br /&gt;
 When encountering issues, first every should be fine without using the Daemon mode.&lt;br /&gt;
 stop the daemon with&lt;br /&gt;
 485solar-get -x&lt;br /&gt;
 be shure there are no alter commands running, so stop all software which is using the same interface, like 123solar, etc.&lt;br /&gt;
 bind address in use&lt;br /&gt;
 If you change the user which 485solar-get (and Daemon) runs, you have to remove the socket file:&lt;br /&gt;
 rm -f /var/tmp/485solar-get_socket&lt;br /&gt;
 debug 485solar-get&lt;br /&gt;
 use the -b option to show debug output:&lt;br /&gt;
 485solar-get -s -b &lt;br /&gt;
 or:&lt;br /&gt;
 485solar-get -b -d -i -e -a -s &lt;br /&gt;
&lt;br /&gt;
 try synchronous detection, by adding the -S option&lt;br /&gt;
 first test Yasdi itself, while 485solar-get is using its library&#039;s&lt;br /&gt;
 yasdishell /etc/yasdi.ini&lt;br /&gt;
 b1&lt;br /&gt;
 when device is detected:&lt;br /&gt;
 z&lt;br /&gt;
 look at the outputs of:&lt;br /&gt;
 d&lt;br /&gt;
 a1&lt;br /&gt;
 p1&lt;br /&gt;
 t1 (probably empty)&lt;br /&gt;
 When the rs485 interface won&#039;t respond, try to zero it:&lt;br /&gt;
 setserial -z /dev/ttyUSB0&lt;br /&gt;
 Get state of rs485 device:&lt;br /&gt;
 setserial -G /dev/ttyUSB0&lt;br /&gt;
 this wil give something like:&lt;br /&gt;
 /dev/ttyUSB0 uart unknown port 0x0000 irq 0 baud_base 24000000 spd_normal low_latency&lt;br /&gt;
 Check baudrate:&lt;br /&gt;
 stty -F /dev/ttyUSB0&lt;br /&gt;
 Set baudrate:&lt;br /&gt;
 stty -F /dev/ttyUSB0 1200&lt;br /&gt;
 cannot open shared object&lt;br /&gt;
 if you get this message after installing the binary version:&lt;br /&gt;
 485solar-get: error while loading shared libraries: libyasdimaster.so.1: cannot open shared object file: No such file or directory&lt;br /&gt;
&lt;br /&gt;
 This means /usr/local/lib is not in the library path.&lt;br /&gt;
 there are 2 solutions:&lt;br /&gt;
&lt;br /&gt;
 setting the path before running, only for this session:&lt;br /&gt;
 export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib&lt;br /&gt;
 Make it permanent:&lt;br /&gt;
 sudo ldconfig /usr/local/lib&lt;br /&gt;
 Debugging and tracing&lt;br /&gt;
 If you can&#039;t get enough data from the -b (debug) option, you can use strace:&lt;br /&gt;
 strace -f -o 485solar-get.strace 485solar-get -d -b&lt;br /&gt;
 All trace info will be written to 485solar-get.strace&lt;br /&gt;
 For monitoring the serial data:&lt;br /&gt;
 strace -s9999 -o 485solar-get.strace -eread,write,ioctl 485solar-get -d -b&lt;br /&gt;
&lt;br /&gt;
==Output Examples:==&lt;br /&gt;
output examples for 485solar-get&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
485solar-get -d (request data)&lt;br /&gt;
 20130712-15:32:55 172.000000 3.107000 534.404000 0.000000 0.000000 0.000000 234.400003 2.083000 488.000000 49.989999 91.364437 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 889.486042 0.000000 OK&lt;br /&gt;
&lt;br /&gt;
485solar-get -d -c (request data in column format)&lt;br /&gt;
 Date 20130712-15:39:04&lt;br /&gt;
 Upv-Ist V 172.000000 &lt;br /&gt;
 Ipv A 3.494000 &lt;br /&gt;
 Pdc 600.968000 &lt;br /&gt;
 dummy 0.000000 &lt;br /&gt;
 dummy 0.000000 &lt;br /&gt;
 dummy 0.000000 &lt;br /&gt;
 Uac V 234.000003 &lt;br /&gt;
 Iac-Ist A 2.346000 &lt;br /&gt;
 Pac W 549.000000 &lt;br /&gt;
 Fac Hz 49.989999 &lt;br /&gt;
 Effcy 91.346629 &lt;br /&gt;
 dummy 0.000000 &lt;br /&gt;
 dummy 0.000000 &lt;br /&gt;
 dummy 0.000000 &lt;br /&gt;
 dummy 0.000000 &lt;br /&gt;
 dummy 0.000000 &lt;br /&gt;
 dummy 0.000000 &lt;br /&gt;
 dummy 0.000000 &lt;br /&gt;
 E-Total kWh 889.537042 &lt;br /&gt;
 dummy 0.000000 &lt;br /&gt;
 State OK&lt;br /&gt;
&lt;br /&gt;
485solar-get -e (events)&lt;br /&gt;
 169.000000 169.000000 0.000000 0.000000 169.000000 0.000000 0.000000 3.000000 233.900003 233.900003 233.900003 49.989999 1200.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 466.000000 0.000000 0.000000 0.000000 0.000000 0.000000 OK&lt;br /&gt;
&lt;br /&gt;
485solar-get -c -e (events in column format)&lt;br /&gt;
 Upv-Ist 172.000000&lt;br /&gt;
 Upv-Ist 172.000000&lt;br /&gt;
 dummy 0.000000&lt;br /&gt;
 dummy 0.000000&lt;br /&gt;
 Upv-Ist 172.000000&lt;br /&gt;
 dummy 0.000000&lt;br /&gt;
 dummy 0.000000&lt;br /&gt;
 Riso 3.000000&lt;br /&gt;
 Uac 234.000003&lt;br /&gt;
 Uac 234.000003&lt;br /&gt;
 Uac 234.000003&lt;br /&gt;
 Fac 49.959999&lt;br /&gt;
 Plimit 1200.000000&lt;br /&gt;
 dummy 0.000000&lt;br /&gt;
 dummy 0.000000&lt;br /&gt;
 dummy 0.000000&lt;br /&gt;
 dummy 0.000000&lt;br /&gt;
 dummy 0.000000&lt;br /&gt;
 dummy 0.000000&lt;br /&gt;
 dummy 0.000000&lt;br /&gt;
 dummy 0.000000&lt;br /&gt;
 dummy 0.000000&lt;br /&gt;
 dummy 0.000000&lt;br /&gt;
 dummy 0.000000&lt;br /&gt;
 dummy 0.000000&lt;br /&gt;
 Pac 582.000000&lt;br /&gt;
 dummy 0.000000&lt;br /&gt;
 dummy 0.000000&lt;br /&gt;
 dummy 0.000000&lt;br /&gt;
 dummy 0.000000&lt;br /&gt;
 dummy 0.000000&lt;br /&gt;
 State OK&lt;br /&gt;
&lt;br /&gt;
485solar-get -i (info)&lt;br /&gt;
 1 WR12-061 SN:2002116358&lt;br /&gt;
 Software-BFR 4.090000 &lt;br /&gt;
 SMA-SN 2002116358.000000 &lt;br /&gt;
 Default 8.000000 BE/C10/11&lt;br /&gt;
 Status Mpp&lt;br /&gt;
 Betriebsart Mpp-Betrieb&lt;br /&gt;
 485solar-get v1.000 daemon: Running&lt;br /&gt;
 485solar-get -a (alarms)&lt;br /&gt;
 Fehler -------&lt;br /&gt;
&lt;br /&gt;
485solar-get -s (possible status fields)&lt;br /&gt;
 All possible status texts for Status:&lt;br /&gt;
 ( 0): &#039;Offset&#039;&lt;br /&gt;
 ( 1): &#039;Stop&#039;&lt;br /&gt;
 ( 2): &#039;Netzueb.&#039;&lt;br /&gt;
 ( 3): &#039;Warten&#039;&lt;br /&gt;
 ( 4): &#039;U-Konst&#039;&lt;br /&gt;
 ( 5): &#039;Turbine&#039;&lt;br /&gt;
 ( 6): &#039;Mpp-Such&#039;&lt;br /&gt;
 ( 7): &#039;Mpp&#039;&lt;br /&gt;
 ( 8): &#039;Stoer.&#039;&lt;br /&gt;
 ( 9): &#039;Fehler&#039;&lt;br /&gt;
 (10): &#039;Mpp-Peak&#039;&lt;br /&gt;
 (11): &#039;Derating&#039;&lt;br /&gt;
 All possible status texts for Fehler:&lt;br /&gt;
 ( 0): &#039;-------&#039;&lt;br /&gt;
 ( 1): &#039;NUW-UAC&#039;&lt;br /&gt;
 ( 2): &#039;NUW-FAC&#039;&lt;br /&gt;
 ( 3): &#039;B3&#039;&lt;br /&gt;
 ( 4): &#039;K1-Trenn&#039;&lt;br /&gt;
 ( 5): &#039;B5&#039;&lt;br /&gt;
 ( 6): &#039;EEPROM dBh&#039;&lt;br /&gt;
 ( 7): &#039;ROM&#039;&lt;br /&gt;
 ( 8): &#039;B8&#039;&lt;br /&gt;
 ( 9): &#039;B9&#039;&lt;br /&gt;
 (10): &#039;B10&#039;&lt;br /&gt;
 (11): &#039;B11&#039;&lt;br /&gt;
 (12): &#039;B12&#039;&lt;br /&gt;
 (13): &#039;EeRestore&#039;&lt;br /&gt;
 (14): &#039;B14&#039;&lt;br /&gt;
 (15): &#039;B15&#039;&lt;br /&gt;
 (16): &#039;B16&#039;&lt;br /&gt;
 (17): &#039;B17&#039;&lt;br /&gt;
 (18): &#039;AC&#039;&lt;br /&gt;
&lt;br /&gt;
==Interface Hardware:==&lt;br /&gt;
The Sunny-Boy&#039;s don&#039;t have an interface from stock, you have to buy the add-on-board for your device from SMA, the 485PB-NR or, 485PB-MS-NR.&amp;lt;br&amp;gt;&lt;br /&gt;
Tip: sometimes you&#039;ll see them on ebay much cheaper.&amp;lt;br&amp;gt;&lt;br /&gt;
For the server or box you can use a USB-RS485-Kabel, I bought one from Conrad, item 975604, very cheap and works out-the-box.&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Before buying, check if your Linux version will work with the serial adapter.&amp;lt;br&amp;gt;&lt;br /&gt;
There are known problemens between Linux kernel 2.6.31 and serial adapters which use the PL2303 chip&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
To connect to the SMA and Aurora, I used a simple cat5 cable, take 1 twisted pair for GND and another for data:&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 Aurora Sunny-Boy  wire                PC&lt;br /&gt;
 GND        5      brown+brown-white   GND&lt;br /&gt;
 r+,w+      2      orange              RS485+&lt;br /&gt;
 r-,w-      7      orange-white        RS485-&lt;br /&gt;
&lt;br /&gt;
Mark 1, if r and w are separate, you can put + together and - together.&amp;lt;br&amp;gt;&lt;br /&gt;
Mark 2, the cable should not in star, but in one line, you can add as many devices you like, but only the devices on both ends can have termination.&amp;lt;br&amp;gt;&lt;br /&gt;
On all devices between, you have to switch termination off.&amp;lt;br&amp;gt;&lt;br /&gt;
on some devices it&#039;s a switch close to the connector, on other devices you should remove resistors from the pcb, it should be explained in the manual.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==USB Devices after system reboot:==&lt;br /&gt;
Using multiple serial USB tty devices&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Serial USB devices are swapped after reboot&amp;lt;br&amp;gt;&lt;br /&gt;
If you use multiple serial USB adapters, it will happen tat they are assigned from /dev/USBtty1 to /dev/USBtty0 after reboot.&amp;lt;br&amp;gt;&lt;br /&gt;
I use a simple script, which is runned before starting 123solar and metern, this will create 2 symlink&#039;s:&amp;lt;br&amp;gt;&lt;br /&gt;
for my smart electricity meter: /dev/ttyUSBp1&amp;lt;br&amp;gt;&lt;br /&gt;
for my solar devices: /dev/ttyUSBsl&amp;lt;br&amp;gt;&lt;br /&gt;
these links I configured in the applications.&amp;lt;br&amp;gt;&lt;br /&gt;
run:&lt;br /&gt;
 dmesg|grep ttyUSB&amp;lt;br&amp;gt;&lt;br /&gt;
and see which strings you can use to see which is which.&amp;lt;br&amp;gt;&lt;br /&gt;
In my case:&lt;br /&gt;
 usb 2-2: pl2303 converter now attached to ttyUSB0&lt;br /&gt;
 usb 3-1: FTDI USB Serial Device converter now attached to ttyUSB1&lt;br /&gt;
&lt;br /&gt;
put this somewhere in your startup script, or in /etc/rc.local:&lt;br /&gt;
 rm -f /dev/ttyUSBp1 /dev/ttyUSBsl&lt;br /&gt;
 P1_DEV=$(dmesg|grep &amp;quot;to ttyUSB&amp;quot;|grep pl2303 |tail -1|awk &#039;{print $NF}&#039;)&lt;br /&gt;
 SL_DEV=$(dmesg|grep &amp;quot;to ttyUSB&amp;quot;|grep FTDI |tail -1|awk &#039;{print $NF}&#039;)&lt;br /&gt;
 ln -s /dev/${P1_DEV} /dev/ttyUSBp1&lt;br /&gt;
 ln -s /dev/${SL_DEV} /dev/ttyUSBsl&lt;/div&gt;</summary>
		<author><name>Roland</name></author>
	</entry>
	<entry>
		<id>http://wiki.breedveld.net/index.php?title=RPiWaterMeter&amp;diff=7304</id>
		<title>RPiWaterMeter</title>
		<link rel="alternate" type="text/html" href="http://wiki.breedveld.net/index.php?title=RPiWaterMeter&amp;diff=7304"/>
		<updated>2021-02-03T11:59:42Z</updated>

		<summary type="html">&lt;p&gt;Roland: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;Water usage measurement with a Raspberry Pi&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
In my case I use Domoticz, but it also works with Home-Assist and other products.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
It works with a magnetic sensor, which can be used because of the half-metal rotor of watermeters in my country (Netherlands)&amp;lt;br&amp;gt;&lt;br /&gt;
For magnetic sensor I use the LJ12A3-4-Z/B from the well known company in China. &amp;lt;br&amp;gt;&lt;br /&gt;
You can use most types but be sure to buy the OC (Open-Collector) version, because most sensors use higher voltages than the Raspberry Pi, and you won&#039;t damage your Pi.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
The sensor should be placed on the side of the rotator, not in the middle.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
With a piece of aluminium it&#039;s easy to mount on the meter:&lt;br /&gt;
&amp;lt;div class=&amp;quot;res-img&amp;quot;&amp;gt;&lt;br /&gt;
[[File:RPi_watermeter_sensor.jpeg|640px]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;res-img&amp;quot;&amp;gt;&lt;br /&gt;
[[File:RPi_watermeter_beugel.jpeg|320px]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Shematics:&lt;br /&gt;
&amp;lt;div class=&amp;quot;res-img&amp;quot;&amp;gt;&lt;br /&gt;
[[File:RPi_watermeter_schematics.jpeg|640px]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
The sensor needs 9-36 Volt, a Raspberry Pi only can deliver 5 and 3.3 Volt.&amp;lt;br&amp;gt;&lt;br /&gt;
You can use an extra 12 Volt adapter, but I don&#039;t like that......&amp;lt;br&amp;gt; &lt;br /&gt;
I use an adjustable chopper board (also from China), adjusted as 12 Volt.&amp;lt;br&amp;gt;&lt;br /&gt;
If you want the same Board it&#039;s called:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;quot;MT3608 DC-DC Adjustable Boost Module Feed Converter  Voltage Regulator Module 2A Max 2 V-24 V to 5 V-28 V&amp;quot;&amp;lt;br&amp;gt;&lt;br /&gt;
Update: There are also sensors working at 5 Volt, this is a lot easier. In the time I build this, I didn&#039;t find them.&amp;lt;br&amp;gt;  &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
The output is connected to one of the GPIO&#039;s of the Pi, which first should configured as input, in my case I use GPIO28 (pin38/BCM20).&amp;lt;br&amp;gt;&lt;br /&gt;
The led will show if it works, for every pulse 1 liter water is detected.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
The diode is not needed if you use 1 Pi.&amp;lt;br&amp;gt;&lt;br /&gt;
I use a Raspberry Pi Cluster, so I can do a failover.&amp;lt;br&amp;gt;&lt;br /&gt;
The board is connected on 1 Pi, the other Pi is connected to the same pins: 6 and 38.&amp;lt;br&amp;gt;&lt;br /&gt;
For the Power (pin 2) a diode is needed, 1 for each Pi, while it&#039;s a bad idea to connect the power to multiple Pi&#039;s.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
First tested it with an experiment board:&lt;br /&gt;
&amp;lt;div class=&amp;quot;res-img&amp;quot;&amp;gt;&lt;br /&gt;
[[File:RPi_watermeter_experiment.jpeg|640px]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
To test it on a pi you need the gpio command:&amp;lt;br&amp;gt;&lt;br /&gt;
if not installed:&amp;lt;br&amp;gt;&lt;br /&gt;
sudo apt-get update&amp;lt;br&amp;gt;&lt;br /&gt;
sudo apt-get install wiringpi&amp;lt;br&amp;gt;&lt;br /&gt;
change GPIO 28 (BCM=20 and pin=38) as input:&amp;lt;br&amp;gt;&lt;br /&gt;
sudo /usr/local/bin/gpio export 20 in&amp;lt;br&amp;gt;&lt;br /&gt;
Put this line somewhere in a startup file, so it will stay that way, after reboot,&amp;lt;br&amp;gt;&lt;br /&gt;
best below in /etc/rc.local (without sudo)&amp;lt;br&amp;gt;&lt;br /&gt;
to show the states:&amp;lt;br&amp;gt;&lt;br /&gt;
sudo gpio  readall&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is the result:&lt;br /&gt;
&amp;lt;div class=&amp;quot;res-img&amp;quot;&amp;gt;&lt;br /&gt;
[[File:RPi_watermeter_board.jpeg|640px]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
All welded on an experiment board, for the Rpi, with a long pin connector, so you can stack other boards.&amp;lt;br&amp;gt;&lt;br /&gt;
I use a RJ11 connector to connect the sensor. &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Complete mounted on the Pi:&lt;br /&gt;
&amp;lt;div class=&amp;quot;res-img&amp;quot;&amp;gt;&lt;br /&gt;
[[File:RPi_watermeter_complete.jpeg|640px]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;Mounted in my Pi-Cluster, above the UPS-board:&lt;br /&gt;
&amp;lt;div class=&amp;quot;res-img&amp;quot;&amp;gt;&lt;br /&gt;
[[File:Pi_Cluster.jpg|640px]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;Yust like a Christmas-Tree:&lt;br /&gt;
&amp;lt;div class=&amp;quot;res-img&amp;quot;&amp;gt;&lt;br /&gt;
[[File:Pi_Cluster_Running.jpg|640px]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;To get is working in Domotics:&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
Add &amp;quot;Generic sysfs GPIO&amp;quot; at Hardware.&amp;lt;br&amp;gt;&lt;br /&gt;
The GPIO device will be added automatically after 1 pulse, I named it &amp;quot;WaterMeterPulse&amp;quot;&amp;lt;br&amp;gt;&lt;br /&gt;
Add a virtual Sensor type &amp;quot;RFXMeter counter&amp;quot;, I Called it &amp;quot;WaterMeter&amp;quot;&amp;lt;br&amp;gt;&lt;br /&gt;
To get it working, add a lua script:&lt;br /&gt;
    -- sript_WaterMeter.lua&lt;br /&gt;
    -- 2018-09-04 v1.00 Roland Breedveld&lt;br /&gt;
    commandArray = {}&lt;br /&gt;
        if (devicechanged[&#039;WaterMeterPulse&#039;] == &#039;Open&#039;) then&lt;br /&gt;
            water=otherdevices[&#039;WaterMeter&#039;]&lt;br /&gt;
            print(&amp;quot;water impulse received: current liter: &amp;quot; .. water)&lt;br /&gt;
            water = water + 1&lt;br /&gt;
            --change 372 tot the ID of your WaterMeter device.&lt;br /&gt;
            commandArray[&#039;UpdateDevice&#039;]=&#039;372|0|&#039;..water&lt;br /&gt;
        end&lt;br /&gt;
    return commandArray&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Update: Arnold Kamminga wrote a plugin for domoticz, much easier to use:&amp;lt;br&amp;gt;&lt;br /&gt;
[https://github.com/akamming/domoticz-watermeter https://github.com/akamming/domoticz-watermeter]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Partlist:&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
Total Costs: about 10 Euro&amp;lt;br&amp;gt;&lt;br /&gt;
I ordered most parts at the well known Chinese site.&amp;lt;br&amp;gt;&lt;br /&gt;
- LJ12A3-4-Z/B magnetic sensor&amp;lt;br&amp;gt;&lt;br /&gt;
- aluminium strip 20x2.5cm, bended:4.5-11-4.5cm, with a ca 12mm hole&amp;lt;br&amp;gt;&lt;br /&gt;
- MT3608 DC-DC Adjustable Boost Module Feed Converter  Voltage Regulator (or external 12 Volt power supply)&amp;lt;br&amp;gt;&lt;br /&gt;
- Led 2mm, green or red.&amp;lt;br&amp;gt;&lt;br /&gt;
- resistor 680 Ohm&amp;lt;br&amp;gt;&lt;br /&gt;
- capacitor ca. 100 nF&amp;lt;br&amp;gt;&lt;br /&gt;
- RPi experiment board, I used: &amp;quot;DIY Proto HAT Shield Extension Board for Raspberry Pi GPIO Board&amp;quot;&amp;lt;br&amp;gt;&lt;br /&gt;
- Connector, with long pins: &amp;quot;20 Pins Female Pin Header 2.54m Pitch Extra Tall Female Dual Row Short Pin Headers PCB Connector&amp;quot;&amp;lt;br&amp;gt;&lt;br /&gt;
- optional: diode 1N4148 or something like that (1 for each RPi)&amp;lt;br&amp;gt;&lt;br /&gt;
- RJ11 connector, but every other connector will be fine.&amp;lt;br&amp;gt;&lt;/div&gt;</summary>
		<author><name>Roland</name></author>
	</entry>
	<entry>
		<id>http://wiki.breedveld.net/index.php?title=RPiWaterMeter&amp;diff=7303</id>
		<title>RPiWaterMeter</title>
		<link rel="alternate" type="text/html" href="http://wiki.breedveld.net/index.php?title=RPiWaterMeter&amp;diff=7303"/>
		<updated>2021-02-03T11:59:16Z</updated>

		<summary type="html">&lt;p&gt;Roland: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;Water usage measurement with a Raspberry Pi&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
In my case I use Domoticz, but it also works with Home-Assist and other products.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
It works with a magnetic sensor, which can be used because of the half-metal rotor of watermeters in my country (Netherlands)&amp;lt;br&amp;gt;&lt;br /&gt;
For magnetic sensor I use the LJ12A3-4-Z/B from the well known company in China. &amp;lt;br&amp;gt;&lt;br /&gt;
You can use most types but be sure to buy the OC (Open-Collector) version, because most sensors use higher voltages than the Raspberry Pi, and you won&#039;t damage your Pi.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
The sensor should be placed on the side of the rotator, not in the middle.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
With a piece of aluminium it&#039;s easy to mount on the meter:&lt;br /&gt;
&amp;lt;div class=&amp;quot;res-img&amp;quot;&amp;gt;&lt;br /&gt;
[[File:RPi_watermeter_sensor.jpeg|640px]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;res-img&amp;quot;&amp;gt;&lt;br /&gt;
[[File:RPi_watermeter_beugel.jpeg|320px]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Shematics:&lt;br /&gt;
&amp;lt;div class=&amp;quot;res-img&amp;quot;&amp;gt;&lt;br /&gt;
[[File:RPi_watermeter_schematics.jpeg|640px]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
The sensor needs 9-36 Volt, a Raspberry Pi only can deliver 5 and 3.3 Volt.&amp;lt;br&amp;gt;&lt;br /&gt;
You can use an extra 12 Volt adapter, but I don&#039;t like that......&amp;lt;br&amp;gt; &lt;br /&gt;
I use an adjustable chopper board (also from China), adjusted as 12 Volt.&amp;lt;br&amp;gt;&lt;br /&gt;
If you want the same Board it&#039;s called:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;quot;MT3608 DC-DC Adjustable Boost Module Feed Converter  Voltage Regulator Module 2A Max 2 V-24 V to 5 V-28 V&amp;quot;&amp;lt;br&amp;gt;&lt;br /&gt;
Update: There are also sensors working at 5 Volt, this is a lot easier. In the time I build this, I didn&#039;t find them.&amp;lt;br&amp;gt;  &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
The output is connected to one of the GPIO&#039;s of the Pi, which first should configured as input, in my case I use GPIO28 (pin38/BCM20).&amp;lt;br&amp;gt;&lt;br /&gt;
The led will show if it works, for every pulse 1 liter water is detected.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
The diode is not needed if you use 1 Pi.&amp;lt;br&amp;gt;&lt;br /&gt;
I use a Raspberry Pi Cluster, so I can do a failover.&amp;lt;br&amp;gt;&lt;br /&gt;
The board is connected on 1 Pi, the other Pi is connected to the same pins: 6 and 38.&amp;lt;br&amp;gt;&lt;br /&gt;
For the Power (pin 2) a diode is needed, 1 for each Pi, while it&#039;s a bad idea to connect the power to multiple Pi&#039;s.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
First tested it with an experiment board:&lt;br /&gt;
&amp;lt;div class=&amp;quot;res-img&amp;quot;&amp;gt;&lt;br /&gt;
[[File:RPi_watermeter_experiment.jpeg|640px]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
To test it on a pi you need the gpio command:&amp;lt;br&amp;gt;&lt;br /&gt;
if not installed:&amp;lt;br&amp;gt;&lt;br /&gt;
sudo apt-get update&amp;lt;br&amp;gt;&lt;br /&gt;
sudo apt-get install wiringpi&amp;lt;br&amp;gt;&lt;br /&gt;
change GPIO 28 (BCM=20 and pin=38) as input:&amp;lt;br&amp;gt;&lt;br /&gt;
sudo /usr/local/bin/gpio export 20 in&amp;lt;br&amp;gt;&lt;br /&gt;
Put this line somewhere in a startup file, so it will stay that way, after reboot,&amp;lt;br&amp;gt;&lt;br /&gt;
best below in /etc/rc.local (without sudo)&amp;lt;br&amp;gt;&lt;br /&gt;
to show the states:&amp;lt;br&amp;gt;&lt;br /&gt;
sudo gpio  readall&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is the result:&lt;br /&gt;
&amp;lt;div class=&amp;quot;res-img&amp;quot;&amp;gt;&lt;br /&gt;
[[File:RPi_watermeter_board.jpeg|640px]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
All welded on an experiment board, for the Rpi, with a long pin connector, so you can stack other boards.&amp;lt;br&amp;gt;&lt;br /&gt;
I use a RJ11 connector to connect the sensor. &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Complete mounted on the Pi:&lt;br /&gt;
&amp;lt;div class=&amp;quot;res-img&amp;quot;&amp;gt;&lt;br /&gt;
[[File:RPi_watermeter_complete.jpeg|640px]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;Mounted in my Pi-Cluster, above the UPS-board:&lt;br /&gt;
&amp;lt;div class=&amp;quot;res-img&amp;quot;&amp;gt;&lt;br /&gt;
[[File:Pi_Cluster.jpg|640px]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;Yust like a Christmas-Tree:&lt;br /&gt;
&amp;lt;div class=&amp;quot;res-img&amp;quot;&amp;gt;&lt;br /&gt;
[[File:Pi_Cluster_Running.jpg|640px]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;To get is working in Domotics:&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
Add &amp;quot;Generic sysfs GPIO&amp;quot; at Hardware.&amp;lt;br&amp;gt;&lt;br /&gt;
The GPIO device will be added automatically after 1 pulse, I named it &amp;quot;WaterMeterPulse&amp;quot;&amp;lt;br&amp;gt;&lt;br /&gt;
Add a virtual Sensor type &amp;quot;RFXMeter counter&amp;quot;, I Called it &amp;quot;WaterMeter&amp;quot;&amp;lt;br&amp;gt;&lt;br /&gt;
To get it working, add a lua script:&lt;br /&gt;
    -- sript_WaterMeter.lua&lt;br /&gt;
    -- 2018-09-04 v1.00 Roland Breedveld&lt;br /&gt;
    commandArray = {}&lt;br /&gt;
        if (devicechanged[&#039;WaterMeterPulse&#039;] == &#039;Open&#039;) then&lt;br /&gt;
            water=otherdevices[&#039;WaterMeter&#039;]&lt;br /&gt;
            print(&amp;quot;water impulse received: current liter: &amp;quot; .. water)&lt;br /&gt;
            water = water + 1&lt;br /&gt;
            --change 372 tot the ID of your WaterMeter device.&lt;br /&gt;
            commandArray[&#039;UpdateDevice&#039;]=&#039;372|0|&#039;..water&lt;br /&gt;
        end&lt;br /&gt;
    return commandArray&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Update: Arnold Kamminga wrote a plugin for domoticz, much easier to use:&amp;lt;br&amp;gt;&lt;br /&gt;
[https://github.com/akamming/domoticz-watermeter]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Partlist:&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
Total Costs: about 10 Euro&amp;lt;br&amp;gt;&lt;br /&gt;
I ordered most parts at the well known Chinese site.&amp;lt;br&amp;gt;&lt;br /&gt;
- LJ12A3-4-Z/B magnetic sensor&amp;lt;br&amp;gt;&lt;br /&gt;
- aluminium strip 20x2.5cm, bended:4.5-11-4.5cm, with a ca 12mm hole&amp;lt;br&amp;gt;&lt;br /&gt;
- MT3608 DC-DC Adjustable Boost Module Feed Converter  Voltage Regulator (or external 12 Volt power supply)&amp;lt;br&amp;gt;&lt;br /&gt;
- Led 2mm, green or red.&amp;lt;br&amp;gt;&lt;br /&gt;
- resistor 680 Ohm&amp;lt;br&amp;gt;&lt;br /&gt;
- capacitor ca. 100 nF&amp;lt;br&amp;gt;&lt;br /&gt;
- RPi experiment board, I used: &amp;quot;DIY Proto HAT Shield Extension Board for Raspberry Pi GPIO Board&amp;quot;&amp;lt;br&amp;gt;&lt;br /&gt;
- Connector, with long pins: &amp;quot;20 Pins Female Pin Header 2.54m Pitch Extra Tall Female Dual Row Short Pin Headers PCB Connector&amp;quot;&amp;lt;br&amp;gt;&lt;br /&gt;
- optional: diode 1N4148 or something like that (1 for each RPi)&amp;lt;br&amp;gt;&lt;br /&gt;
- RJ11 connector, but every other connector will be fine.&amp;lt;br&amp;gt;&lt;/div&gt;</summary>
		<author><name>Roland</name></author>
	</entry>
	<entry>
		<id>http://wiki.breedveld.net/index.php?title=RPiWaterMeter&amp;diff=7302</id>
		<title>RPiWaterMeter</title>
		<link rel="alternate" type="text/html" href="http://wiki.breedveld.net/index.php?title=RPiWaterMeter&amp;diff=7302"/>
		<updated>2021-02-03T11:42:51Z</updated>

		<summary type="html">&lt;p&gt;Roland: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;Water usage measurement with a Raspberry Pi&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
In my case I use Domoticz, but it also works with Home-Assist and other products.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
It works with a magnetic sensor, which can be used because of the half-metal rotor of watermeters in my country (Netherlands)&amp;lt;br&amp;gt;&lt;br /&gt;
For magnetic sensor I use the LJ12A3-4-Z/B from the well known company in China. &amp;lt;br&amp;gt;&lt;br /&gt;
You can use most types but be sure to buy the OC (Open-Collector) version, because most sensors use higher voltages than the Raspberry Pi, and you won&#039;t damage your Pi.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
The sensor should be placed on the side of the rotator, not in the middle.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
With a piece of aluminium it&#039;s easy to mount on the meter:&lt;br /&gt;
&amp;lt;div class=&amp;quot;res-img&amp;quot;&amp;gt;&lt;br /&gt;
[[File:RPi_watermeter_sensor.jpeg|640px]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;res-img&amp;quot;&amp;gt;&lt;br /&gt;
[[File:RPi_watermeter_beugel.jpeg|320px]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Shematics:&lt;br /&gt;
&amp;lt;div class=&amp;quot;res-img&amp;quot;&amp;gt;&lt;br /&gt;
[[File:RPi_watermeter_schematics.jpeg|640px]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
The sensor needs 9-36 Volt, a Raspberry Pi only can deliver 5 and 3.3 Volt.&amp;lt;br&amp;gt;&lt;br /&gt;
You can use an extra 12 Volt adapter, but I don&#039;t like that......&amp;lt;br&amp;gt; &lt;br /&gt;
I use an adjustable chopper board (also from China), adjusted as 12 Volt.&amp;lt;br&amp;gt;&lt;br /&gt;
If you want the same Board it&#039;s called:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;quot;MT3608 DC-DC Adjustable Boost Module Feed Converter  Voltage Regulator Module 2A Max 2 V-24 V to 5 V-28 V&amp;quot;&amp;lt;br&amp;gt;&lt;br /&gt;
Update: There are also sensors working at 5 Volt, this is a lot easier. In the time I build this, I didn&#039;t find them.&amp;lt;br&amp;gt;  &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
The output is connected to one of the GPIO&#039;s of the Pi, which first should configured as input, in my case I use GPIO28 (pin38/BCM20).&amp;lt;br&amp;gt;&lt;br /&gt;
The led will show if it works, for every pulse 1 liter water is detected.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
The diode is not needed if you use 1 Pi.&amp;lt;br&amp;gt;&lt;br /&gt;
I use a Raspberry Pi Cluster, so I can do a failover.&amp;lt;br&amp;gt;&lt;br /&gt;
The board is connected on 1 Pi, the other Pi is connected to the same pins: 6 and 38.&amp;lt;br&amp;gt;&lt;br /&gt;
For the Power (pin 2) a diode is needed, 1 for each Pi, while it&#039;s a bad idea to connect the power to multiple Pi&#039;s.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
First tested it with an experiment board:&lt;br /&gt;
&amp;lt;div class=&amp;quot;res-img&amp;quot;&amp;gt;&lt;br /&gt;
[[File:RPi_watermeter_experiment.jpeg|640px]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
To test it on a pi you need the gpio command:&amp;lt;br&amp;gt;&lt;br /&gt;
if not installed:&amp;lt;br&amp;gt;&lt;br /&gt;
sudo apt-get update&amp;lt;br&amp;gt;&lt;br /&gt;
sudo apt-get install wiringpi&amp;lt;br&amp;gt;&lt;br /&gt;
change GPIO 28 (BCM=20 and pin=38) as input:&amp;lt;br&amp;gt;&lt;br /&gt;
sudo /usr/local/bin/gpio export 20 in&amp;lt;br&amp;gt;&lt;br /&gt;
Put this line somewhere in a startup file, so it will stay that way, after reboot,&amp;lt;br&amp;gt;&lt;br /&gt;
best below in /etc/rc.local (without sudo)&amp;lt;br&amp;gt;&lt;br /&gt;
to show the states:&amp;lt;br&amp;gt;&lt;br /&gt;
sudo gpio  readall&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is the result:&lt;br /&gt;
&amp;lt;div class=&amp;quot;res-img&amp;quot;&amp;gt;&lt;br /&gt;
[[File:RPi_watermeter_board.jpeg|640px]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
All welded on an experiment board, for the Rpi, with a long pin connector, so you can stack other boards.&amp;lt;br&amp;gt;&lt;br /&gt;
I use a RJ11 connector to connect the sensor. &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Complete mounted on the Pi:&lt;br /&gt;
&amp;lt;div class=&amp;quot;res-img&amp;quot;&amp;gt;&lt;br /&gt;
[[File:RPi_watermeter_complete.jpeg|640px]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;Mounted in my Pi-Cluster, above the UPS-board:&lt;br /&gt;
&amp;lt;div class=&amp;quot;res-img&amp;quot;&amp;gt;&lt;br /&gt;
[[File:Pi_Cluster.jpg|640px]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;Yust like a Christmas-Tree:&lt;br /&gt;
&amp;lt;div class=&amp;quot;res-img&amp;quot;&amp;gt;&lt;br /&gt;
[[File:Pi_Cluster_Running.jpg|640px]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;To get is working in Domotics:&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
Add &amp;quot;Generic sysfs GPIO&amp;quot; at Hardware.&amp;lt;br&amp;gt;&lt;br /&gt;
The GPIO device will be added automatically after 1 pulse, I named it &amp;quot;WaterMeterPulse&amp;quot;&amp;lt;br&amp;gt;&lt;br /&gt;
Add a virtual Sensor type &amp;quot;RFXMeter counter&amp;quot;, I Called it &amp;quot;WaterMeter&amp;quot;&amp;lt;br&amp;gt;&lt;br /&gt;
To get it working, add a lua script:&lt;br /&gt;
    -- sript_WaterMeter.lua&lt;br /&gt;
    -- 2018-09-04 v1.00 Roland Breedveld&lt;br /&gt;
    commandArray = {}&lt;br /&gt;
        if (devicechanged[&#039;WaterMeterPulse&#039;] == &#039;Open&#039;) then&lt;br /&gt;
            water=otherdevices[&#039;WaterMeter&#039;]&lt;br /&gt;
            print(&amp;quot;water impulse received: current liter: &amp;quot; .. water)&lt;br /&gt;
            water = water + 1&lt;br /&gt;
            --change 372 tot the ID of your WaterMeter device.&lt;br /&gt;
            commandArray[&#039;UpdateDevice&#039;]=&#039;372|0|&#039;..water&lt;br /&gt;
        end&lt;br /&gt;
    return commandArray&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[https://github.com/akamming/domoticz-watermeter You can also use the Domoticz plugin from Akamming]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Partlist:&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
Total Costs: about 10 Euro&amp;lt;br&amp;gt;&lt;br /&gt;
I ordered most parts at the well known Chinese site.&amp;lt;br&amp;gt;&lt;br /&gt;
- LJ12A3-4-Z/B magnetic sensor&amp;lt;br&amp;gt;&lt;br /&gt;
- aluminium strip 20x2.5cm, bended:4.5-11-4.5cm, with a ca 12mm hole&amp;lt;br&amp;gt;&lt;br /&gt;
- MT3608 DC-DC Adjustable Boost Module Feed Converter  Voltage Regulator (or external 12 Volt power supply)&amp;lt;br&amp;gt;&lt;br /&gt;
- Led 2mm, green or red.&amp;lt;br&amp;gt;&lt;br /&gt;
- resistor 680 Ohm&amp;lt;br&amp;gt;&lt;br /&gt;
- capacitor ca. 100 nF&amp;lt;br&amp;gt;&lt;br /&gt;
- RPi experiment board, I used: &amp;quot;DIY Proto HAT Shield Extension Board for Raspberry Pi GPIO Board&amp;quot;&amp;lt;br&amp;gt;&lt;br /&gt;
- Connector, with long pins: &amp;quot;20 Pins Female Pin Header 2.54m Pitch Extra Tall Female Dual Row Short Pin Headers PCB Connector&amp;quot;&amp;lt;br&amp;gt;&lt;br /&gt;
- optional: diode 1N4148 or something like that (1 for each RPi)&amp;lt;br&amp;gt;&lt;br /&gt;
- RJ11 connector, but every other connector will be fine.&amp;lt;br&amp;gt;&lt;/div&gt;</summary>
		<author><name>Roland</name></author>
	</entry>
	<entry>
		<id>http://wiki.breedveld.net/index.php?title=RPiWaterMeter&amp;diff=7301</id>
		<title>RPiWaterMeter</title>
		<link rel="alternate" type="text/html" href="http://wiki.breedveld.net/index.php?title=RPiWaterMeter&amp;diff=7301"/>
		<updated>2021-02-03T11:40:07Z</updated>

		<summary type="html">&lt;p&gt;Roland: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;Water usage measurement with a Raspberry Pi&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
In my case I use Domoticz, but it also works with Home-Assist and other products.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
It works with a magnetic sensor, which can be used because of the half-metal rotor of watermeters in my country (Netherlands)&amp;lt;br&amp;gt;&lt;br /&gt;
For magnetic sensor I use the LJ12A3-4-Z/B from the well known company in China. &amp;lt;br&amp;gt;&lt;br /&gt;
You can use most types but be sure to buy the OC (Open-Collector) version, because most sensors use higher voltages than the Raspberry Pi, and you won&#039;t damage your Pi.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
The sensor should be placed on the side of the rotator, not in the middle.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
With a piece of aluminium it&#039;s easy to mount on the meter:&lt;br /&gt;
&amp;lt;div class=&amp;quot;res-img&amp;quot;&amp;gt;&lt;br /&gt;
[[File:RPi_watermeter_sensor.jpeg|640px]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;res-img&amp;quot;&amp;gt;&lt;br /&gt;
[[File:RPi_watermeter_beugel.jpeg|320px]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Shematics:&lt;br /&gt;
&amp;lt;div class=&amp;quot;res-img&amp;quot;&amp;gt;&lt;br /&gt;
[[File:RPi_watermeter_schematics.jpeg|640px]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
The sensor needs 9-36 Volt, a Raspberry Pi only can deliver 5 and 3.3 Volt.&amp;lt;br&amp;gt;&lt;br /&gt;
You can use an extra 12 Volt adapter, but I don&#039;t like that......&amp;lt;br&amp;gt; &lt;br /&gt;
I use an adjustable chopper board (also from China), adjusted as 12 Volt.&amp;lt;br&amp;gt;&lt;br /&gt;
If you want the same Board it&#039;s called:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;quot;MT3608 DC-DC Adjustable Boost Module Feed Converter  Voltage Regulator Module 2A Max 2 V-24 V to 5 V-28 V&amp;quot;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
The output is connected to one of the GPIO&#039;s of the Pi, which first should configured as input, in my case I use GPIO28 (pin38/BCM20).&amp;lt;br&amp;gt;&lt;br /&gt;
The led will show if it works, for every pulse 1 liter water is detected.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
The diode is not needed if you use 1 Pi.&amp;lt;br&amp;gt;&lt;br /&gt;
I use a Raspberry Pi Cluster, so I can do a failover.&amp;lt;br&amp;gt;&lt;br /&gt;
The board is connected on 1 Pi, the other Pi is connected to the same pins: 6 and 38.&amp;lt;br&amp;gt;&lt;br /&gt;
For the Power (pin 2) a diode is needed, 1 for each Pi, while it&#039;s a bad idea to connect the power to multiple Pi&#039;s.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
First tested it with an experiment board:&lt;br /&gt;
&amp;lt;div class=&amp;quot;res-img&amp;quot;&amp;gt;&lt;br /&gt;
[[File:RPi_watermeter_experiment.jpeg|640px]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
To test it on a pi you need the gpio command:&amp;lt;br&amp;gt;&lt;br /&gt;
if not installed:&amp;lt;br&amp;gt;&lt;br /&gt;
sudo apt-get update&amp;lt;br&amp;gt;&lt;br /&gt;
sudo apt-get install wiringpi&amp;lt;br&amp;gt;&lt;br /&gt;
change GPIO 28 (BCM=20 and pin=38) as input:&amp;lt;br&amp;gt;&lt;br /&gt;
sudo /usr/local/bin/gpio export 20 in&amp;lt;br&amp;gt;&lt;br /&gt;
Put this line somewhere in a startup file, so it will stay that way, after reboot,&amp;lt;br&amp;gt;&lt;br /&gt;
best below in /etc/rc.local (without sudo)&amp;lt;br&amp;gt;&lt;br /&gt;
to show the states:&amp;lt;br&amp;gt;&lt;br /&gt;
sudo gpio  readall&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is the result:&lt;br /&gt;
&amp;lt;div class=&amp;quot;res-img&amp;quot;&amp;gt;&lt;br /&gt;
[[File:RPi_watermeter_board.jpeg|640px]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
All welded on an experiment board, for the Rpi, with a long pin connector, so you can stack other boards.&amp;lt;br&amp;gt;&lt;br /&gt;
I use a RJ11 connector to connect the sensor. &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Complete mounted on the Pi:&lt;br /&gt;
&amp;lt;div class=&amp;quot;res-img&amp;quot;&amp;gt;&lt;br /&gt;
[[File:RPi_watermeter_complete.jpeg|640px]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;Mounted in my Pi-Cluster, above the UPS-board:&lt;br /&gt;
&amp;lt;div class=&amp;quot;res-img&amp;quot;&amp;gt;&lt;br /&gt;
[[File:Pi_Cluster.jpg|640px]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;Yust like a Christmas-Tree:&lt;br /&gt;
&amp;lt;div class=&amp;quot;res-img&amp;quot;&amp;gt;&lt;br /&gt;
[[File:Pi_Cluster_Running.jpg|640px]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;To get is working in Domotics:&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
Add &amp;quot;Generic sysfs GPIO&amp;quot; at Hardware.&amp;lt;br&amp;gt;&lt;br /&gt;
The GPIO device will be added automatically after 1 pulse, I named it &amp;quot;WaterMeterPulse&amp;quot;&amp;lt;br&amp;gt;&lt;br /&gt;
Add a virtual Sensor type &amp;quot;RFXMeter counter&amp;quot;, I Called it &amp;quot;WaterMeter&amp;quot;&amp;lt;br&amp;gt;&lt;br /&gt;
To get it working, add a lua script:&lt;br /&gt;
    -- sript_WaterMeter.lua&lt;br /&gt;
    -- 2018-09-04 v1.00 Roland Breedveld&lt;br /&gt;
    commandArray = {}&lt;br /&gt;
        if (devicechanged[&#039;WaterMeterPulse&#039;] == &#039;Open&#039;) then&lt;br /&gt;
            water=otherdevices[&#039;WaterMeter&#039;]&lt;br /&gt;
            print(&amp;quot;water impulse received: current liter: &amp;quot; .. water)&lt;br /&gt;
            water = water + 1&lt;br /&gt;
            --change 372 tot the ID of your WaterMeter device.&lt;br /&gt;
            commandArray[&#039;UpdateDevice&#039;]=&#039;372|0|&#039;..water&lt;br /&gt;
        end&lt;br /&gt;
    return commandArray&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[https://github.com/akamming/domoticz-watermeter or use the Domoticz plugin from Akamming]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Partlist:&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
Total Costs: about 10 Euro&amp;lt;br&amp;gt;&lt;br /&gt;
I ordered most parts at the well known Chinese site.&amp;lt;br&amp;gt;&lt;br /&gt;
- LJ12A3-4-Z/B magnetic sensor&amp;lt;br&amp;gt;&lt;br /&gt;
- aluminium strip 20x2.5cm, bended:4.5-11-4.5cm, with a ca 12mm hole&amp;lt;br&amp;gt;&lt;br /&gt;
- MT3608 DC-DC Adjustable Boost Module Feed Converter  Voltage Regulator (or external 12 Volt power supply)&amp;lt;br&amp;gt;&lt;br /&gt;
- Led 2mm, green or red.&amp;lt;br&amp;gt;&lt;br /&gt;
- resistor 680 Ohm&amp;lt;br&amp;gt;&lt;br /&gt;
- capacitor ca. 100 nF&amp;lt;br&amp;gt;&lt;br /&gt;
- RPi experiment board, I used: &amp;quot;DIY Proto HAT Shield Extension Board for Raspberry Pi GPIO Board&amp;quot;&amp;lt;br&amp;gt;&lt;br /&gt;
- Connector, with long pins: &amp;quot;20 Pins Female Pin Header 2.54m Pitch Extra Tall Female Dual Row Short Pin Headers PCB Connector&amp;quot;&amp;lt;br&amp;gt;&lt;br /&gt;
- optional: diode 1N4148 or something like that (1 for each RPi)&amp;lt;br&amp;gt;&lt;br /&gt;
- RJ11 connector, but every other connector will be fine.&amp;lt;br&amp;gt;&lt;/div&gt;</summary>
		<author><name>Roland</name></author>
	</entry>
	<entry>
		<id>http://wiki.breedveld.net/index.php?title=Main_Page&amp;diff=7300</id>
		<title>Main Page</title>
		<link rel="alternate" type="text/html" href="http://wiki.breedveld.net/index.php?title=Main_Page&amp;diff=7300"/>
		<updated>2021-01-13T19:29:01Z</updated>

		<summary type="html">&lt;p&gt;Roland: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[MediaWiki:Common.css]]&lt;br /&gt;
[[Category:Breedveld]]&lt;br /&gt;
&#039;&#039;&#039;Welcome at wiki.breedveld.net&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=Links:=&lt;br /&gt;
 My home-page: [http://www.breedveld.net Breedveld.net]     &lt;br /&gt;
 My Genealogy site: [http://stamboom.breedveld.net Genealogy Breedveld]&lt;br /&gt;
 My GitHub page: [https://github.com/rolandbreedveld/ GitHub]&lt;br /&gt;
&lt;br /&gt;
=Nest:=&lt;br /&gt;
 Nest API for Domoticz: [https://github.com/rolandbreedveld/nest-api Nest-api]&lt;br /&gt;
&lt;br /&gt;
=485solar-get:=&lt;br /&gt;
 SMA data collector [[485solar-get]]&lt;br /&gt;
&lt;br /&gt;
=Water Meter for Raspberry-Pi:=&lt;br /&gt;
 RPiWaterMeter [[RPiWaterMeter]]&lt;/div&gt;</summary>
		<author><name>Roland</name></author>
	</entry>
	<entry>
		<id>http://wiki.breedveld.net/index.php?title=Main_Page&amp;diff=7299</id>
		<title>Main Page</title>
		<link rel="alternate" type="text/html" href="http://wiki.breedveld.net/index.php?title=Main_Page&amp;diff=7299"/>
		<updated>2021-01-13T19:28:11Z</updated>

		<summary type="html">&lt;p&gt;Roland: /* Links: */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[MediaWiki:Common.css]]&lt;br /&gt;
[[Category:Breedveld]]&lt;br /&gt;
&#039;&#039;&#039;Welcome at wiki.breedveld.net&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=Links:=&lt;br /&gt;
 My home-page: [http://www.breedveld.net Breedveld.net]     &lt;br /&gt;
 My Genealogy site: [http://stamboom.breedveld.net Genealogy Breedveld]&lt;br /&gt;
 My GitHub page: [https://github.com/rolandbreedveld/ GitHub]&lt;br /&gt;
&lt;br /&gt;
 Nest API for Domoticz: [https://github.com/rolandbreedveld/nest-api Nest-api]&lt;br /&gt;
&lt;br /&gt;
=485solar-get:=&lt;br /&gt;
 SMA data collector [[485solar-get]]&lt;br /&gt;
&lt;br /&gt;
=Water Meter for Raspberry-Pi:=&lt;br /&gt;
 RPiWaterMeter [[RPiWaterMeter]]&lt;/div&gt;</summary>
		<author><name>Roland</name></author>
	</entry>
	<entry>
		<id>http://wiki.breedveld.net/index.php?title=RPiWaterMeter&amp;diff=7298</id>
		<title>RPiWaterMeter</title>
		<link rel="alternate" type="text/html" href="http://wiki.breedveld.net/index.php?title=RPiWaterMeter&amp;diff=7298"/>
		<updated>2020-12-30T14:07:53Z</updated>

		<summary type="html">&lt;p&gt;Roland: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;Water usage measurement with a Raspberry Pi&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
In my case I use Domoticz, but it also works with Home-Assist and other products.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
It works with a magnetic sensor, which can be used because of the half-metal rotor of watermeters in my country (Netherlands)&amp;lt;br&amp;gt;&lt;br /&gt;
For magnetic sensor I use the LJ12A3-4-Z/B from the well known company in China. &amp;lt;br&amp;gt;&lt;br /&gt;
You can use most types but be sure to buy the OC (Open-Collector) version, because most sensors use higher voltages than the Raspberry Pi, and you won&#039;t damage your Pi.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
The sensor should be placed on the side of the rotator, not in the middle.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
With a piece of aluminium it&#039;s easy to mount on the meter:&lt;br /&gt;
&amp;lt;div class=&amp;quot;res-img&amp;quot;&amp;gt;&lt;br /&gt;
[[File:RPi_watermeter_sensor.jpeg|640px]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;res-img&amp;quot;&amp;gt;&lt;br /&gt;
[[File:RPi_watermeter_beugel.jpeg|320px]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Shematics:&lt;br /&gt;
&amp;lt;div class=&amp;quot;res-img&amp;quot;&amp;gt;&lt;br /&gt;
[[File:RPi_watermeter_schematics.jpeg|640px]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
The sensor needs 9-36 Volt, a Raspberry Pi only can deliver 5 and 3.3 Volt.&amp;lt;br&amp;gt;&lt;br /&gt;
You can use an extra 12 Volt adapter, but I don&#039;t like that......&amp;lt;br&amp;gt; &lt;br /&gt;
I use an adjustable chopper board (also from China), adjusted as 12 Volt.&amp;lt;br&amp;gt;&lt;br /&gt;
If you want the same Board it&#039;s called:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;quot;MT3608 DC-DC Adjustable Boost Module Feed Converter  Voltage Regulator Module 2A Max 2 V-24 V to 5 V-28 V&amp;quot;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
The output is connected to one of the GPIO&#039;s of the Pi, which first should configured as input, in my case I use GPIO28 (pin38/BCM20).&amp;lt;br&amp;gt;&lt;br /&gt;
The led will show if it works, for every pulse 1 liter water is detected.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
The diode is not needed if you use 1 Pi.&amp;lt;br&amp;gt;&lt;br /&gt;
I use a Raspberry Pi Cluster, so I can do a failover.&amp;lt;br&amp;gt;&lt;br /&gt;
The board is connected on 1 Pi, the other Pi is connected to the same pins: 6 and 38.&amp;lt;br&amp;gt;&lt;br /&gt;
For the Power (pin 2) a diode is needed, 1 for each Pi, while it&#039;s a bad idea to connect the power to multiple Pi&#039;s.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
First tested it with an experiment board:&lt;br /&gt;
&amp;lt;div class=&amp;quot;res-img&amp;quot;&amp;gt;&lt;br /&gt;
[[File:RPi_watermeter_experiment.jpeg|640px]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
To test it on a pi you need the gpio command:&amp;lt;br&amp;gt;&lt;br /&gt;
if not installed:&amp;lt;br&amp;gt;&lt;br /&gt;
sudo apt-get update&amp;lt;br&amp;gt;&lt;br /&gt;
sudo apt-get install wiringpi&amp;lt;br&amp;gt;&lt;br /&gt;
change GPIO 28 (BCM=20 and pin=38) as input:&amp;lt;br&amp;gt;&lt;br /&gt;
sudo /usr/local/bin/gpio export 20 in&amp;lt;br&amp;gt;&lt;br /&gt;
Put this line somewhere in a startup file, so it will stay that way, after reboot,&amp;lt;br&amp;gt;&lt;br /&gt;
best below in /etc/rc.local (without sudo)&amp;lt;br&amp;gt;&lt;br /&gt;
to show the states:&amp;lt;br&amp;gt;&lt;br /&gt;
sudo gpio  readall&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is the result:&lt;br /&gt;
&amp;lt;div class=&amp;quot;res-img&amp;quot;&amp;gt;&lt;br /&gt;
[[File:RPi_watermeter_board.jpeg|640px]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
All welded on an experiment board, for the Rpi, with a long pin connector, so you can stack other boards.&amp;lt;br&amp;gt;&lt;br /&gt;
I use a RJ11 connector to connect the sensor. &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Complete mounted on the Pi:&lt;br /&gt;
&amp;lt;div class=&amp;quot;res-img&amp;quot;&amp;gt;&lt;br /&gt;
[[File:RPi_watermeter_complete.jpeg|640px]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;Mounted in my Pi-Cluster, above the UPS-board:&lt;br /&gt;
&amp;lt;div class=&amp;quot;res-img&amp;quot;&amp;gt;&lt;br /&gt;
[[File:Pi_Cluster.jpg|640px]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;Yust like a Christmas-Tree:&lt;br /&gt;
&amp;lt;div class=&amp;quot;res-img&amp;quot;&amp;gt;&lt;br /&gt;
[[File:Pi_Cluster_Running.jpg|640px]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;To get is working in Domotics:&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
Add &amp;quot;Generic sysfs GPIO&amp;quot; at Hardware.&amp;lt;br&amp;gt;&lt;br /&gt;
The GPIO device will be added automatically after 1 pulse, I named it &amp;quot;WaterMeterPulse&amp;quot;&amp;lt;br&amp;gt;&lt;br /&gt;
Add a virtual Sensor type &amp;quot;RFXMeter counter&amp;quot;, I Called it &amp;quot;WaterMeter&amp;quot;&amp;lt;br&amp;gt;&lt;br /&gt;
To get it working, add a lua script:&lt;br /&gt;
    -- sript_WaterMeter.lua&lt;br /&gt;
    -- 2018-09-04 v1.00 Roland Breedveld&lt;br /&gt;
    commandArray = {}&lt;br /&gt;
        if (devicechanged[&#039;WaterMeterPulse&#039;] == &#039;Open&#039;) then&lt;br /&gt;
            water=otherdevices[&#039;WaterMeter&#039;]&lt;br /&gt;
            print(&amp;quot;water impulse received: current liter: &amp;quot; .. water)&lt;br /&gt;
            water = water + 1&lt;br /&gt;
            --change 372 tot the ID of your WaterMeter device.&lt;br /&gt;
            commandArray[&#039;UpdateDevice&#039;]=&#039;372|0|&#039;..water&lt;br /&gt;
        end&lt;br /&gt;
    return commandArray&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Partlist:&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
Total Costs: about 10 Euro&amp;lt;br&amp;gt;&lt;br /&gt;
I ordered most parts at the well known Chinese site.&amp;lt;br&amp;gt;&lt;br /&gt;
- LJ12A3-4-Z/B magnetic sensor&amp;lt;br&amp;gt;&lt;br /&gt;
- aluminium strip 20x2.5cm, bended:4.5-11-4.5cm, with a ca 12mm hole&amp;lt;br&amp;gt;&lt;br /&gt;
- MT3608 DC-DC Adjustable Boost Module Feed Converter  Voltage Regulator (or external 12 Volt power supply)&amp;lt;br&amp;gt;&lt;br /&gt;
- Led 2mm, green or red.&amp;lt;br&amp;gt;&lt;br /&gt;
- resistor 680 Ohm&amp;lt;br&amp;gt;&lt;br /&gt;
- capacitor ca. 100 nF&amp;lt;br&amp;gt;&lt;br /&gt;
- RPi experiment board, I used: &amp;quot;DIY Proto HAT Shield Extension Board for Raspberry Pi GPIO Board&amp;quot;&amp;lt;br&amp;gt;&lt;br /&gt;
- Connector, with long pins: &amp;quot;20 Pins Female Pin Header 2.54m Pitch Extra Tall Female Dual Row Short Pin Headers PCB Connector&amp;quot;&amp;lt;br&amp;gt;&lt;br /&gt;
- optional: diode 1N4148 or something like that (1 for each RPi)&amp;lt;br&amp;gt;&lt;br /&gt;
- RJ11 connector, but every other connector will be fine.&amp;lt;br&amp;gt;&lt;/div&gt;</summary>
		<author><name>Roland</name></author>
	</entry>
	<entry>
		<id>http://wiki.breedveld.net/index.php?title=RPiWaterMeter&amp;diff=7296</id>
		<title>RPiWaterMeter</title>
		<link rel="alternate" type="text/html" href="http://wiki.breedveld.net/index.php?title=RPiWaterMeter&amp;diff=7296"/>
		<updated>2020-12-30T14:01:20Z</updated>

		<summary type="html">&lt;p&gt;Roland: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;Water usage measurement with a Raspberry Pi&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
In my case I use Domoticz, but it also works with Home-Assist and other products.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
It works with a magnetic sensor, which can be used because of the half-metal rotor of watermeters in my country (Netherlands)&amp;lt;br&amp;gt;&lt;br /&gt;
For magnetic sensor I use the LJ12A3-4-Z/B from the well known company in China. &amp;lt;br&amp;gt;&lt;br /&gt;
You can use most types but be sure to buy the OC (Open-Collector) version, because most sensors use higher voltages than the Raspberry Pi, and you won&#039;t damage your Pi.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
The sensor should be placed on the side of the rotator, not in the middle.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
With a piece of aluminium it&#039;s easy to mount on the meter:&lt;br /&gt;
&amp;lt;div class=&amp;quot;res-img&amp;quot;&amp;gt;&lt;br /&gt;
[[File:RPi_watermeter_sensor.jpeg|640px]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;res-img&amp;quot;&amp;gt;&lt;br /&gt;
[[File:RPi_watermeter_beugel.jpeg|320px]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Shematics:&lt;br /&gt;
&amp;lt;div class=&amp;quot;res-img&amp;quot;&amp;gt;&lt;br /&gt;
[[File:RPi_watermeter_schematics.jpeg|640px]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
The sensor needs 9-36 Volt, a Raspberry Pi only can deliver 5 and 3.3 Volt.&amp;lt;br&amp;gt;&lt;br /&gt;
You can use an extra 12 Volt adapter, but I don&#039;t like that......&amp;lt;br&amp;gt; &lt;br /&gt;
I use an adjustable chopper board (also from China), adjusted as 12 Volt.&amp;lt;br&amp;gt;&lt;br /&gt;
If you want the same Board it&#039;s called:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;quot;MT3608 DC-DC Adjustable Boost Module Feed Converter  Voltage Regulator Module 2A Max 2 V-24 V to 5 V-28 V&amp;quot;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
The output is connected to one of the GPIO&#039;s of the Pi, which first should configured as input, in my case I use GPIO28 (pin38/BCM20).&amp;lt;br&amp;gt;&lt;br /&gt;
The led will show if it works, for every pulse 1 liter water is detected.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
The diode is not needed if you use 1 Pi.&amp;lt;br&amp;gt;&lt;br /&gt;
I use a Raspberry Pi Cluster, so I can do a failover.&amp;lt;br&amp;gt;&lt;br /&gt;
The board is connected on 1 Pi, the other Pi is connected to the same pins: 6 and 38.&amp;lt;br&amp;gt;&lt;br /&gt;
For the Power (pin 2) a diode is needed, 1 for each Pi, while it&#039;s a bad idea to connect the power to multiple Pi&#039;s.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
First tested it with an experiment board:&lt;br /&gt;
&amp;lt;div class=&amp;quot;res-img&amp;quot;&amp;gt;&lt;br /&gt;
[[File:RPi_watermeter_experiment.jpeg|640px]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
To test it on a pi you need the gpio command:&amp;lt;br&amp;gt;&lt;br /&gt;
if not installed:&amp;lt;br&amp;gt;&lt;br /&gt;
sudo apt-get update&amp;lt;br&amp;gt;&lt;br /&gt;
sudo apt-get install wiringpi&amp;lt;br&amp;gt;&lt;br /&gt;
change GPIO 28 (BCM=20 and pin=38) as input:&amp;lt;br&amp;gt;&lt;br /&gt;
sudo /usr/local/bin/gpio export 20 in&amp;lt;br&amp;gt;&lt;br /&gt;
Put this line somewhere in a startup file, so it will stay that way, after reboot,&amp;lt;br&amp;gt;&lt;br /&gt;
best below in /etc/rc.local (without sudo)&amp;lt;br&amp;gt;&lt;br /&gt;
to show the states:&amp;lt;br&amp;gt;&lt;br /&gt;
sudo gpio  readall&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is the result:&lt;br /&gt;
&amp;lt;div class=&amp;quot;res-img&amp;quot;&amp;gt;&lt;br /&gt;
[[File:RPi_watermeter_board.jpeg|640px]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
All welded on an experiment board, for the Rpi, with a long pin connector, so you can stack other boards.&amp;lt;br&amp;gt;&lt;br /&gt;
I use a RJ11 connector to connect the sensor. &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Complete mounted on the Pi:&lt;br /&gt;
&amp;lt;div class=&amp;quot;res-img&amp;quot;&amp;gt;&lt;br /&gt;
[[File:RPi_watermeter_complete.jpeg|640px]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;Mounted in my Pi-Cluster, above the UPS-board:&lt;br /&gt;
&amp;lt;div class=&amp;quot;res-img&amp;quot;&amp;gt;&lt;br /&gt;
[[File:Pi_Cluster.jpg|640px]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;To get is working in Domotics:&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
Add &amp;quot;Generic sysfs GPIO&amp;quot; at Hardware.&amp;lt;br&amp;gt;&lt;br /&gt;
The GPIO device will be added automatically after 1 pulse, I named it &amp;quot;WaterMeterPulse&amp;quot;&amp;lt;br&amp;gt;&lt;br /&gt;
Add a virtual Sensor type &amp;quot;RFXMeter counter&amp;quot;, I Called it &amp;quot;WaterMeter&amp;quot;&amp;lt;br&amp;gt;&lt;br /&gt;
To get it working, add a lua script:&lt;br /&gt;
    -- sript_WaterMeter.lua&lt;br /&gt;
    -- 2018-09-04 v1.00 Roland Breedveld&lt;br /&gt;
    commandArray = {}&lt;br /&gt;
        if (devicechanged[&#039;WaterMeterPulse&#039;] == &#039;Open&#039;) then&lt;br /&gt;
            water=otherdevices[&#039;WaterMeter&#039;]&lt;br /&gt;
            print(&amp;quot;water impulse received: current liter: &amp;quot; .. water)&lt;br /&gt;
            water = water + 1&lt;br /&gt;
            --change 372 tot the ID of your WaterMeter device.&lt;br /&gt;
            commandArray[&#039;UpdateDevice&#039;]=&#039;372|0|&#039;..water&lt;br /&gt;
        end&lt;br /&gt;
    return commandArray&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Partlist:&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
Total Costs: about 10 Euro&amp;lt;br&amp;gt;&lt;br /&gt;
I ordered most parts at the well known Chinese site.&amp;lt;br&amp;gt;&lt;br /&gt;
- LJ12A3-4-Z/B magnetic sensor&amp;lt;br&amp;gt;&lt;br /&gt;
- aluminium strip 20x2.5cm, bended:4.5-11-4.5cm, with a ca 12mm hole&amp;lt;br&amp;gt;&lt;br /&gt;
- MT3608 DC-DC Adjustable Boost Module Feed Converter  Voltage Regulator (or external 12 Volt power supply)&amp;lt;br&amp;gt;&lt;br /&gt;
- Led 2mm, green or red.&amp;lt;br&amp;gt;&lt;br /&gt;
- resistor 680 Ohm&amp;lt;br&amp;gt;&lt;br /&gt;
- capacitor ca. 100 nF&amp;lt;br&amp;gt;&lt;br /&gt;
- RPi experiment board, I used: &amp;quot;DIY Proto HAT Shield Extension Board for Raspberry Pi GPIO Board&amp;quot;&amp;lt;br&amp;gt;&lt;br /&gt;
- Connector, with long pins: &amp;quot;20 Pins Female Pin Header 2.54m Pitch Extra Tall Female Dual Row Short Pin Headers PCB Connector&amp;quot;&amp;lt;br&amp;gt;&lt;br /&gt;
- optional: diode 1N4148 or something like that (1 for each RPi)&amp;lt;br&amp;gt;&lt;br /&gt;
- RJ11 connector, but every other connector will be fine.&amp;lt;br&amp;gt;&lt;/div&gt;</summary>
		<author><name>Roland</name></author>
	</entry>
	<entry>
		<id>http://wiki.breedveld.net/index.php?title=RPiWaterMeter&amp;diff=7295</id>
		<title>RPiWaterMeter</title>
		<link rel="alternate" type="text/html" href="http://wiki.breedveld.net/index.php?title=RPiWaterMeter&amp;diff=7295"/>
		<updated>2020-12-30T13:59:10Z</updated>

		<summary type="html">&lt;p&gt;Roland: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;Water usage measurement with a Raspberry Pi&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
In my case I use Domoticz, but it also works with Home-Assist and other products.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
It works with a magnetic sensor, which can be used because of the half-metal rotor of watermeters in my country (Netherlands)&amp;lt;br&amp;gt;&lt;br /&gt;
For magnetic sensor I use the LJ12A3-4-Z/B from the well known company in China. &amp;lt;br&amp;gt;&lt;br /&gt;
You can use most types but be sure to buy the OC (Open-Collector) version, because most sensors use higher voltages than the Raspberry Pi, and you won&#039;t damage your Pi.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
The sensor should be placed on the side of the rotator, not in the middle.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
With a piece of aluminium it&#039;s easy to mount on the meter:&lt;br /&gt;
&amp;lt;div class=&amp;quot;res-img&amp;quot;&amp;gt;&lt;br /&gt;
[[File:RPi_watermeter_sensor.jpeg|640px]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;res-img&amp;quot;&amp;gt;&lt;br /&gt;
[[File:RPi_watermeter_beugel.jpeg|320px]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Shematics:&lt;br /&gt;
&amp;lt;div class=&amp;quot;res-img&amp;quot;&amp;gt;&lt;br /&gt;
[[File:RPi_watermeter_schematics.jpeg|640px]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
The sensor needs 9-36 Volt, a Raspberry Pi only can deliver 5 and 3.3 Volt.&amp;lt;br&amp;gt;&lt;br /&gt;
You can use an extra 12 Volt adapter, but I don&#039;t like that......&amp;lt;br&amp;gt; &lt;br /&gt;
I use an adjustable chopper board (also from China), adjusted as 12 Volt.&amp;lt;br&amp;gt;&lt;br /&gt;
If you want the same Board it&#039;s called:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;quot;MT3608 DC-DC Adjustable Boost Module Feed Converter  Voltage Regulator Module 2A Max 2 V-24 V to 5 V-28 V&amp;quot;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
The output is connected to one of the GPIO&#039;s of the Pi, which first should configured as input, in my case I use GPIO28 (pin38/BCM20).&amp;lt;br&amp;gt;&lt;br /&gt;
The led will show if it works, for every pulse 1 liter water is detected.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
The diode is not needed if you use 1 Pi.&amp;lt;br&amp;gt;&lt;br /&gt;
I use a Raspberry Pi Cluster, so I can do a failover.&amp;lt;br&amp;gt;&lt;br /&gt;
The board is connected on 1 Pi, the other Pi is connected to the same pins: 6 and 38.&amp;lt;br&amp;gt;&lt;br /&gt;
For the Power (pin 2) a diode is needed, 1 for each Pi, while it&#039;s a bad idea to connect the power to multiple Pi&#039;s.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
First tested it with an experiment board:&lt;br /&gt;
&amp;lt;div class=&amp;quot;res-img&amp;quot;&amp;gt;&lt;br /&gt;
[[File:RPi_watermeter_experiment.jpeg|640px]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
To test it on a pi you need the gpio command:&amp;lt;br&amp;gt;&lt;br /&gt;
if not installed:&amp;lt;br&amp;gt;&lt;br /&gt;
sudo apt-get update&amp;lt;br&amp;gt;&lt;br /&gt;
sudo apt-get install wiringpi&amp;lt;br&amp;gt;&lt;br /&gt;
change GPIO 28 (BCM=20 and pin=38) as input:&amp;lt;br&amp;gt;&lt;br /&gt;
sudo /usr/local/bin/gpio export 20 in&amp;lt;br&amp;gt;&lt;br /&gt;
Put this line somewhere in a startup file, so it will stay that way, after reboot,&amp;lt;br&amp;gt;&lt;br /&gt;
best below in /etc/rc.local (without sudo)&amp;lt;br&amp;gt;&lt;br /&gt;
to show the states:&amp;lt;br&amp;gt;&lt;br /&gt;
sudo gpio  readall&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is the result:&lt;br /&gt;
&amp;lt;div class=&amp;quot;res-img&amp;quot;&amp;gt;&lt;br /&gt;
[[File:RPi_watermeter_board.jpeg|640px]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
All welded on an experiment board, for the Rpi, with a long pin connector, so you can stack other boards.&amp;lt;br&amp;gt;&lt;br /&gt;
I use a RJ11 connector to connect the sensor. &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Complete mounted on the Pi:&lt;br /&gt;
&amp;lt;div class=&amp;quot;res-img&amp;quot;&amp;gt;&lt;br /&gt;
[[File:RPi_watermeter_complete.jpeg|640px]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;Mounted in my Pi-Cluster, above the UPS-board:&lt;br /&gt;
&amp;lt;div class=&amp;quot;res-img&amp;quot;&amp;gt;&lt;br /&gt;
[[File:Pi_Cluster.jpg|640px]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;To get is working in Domotics:&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
Add &amp;quot;Generic sysfs GPIO&amp;quot; at Hardware.&amp;lt;br&amp;gt;&lt;br /&gt;
The GPIO will be added automatically after 1 pulse, I named it &amp;quot;WaterMeterPulse&amp;quot;&amp;lt;br&amp;gt;&lt;br /&gt;
Add a virtual Sensor type &amp;quot;RFXMeter counter&amp;quot;, I Called it &amp;quot;WaterMeter&amp;quot;&amp;lt;br&amp;gt;&lt;br /&gt;
To get it working, add a lua script:&lt;br /&gt;
    -- sript_WaterMeter.lua&lt;br /&gt;
    -- 2018-09-04 v1.00 Roland Breedveld&lt;br /&gt;
    commandArray = {}&lt;br /&gt;
        if (devicechanged[&#039;WaterMeterPulse&#039;] == &#039;Open&#039;) then&lt;br /&gt;
            water=otherdevices[&#039;WaterMeter&#039;]&lt;br /&gt;
            print(&amp;quot;water impulse received: current liter: &amp;quot; .. water)&lt;br /&gt;
            water = water + 1&lt;br /&gt;
            commandArray[&#039;UpdateDevice&#039;]=&#039;372|0|&#039;..water&lt;br /&gt;
        end&lt;br /&gt;
    return commandArray&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Partlist:&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
Total Costs: about 10 Euro&amp;lt;br&amp;gt;&lt;br /&gt;
I ordered most parts at the well known Chinese site.&amp;lt;br&amp;gt;&lt;br /&gt;
- LJ12A3-4-Z/B magnetic sensor&amp;lt;br&amp;gt;&lt;br /&gt;
- aluminium strip 20x2.5cm, bended:4.5-11-4.5cm, with a ca 12mm hole&amp;lt;br&amp;gt;&lt;br /&gt;
- MT3608 DC-DC Adjustable Boost Module Feed Converter  Voltage Regulator (or external 12 Volt power supply)&amp;lt;br&amp;gt;&lt;br /&gt;
- Led 2mm, green or red.&amp;lt;br&amp;gt;&lt;br /&gt;
- resistor 680 Ohm&amp;lt;br&amp;gt;&lt;br /&gt;
- capacitor ca. 100 nF&amp;lt;br&amp;gt;&lt;br /&gt;
- RPi experiment board, I used: &amp;quot;DIY Proto HAT Shield Extension Board for Raspberry Pi GPIO Board&amp;quot;&amp;lt;br&amp;gt;&lt;br /&gt;
- Connector, with long pins: &amp;quot;20 Pins Female Pin Header 2.54m Pitch Extra Tall Female Dual Row Short Pin Headers PCB Connector&amp;quot;&amp;lt;br&amp;gt;&lt;br /&gt;
- optional: diode 1N4148 or something like that (1 for each RPi)&amp;lt;br&amp;gt;&lt;br /&gt;
- RJ11 connector, but every other connector will be fine.&amp;lt;br&amp;gt;&lt;/div&gt;</summary>
		<author><name>Roland</name></author>
	</entry>
	<entry>
		<id>http://wiki.breedveld.net/index.php?title=RPiWaterMeter&amp;diff=7294</id>
		<title>RPiWaterMeter</title>
		<link rel="alternate" type="text/html" href="http://wiki.breedveld.net/index.php?title=RPiWaterMeter&amp;diff=7294"/>
		<updated>2020-12-30T13:57:33Z</updated>

		<summary type="html">&lt;p&gt;Roland: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;Water usage measurement with a Raspberry Pi&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
In my case I use Domoticz, but it also works with Home-Assist and other products.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
It works with a magnetic sensor, which can be used because of the half-metal rotor of watermeters in my country (Netherlands)&amp;lt;br&amp;gt;&lt;br /&gt;
For magnetic sensor I use the LJ12A3-4-Z/B from the well known company in China. &amp;lt;br&amp;gt;&lt;br /&gt;
You can use most types but be sure to buy the OC (Open-Collector) version, because most sensors use higher voltages than the Raspberry Pi, and you won&#039;t damage your Pi.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
The sensor should be placed on the side of the rotator, not in the middle.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
With a piece of aluminium it&#039;s easy to mount on the meter:&lt;br /&gt;
&amp;lt;div class=&amp;quot;res-img&amp;quot;&amp;gt;&lt;br /&gt;
[[File:RPi_watermeter_sensor.jpeg|640px]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;res-img&amp;quot;&amp;gt;&lt;br /&gt;
[[File:RPi_watermeter_beugel.jpeg|320px]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Shematics:&lt;br /&gt;
&amp;lt;div class=&amp;quot;res-img&amp;quot;&amp;gt;&lt;br /&gt;
[[File:RPi_watermeter_schematics.jpeg|640px]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
The sensor needs 9-36 Volt, a Raspberry Pi only can deliver 5 and 3.3 Volt.&amp;lt;br&amp;gt;&lt;br /&gt;
You can use an extra 12 Volt adapter, but I don&#039;t like that......&amp;lt;br&amp;gt; &lt;br /&gt;
I use an adjustable chopper board (also from China), adjusted as 12 Volt.&amp;lt;br&amp;gt;&lt;br /&gt;
If you want the same Board it&#039;s called:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;quot;MT3608 DC-DC Adjustable Boost Module Feed Converter  Voltage Regulator Module 2A Max 2 V-24 V to 5 V-28 V&amp;quot;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
The output is connected to one of the GPIO&#039;s of the Pi, which first should configured as input, in my case I use GPIO28 (pin38/BCM20).&amp;lt;br&amp;gt;&lt;br /&gt;
The led will show if it works, for every pulse 1 liter water is detected.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
The diode is not needed if you use 1 Pi.&amp;lt;br&amp;gt;&lt;br /&gt;
I use a Raspberry Pi Cluster, so I can do a failover.&amp;lt;br&amp;gt;&lt;br /&gt;
The board is connected on 1 Pi, the other Pi is connected to the same pins: 6 and 38.&amp;lt;br&amp;gt;&lt;br /&gt;
For the Power (pin 2) a diode is needed, 1 for each Pi, while it&#039;s a bad idea to connect the power to multiple Pi&#039;s.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
First tested it with an experiment board:&lt;br /&gt;
&amp;lt;div class=&amp;quot;res-img&amp;quot;&amp;gt;&lt;br /&gt;
[[File:RPi_watermeter_experiment.jpeg|640px]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
To test it on a pi you need the gpio command:&amp;lt;br&amp;gt;&lt;br /&gt;
if not installed:&amp;lt;br&amp;gt;&lt;br /&gt;
sudo apt-get update&amp;lt;br&amp;gt;&lt;br /&gt;
sudo apt-get install wiringpi&amp;lt;br&amp;gt;&lt;br /&gt;
change GPIO 28 (BCM=20 and pin=38) as input:&amp;lt;br&amp;gt;&lt;br /&gt;
sudo /usr/local/bin/gpio export 20 in&amp;lt;br&amp;gt;&lt;br /&gt;
Put this line somewhere in a startup file, so it will stay that way, after reboot,&amp;lt;br&amp;gt;&lt;br /&gt;
best below in /etc/rc.local (without sudo)&amp;lt;br&amp;gt;&lt;br /&gt;
to show the states:&amp;lt;br&amp;gt;&lt;br /&gt;
sudo gpio  readall&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is the result:&lt;br /&gt;
&amp;lt;div class=&amp;quot;res-img&amp;quot;&amp;gt;&lt;br /&gt;
[[File:RPi_watermeter_board.jpeg|640px]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
All welded on an experiment board, for the Rpi, with a long pin connector, so you can stack other boards.&amp;lt;br&amp;gt;&lt;br /&gt;
I use a RJ11 connector to connect the sensor. &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Complete mounted on the Pi:&lt;br /&gt;
&amp;lt;div class=&amp;quot;res-img&amp;quot;&amp;gt;&lt;br /&gt;
[[File:RPi_watermeter_complete.jpeg|640px]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;Mounted in my Pi-Cluster:&lt;br /&gt;
&amp;lt;div class=&amp;quot;res-img&amp;quot;&amp;gt;&lt;br /&gt;
[[File:Pi_Cluster.jpg|640px]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
To get is working in Domotics:&amp;lt;br&amp;gt;&lt;br /&gt;
Add &amp;quot;Generic sysfs GPIO&amp;quot; at Hardware.&amp;lt;br&amp;gt;&lt;br /&gt;
The GPIO will be added automatically after 1 pulse, I named it &amp;quot;WaterMeterPulse&amp;quot;&amp;lt;br&amp;gt;&lt;br /&gt;
Add a virtual Sensor type &amp;quot;RFXMeter counter&amp;quot;, I Called it &amp;quot;WaterMeter&amp;quot;&amp;lt;br&amp;gt;&lt;br /&gt;
Add a lua script:&lt;br /&gt;
    -- sript_WaterMeter.lua&lt;br /&gt;
    -- 2018-09-04 v1.00 Roland Breedveld&lt;br /&gt;
    commandArray = {}&lt;br /&gt;
        if (devicechanged[&#039;WaterMeterPulse&#039;] == &#039;Open&#039;) then&lt;br /&gt;
            water=otherdevices[&#039;WaterMeter&#039;]&lt;br /&gt;
            print(&amp;quot;water impulse received: current liter: &amp;quot; .. water)&lt;br /&gt;
            water = water + 1&lt;br /&gt;
            commandArray[&#039;UpdateDevice&#039;]=&#039;372|0|&#039;..water&lt;br /&gt;
        end&lt;br /&gt;
    return commandArray&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Partlist:&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
Total Costs: about 10 Euro&amp;lt;br&amp;gt;&lt;br /&gt;
I ordered most parts at the well known Chinese site.&amp;lt;br&amp;gt;&lt;br /&gt;
- LJ12A3-4-Z/B magnetic sensor&amp;lt;br&amp;gt;&lt;br /&gt;
- aluminium strip 20x2.5cm, bended:4.5-11-4.5cm, with a ca 12mm hole&amp;lt;br&amp;gt;&lt;br /&gt;
- MT3608 DC-DC Adjustable Boost Module Feed Converter  Voltage Regulator (or external 12 Volt power supply)&amp;lt;br&amp;gt;&lt;br /&gt;
- Led 2mm, green or red.&amp;lt;br&amp;gt;&lt;br /&gt;
- resistor 680 Ohm&amp;lt;br&amp;gt;&lt;br /&gt;
- capacitor ca. 100 nF&amp;lt;br&amp;gt;&lt;br /&gt;
- RPi experiment board, I used: &amp;quot;DIY Proto HAT Shield Extension Board for Raspberry Pi GPIO Board&amp;quot;&amp;lt;br&amp;gt;&lt;br /&gt;
- Connector, with long pins: &amp;quot;20 Pins Female Pin Header 2.54m Pitch Extra Tall Female Dual Row Short Pin Headers PCB Connector&amp;quot;&amp;lt;br&amp;gt;&lt;br /&gt;
- optional: diode 1N4148 or something like that (1 for each RPi)&amp;lt;br&amp;gt;&lt;br /&gt;
- RJ11 connector, but every other connector will be fine.&amp;lt;br&amp;gt;&lt;/div&gt;</summary>
		<author><name>Roland</name></author>
	</entry>
	<entry>
		<id>http://wiki.breedveld.net/index.php?title=RPiWaterMeter&amp;diff=7293</id>
		<title>RPiWaterMeter</title>
		<link rel="alternate" type="text/html" href="http://wiki.breedveld.net/index.php?title=RPiWaterMeter&amp;diff=7293"/>
		<updated>2020-12-30T13:56:00Z</updated>

		<summary type="html">&lt;p&gt;Roland: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;Water usage measurement with a Raspberry Pi&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
In my case I use Domoticz, but it also works with Home-Assist and other products.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
It works with a magnetic sensor, which can be used because of the half-metal rotor of watermeters in my country (Netherlands)&amp;lt;br&amp;gt;&lt;br /&gt;
For magnetic sensor I use the LJ12A3-4-Z/B from the well known company in China. &amp;lt;br&amp;gt;&lt;br /&gt;
You can use most types but be sure to buy the OC (Open-Collector) version, because most sensors use higher voltages than the Raspberry Pi, and you won&#039;t damage your Pi.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
The sensor should be placed on the side of the rotator, not in the middle.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
With a piece of aluminium it&#039;s easy to mount on the meter:&lt;br /&gt;
&amp;lt;div class=&amp;quot;res-img&amp;quot;&amp;gt;&lt;br /&gt;
[[File:RPi_watermeter_sensor.jpeg|640px]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;res-img&amp;quot;&amp;gt;&lt;br /&gt;
[[File:RPi_watermeter_beugel.jpeg|320px]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Shematics:&lt;br /&gt;
&amp;lt;div class=&amp;quot;res-img&amp;quot;&amp;gt;&lt;br /&gt;
[[File:RPi_watermeter_schematics.jpeg|640px]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
The sensor needs 9-36 Volt, a Raspberry Pi only can deliver 5 and 3.3 Volt.&amp;lt;br&amp;gt;&lt;br /&gt;
You can use an extra 12 Volt adapter, but I don&#039;t like that......&amp;lt;br&amp;gt; &lt;br /&gt;
I use an adjustable chopper board (also from China), adjusted as 12 Volt.&amp;lt;br&amp;gt;&lt;br /&gt;
If you want the same Board it&#039;s called:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;quot;MT3608 DC-DC Adjustable Boost Module Feed Converter  Voltage Regulator Module 2A Max 2 V-24 V to 5 V-28 V&amp;quot;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
The output is connected to one of the GPIO&#039;s of the Pi, which first should configured as input, in my case I use GPIO28 (pin38/BCM20).&amp;lt;br&amp;gt;&lt;br /&gt;
The led will show if it works, for every pulse 1 liter water is detected.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
The diode is not needed if you use 1 Pi.&amp;lt;br&amp;gt;&lt;br /&gt;
I use a Raspberry Pi Cluster, so I can do a failover.&amp;lt;br&amp;gt;&lt;br /&gt;
The board is connected on 1 Pi, the other Pi is connected to the same pins: 6 and 38.&amp;lt;br&amp;gt;&lt;br /&gt;
For the Power (pin 2) a diode is needed, 1 for each Pi, while it&#039;s a bad idea to connect the power to multiple Pi&#039;s.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
First tested it with an experiment board:&lt;br /&gt;
&amp;lt;div class=&amp;quot;res-img&amp;quot;&amp;gt;&lt;br /&gt;
[[File:RPi_watermeter_experiment.jpeg|640px]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
To test it on a pi you need the gpio command:&amp;lt;br&amp;gt;&lt;br /&gt;
if not installed:&amp;lt;br&amp;gt;&lt;br /&gt;
sudo apt-get update&amp;lt;br&amp;gt;&lt;br /&gt;
sudo apt-get install wiringpi&amp;lt;br&amp;gt;&lt;br /&gt;
change GPIO 28 (BCM=20 and pin=38) as input:&amp;lt;br&amp;gt;&lt;br /&gt;
sudo /usr/local/bin/gpio export 20 in&amp;lt;br&amp;gt;&lt;br /&gt;
Put this line somewhere in a startup file, so it will stay that way, after reboot,&amp;lt;br&amp;gt;&lt;br /&gt;
best below in /etc/rc.local (without sudo)&amp;lt;br&amp;gt;&lt;br /&gt;
to show the states:&amp;lt;br&amp;gt;&lt;br /&gt;
sudo gpio  readall&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is the result:&lt;br /&gt;
&amp;lt;div class=&amp;quot;res-img&amp;quot;&amp;gt;&lt;br /&gt;
[[File:RPi_watermeter_board.jpeg|640px]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
All welded on an experiment board, for the Rpi, with a long pin connector, so you can stack other boards.&amp;lt;br&amp;gt;&lt;br /&gt;
I use a RJ11 connector to connect the sensor. &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Complete mounted on the Pi:&lt;br /&gt;
&amp;lt;div class=&amp;quot;res-img&amp;quot;&amp;gt;&lt;br /&gt;
[[File:RPi_watermeter_complete.jpeg|640px]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;Mounted in my Pi-Cluster:&lt;br /&gt;
&amp;lt;div class=&amp;quot;res-img&amp;quot;&amp;gt;&lt;br /&gt;
[[File:Pi_Cluster.jpg|640px]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
To get is working in Domotics:&amp;lt;br&amp;gt;&lt;br /&gt;
Add &amp;quot;Generic sysfs GPIO&amp;quot; at Hardware.&amp;lt;br&amp;gt;&lt;br /&gt;
The GPIO will be added automatically after 1 pulse, I named it &amp;quot;WaterMeterPulse&amp;quot;&amp;lt;br&amp;gt;&lt;br /&gt;
Add a virtual Sensor type &amp;quot;RFXMeter counter&amp;quot;, I Called it &amp;quot;WaterMeter&amp;quot;&amp;lt;br&amp;gt;&lt;br /&gt;
Add a lua script:&lt;br /&gt;
&amp;lt;textarea&amp;gt;&lt;br /&gt;
-- sript_WaterMeter.lua&lt;br /&gt;
-- 2018-09-04 v1.00 Roland Breedveld&lt;br /&gt;
&lt;br /&gt;
commandArray = {}&lt;br /&gt;
    if (devicechanged[&#039;WaterMeterPulse&#039;] == &#039;Open&#039;) then&lt;br /&gt;
        water=otherdevices[&#039;WaterMeter&#039;]&lt;br /&gt;
        print(&amp;quot;water impulse received: current liter: &amp;quot; .. water)&lt;br /&gt;
        water = water + 1&lt;br /&gt;
        --commandArray[&#039;Watermeter pulse&#039;]=&#039;Off&#039;&lt;br /&gt;
        commandArray[&#039;UpdateDevice&#039;]=&#039;372|0|&#039;..water&lt;br /&gt;
    end&lt;br /&gt;
return commandArray&lt;br /&gt;
&amp;lt;/textarea&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Partlist:&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
Total Costs: about 10 Euro&amp;lt;br&amp;gt;&lt;br /&gt;
I ordered most parts at the well known Chinese site.&amp;lt;br&amp;gt;&lt;br /&gt;
- LJ12A3-4-Z/B magnetic sensor&amp;lt;br&amp;gt;&lt;br /&gt;
- aluminium strip 20x2.5cm, bended:4.5-11-4.5cm, with a ca 12mm hole&amp;lt;br&amp;gt;&lt;br /&gt;
- MT3608 DC-DC Adjustable Boost Module Feed Converter  Voltage Regulator (or external 12 Volt power supply)&amp;lt;br&amp;gt;&lt;br /&gt;
- Led 2mm, green or red.&amp;lt;br&amp;gt;&lt;br /&gt;
- resistor 680 Ohm&amp;lt;br&amp;gt;&lt;br /&gt;
- capacitor ca. 100 nF&amp;lt;br&amp;gt;&lt;br /&gt;
- RPi experiment board, I used: &amp;quot;DIY Proto HAT Shield Extension Board for Raspberry Pi GPIO Board&amp;quot;&amp;lt;br&amp;gt;&lt;br /&gt;
- Connector, with long pins: &amp;quot;20 Pins Female Pin Header 2.54m Pitch Extra Tall Female Dual Row Short Pin Headers PCB Connector&amp;quot;&amp;lt;br&amp;gt;&lt;br /&gt;
- optional: diode 1N4148 or something like that (1 for each RPi)&amp;lt;br&amp;gt;&lt;br /&gt;
- RJ11 connector, but every other connector will be fine.&amp;lt;br&amp;gt;&lt;/div&gt;</summary>
		<author><name>Roland</name></author>
	</entry>
	<entry>
		<id>http://wiki.breedveld.net/index.php?title=RPiWaterMeter&amp;diff=7291</id>
		<title>RPiWaterMeter</title>
		<link rel="alternate" type="text/html" href="http://wiki.breedveld.net/index.php?title=RPiWaterMeter&amp;diff=7291"/>
		<updated>2020-12-24T08:12:06Z</updated>

		<summary type="html">&lt;p&gt;Roland: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;Water usage measurement with a Raspberry Pi&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
In my case I use Domoticz, but it also works with Home-Assist and other products.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
It works with a magnetic sensor, which can be used because of the half-metal rotor of watermeters in my country (Netherlands)&amp;lt;br&amp;gt;&lt;br /&gt;
For magnetic sensor I use the LJ12A3-4-Z/B from the well known company in China. &amp;lt;br&amp;gt;&lt;br /&gt;
You can use most types but be sure to buy the OC (Open-Collector) version, because most sensors use higher voltages than the Raspberry Pi, and you won&#039;t damage your Pi.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
The sensor should be placed on the side of the rotator, not in the middle.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
With a piece of aluminium it&#039;s easy to mount on the meter:&lt;br /&gt;
&amp;lt;div class=&amp;quot;res-img&amp;quot;&amp;gt;&lt;br /&gt;
[[File:RPi_watermeter_sensor.jpeg|640px]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;res-img&amp;quot;&amp;gt;&lt;br /&gt;
[[File:RPi_watermeter_beugel.jpeg|320px]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Shematics:&lt;br /&gt;
&amp;lt;div class=&amp;quot;res-img&amp;quot;&amp;gt;&lt;br /&gt;
[[File:RPi_watermeter_schematics.jpeg|640px]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
The sensor needs 9-36 Volt, a Raspberry Pi only can deliver 5 and 3.3 Volt.&amp;lt;br&amp;gt;&lt;br /&gt;
You can use an extra 12 Volt adapter, but I don&#039;t like that......&amp;lt;br&amp;gt; &lt;br /&gt;
I use an adjustable chopper board (also from China), adjusted as 12 Volt.&amp;lt;br&amp;gt;&lt;br /&gt;
If you want the same Board it&#039;s called:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;quot;MT3608 DC-DC Adjustable Boost Module Feed Converter  Voltage Regulator Module 2A Max 2 V-24 V to 5 V-28 V&amp;quot;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
The output is connected to one of the GPIO&#039;s of the Pi, which first should configured as input, in my case I use GPIO28 (pin38/BCM20).&amp;lt;br&amp;gt;&lt;br /&gt;
The led will show if it works, for every pulse 1 liter water is detected.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
The diode is not needed if you use 1 Pi.&amp;lt;br&amp;gt;&lt;br /&gt;
I use a Raspberry Pi Cluster, so I can do a failover.&amp;lt;br&amp;gt;&lt;br /&gt;
The board is connected on 1 Pi, the other Pi is connected to the same pins: 6 and 38.&amp;lt;br&amp;gt;&lt;br /&gt;
For the Power (pin 2) a diode is needed, 1 for each Pi, while it&#039;s a bad idea to connect the power to multiple Pi&#039;s.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
First tested it with an experiment board:&lt;br /&gt;
&amp;lt;div class=&amp;quot;res-img&amp;quot;&amp;gt;&lt;br /&gt;
[[File:RPi_watermeter_experiment.jpeg|640px]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
To test it on a pi you need the gpio command:&amp;lt;br&amp;gt;&lt;br /&gt;
if not installed:&amp;lt;br&amp;gt;&lt;br /&gt;
sudo apt-get update&amp;lt;br&amp;gt;&lt;br /&gt;
sudo apt-get install wiringpi&amp;lt;br&amp;gt;&lt;br /&gt;
change GPIO 28 (BCM=20 and pin=38) as input:&amp;lt;br&amp;gt;&lt;br /&gt;
sudo /usr/local/bin/gpio export 20 in&amp;lt;br&amp;gt;&lt;br /&gt;
Put this line somewhere in a startup file, so it will stay that way, after reboot,&amp;lt;br&amp;gt;&lt;br /&gt;
best below in /etc/rc.local (without sudo)&amp;lt;br&amp;gt;&lt;br /&gt;
to show the states:&amp;lt;br&amp;gt;&lt;br /&gt;
sudo gpio  readall&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is the result:&lt;br /&gt;
&amp;lt;div class=&amp;quot;res-img&amp;quot;&amp;gt;&lt;br /&gt;
[[File:RPi_watermeter_board.jpeg|640px]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
All welded on an experiment board, for the Rpi, with a long pin connector, so you can stack other boards.&amp;lt;br&amp;gt;&lt;br /&gt;
I use a RJ11 connector to connect the sensor. &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Complete mounted on the Pi:&lt;br /&gt;
&amp;lt;div class=&amp;quot;res-img&amp;quot;&amp;gt;&lt;br /&gt;
[[File:RPi_watermeter_complete.jpeg|640px]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Partlist:&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
Total Costs: about 10 Euro&amp;lt;br&amp;gt;&lt;br /&gt;
I ordered most parts at the well known Chinese site.&amp;lt;br&amp;gt;&lt;br /&gt;
- LJ12A3-4-Z/B magnetic sensor&amp;lt;br&amp;gt;&lt;br /&gt;
- aluminium strip 20x2.5cm, bended:4.5-11-4.5cm, with a ca 12mm hole&amp;lt;br&amp;gt;&lt;br /&gt;
- MT3608 DC-DC Adjustable Boost Module Feed Converter  Voltage Regulator (or external 12 Volt power supply)&amp;lt;br&amp;gt;&lt;br /&gt;
- Led 2mm, green or red.&amp;lt;br&amp;gt;&lt;br /&gt;
- resistor 680 Ohm&amp;lt;br&amp;gt;&lt;br /&gt;
- capacitor ca. 100 nF&amp;lt;br&amp;gt;&lt;br /&gt;
- RPi experiment board, I used: &amp;quot;DIY Proto HAT Shield Extension Board for Raspberry Pi GPIO Board&amp;quot;&amp;lt;br&amp;gt;&lt;br /&gt;
- Connector, with long pins: &amp;quot;20 Pins Female Pin Header 2.54m Pitch Extra Tall Female Dual Row Short Pin Headers PCB Connector&amp;quot;&amp;lt;br&amp;gt;&lt;br /&gt;
- optional: diode 1N4148 or something like that (1 for each RPi)&amp;lt;br&amp;gt;&lt;br /&gt;
- RJ11 connector, but every other connector will be fine.&amp;lt;br&amp;gt;&lt;/div&gt;</summary>
		<author><name>Roland</name></author>
	</entry>
	<entry>
		<id>http://wiki.breedveld.net/index.php?title=RPiWaterMeter&amp;diff=7290</id>
		<title>RPiWaterMeter</title>
		<link rel="alternate" type="text/html" href="http://wiki.breedveld.net/index.php?title=RPiWaterMeter&amp;diff=7290"/>
		<updated>2020-12-24T08:10:55Z</updated>

		<summary type="html">&lt;p&gt;Roland: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;Water usage measurement with a Raspberry Pi&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
In my case I use Domoticz, but it also works with Home-Assist and other products.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
It works with a magnetic sensor, which can be used because of the half-metal rotor of watermeters in my country (Netherlands)&amp;lt;br&amp;gt;&lt;br /&gt;
For magnetic sensor I use the LJ12A3-4-Z/B from the well known company in China. &amp;lt;br&amp;gt;&lt;br /&gt;
You can use most types but be sure to buy the OC (Open-Collector) version, because most sensors use higher voltages than the Raspberry Pi, and you won&#039;t damage your Pi.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
The sensor should be placed on the side of the rotator, not in the middle.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
With a piece of aluminium it&#039;s easy to mount on the meter:&lt;br /&gt;
&amp;lt;div class=&amp;quot;res-img&amp;quot;&amp;gt;&lt;br /&gt;
[[File:RPi_watermeter_sensor.jpeg|640px]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;res-img&amp;quot;&amp;gt;&lt;br /&gt;
[[File:RPi_watermeter_beugel.jpeg|320px]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Shematics:&lt;br /&gt;
&amp;lt;div class=&amp;quot;res-img&amp;quot;&amp;gt;&lt;br /&gt;
[[File:RPi_watermeter_schematics.jpeg|640px]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
The sensor needs 9-36 Volt, a Raspberry Pi only can deliver 5 and 3.3 Volt.&amp;lt;br&amp;gt;&lt;br /&gt;
You can use an extra 12 Volt adapter, but I don&#039;t like that......&amp;lt;br&amp;gt; &lt;br /&gt;
I use an adjustable chopper board (also from China), adjusted as 12 Volt.&amp;lt;br&amp;gt;&lt;br /&gt;
If you want the same Board it&#039;s called:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;quot;MT3608 DC-DC Adjustable Boost Module Feed Converter  Voltage Regulator Module 2A Max 2 V-24 V to 5 V-28 V&amp;quot;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
The output is connected to one of the GPIO&#039;s of the Pi, which first should configured as input, in my case I use GPIO28 (pin38/BCM20).&amp;lt;br&amp;gt;&lt;br /&gt;
The led will show if it works, for every pulse 1 liter water is detected.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
The diode is not needed if you use 1 Pi.&amp;lt;br&amp;gt;&lt;br /&gt;
I use a Raspberry Pi Cluster, so I can do a failover.&amp;lt;br&amp;gt;&lt;br /&gt;
The board is connected on 1 Pi, the other Pi is connected to the same pins: 6 and 38.&amp;lt;br&amp;gt;&lt;br /&gt;
For the Power (pin 2) a diode is needed, 1 for each Pi, while it&#039;s a bad idea to connect the power to multiple Pi&#039;s.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
First tested it with an experiment board:&lt;br /&gt;
&amp;lt;div class=&amp;quot;res-img&amp;quot;&amp;gt;&lt;br /&gt;
[[File:RPi_watermeter_experiment.jpeg|640px]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
To test it on a pi you need the gpio command:&amp;lt;br&amp;gt;&lt;br /&gt;
if not installed:&amp;lt;br&amp;gt;&lt;br /&gt;
sudo apt-get update&amp;lt;br&amp;gt;&lt;br /&gt;
sudo apt-get install wiringpi&amp;lt;br&amp;gt;&lt;br /&gt;
change GPIO 28 (BCM=20 and pin=38) as input:&amp;lt;br&amp;gt;&lt;br /&gt;
sudo /usr/local/bin/gpio export 20 in&amp;lt;br&amp;gt;&lt;br /&gt;
Put this line somewhere in a startup file, so it will stay that way, after reboot,&amp;lt;br&amp;gt;&lt;br /&gt;
best below in /etc/rc.local (without sudo)&amp;lt;br&amp;gt;&lt;br /&gt;
to show the states:&amp;lt;br&amp;gt;&lt;br /&gt;
sudo gpio  readall&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is the result:&lt;br /&gt;
&amp;lt;div class=&amp;quot;res-img&amp;quot;&amp;gt;&lt;br /&gt;
[[File:RPi_watermeter_board.jpeg|640px]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
All welded on an experiment board, for the Rpi, with a long pin connector, so you can stack other boards.&amp;lt;br&amp;gt;&lt;br /&gt;
I use a RJ11 connector to connect the sensor. &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Complete mounted on the Pi:&lt;br /&gt;
&amp;lt;div class=&amp;quot;res-img&amp;quot;&amp;gt;&lt;br /&gt;
[[File:RPi_watermeter_complete.jpeg|640px]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Partlist:&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
Total Costs: about 10 Euro&amp;lt;br&amp;gt;&lt;br /&gt;
I ordered most parts at the well known Chinese site.&amp;lt;br&amp;gt;&lt;br /&gt;
- LJ12A3-4-Z/B magnetic sensor&amp;lt;br&amp;gt;&lt;br /&gt;
- aluminium strip 20x2.5cm, bended:4.5-11-4.5cm, with a ca 12mm hole&amp;lt;br&amp;gt;&lt;br /&gt;
- MT3608 DC-DC Adjustable Boost Module Feed Converter  Voltage Regulator (or external 12 Volt power supply)&amp;lt;br&amp;gt;&lt;br /&gt;
- Led 2mm, green or red.&amp;lt;br&amp;gt;&lt;br /&gt;
- resistor 680 Ohm&amp;lt;br&amp;gt;&lt;br /&gt;
- capacitor ca. 100 nF&amp;lt;br&amp;gt;&lt;br /&gt;
- RPi experiment board, I used: &amp;quot;DIY Proto HAT Shield Extension Board for Raspberry Pi 4 Model B / 3B+ / 3B Red RPI GPIO Board&amp;quot;&amp;lt;br&amp;gt;&lt;br /&gt;
- Connector, with long  pins: &amp;quot;20 Pins Female Pin Header 2.54m Pitch Extra Tall Female Dual Row Short Pin Headers PCB Connector&amp;quot;&amp;lt;br&amp;gt;&lt;br /&gt;
- optional: diode 1N4148 or something like that (1 for each RPi)&amp;lt;br&amp;gt;&lt;br /&gt;
- RJ11 connector, but every other connector will be fine.&amp;lt;br&amp;gt;&lt;/div&gt;</summary>
		<author><name>Roland</name></author>
	</entry>
	<entry>
		<id>http://wiki.breedveld.net/index.php?title=RPiWaterMeter&amp;diff=7289</id>
		<title>RPiWaterMeter</title>
		<link rel="alternate" type="text/html" href="http://wiki.breedveld.net/index.php?title=RPiWaterMeter&amp;diff=7289"/>
		<updated>2020-12-24T08:08:10Z</updated>

		<summary type="html">&lt;p&gt;Roland: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;&lt;br /&gt;
Water usage mesurement with a Raspberry Pi&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
In my case I use Domoticz, but it also works with Home-Assist and other products.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
It works with a magnetic sensor, which can be used because of the half-metal rotor of watermeters in my country (Netherlands)&amp;lt;br&amp;gt;&lt;br /&gt;
For magnetic sensor I use the LJ12A3-4-Z/B from the well known company in China. &amp;lt;br&amp;gt;&lt;br /&gt;
You can use most types but be sure to buy the OC (Open-Collector) version, because most sensors use higher voltages than the Raspberry Pi, and you won&#039;t damage your Pi.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
The sensor should be placed on the side of the rotator, not in the middle.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
With a piece of aluminium it&#039;s easy to mount on the meter:&lt;br /&gt;
&amp;lt;div class=&amp;quot;res-img&amp;quot;&amp;gt;&lt;br /&gt;
[[File:RPi_watermeter_sensor.jpeg|640px]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;res-img&amp;quot;&amp;gt;&lt;br /&gt;
[[File:RPi_watermeter_beugel.jpeg|320px]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Shematics:&lt;br /&gt;
&amp;lt;div class=&amp;quot;res-img&amp;quot;&amp;gt;&lt;br /&gt;
[[File:RPi_watermeter_schematics.jpeg|640px]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
The sensor needs 9-36 Volt, a Raspberry Pi only can deliver 5 and 3.3 Volt.&amp;lt;br&amp;gt;&lt;br /&gt;
You can use an extra 12 Volt adapter, but I don&#039;t like that......&amp;lt;br&amp;gt; &lt;br /&gt;
I use an adjustable chopper board (also from China), adjusted as 12 Volt.&amp;lt;br&amp;gt;&lt;br /&gt;
If you want the same Board it&#039;s called:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;quot;MT3608 DC-DC Adjustable Boost Module Feed Converter  Voltage Regulator Module 2A Max 2 V-24 V to 5 V-28 V&amp;quot;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
The output is connected to one of the GPIO&#039;s of the Pi, which first should configured as input, in my case I use GPIO28 (pin38/BCM20).&amp;lt;br&amp;gt;&lt;br /&gt;
The led will show if it works, for every pulse 1 liter water is detected.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
The diode is not needed if you use 1 Pi.&amp;lt;br&amp;gt;&lt;br /&gt;
I use a Raspberry Pi Cluster, so I can do a failover.&amp;lt;br&amp;gt;&lt;br /&gt;
The board is connected on 1 Pi, the other Pi is connected to the same pins: 6 and 38.&amp;lt;br&amp;gt;&lt;br /&gt;
For the Power (pin 2) a diode is needed, 1 for each Pi, while it&#039;s a bad idea to connect the power to multiple Pi&#039;s.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
First tested it with an experiment board:&lt;br /&gt;
&amp;lt;div class=&amp;quot;res-img&amp;quot;&amp;gt;&lt;br /&gt;
[[File:RPi_watermeter_experiment.jpeg|640px]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
To test it on a pi you need the gpio command:&amp;lt;br&amp;gt;&lt;br /&gt;
if not installed:&amp;lt;br&amp;gt;&lt;br /&gt;
sudo apt-get update&amp;lt;br&amp;gt;&lt;br /&gt;
sudo apt-get install wiringpi&amp;lt;br&amp;gt;&lt;br /&gt;
change GPIO 28 (BCM=20 and pin=38) as input:&amp;lt;br&amp;gt;&lt;br /&gt;
sudo /usr/local/bin/gpio export 20 in&amp;lt;br&amp;gt;&lt;br /&gt;
Put this line somewhere in a startup file, so it will stay that way, after reboot,&amp;lt;br&amp;gt;&lt;br /&gt;
best below in /etc/rc.local (without sudo)&amp;lt;br&amp;gt;&lt;br /&gt;
to show the states:&amp;lt;br&amp;gt;&lt;br /&gt;
sudo gpio  readall&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is the result:&lt;br /&gt;
&amp;lt;div class=&amp;quot;res-img&amp;quot;&amp;gt;&lt;br /&gt;
[[File:RPi_watermeter_board.jpeg|640px]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
All welded on an experiment board, for the Rpi, with a long pin connector, so you can stack other boards.&amp;lt;br&amp;gt;&lt;br /&gt;
I use a RJ11 connector to connect the sensor. &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Complete mounted on the Pi:&lt;br /&gt;
&amp;lt;div class=&amp;quot;res-img&amp;quot;&amp;gt;&lt;br /&gt;
[[File:RPi_watermeter_complete.jpeg|640px]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Partlist:&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
I ordered most parts at the well known Chinese site.&amp;lt;br&amp;gt;&lt;br /&gt;
- LJ12A3-4-Z/B magnetic sensor&amp;lt;br&amp;gt;&lt;br /&gt;
- aluminium strip 20x2.5cm, bended:4.5-11-4.5cm, with a ca 12mm hole&amp;lt;br&amp;gt;&lt;br /&gt;
- MT3608 DC-DC Adjustable Boost Module Feed Converter  Voltage Regulator (or external 12 Volt power supply)&amp;lt;br&amp;gt;&lt;br /&gt;
- Led 2mm, green or red.&amp;lt;br&amp;gt;&lt;br /&gt;
- resistor 680 Ohm&amp;lt;br&amp;gt;&lt;br /&gt;
- capacitor ca. 100 nF&amp;lt;br&amp;gt;&lt;br /&gt;
- RPi experiment board, I used: &amp;quot;DIY Proto HAT Shield Extension Board for Raspberry Pi 4 Model B / 3B+ / 3B Red RPI GPIO Board&amp;quot;&amp;lt;br&amp;gt;&lt;br /&gt;
- Connector, with long  pins: &amp;quot;20 Pins Female Pin Header 2.54m Pitch Extra Tall Female Dual Row Short Pin Headers PCB Connector&amp;quot;&amp;lt;br&amp;gt;&lt;br /&gt;
- optional: diode 1N4148 or something like that (1 for each RPi)&amp;lt;br&amp;gt;&lt;br /&gt;
- RJ11 connector, but every other connector will be fine.&amp;lt;br&amp;gt;&lt;/div&gt;</summary>
		<author><name>Roland</name></author>
	</entry>
	<entry>
		<id>http://wiki.breedveld.net/index.php?title=RPiWaterMeter&amp;diff=7288</id>
		<title>RPiWaterMeter</title>
		<link rel="alternate" type="text/html" href="http://wiki.breedveld.net/index.php?title=RPiWaterMeter&amp;diff=7288"/>
		<updated>2020-12-24T08:06:34Z</updated>

		<summary type="html">&lt;p&gt;Roland: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;&lt;br /&gt;
Water usage mesurement with a Raspberry Pi&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
In my case I use Domoticz, but it also works with Home-Assist and other products.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
It works with a magnetic sensor, which can be used because of the half-metal rotor of watermeters in my country (Netherlands)&amp;lt;br&amp;gt;&lt;br /&gt;
For magnetic sensor I use the LJ12A3-4-Z/B from the well known company in China. &amp;lt;br&amp;gt;&lt;br /&gt;
You can use most types but be sure to buy the OC (Open-Collector) version, because most sensors use higher voltages than the Raspberry Pi, and you won&#039;t damage your Pi.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
The sensor should be placed on the side of the rotator, not in the middle.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
With a piece of aluminium it&#039;s easy to mount on the meter:&lt;br /&gt;
&amp;lt;div class=&amp;quot;res-img&amp;quot;&amp;gt;&lt;br /&gt;
[[File:RPi_watermeter_sensor.jpeg|640px]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;res-img&amp;quot;&amp;gt;&lt;br /&gt;
[[File:RPi_watermeter_beugel.jpeg|320px]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Shematics:&lt;br /&gt;
&amp;lt;div class=&amp;quot;res-img&amp;quot;&amp;gt;&lt;br /&gt;
[[File:RPi_watermeter_schematics.jpeg|640px]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
The sensor needs 9-36 Volt, a Raspberry Pi only can deliver 5 and 3.3 Volt.&amp;lt;br&amp;gt;&lt;br /&gt;
You can use an extra 12 Volt adapter, but I don&#039;t like that......&amp;lt;br&amp;gt; &lt;br /&gt;
I use an adjustable chopper board (also from China), adjusted as 12 Volt.&amp;lt;br&amp;gt;&lt;br /&gt;
If you want the same Board it&#039;s called:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;quot;MT3608 DC-DC Adjustable Boost Module Feed Converter  Voltage Regulator Module 2A Max 2 V-24 V to 5 V-28 V&amp;quot;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
The output is connected to one of the GPIO&#039;s of the Pi, which first should configured as input, in my case I use GPIO28 (pin38/BCM20).&amp;lt;br&amp;gt;&lt;br /&gt;
The led will show if it works, for every pulse 1 liter water is detected.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
The diode is not needed if you use 1 Pi.&amp;lt;br&amp;gt;&lt;br /&gt;
I use a Raspberry Pi Cluster, so I can do a failover.&amp;lt;br&amp;gt;&lt;br /&gt;
The board is connected on 1 Pi, the other Pi is connected to the same pins: 6 and 38.&amp;lt;br&amp;gt;&lt;br /&gt;
For the Power (pin 2) a diode is needed, 1 for each Pi, while it&#039;s a bad idea to connect the power to multiple Pi&#039;s.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
First tested it with an experiment board:&lt;br /&gt;
&amp;lt;div class=&amp;quot;res-img&amp;quot;&amp;gt;&lt;br /&gt;
[[File:RPi_watermeter_experiment.jpeg|640px]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
To test it on a pi you need the gpio command:&amp;lt;br&amp;gt;&lt;br /&gt;
if not installed:&amp;lt;br&amp;gt;&lt;br /&gt;
sudo apt-get update&amp;lt;br&amp;gt;&lt;br /&gt;
sudo apt-get install wiringpi&amp;lt;br&amp;gt;&lt;br /&gt;
change GPIO 28 (BCM=20 and pin=38) as input:&amp;lt;br&amp;gt;&lt;br /&gt;
sudo /usr/local/bin/gpio export 20 in&amp;lt;br&amp;gt;&lt;br /&gt;
Put this line somewhere in a startup file, so it will stay that way, after reboot,&amp;lt;br&amp;gt;&lt;br /&gt;
best below in /etc/rc.local (without sudo)&amp;lt;br&amp;gt;&lt;br /&gt;
to show the states:&amp;lt;br&amp;gt;&lt;br /&gt;
sudo gpio  readall&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is the result:&lt;br /&gt;
&amp;lt;div class=&amp;quot;res-img&amp;quot;&amp;gt;&lt;br /&gt;
[[File:RPi_watermeter_board.jpeg|640px]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
All welded on an experiment board, for the Rpi, with a long pin connector, so you can stack other boards.&amp;lt;br&amp;gt;&lt;br /&gt;
I use a RJ11 connector to connect the sensor. &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Complete mounted on the Pi:&lt;br /&gt;
&amp;lt;div class=&amp;quot;res-img&amp;quot;&amp;gt;&lt;br /&gt;
[[File:RPi_watermeter_complete.jpeg|640px]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Partlist:&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
I ordered most parts at the well known Chinese site.&amp;lt;br&amp;gt;&lt;br /&gt;
- LJ12A3-4-Z/B magnetic sensor&amp;lt;br&amp;gt;&lt;br /&gt;
- aluminium strip 20x2.5 cm&amp;lt;br&amp;gt;&lt;br /&gt;
- MT3608 DC-DC Adjustable Boost Module Feed Converter  Voltage Regulator (or external 12 Volt power supply)&amp;lt;br&amp;gt;&lt;br /&gt;
- Led 2mm, green or red.&amp;lt;br&amp;gt;&lt;br /&gt;
- resistor 680 Ohm&amp;lt;br&amp;gt;&lt;br /&gt;
- capacitor ca. 100 nF&amp;lt;br&amp;gt;&lt;br /&gt;
- RPi experiment board, I used: &amp;quot;DIY Proto HAT Shield Extension Board for Raspberry Pi 4 Model B / 3B+ / 3B Red RPI GPIO Board&amp;quot;&amp;lt;br&amp;gt;&lt;br /&gt;
- Connector, with long  pins: &amp;quot;20 Pins Female Pin Header 2.54m Pitch Extra Tall Female Dual Row Short Pin Headers PCB Connector&amp;quot;&amp;lt;br&amp;gt;&lt;br /&gt;
- optional: diode 1N4148 or something like that (1 for each RPi)&amp;lt;br&amp;gt;&lt;br /&gt;
- RJ11 connector, but every other connector will be fine.&amp;lt;br&amp;gt;&lt;/div&gt;</summary>
		<author><name>Roland</name></author>
	</entry>
	<entry>
		<id>http://wiki.breedveld.net/index.php?title=RPiWaterMeter&amp;diff=7287</id>
		<title>RPiWaterMeter</title>
		<link rel="alternate" type="text/html" href="http://wiki.breedveld.net/index.php?title=RPiWaterMeter&amp;diff=7287"/>
		<updated>2020-12-24T08:06:03Z</updated>

		<summary type="html">&lt;p&gt;Roland: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;&lt;br /&gt;
Water usage mesurement with a Raspberry Pi&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
In my case I use Domoticz, but it also works with Home-Assist and other products.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
It works with a magnetic sensor, which can be used because of the half-metal rotor of watermeters in my country (Netherlands)&amp;lt;br&amp;gt;&lt;br /&gt;
For magnetic sensor I use the LJ12A3-4-Z/B from the well known company in China. &amp;lt;br&amp;gt;&lt;br /&gt;
You can use most types but be sure to buy the OC (Open-Collector) version, because most sensors use higher voltages than the Raspberry Pi, and you won&#039;t damage your Pi.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
The sensor should be placed on the side of the rotator, not in the middle.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
With a piece of aluminium it&#039;s easy to mount on the meter:&lt;br /&gt;
&amp;lt;div class=&amp;quot;res-img&amp;quot;&amp;gt;&lt;br /&gt;
[[File:RPi_watermeter_sensor.jpeg|640px]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;res-img&amp;quot;&amp;gt;&lt;br /&gt;
[[File:RPi_watermeter_beugel.jpeg|320px]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Shematics:&lt;br /&gt;
&amp;lt;div class=&amp;quot;res-img&amp;quot;&amp;gt;&lt;br /&gt;
[[File:RPi_watermeter_schematics.jpeg|640px]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
The sensor needs 9-36 Volt, a Raspberry Pi only can deliver 5 and 3.3 Volt.&amp;lt;br&amp;gt;&lt;br /&gt;
You can use an extra 12 Volt adapter, but I don&#039;t like that......&amp;lt;br&amp;gt; &lt;br /&gt;
I use an adjustable chopper board (also from China), adjusted as 12 Volt.&amp;lt;br&amp;gt;&lt;br /&gt;
If you want the same Board it&#039;s called:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;quot;MT3608 DC-DC Adjustable Boost Module Feed Converter  Voltage Regulator Module 2A Max 2 V-24 V to 5 V-28 V&amp;quot;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
The output is connected to one of the GPIO&#039;s of the Pi, which first should configured as input, in my case I use GPIO28 (pin38/BCM20).&amp;lt;br&amp;gt;&lt;br /&gt;
The led will show if it works, for every pulse 1 liter water is detected.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
The diode is not needed if you use 1 Pi.&amp;lt;br&amp;gt;&lt;br /&gt;
I use a Raspberry Pi Cluster, so I can do a failover.&amp;lt;br&amp;gt;&lt;br /&gt;
The board is connected on 1 Pi, the other Pi is connected to the same pins: 6 and 38.&amp;lt;br&amp;gt;&lt;br /&gt;
For the Power (pin 2) a diode is needed, 1 for each Pi, while it&#039;s a bad idea to connect the power to multiple Pi&#039;s.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
First tested it with an experiment board:&lt;br /&gt;
&amp;lt;div class=&amp;quot;res-img&amp;quot;&amp;gt;&lt;br /&gt;
[[File:RPi_watermeter_experiment.jpeg|640px]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
To test it on a pi you need the gpio command:&amp;lt;br&amp;gt;&lt;br /&gt;
if not installed:&amp;lt;br&amp;gt;&lt;br /&gt;
sudo apt-get update&amp;lt;br&amp;gt;&lt;br /&gt;
sudo apt-get install wiringpi&amp;lt;br&amp;gt;&lt;br /&gt;
change GPIO 28 (BCM=20 and pin=38) as input:&amp;lt;br&amp;gt;&lt;br /&gt;
sudo /usr/local/bin/gpio export 20 in&amp;lt;br&amp;gt;&lt;br /&gt;
Put this line somewhere in a startup file, so it will stay that way, after reboot,&amp;lt;br&amp;gt;&lt;br /&gt;
best below in /etc/rc.local (without sudo)&amp;lt;br&amp;gt;&lt;br /&gt;
to show the states:&amp;lt;br&amp;gt;&lt;br /&gt;
sudo gpio  readall&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is the result:&lt;br /&gt;
&amp;lt;div class=&amp;quot;res-img&amp;quot;&amp;gt;&lt;br /&gt;
[[File:RPi_watermeter_board.jpeg|640px]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
All welded on an experiment board, for the Rpi, with a long pin connector, so you can stack other boards.&amp;lt;br&amp;gt;&lt;br /&gt;
I use a RJ11 connector to connect the sensor. &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Complete mounted on the Pi:&lt;br /&gt;
&amp;lt;div class=&amp;quot;res-img&amp;quot;&amp;gt;&lt;br /&gt;
[[File:RPi_watermeter_complete.jpeg|640px]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Partlist:&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
I ordered most parts at the well known Chinese site.&amp;lt;br&amp;gt;&lt;br /&gt;
- LJ12A3-4-Z/B magnetic sensor&amp;lt;br&amp;gt;&lt;br /&gt;
- aluminium strip 20x2.5 cm&amp;lt;br&amp;gt;&lt;br /&gt;
- MT3608 DC-DC Adjustable Boost Module Feed Converter  Voltage Regulator or external 12 Volt power supply.&amp;lt;br&amp;gt;&lt;br /&gt;
- Led 2mm, green or red.&amp;lt;br&amp;gt;&lt;br /&gt;
- resistor 680 Ohm&amp;lt;br&amp;gt;&lt;br /&gt;
- capacitor ca. 100 nF&amp;lt;br&amp;gt;&lt;br /&gt;
- RPi experiment board, I used: &amp;quot;DIY Proto HAT Shield Extension Board for Raspberry Pi 4 Model B / 3B+ / 3B Red RPI GPIO Board&amp;quot;&amp;lt;br&amp;gt;&lt;br /&gt;
- Connector, with long  pins: &amp;quot;20 Pins Female Pin Header 2.54m Pitch Extra Tall Female Dual Row Short Pin Headers PCB Connector&amp;quot;&amp;lt;br&amp;gt;&lt;br /&gt;
- optional: diode 1N4148 or something like that (1 for each RPi)&amp;lt;br&amp;gt;&lt;br /&gt;
- RJ11 connector, but every other connector will be fine.&amp;lt;br&amp;gt;&lt;/div&gt;</summary>
		<author><name>Roland</name></author>
	</entry>
	<entry>
		<id>http://wiki.breedveld.net/index.php?title=RPiWaterMeter&amp;diff=7286</id>
		<title>RPiWaterMeter</title>
		<link rel="alternate" type="text/html" href="http://wiki.breedveld.net/index.php?title=RPiWaterMeter&amp;diff=7286"/>
		<updated>2020-12-24T08:05:33Z</updated>

		<summary type="html">&lt;p&gt;Roland: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;&lt;br /&gt;
Water usage mesurement with a Raspberry Pi&#039;&#039;&#039;&lt;br /&gt;
In my case I use Domoticz, but it also works with Home-Assist and other products.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
It works with a magnetic sensor, which can be used because of the half-metal rotor of watermeters in my country (Netherlands)&amp;lt;br&amp;gt;&lt;br /&gt;
For magnetic sensor I use the LJ12A3-4-Z/B from the well known company in China. &amp;lt;br&amp;gt;&lt;br /&gt;
You can use most types but be sure to buy the OC (Open-Collector) version, because most sensors use higher voltages than the Raspberry Pi, and you won&#039;t damage your Pi.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
The sensor should be placed on the side of the rotator, not in the middle.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
With a piece of aluminium it&#039;s easy to mount on the meter:&lt;br /&gt;
&amp;lt;div class=&amp;quot;res-img&amp;quot;&amp;gt;&lt;br /&gt;
[[File:RPi_watermeter_sensor.jpeg|640px]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;res-img&amp;quot;&amp;gt;&lt;br /&gt;
[[File:RPi_watermeter_beugel.jpeg|320px]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Shematics:&lt;br /&gt;
&amp;lt;div class=&amp;quot;res-img&amp;quot;&amp;gt;&lt;br /&gt;
[[File:RPi_watermeter_schematics.jpeg|640px]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
The sensor needs 9-36 Volt, a Raspberry Pi only can deliver 5 and 3.3 Volt.&amp;lt;br&amp;gt;&lt;br /&gt;
You can use an extra 12 Volt adapter, but I don&#039;t like that......&amp;lt;br&amp;gt; &lt;br /&gt;
I use an adjustable chopper board (also from China), adjusted as 12 Volt.&amp;lt;br&amp;gt;&lt;br /&gt;
If you want the same Board it&#039;s called:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;quot;MT3608 DC-DC Adjustable Boost Module Feed Converter  Voltage Regulator Module 2A Max 2 V-24 V to 5 V-28 V&amp;quot;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
The output is connected to one of the GPIO&#039;s of the Pi, which first should configured as input, in my case I use GPIO28 (pin38/BCM20).&amp;lt;br&amp;gt;&lt;br /&gt;
The led will show if it works, for every pulse 1 liter water is detected.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
The diode is not needed if you use 1 Pi.&amp;lt;br&amp;gt;&lt;br /&gt;
I use a Raspberry Pi Cluster, so I can do a failover.&amp;lt;br&amp;gt;&lt;br /&gt;
The board is connected on 1 Pi, the other Pi is connected to the same pins: 6 and 38.&amp;lt;br&amp;gt;&lt;br /&gt;
For the Power (pin 2) a diode is needed, 1 for each Pi, while it&#039;s a bad idea to connect the power to multiple Pi&#039;s.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
First tested it with an experiment board:&lt;br /&gt;
&amp;lt;div class=&amp;quot;res-img&amp;quot;&amp;gt;&lt;br /&gt;
[[File:RPi_watermeter_experiment.jpeg|640px]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
To test it on a pi you need the gpio command:&amp;lt;br&amp;gt;&lt;br /&gt;
if not installed:&amp;lt;br&amp;gt;&lt;br /&gt;
sudo apt-get update&amp;lt;br&amp;gt;&lt;br /&gt;
sudo apt-get install wiringpi&amp;lt;br&amp;gt;&lt;br /&gt;
change GPIO 28 (BCM=20 and pin=38) as input:&amp;lt;br&amp;gt;&lt;br /&gt;
sudo /usr/local/bin/gpio export 20 in&amp;lt;br&amp;gt;&lt;br /&gt;
Put this line somewhere in a startup file, so it will stay that way, after reboot,&amp;lt;br&amp;gt;&lt;br /&gt;
best below in /etc/rc.local (without sudo)&amp;lt;br&amp;gt;&lt;br /&gt;
to show the states:&amp;lt;br&amp;gt;&lt;br /&gt;
sudo gpio  readall&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is the result:&lt;br /&gt;
&amp;lt;div class=&amp;quot;res-img&amp;quot;&amp;gt;&lt;br /&gt;
[[File:RPi_watermeter_board.jpeg|640px]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
All welded on an experiment board, for the Rpi, with a long pin connector, so you can stack other boards.&amp;lt;br&amp;gt;&lt;br /&gt;
I use a RJ11 connector to connect the sensor. &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Complete mounted on the Pi:&lt;br /&gt;
&amp;lt;div class=&amp;quot;res-img&amp;quot;&amp;gt;&lt;br /&gt;
[[File:RPi_watermeter_complete.jpeg|640px]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Partlist:&#039;&#039;&#039;&lt;br /&gt;
I ordered most parts at the well known Chinese site.&amp;lt;br&amp;gt;&lt;br /&gt;
- LJ12A3-4-Z/B magnetic sensor&amp;lt;br&amp;gt;&lt;br /&gt;
- aluminium strip 20x2.5 cm&amp;lt;br&amp;gt;&lt;br /&gt;
- MT3608 DC-DC Adjustable Boost Module Feed Converter  Voltage Regulator or external 12 Volt power supply.&amp;lt;br&amp;gt;&lt;br /&gt;
- Led 2mm, green or red.&amp;lt;br&amp;gt;&lt;br /&gt;
- resistor 680 Ohm&amp;lt;br&amp;gt;&lt;br /&gt;
- capacitor ca. 100 nF&amp;lt;br&amp;gt;&lt;br /&gt;
- RPi experiment board, I used: &amp;quot;DIY Proto HAT Shield Extension Board for Raspberry Pi 4 Model B / 3B+ / 3B Red RPI GPIO Board&amp;quot;&amp;lt;br&amp;gt;&lt;br /&gt;
- Connector, with long  pins: &amp;quot;20 Pins Female Pin Header 2.54m Pitch Extra Tall Female Dual Row Short Pin Headers PCB Connector&amp;quot;&amp;lt;br&amp;gt;&lt;br /&gt;
- optional: diode 1N4148 or something like that (1 for each RPi)&amp;lt;br&amp;gt;&lt;br /&gt;
- RJ11 connector, but every other connector will be fine.&amp;lt;br&amp;gt;&lt;/div&gt;</summary>
		<author><name>Roland</name></author>
	</entry>
	<entry>
		<id>http://wiki.breedveld.net/index.php?title=RPiWaterMeter&amp;diff=7285</id>
		<title>RPiWaterMeter</title>
		<link rel="alternate" type="text/html" href="http://wiki.breedveld.net/index.php?title=RPiWaterMeter&amp;diff=7285"/>
		<updated>2020-12-24T08:04:36Z</updated>

		<summary type="html">&lt;p&gt;Roland: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;&lt;br /&gt;
Water usage mesurement with a Raspberry Pi&#039;&#039;&#039;&lt;br /&gt;
In my case I use Domoticz, but it also works with Home-Assist and other products.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
It works with a magnetic sensor, which can be used because of the half-metal rotor of watermeters in my country (Netherlands)&amp;lt;br&amp;gt;&lt;br /&gt;
For magnetic sensor I use the LJ12A3-4-Z/B from the well known company in China. &amp;lt;br&amp;gt;&lt;br /&gt;
You can use most types but be sure to buy the OC (Open-Collector) version, because most sensors use higher voltages than the Raspberry Pi, and you won&#039;t damage your Pi.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
The sensor should be placed on the side of the rotator, not in the middle.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
With a piece of aluminium it&#039;s easy to mount on the meter:&lt;br /&gt;
&amp;lt;div class=&amp;quot;res-img&amp;quot;&amp;gt;&lt;br /&gt;
[[File:RPi_watermeter_sensor.jpeg|640px]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;res-img&amp;quot;&amp;gt;&lt;br /&gt;
[[File:RPi_watermeter_beugel.jpeg|320px]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Shematics:&lt;br /&gt;
&amp;lt;div class=&amp;quot;res-img&amp;quot;&amp;gt;&lt;br /&gt;
[[File:RPi_watermeter_schematics.jpeg|640px]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
The sensor needs 9-36 Volt, a Raspberry Pi only can deliver 5 and 3.3 Volt.&amp;lt;br&amp;gt;&lt;br /&gt;
You can use an extra 12 Volt adapter, but I don&#039;t like that......&amp;lt;br&amp;gt; &lt;br /&gt;
I use an adjustable chopper board (also from China), adjusted as 12 Volt.&amp;lt;br&amp;gt;&lt;br /&gt;
If you want the same Board it&#039;s called:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;quot;MT3608 DC-DC Adjustable Boost Module Feed Converter  Voltage Regulator Module 2A Max 2 V-24 V to 5 V-28 V&amp;quot;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
The output is connected to one of the GPIO&#039;s of the Pi, which first should configured as input, in my case I use GPIO28 (pin38/BCM20).&amp;lt;br&amp;gt;&lt;br /&gt;
The led will show if it works, for every pulse 1 liter water is detected.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
The diode is not needed if you use 1 Pi.&amp;lt;br&amp;gt;&lt;br /&gt;
I use a Raspberry Pi Cluster, so I can do a failover.&amp;lt;br&amp;gt;&lt;br /&gt;
The board is connected on 1 Pi, the other Pi is connected to the same pins: 6 and 38.&amp;lt;br&amp;gt;&lt;br /&gt;
For the Power (pin 2) a diode is needed, 1 for each Pi, while it&#039;s a bad idea to connect the power to multiple Pi&#039;s.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
First tested it with an experiment board:&lt;br /&gt;
&amp;lt;div class=&amp;quot;res-img&amp;quot;&amp;gt;&lt;br /&gt;
[[File:RPi_watermeter_experiment.jpeg|640px]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
To test it on a pi you need the gpio command:&amp;lt;br&amp;gt;&lt;br /&gt;
if not installed:&amp;lt;br&amp;gt;&lt;br /&gt;
sudo apt-get update&amp;lt;br&amp;gt;&lt;br /&gt;
sudo apt-get install wiringpi&amp;lt;br&amp;gt;&lt;br /&gt;
change GPIO 28 (BCM=20 and pin=38) as input:&amp;lt;br&amp;gt;&lt;br /&gt;
sudo /usr/local/bin/gpio export 20 in&amp;lt;br&amp;gt;&lt;br /&gt;
Put this line somewhere in a startup file, so it will stay that way, after reboot,&amp;lt;br&amp;gt;&lt;br /&gt;
best below in /etc/rc.local (without sudo)&amp;lt;br&amp;gt;&lt;br /&gt;
to show the states:&amp;lt;br&amp;gt;&lt;br /&gt;
sudo gpio  readall&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is the result:&lt;br /&gt;
&amp;lt;div class=&amp;quot;res-img&amp;quot;&amp;gt;&lt;br /&gt;
[[File:RPi_watermeter_board.jpeg|640px]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
All welded on an experiment board, for the Rpi, with a long pin connector, so you can stack other boards.&amp;lt;br&amp;gt;&lt;br /&gt;
I use a RJ11 connector to connect the sensor. &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Complete mounted on the Pi:&lt;br /&gt;
&amp;lt;div class=&amp;quot;res-img&amp;quot;&amp;gt;&lt;br /&gt;
[[File:RPi_watermeter_complete.jpeg|640px]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Partlist:&#039;&#039;&#039;&lt;br /&gt;
I ordered most parts at the well known Chinese site.&lt;br /&gt;
- LJ12A3-4-Z/B magnetic sensor&lt;br /&gt;
- aluminium strip 20x2.5 cm&lt;br /&gt;
- MT3608 DC-DC Adjustable Boost Module Feed Converter  Voltage Regulator or external 12 Volt power supply.&lt;br /&gt;
- Led 2mm, green or red.&lt;br /&gt;
- resistor 680 Ohm&lt;br /&gt;
- capacitor ca. 100 nF&lt;br /&gt;
- RPi experiment board, I used: &amp;quot;DIY Proto HAT Shield Extension Board for Raspberry Pi 4 Model B / 3B+ / 3B Red RPI GPIO Board&amp;quot;&lt;br /&gt;
- Connector, with long  pins: &amp;quot;20 Pins Female Pin Header 2.54m Pitch Extra Tall Female Dual Row Short Pin Headers PCB Connector&amp;quot;&lt;br /&gt;
- optional: diode 1N4148 or something like that (1 for each RPi)&lt;br /&gt;
- RJ11 connector, but every other connector will be fine.&lt;/div&gt;</summary>
		<author><name>Roland</name></author>
	</entry>
	<entry>
		<id>http://wiki.breedveld.net/index.php?title=File:RPi_watermeter_beugel.jpeg&amp;diff=7284</id>
		<title>File:RPi watermeter beugel.jpeg</title>
		<link rel="alternate" type="text/html" href="http://wiki.breedveld.net/index.php?title=File:RPi_watermeter_beugel.jpeg&amp;diff=7284"/>
		<updated>2020-12-24T08:03:57Z</updated>

		<summary type="html">&lt;p&gt;Roland: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Roland</name></author>
	</entry>
	<entry>
		<id>http://wiki.breedveld.net/index.php?title=RPiWaterMeter&amp;diff=7283</id>
		<title>RPiWaterMeter</title>
		<link rel="alternate" type="text/html" href="http://wiki.breedveld.net/index.php?title=RPiWaterMeter&amp;diff=7283"/>
		<updated>2020-12-24T08:02:53Z</updated>

		<summary type="html">&lt;p&gt;Roland: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;&lt;br /&gt;
Water usage mesurement with a Raspberry Pi&#039;&#039;&#039;&lt;br /&gt;
In my case I use Domoticz, but it also works with Home-Assist and other products.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
It works with a magnetic sensor, which can be used because of the half-metal rotor of watermeters in my country (Netherlands)&amp;lt;br&amp;gt;&lt;br /&gt;
For magnetic sensor I use the LJ12A3-4-Z/B from the well known company in China. &amp;lt;br&amp;gt;&lt;br /&gt;
You can use most types but be sure to buy the OC (Open-Collector) version, because most sensors use higher voltages than the Raspberry Pi, and you won&#039;t damage your Pi.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
The sensor should be placed on the side of the rotator, not in the middle.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
With a piece of aluminium it&#039;s easy to mount on the meter:&lt;br /&gt;
&amp;lt;div class=&amp;quot;res-img&amp;quot;&amp;gt;&lt;br /&gt;
[[File:RPi_watermeter_sensor.jpeg|640px]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;res-img&amp;quot;&amp;gt;&lt;br /&gt;
[[File:RPi_watermeter_sensor1.jpeg|320px]]&lt;br /&gt;
[[File:RPi_watermeter_sensor2.jpeg|320px]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Shematics:&lt;br /&gt;
&amp;lt;div class=&amp;quot;res-img&amp;quot;&amp;gt;&lt;br /&gt;
[[File:RPi_watermeter_schematics.jpeg|640px]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
The sensor needs 9-36 Volt, a Raspberry Pi only can deliver 5 and 3.3 Volt.&amp;lt;br&amp;gt;&lt;br /&gt;
You can use an extra 12 Volt adapter, but I don&#039;t like that......&amp;lt;br&amp;gt; &lt;br /&gt;
I use an adjustable chopper board (also from China), adjusted as 12 Volt.&amp;lt;br&amp;gt;&lt;br /&gt;
If you want the same Board it&#039;s called:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;quot;MT3608 DC-DC Adjustable Boost Module Feed Converter  Voltage Regulator Module 2A Max 2 V-24 V to 5 V-28 V&amp;quot;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
The output is connected to one of the GPIO&#039;s of the Pi, which first should configured as input, in my case I use GPIO28 (pin38/BCM20).&amp;lt;br&amp;gt;&lt;br /&gt;
The led will show if it works, for every pulse 1 liter water is detected.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
The diode is not needed if you use 1 Pi.&amp;lt;br&amp;gt;&lt;br /&gt;
I use a Raspberry Pi Cluster, so I can do a failover.&amp;lt;br&amp;gt;&lt;br /&gt;
The board is connected on 1 Pi, the other Pi is connected to the same pins: 6 and 38.&amp;lt;br&amp;gt;&lt;br /&gt;
For the Power (pin 2) a diode is needed, 1 for each Pi, while it&#039;s a bad idea to connect the power to multiple Pi&#039;s.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
First tested it with an experiment board:&lt;br /&gt;
&amp;lt;div class=&amp;quot;res-img&amp;quot;&amp;gt;&lt;br /&gt;
[[File:RPi_watermeter_experiment.jpeg|640px]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
To test it on a pi you need the gpio command:&amp;lt;br&amp;gt;&lt;br /&gt;
if not installed:&amp;lt;br&amp;gt;&lt;br /&gt;
sudo apt-get update&amp;lt;br&amp;gt;&lt;br /&gt;
sudo apt-get install wiringpi&amp;lt;br&amp;gt;&lt;br /&gt;
change GPIO 28 (BCM=20 and pin=38) as input:&amp;lt;br&amp;gt;&lt;br /&gt;
sudo /usr/local/bin/gpio export 20 in&amp;lt;br&amp;gt;&lt;br /&gt;
Put this line somewhere in a startup file, so it will stay that way, after reboot,&amp;lt;br&amp;gt;&lt;br /&gt;
best below in /etc/rc.local (without sudo)&amp;lt;br&amp;gt;&lt;br /&gt;
to show the states:&amp;lt;br&amp;gt;&lt;br /&gt;
sudo gpio  readall&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is the result:&lt;br /&gt;
&amp;lt;div class=&amp;quot;res-img&amp;quot;&amp;gt;&lt;br /&gt;
[[File:RPi_watermeter_board.jpeg|640px]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
All welded on an experiment board, for the Rpi, with a long pin connector, so you can stack other boards.&amp;lt;br&amp;gt;&lt;br /&gt;
I use a RJ11 connector to connect the sensor. &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Complete mounted on the Pi:&lt;br /&gt;
&amp;lt;div class=&amp;quot;res-img&amp;quot;&amp;gt;&lt;br /&gt;
[[File:RPi_watermeter_complete.jpeg|640px]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Partlist:&#039;&#039;&#039;&lt;br /&gt;
I ordered most parts at the well known Chinese site.&lt;br /&gt;
- LJ12A3-4-Z/B magnetic sensor&lt;br /&gt;
- aluminium strip 20x2.5 cm&lt;br /&gt;
- MT3608 DC-DC Adjustable Boost Module Feed Converter  Voltage Regulator or external 12 Volt power supply.&lt;br /&gt;
- Led 2mm, green or red.&lt;br /&gt;
- resistor 680 Ohm&lt;br /&gt;
- capacitor ca. 100 nF&lt;br /&gt;
- RPi experiment board, I used: &amp;quot;DIY Proto HAT Shield Extension Board for Raspberry Pi 4 Model B / 3B+ / 3B Red RPI GPIO Board&amp;quot;&lt;br /&gt;
- Connector, with long  pins: &amp;quot;20 Pins Female Pin Header 2.54m Pitch Extra Tall Female Dual Row Short Pin Headers PCB Connector&amp;quot;&lt;br /&gt;
- optional: diode 1N4148 or something like that (1 for each RPi)&lt;br /&gt;
- RJ11 connector, but every other connector will be fine.&lt;/div&gt;</summary>
		<author><name>Roland</name></author>
	</entry>
	<entry>
		<id>http://wiki.breedveld.net/index.php?title=RPiWaterMeter&amp;diff=7282</id>
		<title>RPiWaterMeter</title>
		<link rel="alternate" type="text/html" href="http://wiki.breedveld.net/index.php?title=RPiWaterMeter&amp;diff=7282"/>
		<updated>2020-12-24T08:02:36Z</updated>

		<summary type="html">&lt;p&gt;Roland: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;&lt;br /&gt;
Water usage mesurement with a Raspberry Pi&#039;&#039;&#039;&lt;br /&gt;
In my case I use Domoticz, but it also works with Home-Assist and other products.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
It works with a magnetic sensor, which can be used because of the half-metal rotor of watermeters in my country (Netherlands)&amp;lt;br&amp;gt;&lt;br /&gt;
For magnetic sensor I use the LJ12A3-4-Z/B from the well known company in China. &amp;lt;br&amp;gt;&lt;br /&gt;
You can use most types but be sure to buy the OC (Open-Collector) version, because most sensors use higher voltages than the Raspberry Pi, and you won&#039;t damage your Pi.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
The sensor should be placed on the side of the rotator, not in the middle.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
With a piece of aluminium it&#039;s easy to mount on the meter:&lt;br /&gt;
&amp;lt;div class=&amp;quot;res-img&amp;quot;&amp;gt;&lt;br /&gt;
[[File:RPi_watermeter_sensor.jpeg|640px]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;res-img&amp;quot;&amp;gt;&lt;br /&gt;
[[File:RPi_watermeter_sensor1.jpeg|640px]]&lt;br /&gt;
[[File:RPi_watermeter_sensor2.jpeg|640px]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Shematics:&lt;br /&gt;
&amp;lt;div class=&amp;quot;res-img&amp;quot;&amp;gt;&lt;br /&gt;
[[File:RPi_watermeter_schematics.jpeg|640px]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
The sensor needs 9-36 Volt, a Raspberry Pi only can deliver 5 and 3.3 Volt.&amp;lt;br&amp;gt;&lt;br /&gt;
You can use an extra 12 Volt adapter, but I don&#039;t like that......&amp;lt;br&amp;gt; &lt;br /&gt;
I use an adjustable chopper board (also from China), adjusted as 12 Volt.&amp;lt;br&amp;gt;&lt;br /&gt;
If you want the same Board it&#039;s called:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;quot;MT3608 DC-DC Adjustable Boost Module Feed Converter  Voltage Regulator Module 2A Max 2 V-24 V to 5 V-28 V&amp;quot;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
The output is connected to one of the GPIO&#039;s of the Pi, which first should configured as input, in my case I use GPIO28 (pin38/BCM20).&amp;lt;br&amp;gt;&lt;br /&gt;
The led will show if it works, for every pulse 1 liter water is detected.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
The diode is not needed if you use 1 Pi.&amp;lt;br&amp;gt;&lt;br /&gt;
I use a Raspberry Pi Cluster, so I can do a failover.&amp;lt;br&amp;gt;&lt;br /&gt;
The board is connected on 1 Pi, the other Pi is connected to the same pins: 6 and 38.&amp;lt;br&amp;gt;&lt;br /&gt;
For the Power (pin 2) a diode is needed, 1 for each Pi, while it&#039;s a bad idea to connect the power to multiple Pi&#039;s.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
First tested it with an experiment board:&lt;br /&gt;
&amp;lt;div class=&amp;quot;res-img&amp;quot;&amp;gt;&lt;br /&gt;
[[File:RPi_watermeter_experiment.jpeg|640px]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
To test it on a pi you need the gpio command:&amp;lt;br&amp;gt;&lt;br /&gt;
if not installed:&amp;lt;br&amp;gt;&lt;br /&gt;
sudo apt-get update&amp;lt;br&amp;gt;&lt;br /&gt;
sudo apt-get install wiringpi&amp;lt;br&amp;gt;&lt;br /&gt;
change GPIO 28 (BCM=20 and pin=38) as input:&amp;lt;br&amp;gt;&lt;br /&gt;
sudo /usr/local/bin/gpio export 20 in&amp;lt;br&amp;gt;&lt;br /&gt;
Put this line somewhere in a startup file, so it will stay that way, after reboot,&amp;lt;br&amp;gt;&lt;br /&gt;
best below in /etc/rc.local (without sudo)&amp;lt;br&amp;gt;&lt;br /&gt;
to show the states:&amp;lt;br&amp;gt;&lt;br /&gt;
sudo gpio  readall&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is the result:&lt;br /&gt;
&amp;lt;div class=&amp;quot;res-img&amp;quot;&amp;gt;&lt;br /&gt;
[[File:RPi_watermeter_board.jpeg|640px]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
All welded on an experiment board, for the Rpi, with a long pin connector, so you can stack other boards.&amp;lt;br&amp;gt;&lt;br /&gt;
I use a RJ11 connector to connect the sensor. &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Complete mounted on the Pi:&lt;br /&gt;
&amp;lt;div class=&amp;quot;res-img&amp;quot;&amp;gt;&lt;br /&gt;
[[File:RPi_watermeter_complete.jpeg|640px]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Partlist:&#039;&#039;&#039;&lt;br /&gt;
I ordered most parts at the well known Chinese site.&lt;br /&gt;
- LJ12A3-4-Z/B magnetic sensor&lt;br /&gt;
- aluminium strip 20x2.5 cm&lt;br /&gt;
- MT3608 DC-DC Adjustable Boost Module Feed Converter  Voltage Regulator or external 12 Volt power supply.&lt;br /&gt;
- Led 2mm, green or red.&lt;br /&gt;
- resistor 680 Ohm&lt;br /&gt;
- capacitor ca. 100 nF&lt;br /&gt;
- RPi experiment board, I used: &amp;quot;DIY Proto HAT Shield Extension Board for Raspberry Pi 4 Model B / 3B+ / 3B Red RPI GPIO Board&amp;quot;&lt;br /&gt;
- Connector, with long  pins: &amp;quot;20 Pins Female Pin Header 2.54m Pitch Extra Tall Female Dual Row Short Pin Headers PCB Connector&amp;quot;&lt;br /&gt;
- optional: diode 1N4148 or something like that (1 for each RPi)&lt;br /&gt;
- RJ11 connector, but every other connector will be fine.&lt;/div&gt;</summary>
		<author><name>Roland</name></author>
	</entry>
	<entry>
		<id>http://wiki.breedveld.net/index.php?title=RPiWaterMeter&amp;diff=7281</id>
		<title>RPiWaterMeter</title>
		<link rel="alternate" type="text/html" href="http://wiki.breedveld.net/index.php?title=RPiWaterMeter&amp;diff=7281"/>
		<updated>2020-12-23T18:40:12Z</updated>

		<summary type="html">&lt;p&gt;Roland: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;&lt;br /&gt;
Water usage mesurement with a Raspberry Pi&#039;&#039;&#039;&lt;br /&gt;
In my case I use Domoticz, but it also works with Home-Assist and other products.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
It works with a magnetic sensor, which can be used because of the half-metal rotor of watermeters in my country (Netherlands)&amp;lt;br&amp;gt;&lt;br /&gt;
For magnetic sensor I use the LJ12A3-4-Z/B from the well known company in China. &amp;lt;br&amp;gt;&lt;br /&gt;
You can use most types but be sure to buy the OC (Open-Collector) version, because most sensors use higher voltages than the Raspberry Pi, and you won&#039;t damage your Pi.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
The sensor should be placed on the side of the rotator, not in the middle.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
With a piece of aluminium it&#039;s easy to mount on the meter:&lt;br /&gt;
&amp;lt;div class=&amp;quot;res-img&amp;quot;&amp;gt;&lt;br /&gt;
[[File:RPi_watermeter_sensor.jpeg|640px]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Shematics:&lt;br /&gt;
&amp;lt;div class=&amp;quot;res-img&amp;quot;&amp;gt;&lt;br /&gt;
[[File:RPi_watermeter_schematics.jpeg|640px]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
The sensor needs 9-36 Volt, a Raspberry Pi only can deliver 5 and 3.3 Volt.&amp;lt;br&amp;gt;&lt;br /&gt;
You can use an extra 12 Volt adapter, but I don&#039;t like that......&amp;lt;br&amp;gt; &lt;br /&gt;
I use an adjustable chopper board (also from China), adjusted as 12 Volt.&amp;lt;br&amp;gt;&lt;br /&gt;
If you want the same Board it&#039;s called:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;quot;MT3608 DC-DC Adjustable Boost Module Feed Converter  Voltage Regulator Module 2A Max 2 V-24 V to 5 V-28 V&amp;quot;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
The output is connected to one of the GPIO&#039;s of the Pi, which first should configured as input, in my case I use GPIO28 (pin38/BCM20).&amp;lt;br&amp;gt;&lt;br /&gt;
The led will show if it works, for every pulse 1 liter water is detected.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
The diode is not needed if you use 1 Pi.&amp;lt;br&amp;gt;&lt;br /&gt;
I use a Raspberry Pi Cluster, so I can do a failover.&amp;lt;br&amp;gt;&lt;br /&gt;
The board is connected on 1 Pi, the other Pi is connected to the same pins: 6 and 38.&amp;lt;br&amp;gt;&lt;br /&gt;
For the Power (pin 2) a diode is needed, 1 for each Pi, while it&#039;s a bad idea to connect the power to multiple Pi&#039;s.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
First tested it with an experiment board:&lt;br /&gt;
&amp;lt;div class=&amp;quot;res-img&amp;quot;&amp;gt;&lt;br /&gt;
[[File:RPi_watermeter_experiment.jpeg|640px]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
To test it on a pi you need the gpio command:&amp;lt;br&amp;gt;&lt;br /&gt;
if not installed:&amp;lt;br&amp;gt;&lt;br /&gt;
sudo apt-get update&amp;lt;br&amp;gt;&lt;br /&gt;
sudo apt-get install wiringpi&amp;lt;br&amp;gt;&lt;br /&gt;
change GPIO 28 (BCM=20 and pin=38) as input:&amp;lt;br&amp;gt;&lt;br /&gt;
sudo /usr/local/bin/gpio export 20 in&amp;lt;br&amp;gt;&lt;br /&gt;
Put this line somewhere in a startup file, so it will stay that way, after reboot,&amp;lt;br&amp;gt;&lt;br /&gt;
best below in /etc/rc.local (without sudo)&amp;lt;br&amp;gt;&lt;br /&gt;
to show the states:&amp;lt;br&amp;gt;&lt;br /&gt;
sudo gpio  readall&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is the result:&lt;br /&gt;
&amp;lt;div class=&amp;quot;res-img&amp;quot;&amp;gt;&lt;br /&gt;
[[File:RPi_watermeter_board.jpeg|640px]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
All welded on an experiment board, for the Rpi, with a long pin connector, so you can stack other boards.&amp;lt;br&amp;gt;&lt;br /&gt;
I use a RJ11 connector to connect the sensor. &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Complete mounted on the Pi:&lt;br /&gt;
&amp;lt;div class=&amp;quot;res-img&amp;quot;&amp;gt;&lt;br /&gt;
[[File:RPi_watermeter_complete.jpeg|640px]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;/div&gt;</summary>
		<author><name>Roland</name></author>
	</entry>
	<entry>
		<id>http://wiki.breedveld.net/index.php?title=RPiWaterMeter&amp;diff=7280</id>
		<title>RPiWaterMeter</title>
		<link rel="alternate" type="text/html" href="http://wiki.breedveld.net/index.php?title=RPiWaterMeter&amp;diff=7280"/>
		<updated>2020-12-23T18:35:05Z</updated>

		<summary type="html">&lt;p&gt;Roland: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;&lt;br /&gt;
Water usage mesurement with a Raspberry Pi&#039;&#039;&#039;&lt;br /&gt;
In my case I use Domoticz, but it also works with Home-Assist and other products.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
It works with a magnetic sensor, which can be used because of the half-metal rotor of watermeters in my country (Netherlands)&amp;lt;br&amp;gt;&lt;br /&gt;
For magnetic sensor I use the LJ12A3-4-Z/B from the well known company in China. &amp;lt;br&amp;gt;&lt;br /&gt;
You can use most types but be sure to buy the OC (Open-Collector) version, because most sensors use higher voltages than the Raspberry Pi, and you won&#039;t damage your Pi.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
The sensor should be placed on the side of the rotator, not in the middle.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
With a piece of aluminium it&#039;s easy to mount on the meter:&lt;br /&gt;
&amp;lt;div class=&amp;quot;res-img&amp;quot;&amp;gt;&lt;br /&gt;
[[File:RPi_watermeter_sensor.jpeg|640px]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Shematics:&lt;br /&gt;
&amp;lt;div class=&amp;quot;res-img&amp;quot;&amp;gt;&lt;br /&gt;
[[File:RPi_watermeter_schematics.jpeg|640px]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
The sensor needs 9-36 Volt, a Raspberry Pi only can deliver 5 and 3.3 Volt.&amp;lt;br&amp;gt;&lt;br /&gt;
You can use an extra 12 Volt adapter, but I don&#039;t like that......&amp;lt;br&amp;gt; &lt;br /&gt;
I use an adjustable chopper board (also from China), adjusted as 12 Volt.&amp;lt;br&amp;gt;&lt;br /&gt;
If you want the same Board it&#039;s called:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;quot;MT3608 DC-DC Adjustable Boost Module Feed Converter  Voltage Regulator Module 2A Max 2 V-24 V to 5 V-28 V&amp;quot;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
The output is connected to one of the GPIO&#039;s of the Pi, which first should configured as input, in my case I use GPIO28 (pin38/BCM20).&amp;lt;br&amp;gt;&lt;br /&gt;
The led will show if it works, for every pulse 1 liter water is detected.&amp;lt;br&amp;gt;&lt;br /&gt;
I use a Raspberry Pi Cluster, so I can do a failover, pin 2,6 and 38 are also wired to a second Pi,&amp;lt;br&amp;gt;&lt;br /&gt;
for the Power a diode is needed, for each Pi, while it&#039;s a bad idea to connect the power to multiple Pi&#039;s.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
First tested it with an experiment board:&lt;br /&gt;
&amp;lt;div class=&amp;quot;res-img&amp;quot;&amp;gt;&lt;br /&gt;
[[File:RPi_watermeter_experiment.jpeg|640px]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
To test it on a pi you need the gpio command:&amp;lt;br&amp;gt;&lt;br /&gt;
if not installed:&amp;lt;br&amp;gt;&lt;br /&gt;
sudo apt-get update&amp;lt;br&amp;gt;&lt;br /&gt;
sudo apt-get install wiringpi&amp;lt;br&amp;gt;&lt;br /&gt;
change GPIO 28 (BCM=20 and pin=38) as input:&amp;lt;br&amp;gt;&lt;br /&gt;
sudo /usr/local/bin/gpio export 20 in&amp;lt;br&amp;gt;&lt;br /&gt;
Put this line somewhere in a startup file, so it will stay that way, after reboot,&amp;lt;br&amp;gt;&lt;br /&gt;
best below in /etc/rc.local (without sudo)&amp;lt;br&amp;gt;&lt;br /&gt;
to show the states:&amp;lt;br&amp;gt;&lt;br /&gt;
sudo gpio  readall&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is the result:&lt;br /&gt;
&amp;lt;div class=&amp;quot;res-img&amp;quot;&amp;gt;&lt;br /&gt;
[[File:RPi_watermeter_board.jpeg|640px]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
All welded on an experiment board, for the Rpi, with a long pin connector, so you can stack other boards.&amp;lt;br&amp;gt;&lt;br /&gt;
I use a RJ11 connector to connect the sensor. &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Complete mounted on the Pi:&lt;br /&gt;
&amp;lt;div class=&amp;quot;res-img&amp;quot;&amp;gt;&lt;br /&gt;
[[File:RPi_watermeter_complete.jpeg|640px]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;/div&gt;</summary>
		<author><name>Roland</name></author>
	</entry>
	<entry>
		<id>http://wiki.breedveld.net/index.php?title=File:RPi_watermeter_schematics.jpeg&amp;diff=7279</id>
		<title>File:RPi watermeter schematics.jpeg</title>
		<link rel="alternate" type="text/html" href="http://wiki.breedveld.net/index.php?title=File:RPi_watermeter_schematics.jpeg&amp;diff=7279"/>
		<updated>2020-12-23T18:27:59Z</updated>

		<summary type="html">&lt;p&gt;Roland: Roland uploaded a new version of File:RPi watermeter schematics.jpeg&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Roland</name></author>
	</entry>
	<entry>
		<id>http://wiki.breedveld.net/index.php?title=RPiWaterMeter&amp;diff=7278</id>
		<title>RPiWaterMeter</title>
		<link rel="alternate" type="text/html" href="http://wiki.breedveld.net/index.php?title=RPiWaterMeter&amp;diff=7278"/>
		<updated>2020-12-23T18:23:46Z</updated>

		<summary type="html">&lt;p&gt;Roland: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;&lt;br /&gt;
Water usage mesurement with a Raspberry Pi&#039;&#039;&#039;&lt;br /&gt;
In my case I use Domoticz, but it also works with Home-Assist and other products.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
It works with a magnetic sensor, which can be used because of the half-metal rotor of watermeters in my country (Netherlands)&amp;lt;br&amp;gt;&lt;br /&gt;
For magnetic sensor I use the LJ12A3-4-Z/B from the well known company in China. &amp;lt;br&amp;gt;&lt;br /&gt;
You can use most types but be sure to buy the OC (Open-Collector) version, because most sensors use higher voltages than the Raspberry Pi, and you won&#039;t damage your Pi&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
The sensor should be placed on the side of the rotator, not in the middle.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
With a piece of aluminium it&#039;s easy to mount on the meter:&lt;br /&gt;
&amp;lt;div class=&amp;quot;res-img&amp;quot;&amp;gt;&lt;br /&gt;
[[File:RPi_watermeter_sensor.jpeg|640px]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Shematics:&lt;br /&gt;
&amp;lt;div class=&amp;quot;res-img&amp;quot;&amp;gt;&lt;br /&gt;
[[File:RPi_watermeter_schematics.jpeg|640px]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
The sensor needs 9-36 Volt, while a Raspberry Pi only can deliver 5 Volt.&amp;lt;br&amp;gt;&lt;br /&gt;
I use an adjustable chopper board(also from China), adjusted as 12 Volt.&amp;lt;br&amp;gt;&lt;br /&gt;
If you want the same Board it&#039;s called:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;quot;MT3608 DC-DC Adjustable Boost Module Feed Converter  Voltage Regulator Module 2A Max 2 V-24 V to 5 V-28 V&amp;quot;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
The output is connected to one of the GPIO&#039;s of the Pi, which first should configured as input, in my case I use GPIO28 (pin38/BCM20).&amp;lt;br&amp;gt;&lt;br /&gt;
The led will show if it works, for every pulse 1 liter water is detected.&amp;lt;br&amp;gt;&lt;br /&gt;
I use a Raspberry Pi Cluster, so I can do a failover, pin 2,6 and 38 are also wired to a second Pi,&amp;lt;br&amp;gt;&lt;br /&gt;
for the Power a diode is needed, for each Pi, while it&#039;s a bad idea to connect the power to multiple Pi&#039;s.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
First tested it with an experiment board:&lt;br /&gt;
&amp;lt;div class=&amp;quot;res-img&amp;quot;&amp;gt;&lt;br /&gt;
[[File:RPi_watermeter_experiment.jpeg|640px]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
To test it on a pi you need the gpio command:&amp;lt;br&amp;gt;&lt;br /&gt;
if not installed:&amp;lt;br&amp;gt;&lt;br /&gt;
sudo apt-get update&amp;lt;br&amp;gt;&lt;br /&gt;
sudo apt-get install wiringpi&amp;lt;br&amp;gt;&lt;br /&gt;
change GPIO 28 (BCM=20 and pin=38) as input:&amp;lt;br&amp;gt;&lt;br /&gt;
sudo /usr/local/bin/gpio export 20 in&amp;lt;br&amp;gt;&lt;br /&gt;
Put this line somewhere in a startup file, so it will stay that way, after reboot,&amp;lt;br&amp;gt;&lt;br /&gt;
best below in /etc/rc.local (without sudo)&amp;lt;br&amp;gt;&lt;br /&gt;
to show the states:&amp;lt;br&amp;gt;&lt;br /&gt;
sudo gpio  readall&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is the result:&lt;br /&gt;
&amp;lt;div class=&amp;quot;res-img&amp;quot;&amp;gt;&lt;br /&gt;
[[File:RPi_watermeter_board.jpeg|640px]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
All welded on an experiment board, for the Rpi, with a long pin connector, so you can stack other boards.&amp;lt;br&amp;gt;&lt;br /&gt;
I use a RJ11 connector to connect the sensor. &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Complete mounted on the Pi:&lt;br /&gt;
&amp;lt;div class=&amp;quot;res-img&amp;quot;&amp;gt;&lt;br /&gt;
[[File:RPi_watermeter_complete.jpeg|640px]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;/div&gt;</summary>
		<author><name>Roland</name></author>
	</entry>
	<entry>
		<id>http://wiki.breedveld.net/index.php?title=RPiWaterMeter&amp;diff=7277</id>
		<title>RPiWaterMeter</title>
		<link rel="alternate" type="text/html" href="http://wiki.breedveld.net/index.php?title=RPiWaterMeter&amp;diff=7277"/>
		<updated>2020-12-23T18:21:22Z</updated>

		<summary type="html">&lt;p&gt;Roland: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;&lt;br /&gt;
Water usage mesurement with a Raspberry Pi&#039;&#039;&#039;&lt;br /&gt;
In my case I use Domoticz, but it also works with Home-Assist and other products.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
It works with a magnetic sensor, which can be used because of the half-metal rotor of watermeters in my country (Netherlands)&amp;lt;br&amp;gt;&lt;br /&gt;
For magnetic sensor I use the LJ12A3-4-Z/B from the well known company in China. &amp;lt;br&amp;gt;&lt;br /&gt;
You can use most types but be sure to by the OC (Open-Collector) version, while most sensors use higher voltages than a Raspberry Pi.&amp;lt;br&amp;gt;&lt;br /&gt;
The sensor should be placed on the side of the rotator, not in the middle.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
With a piece of aluminium it&#039;s easy to mount on the meter:&lt;br /&gt;
&amp;lt;div class=&amp;quot;res-img&amp;quot;&amp;gt;&lt;br /&gt;
[[File:RPi_watermeter_sensor.jpeg|640px]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Shematics:&lt;br /&gt;
&amp;lt;div class=&amp;quot;res-img&amp;quot;&amp;gt;&lt;br /&gt;
[[File:RPi_watermeter_schematics.jpeg|640px]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
The sensor needs 9-36 Volt, while a Raspberry Pi only can deliver 5 Volt.&amp;lt;br&amp;gt;&lt;br /&gt;
I use an adjustable chopper board(also from China), adjusted as 12 Volt.&amp;lt;br&amp;gt;&lt;br /&gt;
If you want the same Board it&#039;s called:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;quot;MT3608 DC-DC Adjustable Boost Module Feed Converter  Voltage Regulator Module 2A Max 2 V-24 V to 5 V-28 V&amp;quot;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
The output is connected to one of the GPIO&#039;s of the Pi, which first should configured as input, in my case I use GPIO28 (pin38/BCM20).&amp;lt;br&amp;gt;&lt;br /&gt;
The led will show if it works, for every pulse 1 liter water is detected.&amp;lt;br&amp;gt;&lt;br /&gt;
I use a Raspberry Pi Cluster, so I can do a failover, pin 2,6 and 38 are also wired to a second Pi,&amp;lt;br&amp;gt;&lt;br /&gt;
for the Power a diode is needed, for each Pi, while it&#039;s a bad idea to connect the power to multiple Pi&#039;s.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
First tested it with an experiment board:&lt;br /&gt;
&amp;lt;div class=&amp;quot;res-img&amp;quot;&amp;gt;&lt;br /&gt;
[[File:RPi_watermeter_experiment.jpeg|640px]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
To test it on a pi you need the gpio command:&amp;lt;br&amp;gt;&lt;br /&gt;
if not installed:&amp;lt;br&amp;gt;&lt;br /&gt;
sudo apt-get update&amp;lt;br&amp;gt;&lt;br /&gt;
sudo apt-get install wiringpi&amp;lt;br&amp;gt;&lt;br /&gt;
change GPIO 28 (BCM=20 and pin=38) as input:&amp;lt;br&amp;gt;&lt;br /&gt;
sudo /usr/local/bin/gpio export 20 in&amp;lt;br&amp;gt;&lt;br /&gt;
Put this line somewhere in a startup file, so it will stay that way, after reboot,&amp;lt;br&amp;gt;&lt;br /&gt;
best below in /etc/rc.local (without sudo)&amp;lt;br&amp;gt;&lt;br /&gt;
to show the states:&amp;lt;br&amp;gt;&lt;br /&gt;
sudo gpio  readall&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is the result:&lt;br /&gt;
&amp;lt;div class=&amp;quot;res-img&amp;quot;&amp;gt;&lt;br /&gt;
[[File:RPi_watermeter_board.jpeg|640px]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
All welded on an experiment board, for the Rpi, with a long pin connector, so you can stack other boards.&amp;lt;br&amp;gt;&lt;br /&gt;
I use a RJ11 connector to connect the sensor. &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Complete mounted on the Pi:&lt;br /&gt;
&amp;lt;div class=&amp;quot;res-img&amp;quot;&amp;gt;&lt;br /&gt;
[[File:RPi_watermeter_complete.jpeg|640px]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;/div&gt;</summary>
		<author><name>Roland</name></author>
	</entry>
	<entry>
		<id>http://wiki.breedveld.net/index.php?title=RPiWaterMeter&amp;diff=7276</id>
		<title>RPiWaterMeter</title>
		<link rel="alternate" type="text/html" href="http://wiki.breedveld.net/index.php?title=RPiWaterMeter&amp;diff=7276"/>
		<updated>2020-12-23T18:19:57Z</updated>

		<summary type="html">&lt;p&gt;Roland: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;&lt;br /&gt;
Water usage mesurement with a Raspberry Pi&#039;&#039;&#039;&lt;br /&gt;
In my case I use Domoticz, but it also works with Home-Assist and other products.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
It works with a magnetic sensor, which can be used because of the half-metal rotor of watermeters in my country (Netherlands)&amp;lt;br&amp;gt;&lt;br /&gt;
For magnetic sensor I use the LJ12A3-4-Z/B from the well known company in China. &amp;lt;br&amp;gt;&lt;br /&gt;
You can use most types but be sure to by the OC (Open-Collector) version, while most sensors use higher voltages than a Raspberry Pi.&amp;lt;br&amp;gt;&lt;br /&gt;
The sensor should be placed on the side of the rotator, not in the middle.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
With a piece of aluminium it&#039;s easy to mount on the meter:&lt;br /&gt;
&amp;lt;div class=&amp;quot;res-img&amp;quot;&amp;gt;&lt;br /&gt;
[[File:RPi_watermeter_sensor.jpeg|640px]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Shematics:&lt;br /&gt;
&amp;lt;div class=&amp;quot;res-img&amp;quot;&amp;gt;&lt;br /&gt;
[[File:RPi_watermeter_schematics.jpeg|640px]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
The sensor needs 9-36 Volt, while a Raspberry Pi only can deliver 5 Volt.&amp;lt;br&amp;gt;&lt;br /&gt;
I use an adjustable chopper board(also from China), adjusted as 12 Volt.&amp;lt;br&amp;gt;&lt;br /&gt;
If you want the same Board it&#039;s called:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;quot;MT3608 DC-DC Adjustable Boost Module Feed Converter  Voltage Regulator Module 2A Max 2 V-24 V to 5 V-28 V&amp;quot;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
The output is connected to one of the GPIO, which first should configured as input, I use GPIO28 (pin38).&amp;lt;br&amp;gt;&lt;br /&gt;
The led will show if it works, for every pulse 1 liter water is detected.&amp;lt;br&amp;gt;&lt;br /&gt;
I use a Raspberry Pi Cluster, so I can do a failover, pin 2,6 and 38 are also wired to a second Pi,&amp;lt;br&amp;gt;&lt;br /&gt;
for the Power a diode is needed, for each Pi, while it&#039;s a bad idea to connect the power to multiple Pi&#039;s.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
First tested it with an experiment board:&lt;br /&gt;
&amp;lt;div class=&amp;quot;res-img&amp;quot;&amp;gt;&lt;br /&gt;
[[File:RPi_watermeter_experiment.jpeg|640px]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
To test it on a pi you need the gpio command:&amp;lt;br&amp;gt;&lt;br /&gt;
if not installed:&amp;lt;br&amp;gt;&lt;br /&gt;
sudo apt-get update&amp;lt;br&amp;gt;&lt;br /&gt;
sudo apt-get install wiringpi&amp;lt;br&amp;gt;&lt;br /&gt;
change GPIO 28 (BCM=20 and pin=38) as input:&amp;lt;br&amp;gt;&lt;br /&gt;
sudo /usr/local/bin/gpio export 20 in&amp;lt;br&amp;gt;&lt;br /&gt;
Put this line somewhere in a startup file, so it will stay that way, after reboot,&amp;lt;br&amp;gt;&lt;br /&gt;
best below in /etc/rc.local (without sudo)&amp;lt;br&amp;gt;&lt;br /&gt;
to show the states:&amp;lt;br&amp;gt;&lt;br /&gt;
sudo gpio  readall&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is the result:&lt;br /&gt;
&amp;lt;div class=&amp;quot;res-img&amp;quot;&amp;gt;&lt;br /&gt;
[[File:RPi_watermeter_board.jpeg|640px]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
All welded on an experiment board, for the Rpi, with a long pin connector, so you can stack other boards.&amp;lt;br&amp;gt;&lt;br /&gt;
I use a RJ11 connector to connect the sensor. &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Complete mounted on the Pi:&lt;br /&gt;
&amp;lt;div class=&amp;quot;res-img&amp;quot;&amp;gt;&lt;br /&gt;
[[File:RPi_watermeter_complete.jpeg|640px]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;/div&gt;</summary>
		<author><name>Roland</name></author>
	</entry>
	<entry>
		<id>http://wiki.breedveld.net/index.php?title=RPiWaterMeter&amp;diff=7275</id>
		<title>RPiWaterMeter</title>
		<link rel="alternate" type="text/html" href="http://wiki.breedveld.net/index.php?title=RPiWaterMeter&amp;diff=7275"/>
		<updated>2020-12-23T18:19:19Z</updated>

		<summary type="html">&lt;p&gt;Roland: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;&lt;br /&gt;
Water usage mesurement with a Raspberry Pi&#039;&#039;&#039;&lt;br /&gt;
In my case I use Domoticz, but it also works with Home-Assist and other products.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
It works with a magnetic sensor, which can be used because of the half-metal rotor of watermeters in my country (Netherlands)&amp;lt;br&amp;gt;&lt;br /&gt;
For magnetic sensor I use the LJ12A3-4-Z/B from the well known company in China. &amp;lt;br&amp;gt;&lt;br /&gt;
You can use most types but be sure to by the OC (Open-Collector) version, while most sensors use higher voltages than a Raspberry Pi.&amp;lt;br&amp;gt;&lt;br /&gt;
The sensor should be placed on the side of the rotator, not in the middle.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
With a piece of aluminium it&#039;s easy to mount on the meter:&lt;br /&gt;
&amp;lt;div class=&amp;quot;res-img&amp;quot;&amp;gt;&lt;br /&gt;
[[File:RPi_watermeter_sensor.jpeg|640px]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Shematics:&lt;br /&gt;
&amp;lt;div class=&amp;quot;res-img&amp;quot;&amp;gt;&lt;br /&gt;
[[File:RPi_watermeter_schematics.jpeg|640px]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
The sensor needs 9-36 Volt, while a Raspberry Pi only can deliver 5 Volt.&amp;lt;br&amp;gt;&lt;br /&gt;
I use an adjustable chopper board(also from China), adjusted as 12 Volt.&amp;lt;br&amp;gt;&lt;br /&gt;
If you want the same Board is called:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;quot;MT3608 DC-DC Adjustable Boost Module Feed Converter  Voltage Regulator Module 2A Max 2 V-24 V to 5 V-28 V&amp;quot;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
The output is connected to one of the GPIO, which first should configured as input, I use GPIO28 (pin38).&amp;lt;br&amp;gt;&lt;br /&gt;
The led will show if it works, for every pulse 1 liter water is detected.&amp;lt;br&amp;gt;&lt;br /&gt;
I use a Raspberry Pi Cluster, so I can do a failover, pin 2,6 and 38 are also wired to a second Pi,&amp;lt;br&amp;gt;&lt;br /&gt;
for the Power a diode is needed, for each Pi, while it&#039;s a bad idea to connect the power to multiple Pi&#039;s.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
First tested it with an experiment board:&lt;br /&gt;
&amp;lt;div class=&amp;quot;res-img&amp;quot;&amp;gt;&lt;br /&gt;
[[File:RPi_watermeter_experiment.jpeg|640px]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
To test it on a pi you need the gpio command:&amp;lt;br&amp;gt;&lt;br /&gt;
if not installed:&amp;lt;br&amp;gt;&lt;br /&gt;
sudo apt-get update&amp;lt;br&amp;gt;&lt;br /&gt;
sudo apt-get install wiringpi&amp;lt;br&amp;gt;&lt;br /&gt;
change GPIO 28 (BCM=20 and pin=38) as input:&amp;lt;br&amp;gt;&lt;br /&gt;
sudo /usr/local/bin/gpio export 20 in&amp;lt;br&amp;gt;&lt;br /&gt;
Put this line somewhere in a startup file, so it will stay that way, after reboot,&amp;lt;br&amp;gt;&lt;br /&gt;
best below in /etc/rc.local (without sudo)&amp;lt;br&amp;gt;&lt;br /&gt;
to show the states:&amp;lt;br&amp;gt;&lt;br /&gt;
sudo gpio  readall&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is the result:&lt;br /&gt;
&amp;lt;div class=&amp;quot;res-img&amp;quot;&amp;gt;&lt;br /&gt;
[[File:RPi_watermeter_board.jpeg|640px]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
All welded on an experiment board, for the Rpi, with a long pin connector, so you can stack other boards.&amp;lt;br&amp;gt;&lt;br /&gt;
I use a RJ11 connector to connect the sensor. &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Complete mounted on the Pi:&lt;br /&gt;
&amp;lt;div class=&amp;quot;res-img&amp;quot;&amp;gt;&lt;br /&gt;
[[File:RPi_watermeter_complete.jpeg|640px]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;/div&gt;</summary>
		<author><name>Roland</name></author>
	</entry>
	<entry>
		<id>http://wiki.breedveld.net/index.php?title=RPiWaterMeter&amp;diff=7274</id>
		<title>RPiWaterMeter</title>
		<link rel="alternate" type="text/html" href="http://wiki.breedveld.net/index.php?title=RPiWaterMeter&amp;diff=7274"/>
		<updated>2020-12-23T18:16:35Z</updated>

		<summary type="html">&lt;p&gt;Roland: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;&lt;br /&gt;
Water usage mesurement with a Raspberry Pi&#039;&#039;&#039;&lt;br /&gt;
In my case I use Domoticz, but it also works with Home-Assist and other products.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
It works with a magnetic sensor, which can be used because of the half-metal rotor of watermeters in my country (Netherlands)&amp;lt;br&amp;gt;&lt;br /&gt;
For magnetic sensor I use the LJ12A3-4-Z/B from the well known company in China. &amp;lt;br&amp;gt;&lt;br /&gt;
You can use most types but be sure to by the OC (Open-Collector) version, while most sensors use higher voltages than a Raspberry Pi.&amp;lt;br&amp;gt;&lt;br /&gt;
The sensor should be placed on the side of the rotator, not in the middle.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
With a piece of aluminium it&#039;s easy to mount on the meter:&lt;br /&gt;
&amp;lt;div class=&amp;quot;res-img&amp;quot;&amp;gt;&lt;br /&gt;
[[File:RPi_watermeter_sensor.jpeg|640px]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Shematics:&lt;br /&gt;
&amp;lt;div class=&amp;quot;res-img&amp;quot;&amp;gt;&lt;br /&gt;
[[File:RPi_watermeter_schematics.jpeg|640px]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
Because the sensor needs 9-36 Volt, while a Raspberry Pi only can deliver 5 Volt, I use an adjustable chopper (also from China), adjusted as 12 Volt.&amp;lt;br&amp;gt;&lt;br /&gt;
The output is connected to one of the GPIO, which first should configured as input, I use GPIO28 (pin38).&amp;lt;br&amp;gt;&lt;br /&gt;
The led will show if it works, for every pulse 1 liter water is detected.&amp;lt;br&amp;gt;&lt;br /&gt;
I use a Raspberry Pi Cluster, so I can do a failover, pin 2,6 and 38 are also wired to a second Pi,&amp;lt;br&amp;gt;&lt;br /&gt;
for the Power a diode is needed, for each Pi, while it&#039;s a bad idea to connect the power to multiple Pi&#039;s.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
First tested it with an experiment board:&lt;br /&gt;
&amp;lt;div class=&amp;quot;res-img&amp;quot;&amp;gt;&lt;br /&gt;
[[File:RPi_watermeter_experiment.jpeg|640px]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
To test it on a pi you need the gpio command:&amp;lt;br&amp;gt;&lt;br /&gt;
if not installed:&amp;lt;br&amp;gt;&lt;br /&gt;
sudo apt-get update&amp;lt;br&amp;gt;&lt;br /&gt;
sudo apt-get install wiringpi&amp;lt;br&amp;gt;&lt;br /&gt;
change GPIO 28 (BCM=20 and pin=38) as input:&amp;lt;br&amp;gt;&lt;br /&gt;
sudo /usr/local/bin/gpio export 20 in&amp;lt;br&amp;gt;&lt;br /&gt;
Put this line somewhere in a startup file, so it will stay that way, after reboot,&amp;lt;br&amp;gt;&lt;br /&gt;
best below in /etc/rc.local (without sudo)&amp;lt;br&amp;gt;&lt;br /&gt;
to show the states:&amp;lt;br&amp;gt;&lt;br /&gt;
sudo gpio  readall&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is the result:&lt;br /&gt;
&amp;lt;div class=&amp;quot;res-img&amp;quot;&amp;gt;&lt;br /&gt;
[[File:RPi_watermeter_board.jpeg|640px]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
All welded on an experiment board, for the Rpi, with a long pin connector, so you can stack other boards.&amp;lt;br&amp;gt;&lt;br /&gt;
I use a RJ11 connector to connect the sensor. &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Complete mounted on the Pi:&lt;br /&gt;
&amp;lt;div class=&amp;quot;res-img&amp;quot;&amp;gt;&lt;br /&gt;
[[File:RPi_watermeter_complete.jpeg|640px]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;/div&gt;</summary>
		<author><name>Roland</name></author>
	</entry>
	<entry>
		<id>http://wiki.breedveld.net/index.php?title=RPiWaterMeter&amp;diff=7273</id>
		<title>RPiWaterMeter</title>
		<link rel="alternate" type="text/html" href="http://wiki.breedveld.net/index.php?title=RPiWaterMeter&amp;diff=7273"/>
		<updated>2020-12-23T18:15:36Z</updated>

		<summary type="html">&lt;p&gt;Roland: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;&lt;br /&gt;
Water usage mesurement with a Raspberry Pi&#039;&#039;&#039;&lt;br /&gt;
In my case I use Domoticz, but it also works with Home-Assist and other products.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
It works with a magnetic sensor, which can be used because of the half-metal rotor of watermeters in my country (Netherlands)&amp;lt;br&amp;gt;&lt;br /&gt;
For magnetic sensor I use the LJ12A3-4-Z/B from the well known company in China. &amp;lt;br&amp;gt;&lt;br /&gt;
You can use most types but be sure to by the OC (Open-Collector) version, while most sensors use higher voltages than a Raspberry Pi.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
With a piece of aluminium it&#039;s easy to mount on the meter:&lt;br /&gt;
&amp;lt;div class=&amp;quot;res-img&amp;quot;&amp;gt;&lt;br /&gt;
[[File:RPi_watermeter_sensor.jpeg|640px]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Shematics:&lt;br /&gt;
&amp;lt;div class=&amp;quot;res-img&amp;quot;&amp;gt;&lt;br /&gt;
[[File:RPi_watermeter_schematics.jpeg|640px]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
Because the sensor needs 9-36 Volt, while a Raspberry Pi only can deliver 5 Volt, I use an adjustable chopper (also from China), adjusted as 12 Volt.&amp;lt;br&amp;gt;&lt;br /&gt;
The output is connected to one of the GPIO, which first should configured as input, I use GPIO28 (pin38).&amp;lt;br&amp;gt;&lt;br /&gt;
The led will show if it works, for every pulse 1 liter water is detected.&amp;lt;br&amp;gt;&lt;br /&gt;
I use a Raspberry Pi Cluster, so I can do a failover, pin 2,6 and 38 are also wired to a second Pi,&amp;lt;br&amp;gt;&lt;br /&gt;
for the Power a diode is needed, for each Pi, while it&#039;s a bad idea to connect the power to multiple Pi&#039;s.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
First tested it with an experiment board:&lt;br /&gt;
&amp;lt;div class=&amp;quot;res-img&amp;quot;&amp;gt;&lt;br /&gt;
[[File:RPi_watermeter_experiment.jpeg|640px]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
To test it on a pi you need the gpio command:&amp;lt;br&amp;gt;&lt;br /&gt;
if not installed:&amp;lt;br&amp;gt;&lt;br /&gt;
sudo apt-get update&amp;lt;br&amp;gt;&lt;br /&gt;
sudo apt-get install wiringpi&amp;lt;br&amp;gt;&lt;br /&gt;
change GPIO 28 (BCM=20 and pin=38) as input:&amp;lt;br&amp;gt;&lt;br /&gt;
sudo /usr/local/bin/gpio export 20 in&amp;lt;br&amp;gt;&lt;br /&gt;
Put this line somewhere in a startup file, so it will stay that way, after reboot,&amp;lt;br&amp;gt;&lt;br /&gt;
best below in /etc/rc.local (without sudo)&amp;lt;br&amp;gt;&lt;br /&gt;
to show the states:&amp;lt;br&amp;gt;&lt;br /&gt;
sudo gpio  readall&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is the result:&lt;br /&gt;
&amp;lt;div class=&amp;quot;res-img&amp;quot;&amp;gt;&lt;br /&gt;
[[File:RPi_watermeter_board.jpeg|640px]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
All welded on an experiment board, for the Rpi, with a long pin connector, so you can stack other boards.&amp;lt;br&amp;gt;&lt;br /&gt;
I use a RJ11 connector to connect the sensor. &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Complete mounted on the Pi:&lt;br /&gt;
&amp;lt;div class=&amp;quot;res-img&amp;quot;&amp;gt;&lt;br /&gt;
[[File:RPi_watermeter_complete.jpeg|640px]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;/div&gt;</summary>
		<author><name>Roland</name></author>
	</entry>
	<entry>
		<id>http://wiki.breedveld.net/index.php?title=RPiWaterMeter&amp;diff=7272</id>
		<title>RPiWaterMeter</title>
		<link rel="alternate" type="text/html" href="http://wiki.breedveld.net/index.php?title=RPiWaterMeter&amp;diff=7272"/>
		<updated>2020-12-23T18:13:33Z</updated>

		<summary type="html">&lt;p&gt;Roland: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;&lt;br /&gt;
Water usage mesurement with a Raspberry Pi&#039;&#039;&#039;&lt;br /&gt;
In my case I use Domoticz, but it also works with Home-Assist and other products.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
It works with a magnetic sensor, which can be used because of the half-metal rotor of watermeters in my country (Netherlands)&amp;lt;br&amp;gt;&lt;br /&gt;
For magnetic sensor I use the LJ12A3-4-Z/B from the well known company in China. &amp;lt;br&amp;gt;&lt;br /&gt;
You can use most types but be sure to by the OC (Open-Collector) version, while most sensors use higher voltages than a Raspberry Pi.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
With a piece of aluminium it&#039;s easy to mount on the meter:&lt;br /&gt;
&amp;lt;div class=&amp;quot;res-img&amp;quot;&amp;gt;&lt;br /&gt;
[[File:RPi_watermeter_sensor.jpeg|640px]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Shematics:&lt;br /&gt;
&amp;lt;div class=&amp;quot;res-img&amp;quot;&amp;gt;&lt;br /&gt;
[[File:RPi_watermeter_schematics.jpeg|640px]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
Because the sensor needs 9-36 Volt, while a Raspberry Pi only can deliver 5 Volt, I use an adjustable chopper (also from China), adjusted as 12 Volt.&amp;lt;br&amp;gt;&lt;br /&gt;
The output is connected to one of the GPIO, which first should configured as input, I use GPIO28 (pin38).&amp;lt;br&amp;gt;&lt;br /&gt;
The led will show if it works, for every pulse 1 liter water is detected.&amp;lt;br&amp;gt;&lt;br /&gt;
I use a Raspberry Pi Cluster, so I can do a failover, pin 2,6 and 38 are also wired to a second Pi,&amp;lt;br&amp;gt;&lt;br /&gt;
for the Power a diode is needed, for each Pi, while it&#039;s a bad idea to connect the power to multiple Pi&#039;s.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
First tested it with an experiment board:&lt;br /&gt;
&amp;lt;div class=&amp;quot;res-img&amp;quot;&amp;gt;&lt;br /&gt;
[[File:RPi_watermeter_experiment.jpeg|640px]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
To test it on a pi you need the gpio command:&amp;lt;br&amp;gt;&lt;br /&gt;
if not installed:&amp;lt;br&amp;gt;&lt;br /&gt;
sudo apt-get update&amp;lt;br&amp;gt;&lt;br /&gt;
sudo apt-get install wiringpi&amp;lt;br&amp;gt;&lt;br /&gt;
change GPIO 28 (BCM=20 an pin=38) as input:&amp;lt;br&amp;gt;&lt;br /&gt;
sudo /usr/local/bin/gpio export 20 in&amp;lt;br&amp;gt;&lt;br /&gt;
Put this line somewhere in a startup file, so it will stay that way, after reboot,&amp;lt;br&amp;gt;&lt;br /&gt;
best below in /etc/rc.local (without sudo)&amp;lt;br&amp;gt;&lt;br /&gt;
to show the states:&amp;lt;br&amp;gt;&lt;br /&gt;
sudo gpio  readall&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is the result:&lt;br /&gt;
&amp;lt;div class=&amp;quot;res-img&amp;quot;&amp;gt;&lt;br /&gt;
[[File:RPi_watermeter_board.jpeg|640px]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
All welded on an experiment board, for the Rpi, with a long pin connector, so you can stack other boards.&amp;lt;br&amp;gt;&lt;br /&gt;
I use a RJ11 connector to connect the sensor. &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Complete mounted on the Pi:&lt;br /&gt;
&amp;lt;div class=&amp;quot;res-img&amp;quot;&amp;gt;&lt;br /&gt;
[[File:RPi_watermeter_complete.jpeg|640px]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;/div&gt;</summary>
		<author><name>Roland</name></author>
	</entry>
	<entry>
		<id>http://wiki.breedveld.net/index.php?title=RPiWaterMeter&amp;diff=7271</id>
		<title>RPiWaterMeter</title>
		<link rel="alternate" type="text/html" href="http://wiki.breedveld.net/index.php?title=RPiWaterMeter&amp;diff=7271"/>
		<updated>2020-12-23T18:11:20Z</updated>

		<summary type="html">&lt;p&gt;Roland: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;&lt;br /&gt;
Water usage mesurement with a Raspberry Pi&#039;&#039;&#039;&lt;br /&gt;
In my case I use Domoticz, but it also works with Home-Assist and other products.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
It works with a magnetic sensor, which can be used because of the half-metal rotor of watermeters in my country (Netherlands)&amp;lt;br&amp;gt;&lt;br /&gt;
For magnetic sensor I use the LJ12A3-4-Z/B from the well known company in China. &amp;lt;br&amp;gt;&lt;br /&gt;
You can use most types but be sure to by the OC (Open-Collector) version, while most sensors use higher voltages than a Raspberry Pi.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
With a piece of aluminium it&#039;s easy to mount on the meter:&lt;br /&gt;
&amp;lt;div class=&amp;quot;res-img&amp;quot;&amp;gt;&lt;br /&gt;
[[File:RPi_watermeter_sensor.jpeg|640px]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Shematics:&lt;br /&gt;
&amp;lt;div class=&amp;quot;res-img&amp;quot;&amp;gt;&lt;br /&gt;
[[File:RPi_watermeter_schematics.jpeg|640px]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
Because the sensor needs 9-36 Volt, while a Raspberry Pi only can deliver 5 Volt, I use an adjustable chopper (also from China), adjusted as 12 Volt.&amp;lt;br&amp;gt;&lt;br /&gt;
The output is connected to one of the GPIO, which first should configured as input, I use GPIO28 (pin38).&amp;lt;br&amp;gt;&lt;br /&gt;
The led will show if it works, for every pulse 1 liter water is detected.&amp;lt;br&amp;gt;&lt;br /&gt;
I use a Raspberry Pi Cluster, so I can do a failover, pin 2,6 and 38 are also wired to a second Pi,&amp;lt;br&amp;gt;&lt;br /&gt;
for the Power a diode is needed, for each Pi, while it&#039;s a bad idea to connect the power to multiple Pi&#039;s.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
First tested it with an experiment board:&lt;br /&gt;
&amp;lt;div class=&amp;quot;res-img&amp;quot;&amp;gt;&lt;br /&gt;
[[File:RPi_watermeter_experiment.jpeg|640px]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
To test it on a pi you need the gpio command:&amp;lt;br&amp;gt;&lt;br /&gt;
if not installed:&amp;lt;br&amp;gt;&lt;br /&gt;
sudo apt-get update&amp;lt;br&amp;gt;&lt;br /&gt;
sudo apt-get install wiringpi&amp;lt;br&amp;gt;&lt;br /&gt;
change GPIO 28 (BCM=20 an pin=38) as input:&amp;lt;br&amp;gt;&lt;br /&gt;
sudo /usr/local/bin/gpio export 20 in&amp;lt;br&amp;gt;&lt;br /&gt;
Put this line somewhere in a startup file, so it will stay that way, after reboot,&amp;lt;br&amp;gt;&lt;br /&gt;
best below in /etc/rc.local (without sudo)&amp;lt;br&amp;gt;&lt;br /&gt;
to show the states:&amp;lt;br&amp;gt;&lt;br /&gt;
sudo gpio  readall&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is the result:&lt;br /&gt;
&amp;lt;div class=&amp;quot;res-img&amp;quot;&amp;gt;&lt;br /&gt;
[[File:RPi_watermeter_board.jpeg|640px]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
I use a RJ11 connector to connect the sensor. &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Complete mounted on the Pi:&lt;br /&gt;
&amp;lt;div class=&amp;quot;res-img&amp;quot;&amp;gt;&lt;br /&gt;
[[File:RPi_watermeter_complete.jpeg|640px]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;/div&gt;</summary>
		<author><name>Roland</name></author>
	</entry>
	<entry>
		<id>http://wiki.breedveld.net/index.php?title=RPiWaterMeter&amp;diff=7270</id>
		<title>RPiWaterMeter</title>
		<link rel="alternate" type="text/html" href="http://wiki.breedveld.net/index.php?title=RPiWaterMeter&amp;diff=7270"/>
		<updated>2020-12-23T18:08:58Z</updated>

		<summary type="html">&lt;p&gt;Roland: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;&lt;br /&gt;
Water usage mesurement with a Raspberry Pi&#039;&#039;&#039;&lt;br /&gt;
In my case I use Domoticz, but it also works with Home-Assist and other products.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
It works with a magnetic sensor, which can be used because of the half-metal rotor of watermeters in my country (Netherlands)&amp;lt;br&amp;gt;&lt;br /&gt;
For magnetic sensor I use the LJ12A3-4-Z/B from the well known company in China. You can use most types but be sure to by the OC (Open-Collector) version, while most sensors use higher voltages than a Raspberry Pi.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With a piece of aluminium it&#039;s easy to mount on the meter:&lt;br /&gt;
&amp;lt;div class=&amp;quot;res-img&amp;quot;&amp;gt;&lt;br /&gt;
[[File:RPi_watermeter_sensor.jpeg|640px]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Shematics:&lt;br /&gt;
&amp;lt;div class=&amp;quot;res-img&amp;quot;&amp;gt;&lt;br /&gt;
[[File:RPi_watermeter_schematics.jpeg|640px]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
Because the sensor needs 9-36 Volt, while a Raspberry Pi only can deliver 5 Volt, I use an adjustable chopper (also from China), adjusted as 12 Volt.&amp;lt;br&amp;gt;&lt;br /&gt;
The output is connected to one of the GPIO, which first should configured as input, I use GPIO28 (pin38).&lt;br /&gt;
The led will show if it works, for every pulse 1 liter water is detected.&lt;br /&gt;
I use a Raspberry Pi Cluster, so I can do a failover, pin 2,6 and 38 are also wired to a second Pi, for the Power a diode is needed, for each Pi, while it&#039;s a bad idea to connect the power to multiple Pi&#039;s.&lt;br /&gt;
&lt;br /&gt;
First tested it with an experiment board:&lt;br /&gt;
&amp;lt;div class=&amp;quot;res-img&amp;quot;&amp;gt;&lt;br /&gt;
[[File:RPi_watermeter_experiment.jpeg|640px]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
To test it on a pi you need the gpio command:&lt;br /&gt;
if not installed:&lt;br /&gt;
sudo apt-get update&lt;br /&gt;
sudo apt-get install wiringpi&lt;br /&gt;
change GPIO 28 (BCM=20 an pin=38) as input:&lt;br /&gt;
sudo /usr/local/bin/gpio export 20 in&lt;br /&gt;
Put this line somewhere in a startup file, so it will stay that way, after reboot, best below in /etc/rc.local (without sudo)&lt;br /&gt;
to show the states:&lt;br /&gt;
sudo gpio  readall&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This is the result:&lt;br /&gt;
&amp;lt;div class=&amp;quot;res-img&amp;quot;&amp;gt;&lt;br /&gt;
[[File:RPi_watermeter_board.jpeg|640px]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
I use a RJ11 connector to connect the sensor. &lt;br /&gt;
&lt;br /&gt;
Complete mounted on the Pi:&lt;br /&gt;
&amp;lt;div class=&amp;quot;res-img&amp;quot;&amp;gt;&lt;br /&gt;
[[File:RPi_watermeter_complete.jpeg|640px]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;/div&gt;</summary>
		<author><name>Roland</name></author>
	</entry>
	<entry>
		<id>http://wiki.breedveld.net/index.php?title=RPiWaterMeter&amp;diff=7269</id>
		<title>RPiWaterMeter</title>
		<link rel="alternate" type="text/html" href="http://wiki.breedveld.net/index.php?title=RPiWaterMeter&amp;diff=7269"/>
		<updated>2020-12-23T18:08:19Z</updated>

		<summary type="html">&lt;p&gt;Roland: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;&lt;br /&gt;
Water usage mesurement with a Raspberry Pi&#039;&#039;&#039;&lt;br /&gt;
In my case I use Domoticz, but it also works with Home-Assist and other products.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
It works with a magnetic sensor, which can be used because of the half-metal rotor of watermeters in my country (Netherlands)&lt;br /&gt;
For magnetic sensor I use the LJ12A3-4-Z/B from the well known company in China. You can use most types but be sure to by the OC (Open-Collector) version, while most sensors use higher voltages than a Raspberry Pi.&lt;br /&gt;
With a piece of aluminium it&#039;s easy to mount on the meter:&lt;br /&gt;
&amp;lt;div class=&amp;quot;res-img&amp;quot;&amp;gt;&lt;br /&gt;
[[File:RPi_watermeter_sensor.jpeg|640px]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Shematics:&lt;br /&gt;
&amp;lt;div class=&amp;quot;res-img&amp;quot;&amp;gt;&lt;br /&gt;
[[File:RPi_watermeter_schematics.jpeg|640px]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
Because the sensor needs 9-36 Volt, while a Raspberry Pi only can deliver 5 Volt, I use an adjustable chopper (also from China), adjusted as 12 Volt.&amp;lt;br&amp;gt;&lt;br /&gt;
The output is connected to one of the GPIO, which first should configured as input, I use GPIO28 (pin38).&lt;br /&gt;
The led will show if it works, for every pulse 1 liter water is detected.&lt;br /&gt;
I use a Raspberry Pi Cluster, so I can do a failover, pin 2,6 and 38 are also wired to a second Pi, for the Power a diode is needed, for each Pi, while it&#039;s a bad idea to connect the power to multiple Pi&#039;s.&lt;br /&gt;
&lt;br /&gt;
First tested it with an experiment board:&lt;br /&gt;
&amp;lt;div class=&amp;quot;res-img&amp;quot;&amp;gt;&lt;br /&gt;
[[File:RPi_watermeter_experiment.jpeg|640px]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
To test it on a pi you need the gpio command:&lt;br /&gt;
if not installed:&lt;br /&gt;
sudo apt-get update&lt;br /&gt;
sudo apt-get install wiringpi&lt;br /&gt;
change GPIO 28 (BCM=20 an pin=38) as input:&lt;br /&gt;
sudo /usr/local/bin/gpio export 20 in&lt;br /&gt;
Put this line somewhere in a startup file, so it will stay that way, after reboot, best below in /etc/rc.local (without sudo)&lt;br /&gt;
to show the states:&lt;br /&gt;
sudo gpio  readall&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This is the result:&lt;br /&gt;
&amp;lt;div class=&amp;quot;res-img&amp;quot;&amp;gt;&lt;br /&gt;
[[File:RPi_watermeter_board.jpeg|640px]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
I use a RJ11 connector to connect the sensor. &lt;br /&gt;
&lt;br /&gt;
Complete mounted on the Pi:&lt;br /&gt;
&amp;lt;div class=&amp;quot;res-img&amp;quot;&amp;gt;&lt;br /&gt;
[[File:RPi_watermeter_complete.jpeg|640px]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;/div&gt;</summary>
		<author><name>Roland</name></author>
	</entry>
	<entry>
		<id>http://wiki.breedveld.net/index.php?title=RPiWaterMeter&amp;diff=7268</id>
		<title>RPiWaterMeter</title>
		<link rel="alternate" type="text/html" href="http://wiki.breedveld.net/index.php?title=RPiWaterMeter&amp;diff=7268"/>
		<updated>2020-12-23T18:07:37Z</updated>

		<summary type="html">&lt;p&gt;Roland: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;&lt;br /&gt;
Water usage mesurement with a Raspberry Pi&#039;&#039;&#039;&lt;br /&gt;
In my case I use Domoticz, but it also works with Home-Assist and other products.&lt;br /&gt;
&lt;br /&gt;
It works with a magnetic sensor, which can be used because of the half-metal rotor of watermeters in my country (Netherlands)&lt;br /&gt;
For magnetic sensor I use the LJ12A3-4-Z/B from the well known company in China. You can use most types but be sure to by the OC (Open-Collector) version, while most sensors use higher voltages than a Raspberry Pi.&lt;br /&gt;
With a piece of aluminium it&#039;s easy to mount on the meter:&lt;br /&gt;
&amp;lt;div class=&amp;quot;res-img&amp;quot;&amp;gt;&lt;br /&gt;
[[File:RPi_watermeter_sensor.jpeg|640px]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Shematics:&lt;br /&gt;
&amp;lt;div class=&amp;quot;res-img&amp;quot;&amp;gt;&lt;br /&gt;
[[File:RPi_watermeter_schematics.jpeg|640px]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
Because the sensor needs 9-36 Volt, while a Raspberry Pi only can deliver 5 Volt, I use an adjustable chopper (also from China), adjusted as 12 Volt.&lt;br /&gt;
The output is connected to one of the GPIO, which first should configured as input, I use GPIO28 (pin38).&lt;br /&gt;
The led will show if it works, for every pulse 1 liter water is detected.&lt;br /&gt;
I use a Raspberry Pi Cluster, so I can do a failover, pin 2,6 and 38 are also wired to a second Pi, for the Power a diode is needed, for each Pi, while it&#039;s a bad idea to connect the power to multiple Pi&#039;s.&lt;br /&gt;
&lt;br /&gt;
First tested it with an experiment board:&lt;br /&gt;
&amp;lt;div class=&amp;quot;res-img&amp;quot;&amp;gt;&lt;br /&gt;
[[File:RPi_watermeter_experiment.jpeg|640px]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
To test it on a pi you need the gpio command:&lt;br /&gt;
if not installed:&lt;br /&gt;
sudo apt-get update&lt;br /&gt;
sudo apt-get install wiringpi&lt;br /&gt;
change GPIO 28 (BCM=20 an pin=38) as input:&lt;br /&gt;
sudo /usr/local/bin/gpio export 20 in&lt;br /&gt;
Put this line somewhere in a startup file, so it will stay that way, after reboot, best below in /etc/rc.local (without sudo)&lt;br /&gt;
to show the states:&lt;br /&gt;
sudo gpio  readall&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This is the result:&lt;br /&gt;
&amp;lt;div class=&amp;quot;res-img&amp;quot;&amp;gt;&lt;br /&gt;
[[File:RPi_watermeter_board.jpeg|640px]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
I use a RJ11 connector to connect the sensor. &lt;br /&gt;
&lt;br /&gt;
Complete mounted on the Pi:&lt;br /&gt;
&amp;lt;div class=&amp;quot;res-img&amp;quot;&amp;gt;&lt;br /&gt;
[[File:RPi_watermeter_complete.jpeg|640px]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;/div&gt;</summary>
		<author><name>Roland</name></author>
	</entry>
	<entry>
		<id>http://wiki.breedveld.net/index.php?title=RPiWaterMeter&amp;diff=7267</id>
		<title>RPiWaterMeter</title>
		<link rel="alternate" type="text/html" href="http://wiki.breedveld.net/index.php?title=RPiWaterMeter&amp;diff=7267"/>
		<updated>2020-12-23T17:52:45Z</updated>

		<summary type="html">&lt;p&gt;Roland: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;&lt;br /&gt;
This is the way I measure water-usage with my Raspberry Pi&#039;&#039;&#039;&lt;br /&gt;
In my case I use Domoticz, but it also works with Home-Assist and other products.&lt;br /&gt;
&lt;br /&gt;
It works with a magnetic sensor, which can be used because of the half-metal rotor of watermeters in my country (Netherlands)&lt;br /&gt;
For magnetic sensor I use the LJ12A3-4-Z/B from the well known company in China, with a piece of aluminium it&#039;s easy to mount on the meter:&lt;br /&gt;
&amp;lt;div class=&amp;quot;res-img&amp;quot;&amp;gt;&lt;br /&gt;
[[File:RPi_watermeter_sensor.jpeg|640px]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Shematics:&lt;br /&gt;
&amp;lt;div class=&amp;quot;res-img&amp;quot;&amp;gt;&lt;br /&gt;
[[File:RPi_watermeter_schematics.jpeg|thumb]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
Because the sensor needs 9-36 Volt, while a Raspberry Pi only can deliver 5 Volt, I use an adjustable chopper (also from China), adjusted as 12 Volt.&lt;br /&gt;
I use a Raspberry Pi Cluster, so I can do a failover, pin 2,6 and 38 (if you use GPIO20) are also wired to a second Pi, for the Power a diode is needed, for each Pi, while it&#039;s a bad idea to connect the power to multiple Pi&#039;s.&lt;br /&gt;
&lt;br /&gt;
First tested it with an experiment board:&lt;br /&gt;
&amp;lt;div class=&amp;quot;res-img&amp;quot;&amp;gt;&lt;br /&gt;
[[File:RPi_watermeter_experiment.jpeg|thumb]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;/div&gt;</summary>
		<author><name>Roland</name></author>
	</entry>
	<entry>
		<id>http://wiki.breedveld.net/index.php?title=RPiWaterMeter&amp;diff=7266</id>
		<title>RPiWaterMeter</title>
		<link rel="alternate" type="text/html" href="http://wiki.breedveld.net/index.php?title=RPiWaterMeter&amp;diff=7266"/>
		<updated>2020-12-23T17:51:26Z</updated>

		<summary type="html">&lt;p&gt;Roland: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;&lt;br /&gt;
This is the way I measure water-usage with my Raspberry Pi&#039;&#039;&#039;&lt;br /&gt;
In my case I use Domoticz, but it also works with Home-Assist and other products.&lt;br /&gt;
&lt;br /&gt;
It works with a magnetic sensor, which can be used because of the half-metal rotor of watermeters in my country (Netherlands)&lt;br /&gt;
For magnetic sensor I use the LJ12A3-4-Z/B from the well known company in China, with a piece of aluminium it&#039;s easy to mount on the meter:&lt;br /&gt;
&amp;lt;div class=&amp;quot;res-img&amp;quot;&amp;gt;&lt;br /&gt;
[[File:RPi_watermeter_sensor.jpeg|thumb]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Shematics:&lt;br /&gt;
&amp;lt;div class=&amp;quot;res-img&amp;quot;&amp;gt;&lt;br /&gt;
[[File:RPi_watermeter_schematics.jpeg|thumb]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
Because the sensor needs 9-36 Volt, while a Raspberry Pi only can deliver 5 Volt, I use an adjustable chopper (also from China), adjusted as 12 Volt.&lt;br /&gt;
I use a Raspberry Pi Cluster, so I can do a failover, pin 2,6 and 38 (if you use GPIO20) are also wired to a second Pi, for the Power a diode is needed, for each Pi, while it&#039;s a bad idea to connect the power to multiple Pi&#039;s.&lt;br /&gt;
&lt;br /&gt;
First tested it with an experiment board:&lt;br /&gt;
&amp;lt;div class=&amp;quot;res-img&amp;quot;&amp;gt;&lt;br /&gt;
[[File:RPi_watermeter_experiment.jpeg|thumb]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;/div&gt;</summary>
		<author><name>Roland</name></author>
	</entry>
	<entry>
		<id>http://wiki.breedveld.net/index.php?title=RPiWaterMeter&amp;diff=7265</id>
		<title>RPiWaterMeter</title>
		<link rel="alternate" type="text/html" href="http://wiki.breedveld.net/index.php?title=RPiWaterMeter&amp;diff=7265"/>
		<updated>2020-12-23T17:42:51Z</updated>

		<summary type="html">&lt;p&gt;Roland: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;&lt;br /&gt;
This is the way I measure water-usage with my Raspberry Pi&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
It works with a magnetic sensor, which can be used because of the half-metal rotor of watermeters in my country (Netherlands)&lt;br /&gt;
For magnetic sensor I use the LJ12A3-4-Z/B with a piece of aluminium it&#039;s easy to mount on the meter:&lt;br /&gt;
&amp;lt;div class=&amp;quot;res-img&amp;quot;&amp;gt;&lt;br /&gt;
[[File:RPi_watermeter_sensor.jpeg|thumb]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Shematics:&lt;br /&gt;
&amp;lt;div class=&amp;quot;res-img&amp;quot;&amp;gt;&lt;br /&gt;
[[File:RPi_watermeter_schematics.jpeg]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;/div&gt;</summary>
		<author><name>Roland</name></author>
	</entry>
	<entry>
		<id>http://wiki.breedveld.net/index.php?title=RPiWaterMeter&amp;diff=7264</id>
		<title>RPiWaterMeter</title>
		<link rel="alternate" type="text/html" href="http://wiki.breedveld.net/index.php?title=RPiWaterMeter&amp;diff=7264"/>
		<updated>2020-12-23T17:40:56Z</updated>

		<summary type="html">&lt;p&gt;Roland: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;&lt;br /&gt;
This is the way I measure water-usage with my Raspberry Pi&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
It works with a magnetic sensor, which can be used because of the half-metal rotor of watermeters in my country (Netherlands)&lt;br /&gt;
For magnetic sensor I use the LJ12A3-4-Z/B with a piece of aluminium it&#039;s easy to mount on the meter:&lt;br /&gt;
&amp;lt;div class=&amp;quot;res-img&amp;quot;&amp;gt;&lt;br /&gt;
[[File:RPi_watermeter_sensor.jpeg]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Shematics:&lt;br /&gt;
&amp;lt;div class=&amp;quot;res-img&amp;quot;&amp;gt;&lt;br /&gt;
[[File:RPi_watermeter_schematics.jpeg]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;/div&gt;</summary>
		<author><name>Roland</name></author>
	</entry>
	<entry>
		<id>http://wiki.breedveld.net/index.php?title=MediaWiki:Common.css&amp;diff=7263</id>
		<title>MediaWiki:Common.css</title>
		<link rel="alternate" type="text/html" href="http://wiki.breedveld.net/index.php?title=MediaWiki:Common.css&amp;diff=7263"/>
		<updated>2020-12-23T17:40:02Z</updated>

		<summary type="html">&lt;p&gt;Roland: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;.res-img img {&lt;br /&gt;
	max-width:640;&lt;br /&gt;
	height:auto;&lt;br /&gt;
}&lt;/div&gt;</summary>
		<author><name>Roland</name></author>
	</entry>
</feed>