openHABian hassle-free openHAB Setup

@ThomDietrich thanks for a quick reply. I just realized, when I maximized the putty window, I got the command line back, but it wasn’t there with a resized window. Tried pressing q without luck, but probably just due to the resize it didn’t work.

Thought it was my error, therefore I deleted the post. How do I get it back again for others reference?
thanks!

I’ve restored it.
Execute “Update” once more and you should be freed from the less pager in the future.

Btw. did you actually read the list of changes? ^^ (I have to admit there are no interesting changes in the screenshot)

Hey,

Not sure if this is the correct venue for this, but I suspect there is a bug in the openhabian-config tool around the Serial Port configuration.

I was banging my head against the wall trying to get a RaZberry board working in my RPi2 and constantly getting the “/dev/ttyAMA0 does not exist” message. I’d applied the appropriate options in openhabian-config but had no luck. Eventually noticed the following output from openhabian-config:

2017-03-26_10:32:19_AEDT [openHABian] Configuring serial console for serial port peripherals…
Adding ‘enable_uart=1’ to /boot/config.txt
Removing serial console and login shell from /boot/cmdline.txt and /etc/inittab
cp: cannot stat ‘/etc/inittab’: No such file or directory
sed: can’t read /etc/inittab: No such file or directory
Adding serial ports to openHAB java virtual machine in /etc/default/openhab2

I verfied that enable-uart=1 was present in config.txt, but noticed that cmdline.txt had not been updated. It still showed:

dwc_otg.lpm_enable=0 console=serial0,115200 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait

Acting on some info in this thread about general Rasbian issues, I removed “console=serial0,115200” from cmdline.txt.

Lo and behold, my RaZbian board is now reporting as Online and it can find the sensors I had previously bound to it in Z-Way.

Is it possible the lines:

cp: cannot stat ‘/etc/inittab’: No such file or directory
sed: can’t read /etc/inittab: No such file or directory

were preventing the cmdline.txt update from also happening?

@lukics There is an “unlimited encryption” package also available for the Zulu VM, see here.

@ThomDietrich I think we cannot install this by default on openhabian due to the additional license/export regulation agreement. But maybe it could be added as an option to the openhabian installer? In there, you can link to a license that the user needs to acknowledge when installing additional stuff, right?

After the installation I’m not able to connect to the Samba network shares with openhabian:openhabian from macOS Sierra.
With connection smb://openhabian@openhabianpi.local, after many seconds Finder tell me to type password for the openhabian user but after many seconds it notifies me an error asking to control server name.
The behavior is the same with the static ip address: smb://192.168.x.x, with RPi connected with both the wifi that the cable.
The same RPi works fine with Windows 10.
I read that there are some incompatibility issues for OS X because Apple discarded Samba.
Are there some workarounds for solve the problem ?

@ThomDietrich: Thank you for your work with openhabian. I love the image and it is very helpful to have a quick start with openhab. Actually I am experimenting a lot with different bindings and configurations. This is the reason why a make a lot of backups and sometimes :slight_smile: I have to restore from these.

I have one suggestion:
Is it possible to add a samba share (e.g. “backup and restore”) and an openhabian-config point where I can first create an backup of the conf and userdata folder. The backup is stored in the samba share under backup, so you can download it to store it somewhere. The second option is to restore from a backup. You can chose a backup outside the backup folder or you can put a backup file/folder inside the samba share from somewhere and restore it. I am not a linux pro and tap every command by hand, but with this “backup and restore” extension life would be a little bit easier for people like me.

Thank you for your work! Have a nice evening

Johannes

It’s already work in progress:

Oh perfect:-), I didn’t take a look to the latest posts on GitHub.

Hi!
first of all thank you great work, helped me a lot in setting up my OH2.
But now i’m struggling. i got a serial pi plus and tried it on a fresh jessie setup. after adding “enable_uart=1” to /boot/config.txt i get this

pi@raspberrypi:~ $ ls -l /dev lrwxrwxrwx 1 root root 7 Mar 29 18:29 serial0 -> ttyAMA0 lrwxrwxrwx 1 root root 5 Mar 29 18:29 serial1 -> ttyS0

but if i do the same thing on my openHABian setup there’s no serial0 nor serial1

[code][pi3]
kernel=vmlinuz-4.4.0-1-rpi2
initramfs initrd.img-4.4.0-1-rpi2 followkernel

enable the serial console for the installed system

enable_uart=1
gpu_mem=16
dtparam=audio=on
dtoverlay=pi3-disable-bt[/code]

i also tried to disable/enable serial settings via openHABian setup, but that’s not helping.
any idea what i can do?

Not entirely sure what you are trying to accomplish. Please check the following article: http://elinux.org/RPi_Serial_Connection#Connection_to_a_microcontroller_or_other_peripheral

i’d lile to use this one https://www.abelectronics.co.uk/p/51/Serial-Pi-Plus with modbus binding.

ls -l /devdoesn’t bring anything with “serial*” up.
i just made a fresh install of newest openHABian and in settings i activated serial and got this msg:

