 -                        sed -i 's/\[Interface 0\]/Improved\ Coprocessor\ Initialization\ =\ true\n\n&/' /etc/config/rfd.conf || true
 -                fi
 -	fi
-+	if [ ! -e /var/etc/rfd.conf ] ; then
-+		cp $CFG_TEMPLATE_DIR/rfd.conf /var/etc/
++		cp $CFG_TEMPLATE_DIR/rfd.conf /etc/config/rfd.conf
 +  fi
  
 -        # Bug fix

-                echo "Copy rfd files"
-		cp $CFG_TEMPLATE_DIR/rfd.conf /etc/config
-        fi
+  source /var/ids 2>/dev/null
+  if [[ ${HM_MODE} != "HmIP" ]]; then
+		sed -i 's/^ComPortFile = \/dev\/.*$/ComPortFile = \/dev\/ttyAMA0/' /var/etc/rfd.conf
+  fi
 
 	if [ ! -e /etc/config/syslog ] ; then
 		cp $CFG_TEMPLATE_DIR/syslog /etc/config
@@ -43,14 +35,14 @@
 
 waitStartupComplete() {
     echo -n "Waiting for rfd to get ready"

 		then
             echo "rfd is ready now."
             break
