Open Source Smart Energy Meter 3k344e

  • ed by: Vennila
  • 0
  • 0
  • July 2022
  • PDF

This document was ed by and they confirmed that they have the permission to share it. If you are author or own the copyright of this book, please report to us by using this report form. Report 3i3n4


Overview 26281t

& View Open Source Smart Energy Meter as PDF for free.

More details 6y5l6z

  • Words: 10,189
  • Pages: 51
1. Edit a file called memory and add the following script lines to create the memory usage script: #!/bin/sh cat << EOF Content-type: text/plain Cache-control: no-cache

Creating the index.html File

EOF echo "#cat /proc/meminfo" cat /proc/meminfo echo echo "# free -b" free -b echo echo "# ps -el" ps -el Edit a file called memory and add the following script lines to create the kernel boot log script : #!/bin/sh cat << EOF Content-type: text/plain Cache-control: no-cache EOF echo 37

echo "#dmesg" dmesg Edit a file called memory and add the following script lines to create the kernel config options script : #!/bin/sh cat << EOF Content-type: text/plain Cache-control: no-cache EOF rm -rf /tmp/config* /proc/config.gz /tmp gzip -d /tmp/config.gz cat /tmp/config Make the scripts executable: chmod +x memory chmod +x log chmod +x config

2.4.CODING On Raspberry Pi, will need to ensure that certain Python related files installed. To make sure, type the following commands... sudo apt-get install python-dev python-pip sudo pip install apscheduler

The above installs the advanced python scheduler used by the code. Now we will want to the files from this github repository. To do so, type the following commands... sudo apt-get install git git clone https://github.com/kieranc/power.git &&cd power

The file named power-monitor is used to automatically start the data logging process on boot and stop on shutdown. For testing purposes, we do not need this script. However, we should make use of it if we are setting up a more permanent solution. 38

sudo power-monitor /etc/init.d/ sudochmoda+x /etc/init.d/power-monitor sudo update-rc.d power-monitor defaults

Note: Be sure to check the power-monitor file to make sure that the path to the Python application, monitor.py, matches with the path on our system. For example, /home/pi/power/power.py Due to Python's inability to respond to an interrupt, I've used a very simple C app to listen for an interrupt triggered when the LDR detects a pulse. Monitor.py counts these pulses and each minute, creates a power reading in watts which it sends to EmonCMS' API. I'm not much of a coder so a lot of the code is borrowed from other people, I've included all sources as far as I'm aware. The C app came from Radek "Mrkva" Pilar on the raspberrypi. This app will need compiling like so: gccgpio-irq-demo.c -o gpio-irq

Put it somewhere accessible - I used /usr/local/bin, this will need modifying at the bottom of monitor.py if you put it somewhere else. Once all this is done we can start the data logging process... sudo /etc/init.d/power-monitor start

This script is configure only to submit its output to the EmonCMS API. For this we need EmonCMS API.

Install Emoncms on Ubuntu / Debian This guide should work on most debian systems including Ubuntu. For installation guide on installing emoncms on a raspberrypi 1) Install mysql $ sudo apt-get install mysql-server mysql-client

When the blue dialog appears enter a for root , note the down as you will need it later.

39

2) Install apache2 $ sudo apt-get install apache2

3) Install php $ sudo apt-get install php5 libapache2-mod-php5 $ sudo apt-get install php5-mysql

4) Enable mod rewrite $ sudo a2enmod rewrite $ sudonano /etc/apache2/sites-enabled/000-default

Change (line 7 and line 11), "AllowOverride None" to "AllowOverride All". [Ctrl + X ] then [Y] then [Enter] to Save and exit. 5) That completes the server installation, restart the server to make everything above operational: $ sudo /etc/init.d/apache2 restart

Installing emoncms: 6) Install git (recommended but optional) $ sudo apt-get install git-core

7) Emoncms First cd into the var directory: $ cd /var/

Set the permissions of the www directory to be owned by our name (on the raspberrypi its pi): $ sudochown pi www

Cd into www directory $ cd www

40

emoncms using git: $ git clone https://github.com/emoncms/emoncms.git

Alternatively emoncms and unzip to our server: 8) Create a MYSQL database $ mysql -u root -p

Enter the mysql that we set above. Then enter the sql to create a database: mysql> CREATE DATABASE emoncms;

Exit mysql by: mysql> exit

9) Set emoncms database settings. cd into the emoncms directory where the settings file is located $ cd /var/www/emoncms/

Make a copy of default.settings.php and call it settings.php $ default.settings.phpsettings.php

Open settings.php in an editor: $ nanosettings.php

Enter in our database settings. $name = "NAME"; $ = ""; $server

= "localhost";

$database = "emoncms";

Enter in our database settings. Save (Ctrl-X), type Y and exit 41

10) In an internet browser, load emoncms: Chrome Ubuntu 23.0.1271.97 - developed with, works great. Chrome Windows 25.0.1364.172 - quick check revealed no browser specific bugs. Firefox Ubuntu 15.0.1 - no critical browser specific bugs, but movement in the dashboard editor is much less smooth than chrome. Internet explorer 9 - works well with compatibility mode turned off. F12 Development tools -> browser mode: IE9. Some widgets such as the hot water cylinder do load later than the dial. IE 8, 7 - not recommended, widgets and dashboard editor do not work due to no html5 canvas fix implemented but visualisations do work as these have a fix applied.

