Since Synology DSM 4.2 now supports bluetooth by default, I thought it would be easy to install smatool in my nas and have the updates done every 5 minutes, rather then weekly trying to remember to do that with my laptop. So far the plan.
I share my experiences here in case someone wants to build upon them or one day, copy this info in the wiki.
Bluetooth is supported in DMS 4.2, so with a bluetooth usb dongel inserted, i can see my SMA when running hcitool scan.
Next step is to get smatool running. My synology has an ARM processor, so smatool needs to be compiled for that. The necessary tools for compiling are not installed by default on a Synology NAS.
To get that working:
At this point, make fails because of not finding mysqlclient libs; I solved that by changing -L/usr/lib to -L/opt/lib/mysql
Then makefile fails with following error messages:
/opt/lib/gcc/arm-none-linux-gnueabi/4.2.3/../../../../arm-none-linux-gnueabi/lib/libpthread.so: undefined reference to `__default_sa_restorer_v2@GLIBC_PRIVATE'
/opt/lib/gcc/arm-none-linux-gnueabi/4.2.3/../../../../arm-none-linux-gnueabi/lib/libpthread.so: undefined reference to `__default_rt_sa_restorer_v2@GLIBC_PRIVATE'
/opt/lib/gcc/arm-none-linux-gnueabi/4.2.3/../../../../arm-none-linux-gnueabi/lib/libpthread.so: undefined reference to `__default_rt_sa_restorer_v1@GLIBC_PRIVATE'
/opt/lib/gcc/arm-none-linux-gnueabi/4.2.3/../../../../arm-none-linux-gnueabi/lib/libpthread.so: undefined reference to `__default_sa_restorer_v1@GLIBC_PRIVATE'
1) backup the pthread libraries found in /opt/arm-none-linux-gnueabi/lib/ :
mkdir /opt/arm-none-linux-gnueabi/lib_disabled
mv /opt/arm-none-linux-gnueabi/lib/libpthread* /opt/arm-none-linux-gnueabi/lib_disabled
2) Copy the pthread libraries found in /opt/lib
cp /lib/libpthread.so.0 /opt/arm-none-linux-gnueabi/lib/
cd /opt/arm-none-linux-gnueabi/lib/
ln -s libpthread.so.0 libpthread.so
To my joy, afther this the compiling process runs without error messages.
Running ./smatool fails with the error message: ./smatool: error while loading shared libraries: libmysqlclient.so.15: cannot open shared object file: No such file or directory
Running ./smatool again make it fail with a similar error message: ./smatool: error while loading shared libraries: libbluetooth.so.1: cannot open shared object file: No such file or directory
The libbluetooth.so.1 file exists and lives in /opt/lib. I solved that errormessage by creating a symlink.
ln -s /opt/lib/libbluetooth.so.1 /usr/lib/libbluetooth.so.1