SQLite: nothing is written into the database

Topics: 4. Bugs
Sep 3, 2014 at 4:55 PM
I installed SBFspot v3.0 on my Raspberry Pi, using the Quick reference guide.
When I run the "/usr/local/bin/sbfspot.3/SBFspot -v -finq -nocsv" command and then open SQlite and type the "select * from vwspotdata;" command nothing comes out.

Some more informations:
  • When I delete the database and run SBFspot I got no error.
  • The path in the configuration file pointing to the database seems to be correct.
  • Writing in a csv file is working
    What could I do in order that that the data is written in SQlite database?
I am not sure that this information is useful: In parallel an emoncms server is running on the raspberry pi with an sql database. (the goal is to write a python script that read the last entry of the database and then send the data as JSON string to emoncms)

Thanks
Coordinator
Sep 3, 2014 at 6:44 PM
Can you post the output of SBFspot -v and your .cfg file?
Are you sure you compiled with
sudo make release_sqlite
and not
make release
Sep 4, 2014 at 1:25 PM
I am quit sure that I compiled with "release_sqlite". For information it is a Sunny Island battery inverter.
Here is the output .cfg file:
# SMA Inverter's Bluetooth address
# Windows: smaspot -scan
# Linux  : hcitool scan
# IMPORTANT FOR SPEEDWIRE USERS: COMMENT OUT BTADDRESS (PUT # IN FRONT)
#BTAddress=00:00:00:00:00:00

# SMA Inverter's Speedwire IP address
# If IP_Address is not set or is 0.0.0.0 SBFspot will try to detect the speedwire inverter by broadcast
# If IP_Address is set to a valid IP, SBFspot will try to connect directly to that IP without broadcast detection
IP_Address=192.168.178.32

# User password (default 0000)
Password=0000

# MIS_Enabled (Multi Inverter Support: Default=0 Disabled)
# +------------+-------+-------------+
# | #Inverters | NetID | MIS_Enabled |
# +------------+-------+-------------+
# |      1     |   1   | Don't Care  |
# +------------+-------+-------------+
# |      1     |   >1  |      0      |
# +------------+-------+-------------+
# |      >1    |   >1  |      1      |
# +------------+-------+-------------+
MIS_Enabled=0

# Plantname
Plantname=stockage

# OutputPath (Place to store CSV files)
# 
# Windows: C:\Users\Public\SMAdata\%Y
# Linux  : /home/pi/smadata/%Y
# %Y %m and %d will be expanded to Year Month and Day
OutputPath=/home/pi/smadata/%Y

# OutputPathEvents (Place to store CSV files for events)
# If omitted, OutputPath is used
OutputPathEvents=/home/pi/smadata/%Y/Events

# Position of pv-plant http://itouchmap.com/latlong.html
# Example for Ukkel, Belgium
Latitude=47.00
Longitude=7.00

# Calculate Missing SpotValues
# If set to 1, values not provided by inverter will be calculated
# eg: Pdc1 = Idc1 * Udc1
CalculateMissingSpotValues=0

# DateTimeFormat (default %d/%m/%Y %H:%M:%S)
# For details see strftime() function
# http://www.cplusplus.com/reference/clibrary/ctime/strftime/
DateTimeFormat=%d/%m/%Y %H:%M:%S

# DateFormat (default %d/%m/%Y)
DateFormat=%d/%m/%Y

# DecimalPoint (comma/point default comma)
DecimalPoint=comma

# TimeFormat (default %H:%M:%S)
TimeFormat=%H:%M:%S

# SynchTime (default 1 = On)
# If set to 1 the Inverter time is synchronised with pc time
# Some inverters don't have a real-time clock
SynchTime=0

# SunRSOffset
# Offset to start before sunrise and end after sunset (0-3600 - default 900 seconds)
SunRSOffset=3600

# Locale
# Translate Entries in CSV files
# Supported locales: de-DE;en-US;fr-FR;nl-NL;es-ES;it-IT
# Default en-US
Locale=en-US

# Timezone
# Select the right timezone in date_time_zonespec.csv
# e.g. Timezone=Europe/Brussels
Timezone=Europe/Brussels

###########################
### CSV Export Settings ###
###########################
# With CSV_* settings you can define the CSV file format

# CSV_Export (default 1 = Enabled)
# Enables or disables the CSV Export functionality
CSV_Export=1

