PVOutput Integration Service on PI for CC ENVIR

i followed the PVOutput Integration Service Installation Guide v1.5.3.1 to install it on a raspberry pi i just copied all the files to the root directory?

now its installed what do i do…

Im using the rj45 to usb cord that comes with it. is this the right one?

im editing the currentcost.ini and says to change to port but how do i know what port it is?
i have setup the pvoutput.ini file

once setup do i run bin/pvoutput.sh and its good to go?

or do i have to cron it every 5 minutes?
if so how?

does it auto start if the pi is powered down?

Use auto and it will detect the port

ok so still having trouble.

i have followed this thread

and end up getting this error and then it times out
i don’t know if its because im running it on measureit and that still has control of the sensors
i have stopped measure it service from running using

svc -d /service/measureit

/home/pi/pvoutput/bin$ ./pvoutput.sh
2018-08-29 10:33:14.734:INFO:oejs.Server:jetty-7.5.1.v20110908
2018-08-29 10:33:16.035:WARN:oejuc.AbstractLifeCycle:FAILED SelectChannelConnector@localhost:8888 FAILED: java.net.BindException: Address already in use
java.net.BindException: Address already in use
at sun.nio.ch.Net.bind0(Native Method)
at sun.nio.ch.Net.bind(Net.java:414)
at sun.nio.ch.Net.bind(Net.java:406)
at sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:214)
at sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:74)
at org.eclipse.jetty.server.nio.SelectChannelConnector.open(SelectChannelConnector.java:166)
at org.eclipse.jetty.server.AbstractConnector.doStart(AbstractConnector.java:300)
at org.eclipse.jetty.server.nio.SelectChannelConnector.doStart(SelectChannelConnector.java:244)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:59)
at org.eclipse.jetty.server.Server.doStart(Server.java:272)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:59)
at org.pvoutput.integration.console.AdminConsole.(AdminConsole.java:46)
at org.pvoutput.integration.Controller.startAdminConsole(Controller.java:602)
at org.pvoutput.integration.Controller.startup(Controller.java:172)
at org.pvoutput.integration.Controller.run(Controller.java:710)
at java.lang.Thread.run(Thread.java:744)
2018-08-29 10:33:16.068:WARN:oejuc.AbstractLifeCycle:FAILED org.eclipse.jetty.server.Server@4a3658: java.net.BindException: Address already in use
java.net.BindException: Address already in use
at sun.nio.ch.Net.bind0(Native Method)
at sun.nio.ch.Net.bind(Net.java:414)
at sun.nio.ch.Net.bind(Net.java:406)
at sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:214)
at sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:74)
at org.eclipse.jetty.server.nio.SelectChannelConnector.open(SelectChannelConnector.java:166)
at org.eclipse.jetty.server.AbstractConnector.doStart(AbstractConnector.java:300)
at org.eclipse.jetty.server.nio.SelectChannelConnector.doStart(SelectChannelConnector.java:244)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:59)
at org.eclipse.jetty.server.Server.doStart(Server.java:272)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:59)
at org.pvoutput.integration.console.AdminConsole.(AdminConsole.java:46)
at org.pvoutput.integration.Controller.startAdminConsole(Controller.java:602)
at org.pvoutput.integration.Controller.startup(Controller.java:172)
at org.pvoutput.integration.Controller.run(Controller.java:710)
at java.lang.Thread.run(Thread.java:744)
Stable Library

Native lib Version = RXTX-2.2pre2
Java lib Version = RXTX-2.1-7
WARNING: RXTX Version mismatch
Jar version = RXTX-2.1-7
native lib Version = RXTX-2.2pre2

Open the file conf/pvoutput.ini and make sure the following line is commented out with a #

# admin-port=8888

Restart the service.

ok done that

do i have to somehow stop the service?
now it just shows below . how do i know its working?

/home/pi/pvoutput/bin$ ./pvoutput.sh
Stable Library

Native lib Version = RXTX-2.2pre2
Java lib Version = RXTX-2.1-7
WARNING: RXTX Version mismatch
Jar version = RXTX-2.1-7
native lib Version = RXTX-2.2pre2

To run in the background use linux &

/home/pi/pvoutput/bin/pvoutput.sh &

https://www.dexterindustries.com/howto/run-a-program-on-your-raspberry-pi-at-startup/

Service activity will be logged to the file logs/pvoutput.log

