angelnu / docker-ccu

Script to create a docker container with the CCU2 firmware
Apache License 2.0
32 stars 13 forks source link

Docker image does not build on hypriot - lzo missing #7

Closed Munsio closed 7 years ago

Munsio commented 7 years ago

Device: RaspberryPi3 + ELV-Radio Module OS: hypriot 1.4.0 - kernel: 4.4.50 Docker: 17.05.0-ce

Tried it with your prebuildt docker-image including the changes in your readme but the homematic webUI always displaying the failure "BidCos-RF Anlernmodus konnte nicht aktiviert werden".

Log from first run:

Configuring GPIO in port 18

Check if /etc/config/keys exits

Check if /etc/config/ids exits

Starting CCU2 init scripts

Starting /etc/init.d/S00eQ3SystemStart
cat: can't open '/sys/module/plat_eq3ccu2/parameters/board_serial': No such file or directory
/etc/init.d/S00eQ3SystemStart: line 142: can't create /sys/class/leds/power/brightness: nonexistent directory
/etc/init.d/S00eQ3SystemStart: line 142: can't create /sys/class/leds/power/trigger: nonexistent directory
/etc/init.d/S00eQ3SystemStart: line 142: can't create /sys/class/leds/internet/trigger: nonexistent directory
/etc/init.d/S00eQ3SystemStart: line 142: can't create /sys/class/leds/info/trigger: nonexistent directory
/etc/init.d/S00eQ3SystemStart: line 142: can't create /sys/class/leds/info/brightness: nonexistent directory
/etc/init.d/S00eQ3SystemStart: line 142: can't create /sys/class/leds/info/delay_off: nonexistent directory
/etc/init.d/S00eQ3SystemStart: line 142: can't create /sys/class/leds/info/delay_on: nonexistent directory
mkdir: can't create directory '/var/log': File exists
mkdir: can't create directory '/var/tmp': File exists
mkdir: can't create directory '/var/run': File exists
mkdir: can't create directory '/var/spool': File exists
mkdir: can't create directory '/var/lock': File exists
mkdir: can't create directory '/var/cache': File exists
mkdir: can't create directory '/var/lib': File exists
mkdir: can't create directory '/var/lib/misc': File exists
mkdir: can't create directory '/var/empty': File exists
modprobe: chdir(4.4.50-hypriotos-v7+): No such file or directory
modprobe: chdir(4.4.50-hypriotos-v7+): No such file or directory
modprobe: chdir(4.4.50-hypriotos-v7+): No such file or directory
modprobe: chdir(4.4.50-hypriotos-v7+): No such file or directory
modprobe: chdir(4.4.50-hypriotos-v7+): No such file or directory
modprobe: chdir(4.4.50-hypriotos-v7+): No such file or directory
modprobe: chdir(4.4.50-hypriotos-v7+): No such file or directory
modprobe: chdir(4.4.50-hypriotos-v7+): No such file or directory
modprobe: chdir(4.4.50-hypriotos-v7+): No such file or directory
modprobe: chdir(4.4.50-hypriotos-v7+): No such file or directory
LED Code: System start:OK
Starting crond: OK

Starting /etc/init.d/S01logging
Starting logging: OK

Starting /etc/init.d/S10udev
/etc/init.d/S10udev: line 45: can't create /proc/sys/kernel/hotplug: Read-only file system
Populating /dev using udev: done

Starting /etc/init.d/S15watchdog
Starting watchdog...

Starting /etc/init.d/S20urandom
Initializing random number generator... done.

Starting /etc/init.d/S40UsbNetwork
ifconfig: SIOCSIFADDR: Operation not permitted
Starting network over usb: OK

Starting /etc/init.d/S40network
Starting network...
ip: RTNETLINK answers: Operation not permitted
hostname: sethostname: Operation not permitted
route: SIOCADDRT: Operation not permitted
udhcpc (v1.20.2) started
ifconfig: SIOCSIFADDR: Operation not permitted
Sending discover...
Sending discover...
Sending discover...
No lease, failing
killall: checkDHCP: no process killed
eth0 carrier detected
ifconfig: SIOCSIFADDR: Operation not permitted
route: SIOCADDRT: Operation not permitted