42

CHAPTER 3 WORKING 3.1. BLOCK DIAGRAM

Figure 1.19: Working Block Diagram

3.2. EXPERIMENT SETUP

Figure 1.20: Set of Project 43

Figure 1.21: Meter pin configuration with CT & PT connection

Figure 1.22: Load connection with proto type 44

3.3. DIFFUCULTIES OBSERVED Internet connection This project main part is Raspberry pi Board . This board include in LAN port. But internet not connected in directly. Solution is change the simple proxy and Host in First time Browsing. So take the long time for internet connection Python Library installs First time library install completed in 80% not completed in fully installed. Some errors displayed. The library 100% completed in only server LAN connection. So find the problem is very difficult

45

CHAPTER 4 RESULT

4.1. SCREENSHOTS

Figure 1.23: Data file setting (Live Graph)

46

Figure 1.24: Live Graph

4.2. DESCRIPTION Data Writer API If we are not using Java we will have to take care of creating the data files yourself. This should be very straight forward, as the data file format is very simple. Please refer to the data file format definition for details. If we are using Java we can make use of the LiveGraph data writer API. This simple API handles all data file matters for your application. The API is distributed in Java packages org.LiveGraph.dataFile.common andorg.LiveGraph.data File.write;

47

it also includes the package org.LiveGraph.demoDataSource which contains examples. The package org.LiveGraph.dataFile.common includes helper classes; the package org.LiveGraph.dataFile.write includes the main writer API. When we are interested in a detailed description of the API, please refer to the appropriate Javadoc reference page. At this stage we want to provide akickstart example. DataStreamWriterFactory The first class need to know about is org.LiveGraph.dataFile.write.DataStreamWriterFactory. The most interesting methods in this class are the static createDataWriter(…)-methods. They create new writer objects for a unique files located in a specified directory. The file's name is constructed form a specified basis and the current date and time. This makes creating verbose file names and managing data files very easy. For instance, the statement DataStreamWriterFactory.createDataWriter("C:\\TutorialDir ", "TutorialData", "dat"); creates a writer which writes to file c:\TutorialDir\TutorialData.07.03.1319.09.21.dat(assuming it was executed at 19:09:21 on the 13.03.2007).

the

If that file already exists than the names c:\TutorialDir\TutorialData.07.03.1319.09.21(1).dat,c:\TutorialDir\TutorialData.07.03.1319.09.21(2).dat and so on will be automatically used instead. This mechanism allows we to do all we data file management in just one line. DataStreamWriter The second class you need to know about is 48

org.LiveGraph.dataFile.write.DataStreamWriter. DataStreamWriter objects are actually used for writing data to files. DataStreamWriter does not extendjava.io.Writer because the structure of the data being written is different and the making use of the methods published by the standard API class would be counter-intuitive; however, DataStreamWriter objects should be used in much the same manner as a normal Writer in an application. The class provides methods for setting up the data file separator, adding information lines and comments to the data file, defining the number of and the labels for the data series and, eventually, for writing the data. Before any data is sent to the writer the data series should be set up with a series of calls toaddDataSeries(String). Once a dataset is written to the stream, no more data series may be added. A dataset is written by a series of calls to one of the setDataValue(...) methods. Calls to those methods do not cause any data to be written. Instead, the values are associated with the appropriate data series and cached. In order to actually write the data to the underlying stream the method writeDataSet() must be invoked. It flushes the cache to the data stream and prepares for the processing of the next dataset. In order to allow for concise code when using this class in applications, no methods of DataStreamWriterthrow any I/O exceptions. If an IOException is thrown by the underlying stream. it is immediately caught by the writer itself. In order to allow the application to nevertheless access and control the error handling, the methodshadIOException(), getIOException() and resetIOException() are provided.

49

4.3. CONCLUSION Thus the smart meter with the implementation of open source coding and software has been developed. This project mainly focuses on developing the software (or) RTOS framework for open source energy meter. The future work of this project includes may novel ideas such as wireless networking, deploying secured web server. Thus with this open source hardware and software technology. We can able to monitor energy and power easily. 4.4. FUTURE WORK The future work includes the following, • The Energy Meter data can be made to transfer in wireless. • The wireless network can be formed with WIFI or Open Smart Grid Protocol (OSGP).

50

4.5.REFERENCE http://openenergymonitor.org/emon/node/2017 https://github.com/kieranc/power http://en.wikipedia.org/wiki/Smart_meter http://www.raspberrypi.org/phpBB3/viewtopic.php?f=44&t=7509 http://pypi.python.org http://pyevolve.sourceforge.net/wordpress/?p=2383 http://www.ti.com

51

Related Documents 3h463d

Open Source Smart Energy Meter 3k344e
July 2022 0
Smart Prepaid Energy Meter 3z12i
November 2019 37
Smart Energy Meter 3t3d3t
November 2019 46
Smart Energy Meter Project Report 2g1p65
November 2021 0
Open Source 5j22p
August 2021 0
Afeboetel600- Herramientas Open Source 1w1u1r
April 2021 0

More Documents from "Vennila" 62t41

Open Source Smart Energy Meter 3k344e
July 2022 0