Author Topic: Z-wave devices control from NAS or router  (Read 60854 times)

LA

  • Regular Poster
  • **
  • Posts: 26
    • View Profile
Re: Z-wave devices control from NAS or router
« Reply #15 on: June 27, 2010, 06:09:25 pm »
Quote
that really depends on the hardware you want to use. The values in the Makefile were chosen for the mini2440 arm platform. You need to figure out the proper values for your router.
Understand that. In the document about my hardware it is mention that I should do the following:
Code: [Select]
# env CC=/usr/local/arm-none-linux-gnueabi/bin/arm-none-linux-gnueabi-gcc \
LD=/usr/local/arm-none-linux-gnueabi/bin/arm-none-linux-gnueabi-ld \
RANLIB=/usr/local/arm-none-linux-gnueabi/bin/arm-none-linux-gnueabi-ranlib \
CFLAGS="-I/usr/local/arm-none-linux-gnueabi/include" \
LDFLAGS="-L/usr/local/arm-none-linux-gnueabi/lib" \
./configure \
--host=armle-unknown-linux \
--target=armle-unknown-linux \
--build=i686-pc-linux \
--prefix=/usr/local
doesn't it contain or allow to identify which values should be used for parameters march and mtune?

LA

  • Regular Poster
  • **
  • Posts: 26
    • View Profile
Re: Z-wave devices control from NAS or router
« Reply #16 on: July 01, 2010, 07:02:07 pm »
Can somebody please help me to create configure file?
Looks like this is the only way for me to compile the program...

hari

  • Administrator
  • LinuxMCE God
  • *****
  • Posts: 2428
    • View Profile
    • ago control
Re: Z-wave devices control from NAS or router
« Reply #17 on: July 01, 2010, 07:04:30 pm »
you don't need a configure file. Just use the makefile. If you don't have any values for march and mtune just leave the switches out.

br Hari
rock your home - http://www.agocontrol.com home automation

LA

  • Regular Poster
  • **
  • Posts: 26
    • View Profile
Re: Z-wave devices control from NAS or router
« Reply #18 on: July 01, 2010, 07:22:07 pm »
should I just run make in the folder with sources?
If I do bash build-arm.sh, then I get the following error:
Code: [Select]
make[1]: Entering directory `/usr/local/arm-none-linux-gnueabi/bin/harimini/Lighting_Plugin'
g++ -c -DUSE_MYSQL_WRAPPER -I/usr/include/libxml2/ -I/usr/include/mysql -I.. -I../DCE   -msoft-float -D__GCC_FLOAT_NOT_NEEDED -march=armv4 -mtune=arm920t -Wall -fPIC -ggdb3  Main.cpp -o Main.o
Main.cpp:1: error: bad value (armv4) for -march= switch
Main.cpp:1: error: bad value (arm920t) for -mtune= switch
make[1]: *** [Main.o] Error 1
make[1]: Leaving directory `/usr/local/arm-none-linux-gnueabi/bin/harimini/Lighting_Plugin'
make: *** [plugins] Error 2
again it tries to use non-arm g++...

I'll also try to compile it on the NAS itself.
« Last Edit: July 01, 2010, 07:26:41 pm by LA »

LA

  • Regular Poster
  • **
  • Posts: 26
    • View Profile
Re: Z-wave devices control from NAS or router
« Reply #19 on: July 01, 2010, 07:42:37 pm »
Hmm, looks like compilation with usage of make only is successful.
At least, I haven't got any error.
How should I install compiled version on my NAS? Which files should I copy there and which of them should I run?

