plan44 / vdcd

vdcd - home automation device controller for Digital Strom and (via p44mbrd) matter
https://plan44.ch/automation
Other
22 stars 7 forks source link

Compile Error #7

Closed stif closed 3 years ago

stif commented 8 years ago

Hello,

I am running a P44-DSB-X version 1.5.2.0_testing and wanted to test a newer version, so i tried to compile the vdcd (testing branch) according to the How to build vdcd file on a Raspi2 and got a compile error:

src/p44utils/jsonobject.hpp:27:18: fatal error: json.h: No such file or directory compilation terminated. Makefile:3631: recipe for target 'src/p44utils/vdcd-jsoncomm.o' failed make[1]: * [src/p44utils/vdcd-jsoncomm.o] Error 1 make[1]: Leaving directory '/srv/ds/vdcd' Makefile:1094: recipe for target 'all' failed make: * [all] Error 2

i also installed libjsoncpp-dev but it still complains about the missing json.h file. Any suggestions how to solve this?

Kind Regards, Stefan

plan44 commented 8 years ago

I'm not quite sure why this happens in your case. Basically, the autoreconf + configure steps should detect the needed include path for that "json.h" automatically. The problem with json.h in particular is that in some cases/lib versions it is in includes/, in some others in includes/json. As a quick and dirty workaround, if json.h is not present in /usr/include already, it might help to softlink json.h with ln -s /usr/include/json/json.h /usr/include/json.h. But that's not a real solution, just a hack. BTW: libjsoncpp is not needed, just libjson-c (aka libjson0-dev)

stif commented 8 years ago

Thank you for pointing me to the right direction. After symlinking all the files from /usr/include/json/* to /usr/include/ i could compile vdcd. But for some reason the resulting vdcd executable is without enocean support (--enocean bridge it is not listed when calling vdcd --help) and i did not get it to run anyways (tried to editing the variable EXECUTABLE in file /etc/service/vdcd/run). But this is another issue and i hopefully figure it out when i have some more time to play

stif commented 7 years ago

I had some spare time and tried to compile the vdcd again with mixed success. When i strictly follow the instructions in the docs it compiles fine, but without enocean support and the external vdsm feature.

I figured out there is a configure switch --enable-p44buildrpi for making a raspberry pi build. Unfortunatly i get a compile error when using this configure switch:

/usr/bin/ld: src/p44vdc/vdc_common/vdcd-discovery.o: undefined reference to symbol 'avahi_string_list_to_string' //usr/lib/arm-linux-gnueabihf/libavahi-common.so.3: error adding symbols: DSO missing from command line collect2: ld returned 1 exit status Makefile:1917: recipe for target 'vdcd' failed make[1]: [vdcd] Error 1 make[1]: Leaving directory '/srv/ds/vdcd' Makefile:1155: recipe for target 'all' failed make: [all] Error 2 root@p44-dsb-e:/srv/ds/vdcd#

I installed all libraries mentioned in the compile docs and then issued the following commands:

git clone https://github.com/plan44/vdcd.git cd vdcd/ git checkout testing git submodule init git submodule update autoreconf -i ./configure --enable-p44buildrpi make clean make all

Any ideas what is causing the linking error?

plan44 commented 7 years ago

--enable-p44buildrpi is for a quite specific environment (the plan44 P44-DSB running on RPi), not recommended for regular RPi builds. Same for the auxiliary vdsm feature (this is deprecated, and will be removed in a future version). There's a vdsm on the dSSE/dSSIP now (coming on the dSS11 later).

You should try a regular build, and just pass the required ENABLE_XX on the make command line, like

make vdcd ENABLE_ENOCEAN=1
stif commented 7 years ago

Hi,

Passing ENABLE_ENOCEAN on the make command did not help, but i edited p44vdc_config.hpp and added a #define ENABLE_ENOCEAN 1 to the bottom of the file. After compiling i did install avahi-dameon apt-get install avahi-daemon and then started the vdcd:

root@p44-dsb-e:/srv/ds/vdcd# ./vdcd --redled led.0 --productname "${PRODUCTNAME}" --hostname "${HOSTNAME}" --deviceid "${SERIALNO}" --productversion "${PRODUCTVERSION}" --cfgapiport 8090 --webuiport 80 --sshport 22 --sqlitedir /flash --icondir /usr/share/www/icons --huelights --enocean /dev/ttyAMA0

Looks good so far:

[2017-03-24 18:20:50.457 N] starting initialisation of vcd host 'plan44.ch vDC host "plan44" #850A2BE63A455C7F80D23848F74672EE00' dSUID (MAC-derived) = 850A2BE63A455C7F80D23848F74672EE00 (plan44), MAC: B8:27:EB:36:2D:EB, IP = 10.0.0.132 [2017-03-24 18:20:50.479 N] === collecting devices from vdc 6562328B731552058063CE4E2782E5AC00 (EnOcean_Bus_Container #1) [2017-03-24 18:20:50.480 N] --- added device: 97650ED3A9DB5A738007722DAAD6E3DE00 (not yet initialized) [2017-03-24 18:20:50.482 N] --- added device: CD7FF36CC7405C4DC00017D7E854A1C000 (not yet initialized) [2017-03-24 18:20:50.484 N] --- added device: CD7FF36CC7405C4DC00017D7E854A1C001 (not yet initialized) [2017-03-24 18:20:50.486 N] --- added device: D4DA3D5912E75F83C0B33A1FFD32A40900 (not yet initialized) [2017-03-24 18:20:50.488 N] --- added device: D4DA3D5912E75F83C0B33A1FFD32A40902 (not yet initialized) [2017-03-24 18:20:50.491 N] === done collecting from 6562328B731552058063CE4E2782E5AC00 (EnOcean Bridge) [2017-03-24 18:20:50.492 N] === collecting devices from vdc 9BFB8123A52E529FC0AA9F63442EEB3500 (hue_Lights_Container #1) [2017-03-24 18:20:50.493 N] === done collecting from 9BFB8123A52E529FC0AA9F63442EEB3500 [2017-03-24 18:20:50.493 N] --- initialized device: vdSD 97650ED3A9DB5A738007722DAAD6E3DE00 (EnOcean Reed Kontak) - NOT YET announced

  • Binary Inputs: 1
  • Enocean Address = 0x01809E67, subDevice=0
  • single contact, EEP RORG/FUNC/TYPE: D5 00 01, Manufacturer: (FFFF), Profile variant: 00
  • EnOcean device channel #0: Single Contact [2017-03-24 18:20:50.494 N] --- initialized device: vdSD CD7FF36CC7405C4DC00017D7E854A1C000 (Esszimmer) - NOT YET announced
  • Buttons: 1
  • Enocean Address = 0xFEFAE757, subDevice=0
  • button, EEP RORG/FUNC/TYPE: F6 02 FF, Manufacturer: (FFFF), Profile variant: 01
  • EnOcean device channel #0: Pushbutton [2017-03-24 18:20:50.494 N] --- initialized device: vdSD CD7FF36CC7405C4DC00017D7E854A1C001 (Gehen) - NOT YET announced
  • Buttons: 1
  • Enocean Address = 0xFEFAE757, subDevice=1
  • button, EEP RORG/FUNC/TYPE: F6 02 FF, Manufacturer: (FFFF), Profile variant: 01
  • EnOcean device channel #0: Pushbutton [2017-03-24 18:20:50.495 N] --- initialized device: vdSD D4DA3D5912E75F83C0B33A1FFD32A40900 - NOT YET announced
  • Buttons: 2
  • Enocean Address = 0x00295520, subDevice=0
  • rocker switch, EEP RORG/FUNC/TYPE: F6 02 FF, Manufacturer: (FFFF), Profile variant: 00
  • EnOcean device channel #0: Pushbutton
  • EnOcean device channel #1: Pushbutton [2017-03-24 18:20:50.495 N] --- initialized device: vdSD D4DA3D5912E75F83C0B33A1FFD32A40902 (Wohnzimmer) - NOT YET announced
  • Buttons: 2
  • Enocean Address = 0x00295520, subDevice=2
  • rocker switch, EEP RORG/FUNC/TYPE: F6 02 FF, Manufacturer: (FFFF), Profile variant: 00
  • EnOcean device channel #0: Pushbutton
  • EnOcean device channel #1: Pushbutton [2017-03-24 18:20:58.479 N] avahi: starting client [2017-03-24 18:20:59.437 N] discovery: successfully published vDC service 'plan44.ch vDC host "plan44" #850A2BE63A455C7F80D23848F74672EE00'. [2017-03-24 18:21:05.901 N] Sent vdc announcement for vDC 6562328B731552058063CE4E2782E5AC00 (EnOcean Bridge) [2017-03-24 18:21:06.079 N] Announcement for vDC 6562328B731552058063CE4E2782E5AC00 (EnOcean Bridge) acknowledged by vdSM [2017-03-24 18:21:06.091 N] Sent vdc announcement for vDC 9BFB8123A52E529FC0AA9F63442EEB3500 [2017-03-24 18:21:06.269 N] Announcement for vDC 9BFB8123A52E529FC0AA9F63442EEB3500 acknowledged by vdSM [2017-03-24 18:21:06.287 N] Sent device announcement for vdSD 97650ED3A9DB5A738007722DAAD6E3DE00 (EnOcean Reed Kontak) [2017-03-24 18:21:07.029 N] Announcement for vdSD 97650ED3A9DB5A738007722DAAD6E3DE00 (EnOcean Reed Kontak) acknowledged by vdSM [2017-03-24 18:21:07.045 N] Sent device announcement for vdSD CD7FF36CC7405C4DC00017D7E854A1C000 (Esszimmer) [2017-03-24 18:21:07.638 N] Announcement for vdSD CD7FF36CC7405C4DC00017D7E854A1C000 (Esszimmer) acknowledged by vdSM [2017-03-24 18:21:07.649 N] Sent device announcement for vdSD CD7FF36CC7405C4DC00017D7E854A1C001 (Gehen) [2017-03-24 18:21:08.288 N] Announcement for vdSD CD7FF36CC7405C4DC00017D7E854A1C001 (Gehen) acknowledged by vdSM [2017-03-24 18:21:08.299 N] Sent device announcement for vdSD D4DA3D5912E75F83C0B33A1FFD32A40900 [2017-03-24 18:21:08.899 N] Announcement for vdSD D4DA3D5912E75F83C0B33A1FFD32A40900 acknowledged by vdSM [2017-03-24 18:21:08.924 N] Sent device announcement for vdSD D4DA3D5912E75F83C0B33A1FFD32A40902 (Wohnzimmer) [2017-03-24 18:21:09.519 N] Announcement for vdSD D4DA3D5912E75F83C0B33A1FFD32A40902 (Wohnzimmer) acknowledged by vdSM [2017-03-24 18:24:11.353 N] vdSD D4DA3D5912E75F83C0B33A1FFD32A40902 (Wohnzimmer): Button[1] 'up key' was pressed [2017-03-24 18:24:11.546 N] vdSD D4DA3D5912E75F83C0B33A1FFD32A40902 (Wohnzimmer): Button[1] 'up key' was released [2017-03-24 18:24:11.546 N] vdSD D4DA3D5912E75F83C0B33A1FFD32A40902 (Wohnzimmer): Button[1] 'up key' pushes value = 0, clickType 0

The only problem remains is the dSS cannot find the vdcd. regarding to your comment above and your conversation with holli, i guess i need to install vdsm on the dSS for it. I got the vdsm binaries for dSS from http://update.aizo.com/feeds/dss11-production-eglibc/ipk/armv5te/ but dont know if i should use _vdsm-binary4.4 or _vdsm4.11.1 and how to install. I tried on the dSS: opkg install vdsm-binary_4.4.0\+gitr576\+568fb20-r2_armv5te.ipk But got back:

opkg_conf_load: Could not create lock file /var/lib/opkg/lock: Permission denied.

Can you tell me please how to install vdsm on the dSS or how i can use the local vdsm on the raspberry so the enocean bridge will show up on the dSS?

Thanks, Stefan

plan44 commented 7 years ago

Always check the creation dates on the aizo feeds ;-) The 4.4 vdsm is 2 years old, you'll not have a lot of fun with that.

I'd try vdsm_4.11.1-r1_armv5te.ipk, that seems to be recent.

To install stuff with opkg on the dSS, you need to be root. On older dSSes, you could become root just by entering "su", but digitalSTROM has changed that on production firmware dSS. And on "testing" firmware dSS, the vdsm is already installed by default (as it is on dSS11E and dSSIP production)

If you don't have the needed access to your dSS, you can build the regular vdsm on the RPi from https://git.digitalstrom.org/virtual-devices/vdsm