Exit codes of SBFspot

Topics: 2. Documentation, 4. Bugs, 5. Support
Mar 27, 2016 at 1:35 PM
Hello community,

I use SBFspot running on an raspberry pi 1b with 2 SMA Sunny Tripower inverters connected over bluetooth.

I read data by a cron job every 5 minutes, beginning at 6:00am and ending at 11:00pm. Especially in the morning reading out data often doesn't work. It is before sunrise, but not each try exits with failure (exit code not equal to 0). SBFspot then exits with code 139.

Sometimes I also get exit code 250 or 255 (when no BT connection can be established) but this is during the day.

Has somebody a list of possible exit codes of SBFspot and can post it in the documentation?
Direct help here is also welcome.

Thanks - also to the team for creating this great tool!
Coordinator
Mar 28, 2016 at 2:23 PM
Error 139 is not an SBFspot error, but a linux error caused by a "segmentation fault".
It looks like issue 138 is not solved.
Mar 28, 2016 at 9:22 PM
SBF, thanks for the reply.

I'm sorry, but I still used v3.1.2. So maybe issue 138 is solved.
Currently I'm installing v3.1.4 and I will observe, if the issue still occurs.

From your feedback and a little research on the net, I discovered that the shell (bash) returns an error code between 0 and 255, where all greater than 128 is 128+N and N is the signal which caused the exit of the command.
So in this case, code 139 is 128+11 and according to wikipedia (search for "signal unix") 11 is SIGSEGV = „Segmentation violation“: invalid memory reference. („Schutzverletzung“: ungültige Speicherreferenz.).

But for exit code 250 = 128 + 122 and signal number 122 i didn't find an explanation on the net. So can you tell me, why SBFspot exits with 250?

Thanks!
Coordinator
Mar 29, 2016 at 8:35 AM
Error 250 (unsigned) = -6 (signed) which is "E_INIT or Initialization Error" SBFspot was not able to start the communication with the inverter. This error should be ignored and connecttion should be retried later.

All Error codes are in SBFspot.h - For your reference I'll add them here:
    E_OK            =  0,
    E_NODATA        = -1        // Bluetooth buffer empty
    E_BADARG        = -2        // Unknown command line argument
    E_CHKSUM        = -3        // Invalid Checksum
    E_BUFOVRFLW     = -4        // Buffer overflow
    E_ARCHNODATA    = -5        // No archived data found for given timespan
    E_INIT          = -6        // Unable to initialize
    E_INVPASSW      = -7        // Invalid password
    E_RETRY         = -8        // Retry the last action
    E_EOF           = -9        // End of data
    E_PRIVILEGE     = -10       // Privilege not held (need installer login)
Marked as answer by SBF on 5/31/2016 at 8:08 AM