And, when I tried to compile it on the NAS itself, I've got the following error:
Code: [Select]
g++ -shared -fPIC -Wall -g -ggdb3 -D_GNU_SOURCE -DUSE_MYSQL_WRAPPER -I/usr/include/libxml2/ -I/usr/include/mysql -I./ -I../../ -I../ -I../DCE/ -I../../DCE -I../VIPShared/ -I../../VIPShared -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -DUSE_LZO_DATAGRID -DKDE_LMCE -DDEBUG -DTHREAD_LOG -DLOG_ALL_QUERIES -I/stuff/tmp/staging/armv4t-angstrom-linux-gnueabi/usr/include/mysql -o libPlutoUtils.so CommonIncludes.o FileUtils.o MultiThreadIncludes.o Other.o ProcessUtils.o StringUtils.o DatabaseUtils.o getch.o md5c.o minilzo.o uuencode.o LinuxSerialUSB.o ThreadedClass.o ../db_wrapper/db_wrapper.o ../db_wrapper/ClientSocket.o ../db_wrapper/Socket.o -L/usr/lib/mysql -lmysqlclient
/opt/lib/gcc/arm-none-linux-gnueabi/4.2.3/../../../../arm-none-linux-gnueabi/bin/ld: cannot find -lmysqlclient
collect2: ld returned 1 exit status
make[1]: *** [libPlutoUtils.so] Error 1
make[1]: Leaving directory `/tmp/harimini/PlutoUtils'
make: *** [libs] Error 2
seems my NAS doesn't have mysqlclient and have sqllite only.
installation of mysql package doesn't help and mysqlclient package can not be found...
« Last Edit: July 01, 2010, 07:46:35 pm by LA »

LA

  • Regular Poster
  • **
  • Posts: 26
    • View Profile
Re: Z-wave devices control from NAS or router
« Reply #20 on: July 04, 2010, 12:55:41 pm »
Hi Hari,
I am still trying to complile application on the NAS.
I've installed mysql5 package (is it OK? mysql 4 doesn't have mysqlclient libs) and added the following line into Makefile:
Code: [Select]
export LDFLAGS=-L/opt/lib/mysqlso, I haven't got any mysqlclient related error during compilation.
But now I have another error:
Code: [Select]
g++ -c -DUSE_MYSQL_WRAPPER -I/usr/include/libxml2/ -I/usr/include/mysql -I.. -I../DCE   -Wall -fPIC -ggdb3  ../Gen_Devices/RPC_PluginBase.cpp -o ../Gen_Devices/RPC_PluginBase.o
../Gen_Devices/RPC_PluginBase.cpp: In member function 'virtual DCE::DeviceData_Impl* DCE::RPC_Plugin_Data::CreateData(DCE::DeviceData_Impl*, char*, long unsigned int, char*)':
../Gen_Devices/RPC_PluginBase.cpp:13: warning: unused variable 'iPK_Device'
../Gen_Devices/RPC_PluginBase.cpp:14: warning: unused variable 'iPK_Installation'
cc -Wall -fPIC -ggdb3 -c mongoose.c
make[1]: cc: Command not found
make[1]: *** [RPC_Plugin.so] Error 127
make[1]: Leaving directory `/volume2/video/temp/harimini/RPC_Plugin'
make: *** [plugins] Error 2
how should I fix it?