# CSV_ExtendedHeader (default 1 = On)
# Enables or disables the SMA extended header info (8 lines)
# isep=;
# Version CSV1|Tool SBFspot|Linebreaks CR/LF|Delimiter semicolon|Decimalpoint comma|Precision 3
# etc...
# This is usefull for manual data upload to pvoutput.org
CSV_ExtendedHeader=1

# CSV_Header (default 1 = On)
# Enables or disables the CSV data header info (1 line)
# dd/MM/yyyy HH:mm:ss;kWh;kW
# This is usefull for manual data upload to pvoutput.org
# If CSV_ExtendedHeader is enabled, CSV_Header is also enabled
CSV_Header=1

# CSV_SaveZeroPower (default 1 = On)
# When enabled, daily csv files contain all data from 00:00 to 23:55
# This is usefull for manual data upload to pvoutput.org
CSV_SaveZeroPower=1

# CSV_Delimiter (comma/semicolon default semicolon)
CSV_Delimiter=semicolon

# CSV_Spot_TimeSource (Inverter|Computer default Inverter)
CSV_Spot_TimeSource=Inverter

# CSV_Spot_WebboxHeader (Default 0 = Off)
# When enabled, use Webbox style header (DcMs.Watt[A];DcMs.Watt[B]...)
CSV_Spot_WebboxHeader=0

###########################
###   SQL DB Settings   ###
###########################

# SQLite
# SQL_Database (Fullpath to SQLite DB)
# Windows: C:\Users\Public\SMAdata\SBFspot.db
# Linux  : /home/pi/smadata/SBFspot.db
SQL_Database=/home/pi/smadata/SBFspot.db

# MySQL
#SQL_Database=SBFspot
#SQL_Hostname=<Network Name> or <IP-address>
#SQL_Username=SBFspotUser
#SQL_Password=SBFspotPassword
And here the output:
 /usr/local/bin/sbfspot.3/SBFspot -v
SBFspot V3.0.0
Yet another tool to read power production of SMA solar inverters
(c) 2012-2014, SBF (https://sbfspot.codeplex.com)
Compiled for Linux 32 bit

Commandline Args: -v
Reading config '/usr/local/bin/sbfspot.3/SBFspot.cfg'
Thu Sep  4 12:22:59 2014: INFO: Starting...
sunrise: 04:56
sunset : 18:05
Connecting to Local Network...
Initializing...
SUSyID: 125 - SN: 983166366 (0x3A99ED9E)
Inverter IP address: 192.168.178.32 from SBFspot.cfg
Logon OK
SetInverterTime() not executed! We're still testing...
SUSyID: 289 - SN: 1261010187
Device Name:      SN: 1261010187
Device Class:     DevClss7
Device Type:      Sunny Island 6.0H
Software Version: 01.02.13.R
Serial number:    1261010187
SUSyID: 289 - SN: 1261010187
Batt. Charging Status: 100%
SUSyID: 289 - SN: 1261010187
Batt. Temperature: 29.0°C
Batt. Voltage    : 53.30V
Batt. Current    : 0.000A
SUSyID: 289 - SN: 1261010187
Device Status:      Ok
SUSyID: 289 - SN: 1261010187
Device Temperature: 0.0°C
SUSyID: 289 - SN: 1261010187
Pac max phase 1: 0W
Pac max phase 2: 0W
Pac max phase 3: 0W
SUSyID: 289 - SN: 1261010187
Energy Production:
        EToday: 0.000kWh
        ETotal: 0.000kWh
        Operation Time: 0.00h
        Feed-In Time  : 0.00h
SUSyID: 289 - SN: 1261010187
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: 289 - SN: 1261010187
AC Spot Data:
        Phase 1 Pac :   0.000kW - Uac: 235.80V - Iac:  0.000A
        Phase 2 Pac :   0.000kW - Uac: 236.70V - Iac:  0.000A
        Phase 3 Pac :   0.000kW - Uac: 239.70V - Iac:  0.000A
        Total Pac   :  -0.050kW
SUSyID: 289 - SN: 1261010187
Grid Freq. : 49.90Hz
ExportBatteryDataToCSV()
Terminating here... Dealing with Battery Inverter.
Thank you for your help
Coordinator
Sep 4, 2014 at 3:24 PM
That's indeed the problem: battery inverters are not yet fully supported
ExportBatteryDataToCSV()
Terminating here... Dealing with Battery Inverter.
I'll try to fix this asap
Coordinator
Sep 12, 2014 at 11:52 AM
This discussion has been copied to a work item. Click here to go to the work item and continue the discussion.