openHABian hassle-free openHAB Setup

Let’s make a step back.

You seem to have only little linux knowhow, which is okay (!) because openHABian is here because home automation enthusiasts should not concern themselves with a whole new operating system.

That’s why openHABian installs and configures Samba by default. You can find all you need to know here. You will find two shares of which only the config folder is of real relevance for now. Mount the share by assigning a drive letter and voila you can freely edit all configuration files from your Windows machine (with notepad or preferably something “better”). Remember to look into the SmartHome Designer as well.

Regarding your original question: Your nano command should have been something like nano /etc/openhab2/items/home.items

If you want to learn about linux, I can highly recommend https://linuxjourney.com

i have used linux with the rpi for over a year now, for oh1 and oh2. i am not an expert by any means, but have never used it headless before; always through the gui and been able to find my file locations via it, which is why i asked early on about a gui.

Ah right, sorry I forgot about that.

Has anybody been able to get the GPIO binding to work with openhabian? I am trying and it doesn’t seem to work. I followed directions for setting up a simple sitemap/items from here:

In /var/log/openhab2/events.log I have the following entries.
2016-09-28 11:15:21.605 [ItemCommandEvent ] - Item ‘RaspiLED’ received command OFF
2016-09-28 11:15:21.612 [ItemStateChangedEvent ] - RaspiLED changed from ON to OFF
2016-09-28 11:15:22.686 [ItemCommandEvent ] - Item ‘RaspiLED’ received command ON
2016-09-28 11:15:22.692 [ItemStateChangedEvent ] - RaspiLED changed from OFF to ON

My entry in Pool.items
//------------------------------------------------------------------------
// Raspberry Pi
// GPIO
//------------------------------------------------------------------------
Switch RaspiLED{ gpio=“pin:17” }

pin 17 the way I am reading this is GPIO17 (pin 11). Which is hooked up and works with a python script I wrote.

I believe the problem is that openhabian didn’t include the gpio group in the build and my openhab is running as openhab not root (so openhab has no access to gpio…needs to either be included in the non-existant gpio group or added to root).

Yes, you need the right privileges. https://github.com/openhab/openhab/wiki/GPIO-Binding#installation
You could switch to root once as proof of concept.
Regarding the gpio group: I’m not sure why it is not there and how you could use it. Would you consider trying to create one and then working through this: http://raspberrypi.stackexchange.com/questions/40105/access-gpio-pins-without-root-no-access-to-dev-mem-try-running-as-root

Hello @KjetilA,
a short update on that topic. Here are the steps to get InfluxDB up and running: https://github.com/ThomDietrich/openhabian/blob/master/openhabian-setup.sh#L493-L501

The second part is the installation of Grafana. There was a mentioning regarding this over in the InfluxDB+Grafana thread but I didn’t get it to work. @fg2it thanks for the detailed instructions in your github README. I was not able to get the binaries installed on my ARMv6 architecture RPi1, neither did I get the build process to finish without errors. Maybe @KjetilA could test the binaries on ARMv7. I would be okay with binaries only for ARMv7 as the RPi 1 is not officially recommended for the use with openHAB and will be used less and less.

Thom…thanks for your reply. I did sudo adduser openhab root to add openhab to the root group as a test and rebooted. Get a different error now…

2016-09-28 11:42:18.894 [ERROR] [ab.binding.gpio.internal.GPIOBinding] - Error occured while creating backend object for item RaspiLED, exception: /sys/class/gpio/export

[11:44:07] pi@openHABianPi:/var/log/openhab2$ ls -la /sys/class/gpio
total 0
drwxr-xr-x 2 root root 0 Sep 28 11:45 .
drwxr-xr-x 48 root root 0 Dec 31 1969 …
–w------- 1 root root 4096 Dec 31 1969 export
lrwxrwxrwx 1 root root 0 Dec 31 1969 gpiochip0 -> …/…/devices/platform/soc/3f200000.gpio/gpio/gpiochip0
lrwxrwxrwx 1 root root 0 Dec 31 1969 gpiochip100 -> …/…/devices/platform/soc/soc:virtgpio/gpio/gpiochip100
–w------- 1 root root 4096 Dec 31 1969 unexport

I think I am going to do a new build of openhabian and start from scratch. I will document the components that are missing (compared to a NOOBS build) that might be related to issues using GPIO.

Sorry I was not clear enough. My binary are for raspberry pi 2 : I tested them on this hardware with wheezy and jessie (but the one I linked was reported to work on raspberry pi 3 too on an other forum).
Build instructions depend on your distro. Could you provide details on your build platform and the errors you got ?

I wrote a few comments on your commit 497f6bd1.

Hey, thanks for the answer. As I said before, I don’t need grafana on the RPi 1. It’s not the recommended platform for openHAB anyway and honestly not the system I would put it on performance-wise.
InfluxDB+Grafana is a nice addition to an openHAB end user setup and that’s why I want to include both (for RPi2/3, jessie) if possible. It would be preferable if prebuild binaries were used in this process and that’s what you are offering. I’ll upgrade to a RPi3 myself next week and then go through the whole setup process again. If it works as expected, I’ll include installation of your binaries in openHABian and hereby thank you for providing them.

