On Linux "Ubuntu" I keep getting SBFsopt hand then start a new pid next time

Topics: 1. General
May 20, 2015 at 7:41 AM
I keep getting this where SBFspot will not exit then cron kicks off a 2nd process.

root 700 1 0 09:22 ? 00:01:27 /usr/local/sbfspot/SBFspotUploadDaemon
root 2172 2171 0 16:05 ? 00:00:00 /bin/sh -c /usr/local/sbfspot/SBFspot -v -nocsv > /dev/null
root 2173 2172 0 16:05 ? 00:00:00 /usr/local/sbfspot/SBFspot -v -nocsv
root 2178 2177 0 16:10 ? 00:00:00 /bin/sh -c /usr/local/sbfspot/SBFspot -v -nocsv > /dev/null
root 2179 2178 0 16:10 ? 00:00:00 /usr/local/sbfspot/SBFspot -v -nocsv
root 2194 2193 0 16:20 ? 00:00:00 /bin/sh -c /usr/local/sbfspot/SBFspot -v -nocsv > /dev/null
root 2195 2194 0 16:20 ? 00:00:00 /usr/local/sbfspot/SBFspot -v -nocsv
root 2236 2235 0 16:55 ? 00:00:00 /bin/sh -c /usr/local/sbfspot/SBFspot -v -nocsv > /dev/null
root 2237 2236 0 16:55 ? 00:00:00 /usr/local/sbfspot/SBFspot -v -nocsv
May 20, 2015 at 7:45 AM
Just a note I kill them off once I get home then run it with finq and everything is fine.