Starting /etc/init.d/S45ifplugd
Starting Network Interface Plugging Daemon: eth0.

Starting /etc/init.d/S49hs485d
Preparing start of hs485dOK

Starting /etc/init.d/S50SetClock
clock_settime: Operation not permitted
hwclock: Cannot access the Hardware Clock via any known method.
hwclock: Use the --debug option to see the details of our search for an access method.
Starting setclock: OK

Starting /etc/init.d/S50eq3configd
cat: can't open '/sys/module/plat_eq3ccu2/parameters/radio_mac': No such file or directory
cat: can't open '/sys/module/plat_eq3ccu2/parameters/board_serial': No such file or directory
Starting eq3configd: OK

Starting /etc/init.d/S50lighttpd
Starting lighttpd: OK

Starting /etc/init.d/S50sshd

Starting /etc/init.d/S58LGWFirmwareUpdate

Starting /etc/init.d/S59SetLGWKey
ls: /etc/config/*.keychange: No such file or directory
OK

Starting /etc/init.d/S60hs485d
Starting hs485d: OK

Starting /etc/init.d/S60multimacd
Starting multimacd: 
Could not open SPI device: No such file or directory
Could not open SPI device: No such file or directory
sed: /sys/module/plat_eq3ccu2/parameters/radio_mac: No such file or directory
2017/06/04 16:11:17.214 <Error> CCU2CommControllerMod::performIdentify(): Unable to determine coprocessor state.
Could not open SPI device: No such file or directory
checking if firmware update is needed...
error while updating coprocessor, recovering...
Could not open SPI device: No such file or directory
sh: 265: unknown operand
sh: 265: unknown operand
sh: 265: unknown operand
sh: 265: unknown operand
sh: 265: unknown operand
Waiting for multimacd to get ready.....Timeout while waiting for multimacd to get ready.

Starting /etc/init.d/S61rfd
Starting rfd: 
sh: 293: unknown operand
sh: 293: unknown operand
sh: 293: unknown operand
sh: 293: unknown operand
Waiting for rfd to get ready.....rfd is ready now.

cp: can't stat '/etc/config_templates/hmip_networkkey.conf': No such file or directory
Starting /etc/init.d/S62HMServer
Starting HMServer: Waiting for HMServer to get ready
OK

Starting /etc/init.d/S70ReGaHss
Starting ReGaHss: OK

Starting /etc/init.d/S99eQ3SystemStarted
cat: can't open '/sys/module/plat_eq3ccu2/parameters/board_serial': No such file or directory
/etc/init.d/S99eQ3SystemStarted: line 58: can't create /sys/class/leds/power/brightness: nonexistent directory
/etc/init.d/S99eQ3SystemStarted: line 58: can't create /sys/class/leds/power/trigger: nonexistent directory
/etc/init.d/S99eQ3SystemStarted: line 58: can't create /sys/class/leds/internet/trigger: nonexistent directory
/etc/init.d/S99eQ3SystemStarted: line 58: can't create /sys/class/leds/info/trigger: nonexistent directory
insmod: can't insert '/opt/mh/tun.ko': Operation not permitted
System startedOK
Done starting CCU2 init scripts

Register trap for SIGTERM
sending incremental file list
etc/config/
etc/config/netconfig
etc/config/rfd.conf
etc/config/addons/mh/ids
etc/config/eshlight/mapdb/storage.mapdb.t

sent 4976 bytes  received 108 bytes  10168.00 bytes/sec
total size is 1557950  speedup is 306.44
sending incremental file list

sent 2432 bytes  received 29 bytes  4922.00 bytes/sec
total size is 1557950  speedup is 633.06

Docker-Compose File:

version: "3"
services:
  ccu2:
    image: angelnu/ccu2
    hostname: ccu2
    ports:
      - "2001:2001/tcp"
      - "8086:80/tcp"
    environment:
      PERSISTENT_DIR: /mnt
    volumes:
      - /dev:/dev_org
      - /sys:/sys_org
      - /opt/ccu2/data:/mnt
    restart: always

After that i found that your CCU Version is old so i tried it with an git checkout, changing the version in build.sh like you described in the readme and executed build.sh but it failed with following error:

Extract UBI image from tarball

Extract UBI image content
Cloning into 'ubi_reader'...
remote: Counting objects: 567, done.
remote: Compressing objects: 100% (31/31), done.
remote: Total 567 (delta 12), reused 19 (delta 5), pack-reused 531
Receiving objects: 100% (567/567), 205.43 KiB | 146.00 KiB/s, done.
Resolving deltas: 100% (312/312), done.
Checking connectivity... done.
Traceback (most recent call last):
  File "ubi_reader/scripts/ubireader_extract_files", line 29, in <module>
    from ubireader.ubifs import ubifs
  File "/opt/ccu2/src/docker-ccu2/build/ubi_reader/ubireader/ubifs/__init__.py", line 24, in <module>
    from ubireader.ubifs import nodes, display
  File "/opt/ccu2/src/docker-ccu2/build/ubi_reader/ubireader/ubifs/nodes.py", line 20, in <module>
    from ubireader.ubifs.misc import parse_key
  File "/opt/ccu2/src/docker-ccu2/build/ubi_reader/ubireader/ubifs/misc.py", line 19, in <module>
    import lzo
ImportError: No module named lzo

I will try some other things but it would be great if you can lend an eye or so and get me this thing to work like it should.

regards

Munsio commented 7 years ago

found out i forgot something about editing the rfd.conf so i changed it to this:

[Interface 0]
Type = CCU2
ComPortFile = /dev_org/ttyAMA0
AccessFile = /dev/null
ResetFile = /sys_org/class/gpio/gpio18/value

i dont know why but everytime i start the container the lines AccesFile and ResetFile get modified with an # before.

And still the same error

Munsio commented 7 years ago

The # are added in the entrypoint.sh. Then i figured out that you are mapping /dev_org/ttyAMA0 to /dev/mmd_bidcos so i changed the ComPortFile to /dev/mmd_bidcos but still no luck.

Could it be that i roasted something during soldering?

omo2002 commented 7 years ago

same thing with the latest image from https://hub.docker.com/r/angelnu/ccu2/. I don't think it is a hardware problem. I have an elder docker ccu2 image which works. What I found out:

with the working container I can do this successfully: echo "0" > /sys/class/gpio/gpio18/value and the value really changes

doing this with the latest image I get: sh: can't create /sys/class/gpio/gpio18/value: Read-only file system

Any ideas ?

omo2002 commented 7 years ago

update: having written my prevoius comment, I tried to do echo "0" > /sys_org/class/gpio/gpio18/value and it worked.

So I changed the entrypoint.sh and tried again, without success. Problem seems to be rfd, which starts correct now (after the change), but dies after some seconds.

angelnu commented 7 years ago

Hi,

with the new docker image you need additional binds in the docker compose file for sys and dev. Mine looks like this:

ccu2: image: angelnu/ccu2 volumes:

angelnu commented 7 years ago

If you want to build the docker image yourself you need to install python-lzo on your system. Usually this should be handled by build.sh but I guess it does not work on your OS.

build.sh contains: python -mplatform | grep -qi Ubuntu && apt-get update && apt-get install python-lzo || true python -mplatform | grep -qi ARCH && apt-get update && pip2 install python-lzo || true

So what is the output from python -mplatform on your system?

angelnu commented 7 years ago

@Munsio could you please let me know what do you get on your system when you execute "python -mplatform" ? Without this I do not know why lzo did not get installed.

Munsio commented 7 years ago

we can close this issue i'm using the official raspbian instead hypriotOS and i don't want to build the image cause you provided a new one