I had problems with both installing your binaries as well as building them on my “Raspberry Pi Model B Plus Rev 1.2”. If you are interested I can go through the process again and provide details, if you are interested in providing a grafana build for ARMv6 ??

Not directly : I don’t have and won’t buy a rpi1. But indirectly, this could be possible. I pushed a PR in grafana to support crossbuild. So, depending on where the build is failing, an armv6 build could be done using this feature.

I also plan to provide the .deb in a more classical way on bintray. In fact I already have debian repo there with grafana v3.1.1 :

sudo apt-get install apt-transport-https
echo "deb https://dl.bintray.com/fg2it/deb jessie main" | sudo tee -a /etc/apt/sources.list
sudo apt-get update
sudo apt-cache madison grafana
#   grafana | 3.1.1-1472506485 | https://dl.bintray.com/fg2it/deb/ jessie/main armhf Packages

Running openhab as root resolves this. Not sure how I feel about it though…

Thom,

Thank you for openHABian! I set up my second RPi3 using this and it works flawlessly.
I’m really looking forward to the new things you’re working on.

What was difficult to me was the wifi configuration on my RPi3. I’ve seen your discussion in this thread, however following it didn’t help - I needed to manually install wifi drivers in order to see “wlan0” on the interfaces list.
I’d love to see seamless wifi configuration option inside openhabian-config and - if possible - ability to have it working without Ethernet cable.

As this topic is getting more and more crowded (158 posts and counting :slight_smile:), maybe it’d be a good idea to start migrating the knowledge from here to project’s wiki page?
I can help!

Thank you again for splendid work.
I hope openHABian will grow as an official channel of openHAB for RaspberryPI users some day.

I think I’ll put this on hold for now. RPi 2/3 is more important in the context here.

That would be a big step forward :thumbsup: is the url you posted the one I can safely start integrating or are you going to change it once more? Just asking because of the “I also plan to provide…”

Hey @kubawolanin,
happy to hear everything went fine. The wifi configuration is one thing definitely in the ToDo list! I’ll look into that as soon as I got the RPi3 I ordered a few days back. Setting up Wifi from within openhabian-config is not going to be a problem, making the whole setup process wireless (that’s what was discussed earlier) is currently out of the scope of openhabian as it’s an issue dealt with over here.

I’ve thought about the future of this thread myself. Whith openHABian soon reaching Version 1.0, I’m planing to close this “beta discussion thread” and create a dedicated category for questions regarding openHABian here in the forum. You are right, that a more in-detail documentation should exist. I was planing to put one next to this article at docs.openhab.org. openHABian will also be transfered out of my personal account into the openhab github organization. This transfer, the documentation and a few small cosmetic changes to the menu are what’s needed before I’m going to release Version 1.0.

That’s great! Regarding the openHABian documentation I’m mostly going to rephrase what’s already posted here and in other places. Of course you can participate in that but let me write a first draft before we talk more. Evaluated at what’s currently available here, which information would you like to additionally include?
Would you be interested in helping out with the docs.openhab.org in general? I can point you to a few articles which need creation or serious rework…

I have tried the steps pointed out above, however, the command as step 4 fails as follows:

chown -R influxdb:influxdb /var/lib/influxdb
chown: cannot access ‘/var/lib/influxdb’: No such file or directory

I guess this is no surprise as the directory (or file) in question is not there.

Is there a missing step that is supposed to create this?

Hmm… It seems it is really the first step - the extraction of the archive - that fails to place the files in the correct locations;
/etc
/usr
/var

Instead it creates a top-level directory called ‘influxdb-1.0.0-1’ where the files are stored.

Oh damn, sorry. I reduced the commands to a minimum and overlooked that detail. Why would they put these three files in another folder. I’ll fix that in my steps, thanks for pointing it out. I received my RPi3 today and will finish the whole InfluxDB+Grafana setup next week. Stay tuned :wink:

I fiddled a little more with this and it seems this works:

curl -L https://dl.influxdata.com/influxdb/releases/influxdb-1.0.0_linux_armhf.tar.gz | tar xvz -C / --strip 2

The ‘–strip 2’ option skips the two first levels of directories inside the archive (it seems it was actually packed with two levels of rubbish in front of the files).

Now it is step 6 that gives an error:

systemctl enable influxdb.service
Failed to execute operation: No such file or directory

I simply did the next (and last) step and it succeeded.

Doing ‘systemctl status influxdb.service’ indicates that the service is running, and the admin web interface is availabel (at port 8083) so all seems to be well! :slight_smile:

Looking a bit closer, the structure inside the archive is actually ./influxdb-1.0.0-1/etc/...:

   .   / influxdb-1.0.0-1 / etc / ...
level1       level2       level3

Somebody did not have enough coffee while inventing this archive :smiley:

Great but is enable still not working? It really should…

Discussion on integrating my.openhab setup in openhabian-config: