SMA Solar PV Inverters - monitoring over bluetooth

Hi Stuart
Have you had any time to look at the script? I have noticed after the last update that the script isn’t working.
Oddly enough when you run python “emonhub.py --config-file /home/pi/data/emonhub.conf” it works in the SSH session but stops when closing the window?

Regards
Dave

Hi Dave,

I’ve not had a problem with the script - if it works inside the SSH session then it should be working when run from the cron job that normally fires it off.

Has the configuration file still got the correct bits in it for the SMA section ?

Usually that’s true. One thing to keep in mind though, cron doesn’t inherit the same paths as the user unless it’s set up to do so, or, the script is called with a fully qualified pathname. (which may or may not work, depending on the script)

Anything in the normal emonhub log files?

@stuart, @Dave et al,

I have been a user of emonCMS on my AXPERT inverter for a couple of months and built nice dashboards to monitor usage.

I am currently in the process of installing 2 SunnyBoys: SB4000TL-21 with two strings each. (PV Modules up, Inverters on the wall…Just cabling breakers to do this weekend 2017/07/01)

I am hoping to help test if needed else to really use my extra Rasbberry Pi 3B to monitor the SMA and ideally feed the info to PVOUTPUT.ORG.

I am not a developer but I am PC savvy.

Is there anybody willing to help me (not being developer) to get mine up and running PLEASE:

Kind Regards

Frits

@Frits

If you want to upload into PVOUTPUT, then this project is best for you…

https://sbfspot.codeplex.com/

Thanks @stuart

Hi, Im trying to use this code on a RPi Zero W and when running “python emonhub.py --config-file /home/pi/data/emonhub.conf” I get “ImportError: No module named paho.mqtt.client” Can anyone help with this? Cheers, MikeC

try issuing the command pip list

if you don’t see the paho client in the list,

issue this command: pip install paho-mqtt

Ref: python - Import Error: paho.mqtt.client not found - Stack Overflow

Thanks Bill, that fixed that particular problem but now I have the below.

Traceback (most recent call last):
File “emonhub.py”, line 33, in
import interfacers.emonhub_interfacer as ehi
File “/home/pi/data/sma_emonhub/emonhub/src/interfacers/emonhub_interfacer.py”, line 25, in
from pydispatch import dispatcher
ImportError: No module named pydispatch

Thinking there must be a bigger issue with me installing this code. I am running it on the base noobs install not emonpi but have installed emoncms. Im thinking there is some pre-requsits I’m missing?

Cheers, MikeC

Correct. The noobs distro will be missing many of the dependencies emonCMS needs.

Your best bet is to download the pre-built emonSD image and burn it to your flash card.

Thanks Bill, will do. Cheers for your time and help.

YVW, S!

Great tool.

Is it possible to read from an inverter that is wired to the network at all? Or is it hard coded to bluetooth?

(I see it takes a mac address, can that not be specified to one on the network? I tried the debug tool but it seemed hardcoded to bluetooth?

Ok, found an old bluetooth dongle in the draw now in the EmonPi, this is great, interesting to see the discrepancy between the inverter voltage and the emonpi and emontx.

Going to validate the Grid voltage with another tool and see if I can re-calibrate :slight_smile:

@stuart

I managed to set this up over the weekend.
Here and there a challenge, but it now runs like a clock!

Thanks for the suggestion

Regards

Frits

Hi, after having this running for around a week successfully I suddenly get an error ? with the bluetooth. Emonhub log below. Any idea?

2017-07-31 06:57:56,449 INFO SMASolar Log into the SMA solar inverter 00:80:25:2F:B4:28
2017-07-31 06:57:56,451 INFO SMASolar Opening bluetooth address 00:80:25:2F:B4:28
2017-07-31 06:57:58,067 DEBUG SMASolar initaliseSMAConnection
2017-07-31 06:57:58,516 DEBUG SMASolar packet count = 0101
2017-07-31 06:57:58,587 DEBUG SMASolar packet count = 0102
2017-07-31 06:57:58,599 DEBUG SMASolar logon
2017-07-31 06:57:58,731 DEBUG SMASolar packet count = 0103
2017-07-31 06:57:58,824 ERROR SMASolar Failed to grab all the bytes needed for a Level 2 packet
2017-07-31 06:57:58,877 ERROR SMASolar [‘Traceback (most recent call last):\n’, ’ File “/home/pi/emonhub/src/interfacers/EmonHubSMASolarInterfacer.py”, line 203, in read\n self._login_inverter()\n’, ’ File “/home/pi/emonhub/src/interfacers/EmonHubSMASolarInterfacer.py”, line 90, in _login_inverter\n dictInverterData = SMASolar_library.getInverterDetails(self._btSocket, self._packet_send_counter, self.mylocalBTAddress, self.MySerialNumber)\n’, ’ File “/home/pi/emonhub/src/smalibrary/SMASolar_library.py”, line 141, in getInverterDetails\n data=request_data(btSocket, packet_send_counter, mylocalBTAddress, MySerialNumber, 0x58000200, 0x00821E00, 0x008220FF)\n’, ’ File “/home/pi/emonhub/src/smalibrary/SMASolar_library.py”, line 322, in request_data\n bluetoothbuffer = read_SMA_BT_Packet(btSocket, packet_send_counter, True,mylocalBTAddress)\n’, ’ File “/home/pi/emonhub/src/smalibrary/SMASolar_library.py”, line 81, in read_SMA_BT_Packet\n raise Exception(“Failed to grab all the bytes needed for a Level 2 packet”)\n’, ‘Exception: Failed to grab all the bytes needed for a Level 2 packet\n’]
2017-07-31 06:58:02,502 INFO SMASolar Log into the SMA solar inverter 00:80:25:2F:B4:28
2017-07-31 06:58:02,504 INFO SMASolar Opening bluetooth address 00:80:25:2F:B4:28
2017-07-31 06:58:02,506 ERROR SMASolar (16, ‘Device or resource busy’)
2017-07-31 06:58:02,518 ERROR SMASolar Bluetooth error while connecting to 00:80:25:2F:B4:28

hcitool scan still shows the inverter.
Scanning …
00:80:25:2F:B4:28 SMA001d SB 3000TL-21 613 SN2130330613

Thanks for any help.

Cheers, MikeC

Strangely after 6 months of running, mine also stopped today!

Have you tried a simple re-boot of the PI, or just restarting emonHub.

The code cannot open the connection to the USB bluetooth device “Device or resource busy” - which means its already in use.

Yea, tried rebooting and restarting emonhub. Im actually running this on a rpi zero W and using the internal BT. I can use this adaptor because I’m not running the rfm12b on the pi and therefore have no conflicts with the hardware serial. Will look into the bluetooth device being used by something else. Cheers.

Are you still getting the “Device or resource busy” - if so, did you recently upgrade emoncms to a new version, it may have re-enabled the RFM12 module and emonhub is hogging the serial port.