upd. fixed it by adding
Code: [Select]
export CC=${CROSS}gcc ${CFLAGS}to Makefile.
I also had to replace ./post_make.sh in RPC_Plugin/Makefile to direct path - /volume2/video/temp/harimini/RPC_Plugin/post_make.sh.
Now I am getting error
Code: [Select]
g++ -o ZWave Main.o ZWave.o ../Gen_Devices/ZWaveBase.o Serial.o ZWApi.o ../Generic_Serial_Device/IOUtils.o -L/opt/lib/mysql  -L../lib   -lSerializeClass -lDCECommon -lPlutoUtils -lpthread
/opt/lib/gcc/arm-none-linux-gnueabi/4.2.3/../../../../arm-none-linux-gnueabi/bin/ld: warning: libmysqlclient.so.15, needed by ../lib/libDCECommon.so, not found (try using -rpath or -rpath-link)
/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'
collect2: ld returned 1 exit status
make[1]: *** [ZWave] Error 1
make[1]: Leaving directory `/volume2/video/temp/harimini/ZWave'
make: *** [dcedevs] Error 2
« Last Edit: July 04, 2010, 05:17:03 pm by LA »

LA

  • Regular Poster
  • **
  • Posts: 26
    • View Profile
Re: Z-wave devices control from NAS or router
« Reply #21 on: July 06, 2010, 07:14:12 pm »
(while testing that on the version compiled on PC)
hari, how should I start the service?
I've tried to run all files generated in the bin folder and then access web-interface thru ip:8080 - got nothing.

hari

  • Administrator
  • LinuxMCE God
  • *****
  • Posts: 2428
    • View Profile
    • ago control
Re: Z-wave devices control from NAS or router
« Reply #22 on: July 06, 2010, 07:39:01 pm »
8088, make sure that DCERouter did load the RPC plugin.

br Hari
rock your home - http://www.agocontrol.com home automation

LA

  • Regular Poster
  • **
  • Posts: 26
    • View Profile
Re: Z-wave devices control from NAS or router
« Reply #23 on: July 06, 2010, 08:38:58 pm »
Hari, thanks, surely it should be 8088..

I am getting the following error when run DCERouter:
Code: [Select]
root@ubuntu910desktop:/usr/local/arm-none-linux-gnueabi/bin/harimini/bin# ./DCERouter
./DCERouter: error while loading shared libraries: libDCECommon.so: cannot open shared object file: No such file or directory
« Last Edit: July 06, 2010, 09:25:00 pm by LA »

hari

  • Administrator
  • LinuxMCE God
  • *****
  • Posts: 2428
    • View Profile
    • ago control
Re: Z-wave devices control from NAS or router
« Reply #24 on: July 06, 2010, 09:34:56 pm »
it tries to dynamically load that library, either point ld.conf to it or export a proper LD_PRELOAD_PATH to the location of the library.

br Hari
rock your home - http://www.agocontrol.com home automation

LA

  • Regular Poster
  • **
  • Posts: 26
    • View Profile
Re: Z-wave devices control from NAS or router
« Reply #25 on: July 07, 2010, 08:12:21 pm »
I've added path to LD_PRELOAD_PATH:
Code: [Select]
root@ubuntu910desktop:/usr/local/arm-none-linux-gnueabi/bin/harimini/bin# export -p
declare -x LD_PRELOAD_PATH="/usr/local/arm-none-linux-gnueabi/bin/harimini/lib"
but it didn't help.

What is ld.conf?

hari

  • Administrator
  • LinuxMCE God
  • *****
  • Posts: 2428
    • View Profile
    • ago control
Re: Z-wave devices control from NAS or router
« Reply #26 on: July 07, 2010, 09:01:59 pm »
sorry, meant LD_LIBRARY_PATH

br Hari
rock your home - http://www.agocontrol.com home automation

LA

  • Regular Poster
  • **
  • Posts: 26
    • View Profile
Re: Z-wave devices control from NAS or router
« Reply #27 on: July 09, 2010, 07:19:02 pm »
do I also need to add path to mysql somehow?
I've compiled an application (on PC now) and try to run mini-install.sh. Getting the following errors:
Code: [Select]
root@ubuntu910desktop:/tmp/harimini/installer# ./mini-install.sh
SQL_Ops.sh: line 30: mysql: command not found
Setting up your computer to act as a 'Core'
./mce-install-common.sh: line 62: /usr/pluto/bin/CreateDevice: No such file or directory
SQL_Ops.sh: line 30: mysql: command not found
Configuring devices
./mce-install-common.sh: line 70: /usr/bin/mysql: No such file or directory
SQL_Ops.sh: line 30: mysql: command not found
SQL_Ops.sh: line 30: mysql: command not found
SQL_Ops.sh: line 30: mysql: command not found
SQL_Ops.sh: line 30: mysql: command not found
SQL_Ops.sh: line 30: mysql: command not found
SQL_Ops.sh: line 30: mysql: command not found
SQL_Ops.sh: line 30: mysql: command not found
SQL_Ops.sh: line 30: mysql: command not found
SQL_Ops.sh: line 30: mysql: command not found
SQL_Ops.sh: line 30: mysql: command not found


tried to add it like:
Code: [Select]
export PATH="${PATH}:/usr/include/mysql"but really there is no mysql file. What kind of package should I install on my Ubuntu 9.10 to get it?
« Last Edit: July 09, 2010, 08:54:03 pm by LA »

hari

  • Administrator
  • LinuxMCE God
  • *****
  • Posts: 2428
    • View Profile
    • ago control
Re: Z-wave devices control from NAS or router
« Reply #28 on: July 10, 2010, 04:58:46 pm »
Mysql-client and mysql-server,

br Hari
rock your home - http://www.agocontrol.com home automation

LA

  • Regular Poster
  • **
  • Posts: 26
    • View Profile
Re: Z-wave devices control from NAS or router
« Reply #29 on: July 11, 2010, 02:00:11 pm »
Hari, I've installed both packages and now when I run mini-install.sh, terminal hangs (nothing is displayed, but command run is not finished - looks like infinite loop somewhere).

And, if I run DCERoute I am getting the following:
Code: [Select]
user@ubuntu910desktop:~$ /tmp/harimini/src/bin/DCERouter
touch: cannot touch `/usr/pluto/var/DCERouter.running': No such file or directory
Copyright (C) 2004 Pluto, Inc., a Florida Corporation
www.plutohome.com
Phone: +1 (877) 758-8648
This program is distributed according to the terms of the GNU Public License, available at:
http://www.fsf.org/licensing/licenses/gpl.html
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the GNU Public License for more details.
---------------