log file below. seems to connect to pvoutput fine just doesn’t seem to connect to the sensors. looks like a port issue

2018-08-29 10:57:55,352 INFO [main] (Controller.java:108) -
2018-08-29 10:57:55,421 INFO [main] (Controller.java:109) - *** Starting PVOutput Integration Service v1.5.3.1
2018-08-29 10:57:55,480 INFO [Thread-0] (Controller.java:130) - Install Directory: /home/pi/pvoutput
2018-08-29 10:57:55,487 INFO [Thread-0] (Controller.java:139) - Loaded Config: pvoutput.ini
2018-08-29 10:58:02,457 INFO [Thread-0] (WebClient.java:133) - >>> http://pvoutput.org:80/service/r2/getsystem.jsp?donations=1
2018-08-29 10:58:06,645 INFO [Thread-0] (Controller.java:2136) - <<< parkour,4830,5271,14,345,Sunpower P17,1,5000,Zeversolar,N,25.0,No,20180828,-36.956215,140.741421,5;;1
2018-08-29 10:58:08,655 INFO [Thread-0] (WebClient.java:133) - >>> http://pvoutput.org:80/service/r1/getstatus.jsp?d=20180829
2018-08-29 10:58:09,403 INFO [Thread-0] (Controller.java:323) - --------------------------
2018-08-29 10:58:09,410 INFO [Thread-0] (Controller.java:324) - System Name: parkour
2018-08-29 10:58:09,415 INFO [Thread-0] (Controller.java:325) - System Size: 4830
2018-08-29 10:58:09,419 INFO [Thread-0] (Controller.java:326) - Timezone: Etc/UTC
2018-08-29 10:58:09,423 INFO [Thread-0] (Controller.java:327) - Donation Mode: true
2018-08-29 10:58:09,427 INFO [Thread-0] (Controller.java:328) - Max History: 90
2018-08-29 10:58:09,430 INFO [Thread-0] (Controller.java:329) - Status Interval: 5-min
2018-08-29 10:58:09,434 INFO [Thread-0] (Controller.java:330) - Status Date Time: null
2018-08-29 10:58:09,437 INFO [Thread-0] (Controller.java:331) - Upload Temperature: true
2018-08-29 10:58:09,441 INFO [Thread-0] (Controller.java:332) - Upload Voltage: true
2018-08-29 10:58:09,454 INFO [Thread-0] (Controller.java:333) - Energy Generation: -1
2018-08-29 10:58:09,457 INFO [Thread-0] (Controller.java:334) - Energy Consumption: -1
2018-08-29 10:58:09,461 INFO [Thread-0] (Controller.java:335) - Create Local Graph: true
2018-08-29 10:58:09,477 INFO [Thread-0] (Controller.java:336) - Retry Limit: 30 to 40
2018-08-29 10:58:09,480 INFO [Thread-0] (Controller.java:337) - --------------------------
2018-08-29 10:58:09,720 INFO [Thread-0] (Controller.java:372) - Loaded Reader 1: currentcost
2018-08-29 10:58:09,731 INFO [Thread-0] (Controller.java:373) - Log Directory 1: [/logs]
2018-08-29 10:58:09,736 INFO [Thread-0] (Controller.java:384) - Loading Config 1: currentcost.ini
2018-08-29 10:58:09,743 INFO [Thread-0] (CurrentcostLogReader.java:177) - Port: auto
2018-08-29 10:58:09,747 INFO [Thread-0] (CurrentcostLogReader.java:178) - Rate: 57600
2018-08-29 10:58:09,751 INFO [Thread-0] (CurrentcostLogReader.java:179) - Port Detect Wait: 15
2018-08-29 10:58:09,756 INFO [Thread-0] (CurrentcostLogReader.java:180) - Port Idle Recycle: 60
2018-08-29 10:58:09,822 INFO [Thread-0] (CurrentcostLogReader.java:245) - Id: 0, sensor: 0, channels: [], direction: Import, calibration: 1.0
2018-08-29 10:58:09,839 INFO [Thread-0] (CurrentcostLogReader.java:245) - Id: 1, sensor: 9, channels: [], direction: Import, calibration: 1.0
2018-08-29 10:58:09,844 INFO [Thread-0] (CurrentcostLogReader.java:270) - v7 sensor 9
2018-08-29 10:58:10,203 INFO [Thread-0] (CurrentcostLogReader.java:528) - Serial ports available: 0
2018-08-29 10:58:10,236 ERROR [Thread-0] (Controller.java:722) - Startup Error
java.lang.Exception: No free serial ports detected
at org.pvoutput.integration.reader.CurrentcostLogReader.startup(CurrentcostLogReader.java:454)
at org.pvoutput.integration.Controller.startup(Controller.java:410)
at org.pvoutput.integration.Controller.run(Controller.java:710)
at java.lang.Thread.run(Thread.java:744)

