SMA Solar PV Inverters - monitoring over bluetooth

Stuart,
Working well with my Sunny Boy 3000.

I’ll be traveling the next week’s, but will give it a go when I get home.

I will but am on hols at the moment, back next week.

Christian.

Yes that should be fine. I still don’t know what will happen with more than 1 inverter, but we can fix that as we find it!

Worth mentioning that if you do run the module, but don’t see any node values in emonPI (except for the RSSI input) then the emonPI needs a reboot.

This appears to be a known issue with MQTT inputs not refreshing correctly.

Hi @stuart
I’ve put a bluetooth module in my pi but I’m unable to connect to the inverters.

The inverters i have are 1x Sunny Boy SB 3000TL-21 and 1x Sunny Boy SB 3600TL-21
Both user code are set to 0000 and the installer code changed from default, I presume the script connects as “user”?

The logs are as follows…

2017-03-18 10:10:41,051 INFO     MainThread Creating EmonHubSMASolarInterfacer 'SMASolar'
2017-03-18 10:10:41,052 INFO     MainThread Log into the SMA solar inverter 00:80:25:33:73:FB
2017-03-18 10:10:41,053 INFO     MainThread Opening bluetooth address 00:80:25:33:73:FB
2017-03-18 10:10:41,255 DEBUG    RFM2Pi     1 NEW FRAME : OK 5 161 2 9 2 170 4 202 94 143 0 136 0 0 0 0 0 0 0 0 0 236 82 6 0 (-0)
2017-03-18 10:10:41,257 DEBUG    RFM2Pi     1 Timestamp : 1489831841.26
2017-03-18 10:10:41,257 DEBUG    RFM2Pi     1 From Node : 5
2017-03-18 10:10:41,258 DEBUG    RFM2Pi     1    Values : [673, 521, 1194, 24266, 143, 136, 0, 0, 0, 0, 21228, 6]
2017-03-18 10:10:41,258 DEBUG    RFM2Pi     1 Sent to channel(start)' : ToEmonCMS
2017-03-18 10:10:41,259 DEBUG    RFM2Pi     1 Sent to channel(end)' : ToEmonCMS
2017-03-18 10:10:41,361 DEBUG    RFM2Pi     device settings updated: E i5 g210 @ 433 MHz q0 USA 0
2017-03-18 10:10:41,569 DEBUG    RFM2Pi     Discarding RX frame 'unreliable content'? 29 65 37 237 32 104 129 0 169 64 39 171 163 8 80 96 174 106 161 13 109 (-102)
Received packet number 00 expected 01
2017-03-18 10:10:41,616 ERROR    MainThread Unable to create 'SMASolar' interfacer: Wrong Level 2 packet returned!
2017-03-18 10:10:41,617 INFO     MainThread Creating EmonHubMqttInterfacer 'MQTT'
2017-03-18 10:10:41,618 INFO     MainThread MQTT Init mqtt_host=127.0.0.1 mqtt_port=1883 mqtt_user=emonpi
2017-03-18 10:10:41,622 DEBUG    MainThread MQTT Subscribed to channel' : ToEmonCMS
2017-03-18 10:10:41,623 INFO     MainThread Creating EmonHubEmoncmsHTTPInterfacer 'emoncmsorg'
2017-03-18 10:10:41,625 DEBUG    MainThread emoncmsorg Subscribed to channel' : ToEmonCMS
2017-03-18 10:10:41,723 INFO     MQTT       Connecting to MQTT Server

One thing I noticed while using sunny explorer is that it appears to have modbus built in?

Regards
Dave

Thanks for testing Dave.

Its the “Wrong Level 2 packet returned!” message - I suspect because I’m
getting replies from both inverters and not expecting that.

This is going to be a pain to debug, so I may publish some code to grab the
data packets - if you are okay to run this for me?

Regards
Stu.

Yes no worries, would it be easier for me to create you a VPN so you can access my pi direct?

Regards
Dave

Possibily, however at the moment, lets get some basic logging!

Jump on the emonPI and run…

sudo service emonhub stop
cd /home/pi/data
git clone https://github.com/stuartpittaway/smasolarbluetoothdebugtool.git

cd /home/pi/data/smasolarbluetoothdebugtool
python SMASolarInverterPacketDebug.py  00:80:25:1D:AC:53 0000 > logfile

sudo service emonhub start

Obviously replacing the bluetooth address and pin code with your details. Its the contents of the “logfile” that I’ll be interested in!

logfile.txt (20.3 KB)
Thanks @stuart If I’ve done it right, please see above.

Stuart, about my SB 3000 which isn’t returning DC values.

I installed the (free trial) Oxley Solar app on my Android tablet and its display includes DC power, volts and current. Good data for String 1 and all zero for String 2, correct since no 2nd string is connected.

Incidentally the app also tries to display inverter temperature, but gets zero.

Then I ran your debugtool. DC section has “Error code returned from inverter”.
3000.txt (15.6 KB)

Thanks for the log files, I originally wrote most of this code 4 years ago, and having just picked it up again, the hex dumps are making my head hurt !

@Dave can you tell me more about the two inverters you have, model numbers etc. What string configuration you are running etc?

I can see we found one Serial Number = ‘2130366983’ with name “Rear_Inverter”

I think I can also see when we queried the inverters (dc watts) we got two replies back, which I’ve not seen before and a first byte potentially indicating the inverter 01/02

PowData:01 1E 25 40 B9 11 CD 58 0C 01 00 00 0C 01 00 00 0C 01 00 00 0C 01 00 00 01 00 00 00 
PowData:02 1E 25 40 B9 11 CD 58 0B 01 00 00 0B 01 00 00 0B 01 00 00 0B 01 00 00 01 00 00 00 

However @Dave the script appears to have run okay - does this code run consistently okay, what happens if you run it a few times, does it bounce between the inverters? Does the emonhub now work in some fashion ?

Thanks @stuart
I have the two inverters configured as follows…

Rear_Inverter - SB 3600TL-21 - Serial No. 2130383663 - 2x Identical PV Strings (250v)
Front_Inverter - SB 3000TL-21 - Serial No. 2130355899 - 1x PV String (400v)
The EmonHUB configuration is setup to connect to the rear inverter with the common bluetooth NetID 2.

Nothing is coming up within the inputs of EmonCMS and in the logs it fails to setup the SMA interface, I’ve only pulled the log off once, do you want me to restart the debug script a few times and upload the logs?

I appreciate the help on this as this is way above my head to get it going.

Regards
Dave

So is the serial number I’ve got in the log file wrong? You have it as 2130 383663

Hi @stuart
You’re right, the SN in the SMA website is wrong! The correct serial number 2130366983 is for the Rear_Inverter.

Regards
Dave

Thats a relief - thought the code was properly broken!

Give me a couple of evenings to get something else put together - I’ve found some documentation so will put a more robust solution together.

Stu.

Many Thanks @stuart

I’ve put together an updated test script. The logic has improved from some internet research I’ve done.

If you repeat the commands…

sudo service emonhub stop
cd /home/pi/data
rm -dfr /home/pi/data/smasolarbluetoothdebugtool
git clone https://github.com/stuartpittaway/smasolarbluetoothdebugtool.git

cd /home/pi/data/smasolarbluetoothdebugtool
python SMASolarInverterPacketDebug.py  00:80:25:1D:AC:53 0000 > logfile

sudo service emonhub start

Hi @stuart
I’ve run the script and attached the log, I updated my EmonPi last night and noticed that I now have the RearInverter in my input list.

Regards
Dave
logfile.txt (13.4 KB)

Glad it appears to be working on the RearInverter!

Are the readings stable?