[RPi] SBFspotUploadDeamon not sending data

Topics: 5. Support
Aug 29, 2015 at 8:17 PM
Hello,

I've recently migrated SBFspot to my freshly new Raspberry Pi.
Before this, the program was running under Windows 7 and data sent well to PVOutput.
I've put the SQLite database on the RPI and the data are collected from my Sunny Boy 1.5 every 5 minutes.
The problem is that nothing is sent do PVOutput :(

The daemon is running but nothing more happens (no datapoints were found).
Yesterday I noticed that the 'Select * from inverters;' request was returning me bad values.
So I launched SBFspot under Windows and put again the database from my Windows machine (20h41) and after this all was OK

But today I've got the same problem.
It seems that with 2 consecutives call of the SBFspot with exactly the same arg on the command line, it sometimes is able to determinate the name of the inverter and sometimes not :(

First launch :
pi@raspberrypi ~/scripts $ /usr/local/bin/sbfspot.3/SBFspot -v3 -finq -am0 -ae0
SBFspot V3.1.0
Yet another tool to read power production of SMA solar inverters
(c) 2012-2015, SBF (https://sbfspot.codeplex.com)
Compiled for Linux (LE) 32 bit

Commandline Args: -v3 -finq -am0 -ae0
Reading config '/usr/local/bin/sbfspot.3/SBFspot.cfg'
Configuration settings:
IP_Address=192.168.0.5
Password=<undisclosed>
MIS_Enabled=0
Plantname=pascal69480
OutputPath=/mnt/usb/smadata/%Y/%m
OutputPathEvents=/mnt/usb/smadata/%Y/Events
Latitude=4.72
Longitude=45.93
Timezone=Europe/Paris
CalculateMissingSpotValues=1
DateTimeFormat=%d/%m/%Y %H:%M:%S
DateFormat=%d/%m/%Y
TimeFormat=%H:%M:%S
SynchTime=0
SunRSOffset=900
DecimalPoint=comma
CSV_Delimiter=semicolon
Precision=3
CSV_Export=1
CSV_ExtendedHeader=1
CSV_Header=1
CSV_SaveZeroPower=1
CSV_Spot_TimeSource=0
CSV_Spot_WebboxHeader=0
Locale=fr-FR
BTConnectRetries=10
SQL_Database=/mnt/usb/smadata/SBFspot.db
### End of Config ###
Sat Aug 29 20:24:30 2015: INFO: Starting...
sunrise: 04:53
sunset : 17:00
Connecting to Local Network...
Initializing...
SUSyID: 125 - SessionID: 992173846 (0x3B235F16)
Inverter IP address: 192.168.0.5 from SBFspot.cfg
Logon OK
SUSyID: 303 - SN: xxxxxxxxx
Device Name:      
Device Class:     
Device Type:      
Software Version: 
Serial number:    xxxxxxxxx
SUSyID: 303 - SN: xxxxxxxxx
Device Status:      ?
SUSyID: 303 - SN: xxxxxxxxx
Device Temperature: 0.0°C
SUSyID: 303 - SN: xxxxxxxxx
Pac max phase 1: 0W
Pac max phase 2: 0W
Pac max phase 3: 0W
SUSyID: 303 - SN: xxxxxxxxx
Energy Production:
    EToday: 0.000kWh
    ETotal: 0.000kWh
    Operation Time: 0.00h
    Feed-In Time  : 0.00h
SUSyID: 303 - SN: xxxxxxxxx
DC Spot Data:
    String 1 Pdc:   0.000kW - Udc:   0.00V - Idc:  0.000A
    String 2 Pdc:   0.000kW - Udc:   0.00V - Idc:  0.000A
SUSyID: 303 - xxxxxxxxx
AC Spot Data:
    Phase 1 Pac :   0.000kW - Uac:   0.00V - Iac:  0.000A
    Phase 2 Pac :   0.000kW - Uac:   0.00V - Iac:  0.000A
    Phase 3 Pac :   0.000kW - Uac:   0.00V - Iac:  0.000A
    Total Pac   :   0.000kW
SUSyID: 303 - SN: xxxxxxxxx
Grid Freq. : 0.00Hz
********************
* ArchiveDayData() *
********************
startTime = 55E0D9E0 -> 29/08/2015 00:00:00
**********************
* ArchiveMonthData() *
**********************
startTime = 55BCA6B0 -> 01/08/2015 13:00:00
monthDataOffset=0
Sat Aug 29 20:24:31 2015: INFO: Done.
Second consecutive launch :
pi@raspberrypi ~/scripts $ /usr/local/bin/sbfspot.3/SBFspot -v3 -finq -am0 -ae0
SBFspot V3.1.0
Yet another tool to read power production of SMA solar inverters
(c) 2012-2015, SBF (https://sbfspot.codeplex.com)
Compiled for Linux (LE) 32 bit

Commandline Args: -v3 -finq -am0 -ae0
Reading config '/usr/local/bin/sbfspot.3/SBFspot.cfg'
Configuration settings:
IP_Address=192.168.0.5
Password=<undisclosed>
MIS_Enabled=0
Plantname=pascal69480
OutputPath=/mnt/usb/smadata/%Y/%m
OutputPathEvents=/mnt/usb/smadata/%Y/Events
Latitude=4.72
Longitude=45.93
Timezone=Europe/Paris
CalculateMissingSpotValues=1
DateTimeFormat=%d/%m/%Y %H:%M:%S
DateFormat=%d/%m/%Y
TimeFormat=%H:%M:%S
SynchTime=0
SunRSOffset=900
DecimalPoint=comma
CSV_Delimiter=semicolon
Precision=3
CSV_Export=1
CSV_ExtendedHeader=1
CSV_Header=1
CSV_SaveZeroPower=1
CSV_Spot_TimeSource=0
CSV_Spot_WebboxHeader=0
Locale=fr-FR
BTConnectRetries=10
SQL_Database=/mnt/usb/smadata/SBFspot.db
### End of Config ###
Sat Aug 29 20:31:18 2015: INFO: Starting...
sunrise: 04:53
sunset : 17:00
Connecting to Local Network...
Initializing...
SUSyID: 125 - SessionID: 823952026 (0x311C829A)
Inverter IP address: 192.168.0.5 from SBFspot.cfg
Logon OK
SUSyID: 303 - SN: xxxxxxxxxx
Device Name:      SB1.5-1VL-40 676
Device Class:     Onduleur solaire
Device Type:      SB1.5-1VL-40
Software Version: 02.03.01.R
Serial number:    xxxxxxxxxx
SUSyID: 303 - SN: xxxxxxxxxx
Device Status:      Ok
SUSyID: 303 - SN: xxxxxxxxxx
Device Temperature: 0.0°C
SUSyID: 303 - SN: xxxxxxxxxx
GridRelay Status:      Aucune information
SUSyID: 303 - SN: xxxxxxxxxx
Pac max phase 1: 1500W
Pac max phase 2: 0W
Pac max phase 3: 0W
SUSyID: 303 - SN: xxxxxxxxxx
Energy Production:
    EToday: 10.754kWh
    ETotal: 712.231kWh
    Operation Time: 1064.94h
    Feed-In Time  : 1046.61h
SUSyID: 303 - SN: xxxxxxxxxx
DC Spot Data:
    String 1 Pdc:   0.000kW - Udc:   0.00V - Idc:  0.000A
    String 2 Pdc:   0.000kW - Udc:   0.00V - Idc:  0.000A
SUSyID: 303 - SN: xxxxxxxxxx
AC Spot Data:
    Phase 1 Pac :   0.000kW - Uac:   0.00V - Iac:  0.000A
    Phase 2 Pac :   0.000kW - Uac:   0.00V - Iac:  0.000A
    Phase 3 Pac :   0.000kW - Uac:   0.00V - Iac:  0.000A
    Total Pac   :   0.000kW
SUSyID: 303 - SN: xxxxxxxxxx
Grid Freq. : 0.00Hz
SUSyID: 303 - SN: xxxxxxxxxx
Current Inverter Time: 29/08/2015 20:31:17
Inverter Wake-Up Time: 29/08/2015 07:12:11
Inverter Sleep Time  : 29/08/2015 20:30:43
ExportSpotDataToCSV()
********************
* ArchiveDayData() *
********************
startTime = 55E0D9E0 -> 29/08/2015 00:00:00
ArchiveDayData returned an error: -1
**********************
* ArchiveMonthData() *
**********************
startTime = 55BCA6B0 -> 01/08/2015 13:00:00
Sat Aug 29 20:31:29 2015: INFO: Done.
Do you have any idea of what happens ?
Coordinator
Aug 31, 2015 at 9:05 AM
It looks like your inverter is not returning any data (E-Today = 0)
Can you post a debug log (-v5 -d5)

BTW, you should switch Longitude/Latitude if your TZ is Europe/Paris (now it's pointing to Somalia and causing a miscalculation of sunrise/sunset)
Aug 31, 2015 at 10:22 PM
Edited Aug 31, 2015 at 10:23 PM
Yes you're right, I made a mistake and had switched latitude and longitude :(
Wim told it to me by mail and I've corrected the config file.
It's now OK and sunrise and sunset values match the real ones in France !
I can put the -finq argument away ;)

Concerning the export of data, I've noticed the error that only happens when using SBFspot on my Raspberry.
With the 309 revision under Windows (the one sent to me this summer before the release of the last 'official' beta), it's OK.

Wim have also asked for detailed logs.
I'll post them here as quick as possible (and will run the program on each machine).

Regards

Pascal
Aug 31, 2015 at 11:38 PM
hej pascal, i did forward the results of your earlier tests to sbf :-)

after my analysis on your problem with RPi (and not with windows) the below questions
?a? please confirm that you do use on RPi the v3.1.0 that is now on the download page of codeplex
?b? if the above is true -> then please put your tests with RPi and v310 on hold for a few days

we keep you posted about the next step kr wim
Aug 31, 2015 at 11:44 PM
Edited Sep 2, 2015 at 1:33 PM
Re,

Here are a zip file containing log generated from the 2 OS (Windows vs Raspbian) :
https://dl.dropboxusercontent.com/u/27156409/pascal69480_SBFspot.zip

I've removed the SN number and think there are no more 'personal' data left.

When comparing the 2 files, somes differences appear (Win vs Raspbian) :
  • the release (V3.0.9 vs V3.1.0)
  • the OutputPath for the CSV export (I put a new tree level on the RPI with %m)
  • the INV_TYPE variable is not the same ('SB 1.5' vs 'SB1.5-1VL-40')
  • same for Device Type (but I presume it depends on the previous variable)
  • ArchiveDayData()
Here is the most significant point : it seems there's still a problem with the size of the packet buffer : 1030 bytes vs 1024 bytes
Instead of splitting the data, the RPI version finished with this error :
ethGetPacket()
Timeout reading socket
No data!
ArchiveDayData returned an error: -1
**********************
* ArchiveMonthData() *
**********************
startTime = 55BCA6B0 -> 01/08/2015 13:00:00
--------: 00 01 02 03 04 05 06 07 08 09
00000000: 53 4D 41 00 00 04 02 A0 00 00 
00000010: 00 01 00 26 00 10 60 65 09 E0 
00000020: 2F 01 F4 80 09 73 00 00 7D 00 
00000030: 7E 1B 1E 33 00 00 00 00 00 00 
00000040: 16 80 00 02 20 70 B0 03 BA 55 
00000050: B0 D6 E6 55 00 00 00 00 
__4294967295__ Bytes sent to IP [192.168.0.5]
This a prime analysis, hope it will help you.

Pascal
Aug 31, 2015 at 11:48 PM
Edited Aug 31, 2015 at 11:51 PM
SillieWimons wrote:
hej pascal, i did forward the results of your earlier tests to sbf :-)

after my analysis on your problem with RPi (and not with windows) the below questions
?a? please confirm that you do use on RPi the v3.1.0 that is now on the download page of codeplex
?b? if the above is true -> then please put your tests with RPi and v310 on hold for a few days

we keep you posted about the next step kr wim
:) our posts have crossed each other !
Do you want me to do the same test with the 3.1.0 release with Windows ? (I actually still use the intermediate 3.0.9 release)
For the ?a? point : for the RPi, yes, I'm using the last release found on the project page.
I must admit that I first have compiled the previous version, than have done it again with the last one (deleting /usr/local/bin between the 2 makes)
Coordinator
Sep 1, 2015 at 8:36 AM
The 3.1.0 version does not have the comm buffer fix - I'll update it ASAP
Marked as answer by Pascal69480 on 9/1/2015 at 2:40 AM
Sep 1, 2015 at 9:03 AM
to pascal,

please put your tests with RPi and v310 on hold -> we keep you posted about the progress

v3.1.0 was released earlier then v3.0.9 v3.0.9 was a beta to allow you and michael to test ALL the fixes for SB15

kr wim
Sep 1, 2015 at 10:48 AM
OK, I now understand why I get different results.
Sorry for the misunderstanding, I thought that the 3.1.0 was higher than 3.0.9 !
More, I haven't the identification problem of my inverter and the sources were released after you sent me the 3.0.9 so I was thinking the update you made on the buffer fix were include.
It's all clear now, I'll continue to collect data with the compiled 3.0.9 version with Windows (but the machine isn't continuously on, so spotvalues cannot be get on the fly) and maybe use a shared database located on my RPi (and use the RPi daemon to send data to PVOutput.

I stay connected for the next release to come.
I'd like to publish a french documentation. As soon as this release is OK, I'll work on it. Would a Wiki be OK for you or do you prefer a read only documentation ?
Sep 8, 2015 at 2:35 PM
Edited Sep 8, 2015 at 2:35 PM
SBF wrote:
The 3.1.0 version does not have the comm buffer fix - I'll update it ASAP
Hello,

If it's not too complicated, is it possible to you to send me in private the update to to so I can build the program ?
I actually have to collect data on the Windows machine (which is only on at the end of the day) and send them to PVOutput with RPi daemon and it's not really convenient.

Concerning the documentation, should I publish a document based on yours like Tony did ?
Coordinator
Sep 8, 2015 at 10:19 PM
@Pascal
Released V3.1.1 with the needed fix for your inverter (sorry for the delay)

For documentation: it's OK to have something like Tony's version
Sep 10, 2015 at 8:45 PM
Well done and thank you !
No problem for the delay, I can understand what it is if you work on the software during you 'free' time.
I'll keep you informed concerning the documentation & Wiki and will very soon visit Paypal website ;)

Thank you again for your help and reactivity.