sh: /usr/pluto/bin/mysql_wrapper: not found
01 07/11/10 7:58:34.084 Connect failed Failed to get error message <0xb77ba8e0>
sh: /usr/pluto/bin/mysql_wrapper: not found
01 07/11/10 7:58:44.246 Connect failed Failed to get error message <0xb77ba8e0>
01 07/11/10 7:58:44.247 Cannot connect to database! <0xb77ba8e0>
user@ubuntu910desktop:~$


upd. I've run mini-install.sh under root and got the following:
Code: [Select]
root@ubuntu910desktop:/tmp/harimini/installer# ./mini-install.sh
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)
Setting up your computer to act as a 'Core'
./mce-install-common.sh: line 62: /usr/pluto/bin/CreateDevice: No such file or directory
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)
Configuring devices
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)
where should I indicate password to be used for MySQL root user? Or, where can I remove it (it was mandatory during package installation)?

upd. found it in mce_install_common.sh, but got other errors now ;):
Code: [Select]
root@ubuntu910desktop:/tmp/harimini/installer# ./mini-install.sh
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
Setting up your computer to act as a 'Core'
./mce-install-common.sh: line 62: /usr/pluto/bin/CreateDevice: No such file or directory
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
Configuring devices
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
root@ubuntu910desktop:/tmp/harimini/installer# ./mini-install.sh
ERROR 1049 (42000): Unknown database 'pluto_main'
Setting up your computer to act as a 'Core'
./mce-install-common.sh: line 62: /usr/pluto/bin/CreateDevice: No such file or directory
ERROR 1049 (42000): Unknown database 'pluto_main'
Configuring devices
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)
ERROR 1049 (42000): Unknown database 'pluto_main'
ERROR 1049 (42000): Unknown database 'pluto_main'
ERROR 1049 (42000): Unknown database 'pluto_main'
ERROR 1049 (42000): Unknown database 'pluto_main'
ERROR 1049 (42000): Unknown database 'pluto_main'
ERROR 1049 (42000): Unknown database 'pluto_main'
ERROR 1049 (42000): Unknown database 'pluto_main'
ERROR 1049 (42000): Unknown database 'pluto_main'
ERROR 1049 (42000): Unknown database 'pluto_main'
ERROR 1049 (42000): Unknown database 'pluto_main'
root@ubuntu910desktop:/tmp/harimini/installer#

and after changing of path to CreateDevice in mce-install-common.sh from /usr/pluto/bin to my path:
Code: [Select]
root@ubuntu910desktop:/tmp/harimini/installer# export LD_LIBRARY_PATH=/tmp/harimini/src/lib
root@ubuntu910desktop:/tmp/harimini/installer# ./mini-install.shERROR 1049 (42000): Unknown database 'pluto_main'
Setting up your computer to act as a 'Core'
05 07/11/10 8:26:34.277 Called with: -d 7  <0xb78896d0>
01 07/11/10 8:26:34.332 Connect failed Unknown database 'pluto_main' <0xb78896d0>
Cannot connect to database
CreateDevice failed
ERROR 1049 (42000): Unknown database 'pluto_main'
Configuring devices
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)
ERROR 1049 (42000): Unknown database 'pluto_main'

I've also tried to run import.sh from dumps folder (have corrected path to sqlCVS there also)
it tries to run mysql_wrapper
Code: [Select]
root@ubuntu910desktop:/tmp/harimini/dumps# ./import.sh
sh: /usr/pluto/bin/mysql_wrapper: not found
not clear where the path should be corrected.
However after that it started to import tables, but anyway after that:
Code: [Select]
root@ubuntu910desktop:/tmp/harimini/installer# ./mini-install.sh
Setting up your computer to act as a 'Core'
05 07/11/10 8:51:20.223 Called with: -d 7  <0xb77ed6d0>
01 07/11/10 8:51:20.525 Query failed (You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ') AND FK_DeviceTemplate=1' at line 1): SELECT PK_DeviceTemplate_DeviceCategory_ControlledVia FROM DeviceTemplate_DeviceCategory_ControlledVia WHERE FK_DeviceCategory IN () AND FK_DeviceTemplate=1 (1) <0xb77ed6d0>
05 07/11/10 8:51:20.525 Resetting db_wrapper connection <0xb77ed6d0>
01 07/11/10 8:51:20.526 Query failed (You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ') AND FK_DeviceTemplate=1' at line 1): SELECT PK_DeviceTemplate_DeviceCategory_ControlledVia FROM DeviceTemplate_DeviceCategory_ControlledVia WHERE FK_DeviceCategory IN () AND FK_DeviceTemplate=1 (1) <0xb77ed6d0>
(I've installed mysql 5)
« Last Edit: July 11, 2010, 02:53:29 pm by LA »