âââââââââââââââââââââââââââ⤠Operation Successful! âââââââââââââââââââââââââââââ â â â All done. After a reboot the serial console will be available via â â /dev/ttyAMA0 or /dev/ttyS0 (depends on your device). â
shouldn’t i see this with ls -l /dev?

with a clean raspian jessi install i get seria0 and serial1.

the link you postet doesn’t help. sudo: raspi-config: command not found
also methods 2 & 3 don’t seem to get me a serial device to use with modbus.

OK, today i used a clean raspian jessie and installed openHABian via git, configured the serial port, added permission and now it finally seems to be working! sadly all me other conf is on the openHABian install - won’t i be able to use serial with the minimal openHABian install?

Hi,
i’m new to the whole homeautomation game and to openHAB.
I downloaded the openhabianpi-raspbian image (~200mb).

Installation and first configuration steps (openhabian-config, first things, first items etc) were as easy as advertised.

So many thanks to ThomDietrich an all involved for their work and time.:clap:

I hit a little bump in the road, when i tried to install mosquitto. I used openhabian-config, entered the password (myPaSSword) for the openhabian user.
sudo systemctl start mosquitto … status mosquitto showed everything up and running.

When i tested a connection with: mosquitto_sub -d -u openhabian -P myPaSSword -t dev/test on the same Pi3
i got an: connection refused.

When i looked at /etc/mosquitto/mosquitto.conf it was broken.

# Place your local configuration in /etc/mosquitto/conf.d/
#
# A full description of the configuration file is at
# /usr/share/doc/mosquitto/examples/mosquitto.conf.example

pid_file /var/run/mosquitto.pid

persistence true
persistence_location /var/lib/mosquitto/

log_dest file /var/log/mosquitto/mosquitto.log

include_dir /etc/mosquitto/conf.d

^[[90;01m$ echo -e
password_file /etc/mosquitto/passwd
allow_anonymous false
^[[39;49;00m

password_file /etc/mosquitto/passwd
allow_anonymous false

After cleaning up (deleting) the two wonky lines, and the double password_file allow_anonymous lines in between, everything is working fine now.

Just wanted to inform the MAKER’S, so someone more knowledgeable then me, can have a look at the script code.

btw. Pi3 is new, 2 weeks old, as is the SD-Card.There should be no corruption yet (i hope :smile:).

Hey @garionth, thanks for reporting this bug (which it is). I’m surprised that 1) I didn’t catch it while adding and testing the authentication feature and 2) you are the first one to report it after 37 days…

I’ve just committed a (tested) bugfix. As always one has to update the openHABian Configuration Tool to receive it.

Thanks for the report!

I saw them and deleted them yesterday too. Sorry for not reporting. It was too after a fresh install of openHabian too if that helps.

Sudo asking for password problem solved

Replace user ‘pi’ with ‘openhabian’ in /etc/sudoers.d/010_pi-nopasswd
from
pi ALL=(ALL) NOPASSWD: ALL
to
openhabian ALL=(ALL) NOPASSWD: ALL

From now on all sudo commands won’t ask for the openhabian password again (that was the default before changing the standard user from ‘pi’ to ‘openhabian’.

Tipp: for more comfort you may run “sudo bash” to run multiple commands as root, but don’t get lazy and know what you are doing!

Changing hostname with openhabian-config does not change all appearances of the hostname

If I change the hostname via openhabian-config the hostname gets changed in /etc/hostname und /etc/hosts, but not in /boot/openhabian.conf and my router/dhcp server knows the raspi under the old name.

Yesterday, I installed a new openHABian. I am using the new dsmr binding with manual configuration and specify the serial port in a .things file. Previously, I used a persistent device name through a udev rule without issues. Now this does not seem to work with openHABian. Using the device /dev/ttyUSB1 fortunately is working, but I’d like to use persistent /dev/dsmr.

What could be wrong?

$ cat /etc/udev/rules.d/50-usb-serial.rules
SUBSYSTEM=="tty", ATTRS{idVendor}=="0403", ATTRS{idProduct}=="6001", ATTRS{serial}=="A5Z5VJCX", SYMLINK+="dsmr"

$ ls -la /dev
lrwxrwxrwx  1 root root           7 Apr  3 10:39 dsmr -> ttyUSB1
crw-rw----  1 root dialout 188,   1 Apr  3 10:39 ttyUSB1

$ cat /etc/group | grep 'dialout'
dialout:x:20:openhabian,openhab

Update: it has nothing to do with the binding. The same applies for the rfxcom binding that is working with /dev/ttyUSB0 and not with /dev/rfxcom.

Perhaps asking for the password is meant a feature, by design, for additional security?

1 Like

Problem with device permissions and razberry board

I use a razberry board and was succesful with installing it an raspbian with openhab. Now with openhabian I ran into problems (it should be the other way around?).
I used the ‘serial port’ setup from openhabian-config to prepare for the razberry.
After reboot I have a symbolic link from /dev/serial0 to /dev/ttyAMA0. Nice. But /dev/ttyAMA0 has the permissions crw_w__ and user root and group tty. So the user openhabian does not have access rights to /dev/AMA0 or /dev/serial0 even it is member of group ‘tty’.
I will try to get it installed by hand as before.