root@Solar:~# /usr/local/sbfspot/SBFspot -v -finq -nocsv
SBFspot V3.0.3
Yet another tool to read power production of SMA solar inverters
(c) 2012-2014, SBF (https://sbfspot.codeplex.com)
Compiled for Linux (LE) 64 bit

Commandline Args: -v -finq -nocsv
Reading config '/usr/local/sbfspot/SBFspot.cfg'
Wed May 20 17:42:32 2015: INFO: Starting...
sunrise: 06:25
sunset : 17:01
Connecting to 00:80:25:1D:EE:40 (1/10)
SUSyID: 125 - SN: 881742602 (0x348E530A)
SMA netID=01
Serial Nr: 7D32CF3A (2100481850)
BT Signal=64%
Logon OK
Local Time: 20/05/2015 17:42:35
TZ offset (s): 36000 - DST: Off
SUSyID: 78 - SN: 2100481850
Device Name: Homer
Device Class: Solar Inverters
Device Type: SB 4000TL-20
Software Version: 03.20.01.R
Serial number: 2100481850
SUSyID: 78 - SN: 2100481850
Device Status: Ok
SUSyID: 78 - SN: 2100481850
Device Temperature: 0.0°C
SUSyID: 78 - SN: 2100481850
GridRelay Status: Information not available
SUSyID: 78 - SN: 2100481850
Pac max phase 1: 4000W
Pac max phase 2: 4000W
Pac max phase 3: 4000W
SUSyID: 78 - SN: 2100481850
Energy Production:
EToday: 7.139kWh
ETotal: 13601.340kWh
Operation Time: 14770.53h
Feed-In Time  : 14351.41h
SUSyID: 78 - SN: 2100481850
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: 78 - SN: 2100481850
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: 78 - SN: 2100481850
Grid Freq. : 0.00Hz
SUSyID: 78 - SN: 2100481850
Current Inverter Time: 20/05/2015 17:41:09
Inverter Wake-Up Time: 20/05/2015 06:27:14
Inverter Sleep Time : 20/05/2015 17:04:44

  • ArchiveDayData() *

startTime = 555B41E0 -> 20/05/2015 00:00:00

  • ArchiveMonthData() *

startTime = 5542DE20 -> 01/05/2015 12:00:00
Reading events: 2015-May-01
Wed May 20 17:42:40 2015: INFO: Done.
May 20, 2015 at 6:27 PM
dear djenglish, it might be that you do face more then one problem

remark-1: when your coming home >> then
according the information from your inverter (see production == 0Watt GridFreq=0,00Hz it's dark outside)
your inverter is, somewhat in "sleep mode" - he is not monitoring the mains-net - refer the value for GridFreq=0,00Hz
the calculation by sbfspot about the sunrise sunset values matches with that info

in the info from your sbfspot config file
  • the values for location and timezone are not shown (it's up to you to validate them) i assume these to be correct
  • what can not be controlled from this info is ??? when hits your production to "ZERO"
    your inverter goes "a sleep" at 17:04:44 but this does not inform when production stopped
if your in the mood to assist in detailed analysis, please consider the following steps

kr wim

suggest-a-1: distinguish output types from your task 1=stdout 2=stderr
  • i'm not certain whether this fits ubuntu cron but you can send 1>/dev/null 2>your-choice-name-file.err.txt
    rational: try to grasp info about abnormal behaviour
    remark: in my scripts i'll check for various "unexpected" reactions -> if "unexpected" i'll keep the std-out and std-err
suggest-b-1: allow csv output, for this "problem-hunt", !!! adapt the config file to catch the information in easy manner
rational: old fashion but easier to view information
examples: all info for each activation of sbfspot is written in "spot.csv" records up to its last execution

suggest-c-1: assist in catching a detailed output from sbfspot when failing
  • the problem seems to occur at sun-shine-end -> after 16h10 before 17h00
  • split the execution for sbfspot in three "time" blocks using the cron task settings
    c-1-a from 00-15 -c /usr/local/sbfspot/SBFspot -v -nocsv > /dev/null
    c-1-b from 16-17 -c /usr/local/sbfspot/SBFspot -d5 -v5 1>>your-name-std-out.txt 2>>your-name-std-err.txt
    c-1-c from 17-23 -c /usr/local/sbfspot/SBFspot -v -nocsv > /dev/null
suggest-d-1: give it a trial to limit the number of connect retries to "3" see parameter in the config file
rational: depending on the "settings" it might be that your OS expects the SBFspot task to return control within less then 60seconds
depending on ??? conditions it might be that the BT comms does not return contol within 10 * 7 seconds (at end of production)
May 20, 2015 at 9:56 PM
Ok made the changes see how it goes

*/5 5-15 * * * /usr/local/sbfspot/SBFspot -v > /dev/null
*/5 16-17 * * * /usr/local/sbfspot/SBFspot -d5 -v5 1>>/tmp/std-out.txt 2>>/tmp/std-err.txt
*/5 18-19 * * * /usr/local/sbfspot/SBFspot -v > /dev/null

Config /usr/local/sbfspot/SBFspot.cfg





DateTimeFormat=%d/%m/%Y %H:%M:%S



May 20, 2015 at 11:07 PM
Edited May 21, 2015 at 1:52 PM
dear djenglish, I have read your (quick) info and reaction :-) - looks perfect

altough some precautions/remarks (see below)

kr wim

point-1: in treating your subject
  • keep in mind that it might be about multiple causes - a possible "hang" and/or "failure"
    !! for problems that result in "hang", it is a known limit of the OS that the "stdout.txt" and "stderr.txt"
    do not include the very last part of the information, ;-{
  • if that should be the case - one needs to execute these tasks from a command window
    but that might not work in "unattended" mode
From what I know SBFspot restricts treatment of these value to two figures after the point!!
I don't know yet what the reaction will be by SBFspot on your location info
I can't test this since it's dark now here :-)


point-3: remark on your adaptation of the cron
  • apply a method to limit the size of catenuated stdout.txt file -> the files should not become too large
    *** size of std-out.txt should (will) not exceed around 65kByte per execution - total 24 * 65 = 2MB
    *** size of std-err.txt is small, less then 1kByter per execution
tric-1: apply these cron tasks per one hour and use the hour indication in the filenames
tric-2: apply %hour as part of the name (syntax depends on operating system)

it's a good practice to either
  • modify the cron task when not in "test" mode (when not testing then -> output to null)
  • move each day the "std-out.txt" file
  • give these files a YMDD-HH extension (method depends on the OS)
    it's no good practice to keep these files ever growing
  • simple method is - create a task that runs once a day (eg at 14) and that renames "unconditional" these files (eg to "stdout.old.txt")
!!!! unless your disk is large - you might need to delete files without meaning
May 24, 2015 at 9:08 PM
Since changing the Bluetooth settings have not had any issues, looking good thanks guys.

Fix was;
Marked as answer by SBF on 7/12/2015 at 11:28 AM