sma-bluetooth on OpenWrt

596 views
Skip to first unread message

sbf

unread,
Feb 6, 2012, 8:31:03 AM2/6/12
to sma-bluetooth
Hi,
I got sms-bluetooth running on my Asus WL500gP router with OpenWrt.
For the moment, I stripped mySQL & curl stuff. I probably need to
change to SQLite...


BusyBox v1.15.3 (2011-11-24 04:30:44 CET) built-in shell (ash)
Enter 'help' for a list of built-in commands.

_______ ________ __
| |.-----.-----.-----.| | | |.----.| |_
| - || _ | -__| || | | || _|| _|
|_______|| __|_____|__|__||________||__| |____|
|__| W I R E L E S S F R E E D O M
Backfire (10.03.1, r29592) ------------------------
* 1/3 shot Kahlua In a shot glass, layer Kahlua
* 1/3 shot Bailey's on the bottom, then Bailey's,
* 1/3 shot Vodka then Vodka.
---------------------------------------------------
root@OpenWrt:~# smatool -v -from "2012-02-01 08:00:00" -to "2012-02-01
08:59:59"
Address XX:XX:XX:XX:XX:XX
bluetooth signal = 72%
serial=XX:XX:XX:XX
bluetooth signal = 72%
bluetooth signal = 72%
2012-02-01 07:24:42 Unit Serial = 0000000
none
2012-02-01 07:24:42 NO DATA for 1f 82 = 8001 NO UNITS
2012-02-01 07:24:42 NO DATA for 20 82 = 358 NO UNITS
2011-11-25 16:18:47 NO DATA for 21 82 = 601 NO UNITS
2011-11-25 16:18:47 NO DATA for 21 82 = 635 NO UNITS
2012-02-01 15:01:19 NO DATA for 48 21 = 35 NO UNITS
2012-02-01 15:01:23 Total Power = 517 Watts
2012-02-01 15:01:19 Max Phase 1 = 4000 Watts
2012-02-01 15:01:19 Max Phase 2 = 4000 Watts
2012-02-01 15:01:19 Max Pahse 3 = 4000 Watts
2012-02-01 15:01:19 Unknown = 0 Unknown
2012-02-01 15:01:19 Unknown = 0 Unknown
2012-02-01 15:01:23 Output Phase 1 = 517 Watts
2012-02-01 15:01:23 Output Phase 2 = 0 Watts
2012-02-01 15:01:23 Output Phase 3 = 0 Watts
2012-02-01 15:01:23 Line Voltage Phase 1Volts = 234
Volts
2012-02-01 15:01:23 Line Voltage Phase 2Volts = 0
Volts
2012-02-01 15:01:23 Line Voltage Phase 3Volts = 0
Volts
2012-02-01 15:01:23 Line Current Phase 1Amps = 2 Amps
2012-02-01 15:01:23 Line Current Phase 2Amps = 0 Amps
2012-02-01 15:01:23 Line Current Phase 3Amps = 0 Amps
2012-02-01 15:01:23 Grid Frequency = 50 Hertz
bluetooth signal = 72%


1/2/2012 07:55:00 total=4218.080 Kwh current=0 Watts togo=0 i=11
crc=0
1/2/2012 08:00:00 total=4218.087 Kwh current=84 Watts togo=0 i=23
crc=0
1/2/2012 08:05:00 total=4218.094 Kwh current=84 Watts togo=0 i=35
crc=0
1/2/2012 08:10:00 total=4218.103 Kwh current=108 Watts togo=0 i=47
crc=0
1/2/2012 08:15:00 total=4218.113 Kwh current=120 Watts togo=0 i=59
crc=0
1/2/2012 08:20:00 total=4218.124 Kwh current=132 Watts togo=0 i=71
crc=0
1/2/2012 08:25:00 total=4218.137 Kwh current=156 Watts togo=0 i=83
crc=0
1/2/2012 08:30:00 total=4218.151 Kwh current=168 Watts togo=0 i=95
crc=0
1/2/2012 08:35:00 total=4218.166 Kwh current=180 Watts togo=0 i=107
crc=0
1/2/2012 08:40:00 total=4218.182 Kwh current=192 Watts togo=0 i=119
crc=0
1/2/2012 08:45:00 total=4218.201 Kwh current=228 Watts togo=0 i=131
crc=0
1/2/2012 08:50:00 total=4218.222 Kwh current=252 Watts togo=0 i=143
crc=0
1/2/2012 08:55:00 total=4218.246 Kwh current=288 Watts togo=0 i=155
crc=0
root@OpenWrt:~#

Rob Hills

unread,
Feb 7, 2012, 12:12:35 AM2/7/12
to sma-bl...@googlegroups.com
Hi,


