Getting sma-bluetooth to connect to my inverter, and upload to pvoutput proved to not be an exactly trivial exercise. In brief overview the below are the steps I took to get it working. It does however, now work well for auto uploading of data.
So after much fun and games, I finally managed to get monitoring and upload to pvoutput working with sma-bluetooth.
Step 1 – Grab the code
hg clone https://sma-bluetooth.googlecode.com/hg/ sma-bluetooth
Once the code was grabbed, I changed into the directory and ran make.
./smatool -INSTALL -U dbuser -P dbpass
There was a table missing, so I manually created it as per
CREATE TABLE `LiveData` (`id` BIGINT NOT NULL AUTO_INCREMENT ,`DateTime` datetime NOT NULL, `Inverter` varchar(10) NOT NULL, `Serial` varchar(40) NOT NULL, `Description` char(20) NOT NULL , `Value` INT NOT NULL , `Units` char(20) NOT NULL , `CHANGETIME` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00' ON UPDATE CURRENT_TIMESTAMP, UNIQUE KEY (`DateTime`,`Inverter`,`Serial`,`Description`), PRIMARY KEY ( `id` ) ) ENGINE = MYISAM;
Now the biggest gotcha for me was the below code block:
To make things happy and working, I added the following block to “invcode.in” and used this new model in my smatool.conf file.
Update: For reference, I’ve switched to using SBFspot the bluetooth dongle is shockingly unreliable (eBay jobbie) will have to find something a little better, will update as info becomes available.