/home/pi/pvoutput/logs$ lsusb
Bus 001 Device 002: ID 0424:9514 Standard Microsystems Corp.
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 003: ID 0424:ec00 Standard Microsystems Corp.
Bus 001 Device 004: ID 067b:2303 Prolific Technology, Inc. PL2303 Serial Port

should my port be set to com4? or…

This means there were no open ports detected on the device.

You can try -

port=/dev/ttyUSB0

im getting anything from

2018-08-29 12:01:39,110 ERROR [Thread-0] (Controller.java:722) - Startup Error
java.lang.Exception: The port /dev/ttyUSB0 does not exist
at org.pvoutput.integration.reader.CurrentcostLogReader.startup(CurrentcostLogReader.java:448)
at org.pvoutput.integration.Controller.startup(Controller.java:410)
at org.pvoutput.integration.Controller.run(Controller.java:710)
at java.lang.Thread.run(Thread.java:744)

to

2018-08-29 12:11:08,417 INFO [Thread-0] (CurrentcostLogReader.java:489) - Opened serial port: /dev/ttyUSB0
2018-08-29 12:11:08,486 INFO [Thread-0] (Controller.java:489) - Added Reader: currentcost0
2018-08-29 12:11:08,519 INFO [Thread-0] (Controller.java:511) - Log File: currentcost0 [CC0-2018-08-29.log]
2018-08-29 12:11:08,524 INFO [Thread-0] (Controller.java:517) - Import Sensor: 0, id: 0
2018-08-29 12:11:08,528 INFO [Thread-0] (Controller.java:489) - Added Reader: currentcost1
2018-08-29 12:11:08,549 INFO [Thread-0] (Controller.java:511) - Log File: currentcost1 [CC1-2018-08-29.log]
2018-08-29 12:11:08,553 INFO [Thread-0] (Controller.java:517) - Import Sensor: 9, id: 1
2018-08-29 12:11:08,651 INFO [Thread-0] (Controller.java:579) - Service: [http://pvoutput.org:80/service/r2/addbatchstatus.jsp] Test: false, End: 18:00
2018-08-29 12:11:08,655 INFO [Thread-0] (Controller.java:587) - Loaded 2 Readers (Import: 2, Export: 0)
2018-08-29 12:11:10,661 INFO [Thread-0] (Controller.java:731) - Startup Complete: Waiting for data…
2018-08-29 12:11:10,667 WARN [Thread-0] (Controller.java:787) - Log directory ‘/logs’ does not exist
2018-08-29 12:11:10,670 WARN [Thread-0] (Controller.java:787) - Log directory ‘/logs’ does not exist
2018-08-29 12:12:08,483 WARN [Thread-3] (CurrentcostLogReader.java:863) - Port /dev/ttyUSB0 idle for more than 60 seconds
2018-08-29 12:12:08,486 INFO [Thread-3] (CurrentcostLogReader.java:476) - Closing Serial Port: /dev/ttyUSB0
2018-08-29 12:12:08,512 INFO [Thread-3] (CurrentcostLogReader.java:489) - Opened serial port: /dev/ttyUSB0
2018-08-29 12:12:10,676 WARN [Thread-0] (Controller.java:787) - Log directory ‘/logs’ does not exist
2018-08-29 12:12:10,686 WARN [Thread-0] (Controller.java:787) - Log directory ‘/logs’ does not exist

have tried multiple log folder options but nothing seems to work

ok so set the log directory as full path and it appears that works but still not working

2018-08-29 12:26:51,066 INFO [main] (Controller.java:108) -
2018-08-29 12:26:51,135 INFO [main] (Controller.java:109) - *** Starting PVOutput Integration Service v1.5.3.1
2018-08-29 12:26:51,207 INFO [Thread-0] (Controller.java:130) - Install Directory: /home/pi/pvoutput
2018-08-29 12:26:51,214 INFO [Thread-0] (Controller.java:139) - Loaded Config: pvoutput.ini
2018-08-29 12:26:58,193 INFO [Thread-0] (WebClient.java:133) - >>> http://pvoutput.org:80/service/r2/getsystem.jsp?donations=1
2018-08-29 12:27:01,576 INFO [Thread-0] (Controller.java:2136) - <<< parkour,4830,5271,14,345,Sunpower P17,1,5000,Zeversolar,N,25.0,No,20180828,-36.956215,140.741421,5;;1
2018-08-29 12:27:03,586 INFO [Thread-0] (WebClient.java:133) - >>> http://pvoutput.org:80/service/r1/getstatus.jsp?d=20180829
2018-08-29 12:27:04,339 INFO [Thread-0] (Controller.java:323) - --------------------------
2018-08-29 12:27:04,343 INFO [Thread-0] (Controller.java:324) - System Name: parkour
2018-08-29 12:27:04,347 INFO [Thread-0] (Controller.java:325) - System Size: 4830
2018-08-29 12:27:04,351 INFO [Thread-0] (Controller.java:326) - Timezone: Etc/UTC
2018-08-29 12:27:04,355 INFO [Thread-0] (Controller.java:327) - Donation Mode: true
2018-08-29 12:27:04,359 INFO [Thread-0] (Controller.java:328) - Max History: 90
2018-08-29 12:27:04,363 INFO [Thread-0] (Controller.java:329) - Status Interval: 5-min
2018-08-29 12:27:04,367 INFO [Thread-0] (Controller.java:330) - Status Date Time: null
2018-08-29 12:27:04,370 INFO [Thread-0] (Controller.java:331) - Upload Temperature: true
2018-08-29 12:27:04,374 INFO [Thread-0] (Controller.java:332) - Upload Voltage: true
2018-08-29 12:27:04,387 INFO [Thread-0] (Controller.java:333) - Energy Generation: -1
2018-08-29 12:27:04,391 INFO [Thread-0] (Controller.java:334) - Energy Consumption: -1
2018-08-29 12:27:04,395 INFO [Thread-0] (Controller.java:335) - Create Local Graph: true
2018-08-29 12:27:04,408 INFO [Thread-0] (Controller.java:336) - Retry Limit: 30 to 40
2018-08-29 12:27:04,412 INFO [Thread-0] (Controller.java:337) - --------------------------
2018-08-29 12:27:04,650 INFO [Thread-0] (Controller.java:372) - Loaded Reader 1: currentcost
2018-08-29 12:27:04,659 INFO [Thread-0] (Controller.java:373) - Log Directory 1: [/home/pi/pvoutput/logs]
2018-08-29 12:27:04,663 INFO [Thread-0] (Controller.java:384) - Loading Config 1: currentcost.ini
2018-08-29 12:27:04,675 INFO [Thread-0] (CurrentcostLogReader.java:177) - Port: /dev/ttyUSB0
2018-08-29 12:27:04,679 INFO [Thread-0] (CurrentcostLogReader.java:178) - Rate: 57600
2018-08-29 12:27:04,683 INFO [Thread-0] (CurrentcostLogReader.java:179) - Port Detect Wait: 15
2018-08-29 12:27:04,686 INFO [Thread-0] (CurrentcostLogReader.java:180) - Port Idle Recycle: 60
2018-08-29 12:27:04,752 INFO [Thread-0] (CurrentcostLogReader.java:245) - Id: 0, sensor: 0, channels: [], direction: Import, calibration: 1.0
2018-08-29 12:27:04,770 INFO [Thread-0] (CurrentcostLogReader.java:245) - Id: 1, sensor: 9, channels: [], direction: Import, calibration: 1.0
2018-08-29 12:27:04,774 INFO [Thread-0] (CurrentcostLogReader.java:270) - v7 sensor 9
2018-08-29 12:27:05,146 INFO [Thread-0] (CurrentcostLogReader.java:489) - Opened serial port: /dev/ttyUSB0
2018-08-29 12:27:05,214 INFO [Thread-0] (Controller.java:489) - Added Reader: currentcost0
2018-08-29 12:27:05,248 INFO [Thread-0] (Controller.java:511) - Log File: currentcost0 [CC0-2018-08-29.log]
2018-08-29 12:27:05,253 INFO [Thread-0] (Controller.java:517) - Import Sensor: 0, id: 0
2018-08-29 12:27:05,257 INFO [Thread-0] (Controller.java:489) - Added Reader: currentcost1
2018-08-29 12:27:05,277 INFO [Thread-0] (Controller.java:511) - Log File: currentcost1 [CC1-2018-08-29.log]
2018-08-29 12:27:05,281 INFO [Thread-0] (Controller.java:517) - Import Sensor: 9, id: 1
2018-08-29 12:27:05,379 INFO [Thread-0] (Controller.java:579) - Service: [http://pvoutput.org:80/service/r2/addbatchstatus.jsp] Test: false, End: 18:00
2018-08-29 12:27:05,383 INFO [Thread-0] (Controller.java:587) - Loaded 2 Readers (Import: 2, Export: 0)
2018-08-29 12:27:07,389 INFO [Thread-0] (Controller.java:731) - Startup Complete: Waiting for data…
2018-08-29 12:28:05,209 WARN [Thread-3] (CurrentcostLogReader.java:863) - Port /dev/ttyUSB0 idle for more than 60 seconds
2018-08-29 12:28:05,213 INFO [Thread-3] (CurrentcostLogReader.java:476) - Closing Serial Port: /dev/ttyUSB0
2018-08-29 12:28:05,233 INFO [Thread-3] (CurrentcostLogReader.java:489) - Opened serial port: /dev/ttyUSB0
2018-08-29 12:30:05,240 WARN [Thread-3] (CurrentcostLogReader.java:863) - Port /dev/ttyUSB0 idle for more than 60 seconds
2018-08-29 12:30:05,245 INFO [Thread-3] (CurrentcostLogReader.java:476) - Closing Serial Port: /dev/ttyUSB0
2018-08-29 12:30:05,273 INFO [Thread-3] (CurrentcostLogReader.java:489) - Opened serial port: /dev/ttyUSB0
2018-08-29 12:32:05,280 WARN [Thread-3] (CurrentcostLogReader.java:863) - Port /dev/ttyUSB0 idle for more than 60 seconds
2018-08-29 12:32:05,283 INFO [Thread-3] (CurrentcostLogReader.java:476) - Closing Serial Port: /dev/ttyUSB0
2018-08-29 12:32:13,803 INFO [Thread-3] (CurrentcostLogReader.java:489) - Opened serial port: /dev/ttyUSB0

This means no data is been sent from the currentcost to the rpi on /dev/ttyUSB0

The rpi command below will where the port is mounted -

sudo dmesg | grep tty

usb 1-1.2: pl2303 converter now attached to ttyUSB0

/home/pi/pvoutput/logs$ dmesg | grep tty
[ 0.000000] Kernel command line: dma.dmachans=0x7f35 bcm2708_fb.fbwidth=656 bcm2708_fb.fbheight=416 bcm2708.boardrev=0xe bcm2708.serial=0x392de160 smsc95xx.macaddr=B8:27:EB:2D:E1:60 bcm2708_fb.fbswap=1 sdhci-bcm2708.emmc_clock_freq=250000000 vc_mem.mem_base=0x1ec00000 vc_mem.mem_size=0x20000000 dwc_otg.lpm_enable=0 console=ttyAMA0,115200 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline rootwait
[ 0.001410] console [tty1] enabled
[ 0.707040] dev:f1: ttyAMA0 at MMIO 0x20201000 (irq = 83, base_baud = 0) is a PL011 rev3
[ 1.096462] console [ttyAMA0] enabled
[ 6.648284] usb 1-1.3: pl2303 converter now attached to ttyUSB0

/dev/ttyUSB0 is the correct port, check that measureit is stopped and not grabbing the data.

I stopped the service and deleted the sensors in measureit but i guess i havent disabled it to not start on reboot. Will look into that.

unable to find out how to disable Measureit from starting up on reboot so i renamed all files i thought were important. and put the shutdown code into the rc.local file.

for some reason its not auto starting when i reboot even after follow this

my rc.local shows below. is this correct?

svc -d /service/measureit
cd ~/pvoutput/bin
./pvoutput.sh

and not sure if i have set it up correctly

im using these settings but it doesnt look right. is this how to set it up.
sensor 0 is consumption in the main graph and sensor 9 is V7 in the extended data graph.

sensors=0,9
direction=in,in
v7.sensor=9

i think its adding sensor 9 into the sensor 0 total for main consumption?

EDIT:
worked it out if i ignore the sensor i want to bypass main consumption and just put it in the V7 it works as i want

sensors=0
direction=in
v7.sensor=9