On 06/02/12 21:31, sbf wrote:
Hi,
I got sms-bluetooth running on my Asus WL500gP router with OpenWrt.
For the moment, I stripped mySQL & curl stuff. I probably need to
change to SQLite...

Well done!  How are you pulling data from your inverter?  I assume you can't plug a Bluetooth dongle into a WL500gP and that you're using ethernet, yes?

There is an SQLite version of sma-bluetooth, my clone (basically a few minor mods to Tony Brown's work + extra documentation) is here: http://code.google.com/r/rcphills-sma-bluetooth-dbabstraction/

Cheers,

--
Rob Hills
Waikiki, Western Australia

Steve Roehrs

unread,
Feb 7, 2012, 12:18:33 AM2/7/12
to sma-bl...@googlegroups.com
I've got a full sma-bluetooth running on OpenWrt, but the x86 version
- not sure it it would just recompile for a different architecture.
It's running on an old Nortel Contivity, which sits out in my shed and
acts as a network switch, inverter interface, and also runs a USB
camera for the shed. I got sick of trying to connect directly from
the server to the inverter via bluetooth, over 20 metres away, and
through a tiled roof and colourbond steel wall!

The backend mysql database runs on a seperate server in the house.

I'd be happy to try and package it up into a proper OpenWrt package if
anyone's interested?

Steve

sbf

unread,
Feb 7, 2012, 3:01:49 AM2/7/12
to sma-bluetooth
> Well done!  How are you pulling data from your inverter?  I assume you
> can't plug a Bluetooth dongle into a WL500gP and that you're using
> ethernet, yes?

There are 2 USB ports on that router: 1 for BT dongle and 1 for memory
stick
I installed bluetooth kernel module and bluez-utils

All I did to smatool.c was commenting out the MySQL & curl code

> There is an SQLite version of sma-bluetooth, my clone (basically a few
> minor mods to Tony Brown's work
> <http://code.google.com/r/bonybrown-dbabstraction/> + extra
I had this already in mind when I started with my project... but of
course, first I had to be sure I could cross-compile it to MIPS
architecture.
I want to use the memory stick to store the SQLite database

Toby Rees

unread,
Mar 5, 2012, 6:52:28 PM3/5/12
to sma-bl...@googlegroups.com
I would be interested - I am trying to run it on a linksys NSLU2 "Slug" running OpenSlug/BE (Debian) but dont have a cross-compile environment.

any help (or binaries) you can share would be great.

Tobes

Bret Watson

unread,
Mar 6, 2012, 5:18:56 AM3/6/12
to sma-bl...@googlegroups.com
It wasn't hard to build on a debian arm environment. My slug died years ago unfortunately otherwise I'd build it for you...

Toby Rees

unread,
Mar 6, 2012, 5:24:48 AM3/6/12
to sma-bluetooth
Maybe a vmware player debian install on my mac would be the easy way
forward, and then cross compile from there.



On Mar 6, 10:18 am, Bret Watson <b...@ticm.com> wrote:
> It wasn't hard to build on a debian arm environment. My slug died years ago
> unfortunately otherwise I'd build it for you...
>
> >> >http://code.google.com/r/**rcphills-sma-bluetooth-**dbabstraction/<http://code.google.com/r/rcphills-sma-bluetooth-dbabstraction/>

Emanuele Sparisi

unread,
Mar 6, 2012, 5:28:56 AM3/6/12
to sma-bl...@googlegroups.com
I used qemu on windows to compile an ARM version with no problem.  


2012/3/6 Toby Rees <treesa...@gmail.com>

Bret Watson

unread,
Mar 6, 2012, 6:46:15 AM3/6/12
to sma-bl...@googlegroups.com
try this a very old build, but if it runs I'll do the current one for you

cheers

bret
sma-bluetooth.zip

Toby Rees

unread,
Mar 6, 2012, 7:12:04 AM3/6/12
to sma-bl...@googlegroups.com
Thanks Bret.

unziped and modded the smatool.conf file.

I know I am doing something wrong. When I install and run I get the following.

root@slug2:/smatool2/sma-bluetooth# smatool -v -from "2012-02-05 00:00:00" -to "
2012-02-05 23:55:00"
smatool: line 1: syntax error: word unexpected (expecting ")")

I am starting to think I am missing some shared libs that need to be in place.

Any thoughts?

Thanks

Tobes


<sma-bluetooth.zip>

Bret Watson

unread,
Mar 6, 2012, 7:22:41 AM3/6/12
to sma-bl...@googlegroups.com
It probably means the endian-ness is the opposite.... a problem with ARM systems

Toby Rees

unread,
Mar 6, 2012, 7:46:51 AM3/6/12
to sma-bl...@googlegroups.com
Ah - yes good catch. I am running BE. I guess that compile environment is calling…

Tobes

Toby Rees

unread,
Mar 6, 2012, 8:18:59 AM3/6/12
to sma-bl...@googlegroups.com
Excellent guess.

Is there a simple way to bitswap them from LE to BE?

Tobes

root@slug2:/smatool2/sma-bluetooth# file /bin/busybox 
/bin/busybox: ELF 32-bit MSB executable, ARM, version 1 (SYSV), dynamically linked (uses shared libs), stripped
root@slug2:/smatool2/sma-bluetooth# file /smatool2/sma-bluetooth/smatool
/smatool2/sma-bluetooth/smatool: ELF 32-bit LSB executable, ARM, version 1 (SYSV), for GNU/Linux 2.6.14, dynamically linked (uses shared libs), not stripped
On 6 Mar 2012, at 12:22, Bret Watson wrote:

Toby Rees

unread,
Mar 12, 2012, 7:12:55 PM3/12/12
to sma-bluetooth
So I rebuilt my NSLU2 as Little Endian, and then installed the local
compilation environment - hey presto - it all works.
Now just waiting to see if PVoutput.org gets updated.

Is there a single known good update link for the PVOutput URL?
currently I am using the following but couldn't find any other
documentation.

PVOutputURL http://pvoutput.org/service/r2/addoutput.jsp

Thanks

Tobes

On Mar 6, 1:18 pm, Toby Rees <treesatci...@gmail.com> wrote:
> Excellent guess.
>
> Is there a simple way to bitswap them from LE to BE?
>
> Tobes
>
> root@slug2:/smatool2/sma-bluetooth# file /bin/busybox
> /bin/busybox: ELF 32-bit MSB executable, ARM, version 1 (SYSV), dynamically linked (uses shared libs), stripped
> root@slug2:/smatool2/sma-bluetooth# file /smatool2/sma-bluetooth/smatool
> /smatool2/sma-bluetooth/smatool: ELF 32-bit LSB executable, ARM, version 1 (SYSV), for GNU/Linux 2.6.14, dynamically linked (uses shared libs), not stripped
> On 6 Mar 2012, at 12:22, Bret Watson wrote:
>
>
>
>
>
>
>
> > It probably means the endian-ness is the opposite.... a problem with ARM systems
>
> > On 6 March 2012 20:12, Toby Rees <treesatci...@gmail.com> wrote:
> > Thanks Bret.
>
> > unziped and modded the smatool.conf file.
>
> > I know I am doing something wrong. When I install and run I get the following.
>
> > root@slug2:/smatool2/sma-bluetooth# smatool -v -from "2012-02-05 00:00:00" -to "
> > 2012-02-05 23:55:00"
> > smatool: line 1: syntax error: word unexpected (expecting ")")
>
> > I am starting to think I am missing some shared libs that need to be in place.
>
> > Any thoughts?
>
> > Thanks
>
> > Tobes
>
> > On 6 Mar 2012, at 11:46, Bret Watson wrote:
>
> >> try this a very old build, but if it runs I'll do the current one for you
>
> >> cheers
>
> >> bret
>

Emanuele

unread,
Mar 14, 2013, 10:32:08 AM3/14/13
to sma-bl...@googlegroups.com
Hello I'm trying to compile sma-bluetooth in openwrt SDK but I'm not able to compile,
could you give me the makefile for the openwrt SDK?

Regards,
Emanuele.

Claas Anders Rathje

unread,
Sep 1, 2013, 1:26:04 PM9/1/13
to sma-bl...@googlegroups.com
I can give you a starting point.
Actually I do not own an inverter myself but I am trying to set something up for a friend.

This has compiles using OpenWRT backfire and starts up. Still not testes in live system, but may be worth a look.

The mysql stuff gets removed during compiling because I was too lazy for the mysql-lib (and had not space on the target device).

Regards,
Claas
20130901-sma-bluetooth-918357e2ae22-openwrt-firsttry.tar.bz2

Claas Anders Rathje

unread,
Sep 2, 2013, 12:29:36 PM9/2/13
to sma-bl...@googlegroups.com
Better try the file attached here.

This fixes the "not all values set" bug.

Extract the sma-bluetooth folder to your OpenWRT package/ directory and you can select the tool within the build menu below utilities.
I do not have an inverter at hand but using that package I can get the tool to connect to some other bluetooth device and parse the text it is receiving.

Regards,
Claas
20130902-sma-bluetooth-918357e2ae22-openwrt-2ndtry.tar.bz2

Claas Anders Rathje

unread,
Sep 12, 2013, 3:44:16 PM9/12/13
to sma-bl...@googlegroups.com
Just wanted to let you know that this is running for some days now on a TP-Link TL-WR1043ND running Backfire (10.03.x Snapshot, r33081) and accessing a SB5000TL inverter.

Regards,
Claas
Reply all
Reply to author
Forward
0 new messages