Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pine64 Support #93

Closed
ThomDietrich opened this issue Feb 11, 2017 · 64 comments
Closed

pine64 Support #93

ThomDietrich opened this issue Feb 11, 2017 · 64 comments

Comments

@ThomDietrich
Copy link
Member

I'm in the process of building an openHABian pine64 image.
@kaikreuzer @dmcwhinnie

Progress so far:

Good news: A first test did already set up and install a working openHAB!

@ThomDietrich
Copy link
Member Author

ThomDietrich commented Feb 11, 2017

First build successful. Flashing now...

@dmcwhinnie
Copy link

Purchased a new SD card this week, so ready to test when you are...

@ThomDietrich
Copy link
Member Author

The image is almost finished. The next step will be modifications and improvements inside the openhabian setup. That's easier. @dmcwhinnie I'd be happy to provide you with a first image in a few hours.

@dmcwhinnie
Copy link

dmcwhinnie commented Feb 12, 2017 via email

@kaikreuzer
Copy link
Member

Started flashing my SD card :-)

One drawback to the RPi net-installer is that the extracted image is 4GB, so initial flashing takes much longer.

@ThomDietrich
Copy link
Member Author

Indeed :) One does appreciate that after a while.

Sadly there was a small error in the image, you will not have much fun with it. Give me a few seconds.
It would be great to have a few testers in the next few days.

@kaikreuzer
Copy link
Member

Ok, cancelling the flashing...
Will be happy to test any further updates!

@ThomDietrich
Copy link
Member Author

ThomDietrich commented Feb 13, 2017

Finally here we go! https://drive.google.com/drive/folders/0B67AyLNQlS3dYzJEbGtBOUdmTTg?usp=sharing
The setup process seems to be stable now. It will be a bit simpler as soon as the pine image build project accepted three PRs of mine. Okay, currently there are two problems:

  1. The first boot seems to need a bit longer to provide network connectivity, the second boot will then successfully start and finish the openHABian setup. After that you'll have (most obvious) the openHABian login screen and everything else, just like with the RPi. check the progress: grep rc.local /var/log/syslog.

  2. Zulu Embedded doesn't work 😢 I've tracked it down to the absence of /lib/ld-linux-armhf.so.3, which was already discussed here, which I didn'T want to go through now. It's late enough and I hope @kaikreuzer knows the solutions to that little problem :)

Happy Hacking!

@dmcwhinnie
Copy link

dmcwhinnie commented Feb 13, 2017

First install looks good! To fix the armhf library issue, these steps need to be added.

# Add armhf architecture
dpkg --add-architecture armhf
#verify
dpkg --print-foreign-architectures
#update source
apt-get update
#Install required armhf binaries
apt-get install libc6:armhf libncurses5:armhf libstdc++6:armhf

Once I did that, I was able to start openHAB. Reboot started everything automatically. Note, I can't find the source I found that information, so it may be possible that we don't need all 3 libraries for Java to work. All I have in my notes is to install all 3. 😊

I also did some basic tests with samba, z-wave addon installed, and detected the zwave module shipped with the original IOT Pine 64 shipments.

@kaikreuzer
Copy link
Member

Err, stupid question: What is the default user to log in with?

@ThomDietrich
Copy link
Member Author

I found a solution to the first problem (not in the image yet, so you will have to reboot once) and can confirm that the steps as described by @dmcwhinnie do the job (Thanks!).

@kaikreuzer ubuntu:ubuntu ;D

@kaikreuzer
Copy link
Member

Ah :-) Needs to be changed 😎

@kaikreuzer
Copy link
Member

Just FTR: Whatever I execute, I see many of these warnings:

perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
	LANGUAGE = (unset),
	LC_ALL = (unset),
	LC_CTYPE = "UTF-8",
	LANG = "C"
    are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").

@ThomDietrich
Copy link
Member Author

I had longer discussions about that before. till now we decided to stay with the default password (e.g. pi:raspberry) but ask the user to change it: https://github.com/openhab/openhabian/blob/pine64-build/openhabian-setup.sh#L1006-L1042 - This routine is called whenever a user exits sudo openhabian-config.

@ThomDietrich
Copy link
Member Author

ThomDietrich commented Feb 13, 2017

Ah, setting locale was one of the last things I automated yesterday. Didn't ensure it's running smoothly... https://github.com/openhab/openhabian/blob/pine64-build/openhabian-setup.sh#L149-L158

@kaikreuzer
Copy link
Member

till now we decided to stay with the default password

I was also hoping for a different user, like e.g. "openhab" instead of "ubuntu". But I see that this won't work for e.g. the netinstaller that isn't under our control. And nothing to urgent for sure. But on the long run, it would be neat to have the same user on any openHABian installation and not different once depending on whether you run it on pi or pine.

@kaikreuzer
Copy link
Member

Regarding Zulu JDK, all I needed to make it work was:

dpkg --add-architecture armhf
apt-get update
apt-get install libc6:armhf 

@dmcwhinnie Are libncurses5:armhf& libstdc++6:armhf really required as well?

@ThomDietrich I also found the solution for the font issue! It is as simple as installing fontconfig:armhf!

@kaikreuzer
Copy link
Member

Configuring the Z-Wave board as /dev/ttyS2 also directly worked without any further tweaking - so overall, I agree with @dmcwhinnie: Great work so far! 👍

@dmcwhinnie
Copy link

@kaikreuzer Are libncurses5:armhf& libstdc++6:armhf really required as well?

I never confirmed all 3 were required. I had found the information somewhere, in the past, which said all 3 were needed. Once I had it working, I never went back to fully confirm if all 3 were needed. I suspect only the 1 is needed, and your setup seems to confirm.

@ThomDietrich
Copy link
Member Author

But I see that this won't work for e.g. the netinstaller that isn't under our control.
same user on any openHABian installation

Oh but it is 😃 I just decided to set it to pi/ubuntu for now. You see, in the beginning of openHABian I wanted a "hassle-free" start, which includes being able to log in with the password RPi users with little or no Linux experience know: raspberry. Now with possibly more and more platforms supported I'd agree, one username:password would be nice.
Are you sure about the openhab user? That's the system user openHAB is running under. It's not a good practice to user system users as interactive/sudo users... How about "openhabian" or "hab" or "enthusiast"

@kaikreuzer
Copy link
Member

Are you sure about the openhab user?

Well, it would be in line with our docs for manual setup.

@kaikreuzer
Copy link
Member

Or do you mean we should actually have two users? "openhab" for running the service and then an admin/sudo user for manual logins?

@ThomDietrich
Copy link
Member Author

ThomDietrich commented Feb 13, 2017

@kaikreuzer could you please provide me with one example command to provoke the locale warning...

Regarding Zulu JDK

Thanks. Turns out all I missed in my late nighter yesterday was the apt update 😅

I also found the solution for the font issue! It is as simple as installing fontconfig:armhf!

Amazing. Do I still need to confirm this on the RPi?

Configuring the Z-Wave board as /dev/ttyS2 also directly worked without any further tweaking

You mean inside openHAB? No changes on system side needed? Perfect!

I never went back to fully confirm if all 3 were needed

Okay then, I'll add the one and it's good that all three of them are mentioned here in case of later problems.

I agree with @dmcwhinnie: Great work so far! 👍

Gracias :)

To summarize: I'll build a new image this evening. It will include:

  • first boot fix
  • libc6:armhf for Zulu
  • fontconfig:armhf for charts
  • corrected locale settings

I'll also work on a fix for FireMotD to detect the pine64 platform.

It would also be nice to have the on-board LED blink after the setup was successfully finished (just as with the RPi - @kaikreuzer @dmcwhinnie the pine I got from Kai (Thanks again!) is a prototype and doesn't have a status LED. Meaning this would be up to you to figure out. If something like this is not easily available, We can ignore that for now. It's just nice to have and not necessary.

@ThomDietrich
Copy link
Member Author

ThomDietrich commented Feb 13, 2017

Well, it would be in line with our docs for manual setup.

sudo adduser --system --no-create-home --group --disabled-login openhab

This is a system user without (ssh) login ;)

Or do you mean we should actually have two users? "openhab" for running the service and then an admin/sudo user for manual logins?

Yup, that's how something like this is normally done. Linux users like "openhab" or "www-data" should be reasonably restricted. The end user should have his own interactive user with unrelated privileges. The fact that some users give openhab sudo is another story 💩 😉

@kaikreuzer
Copy link
Member

This is a system user without (ssh) login ;)

Ok, then I would go for "openhabian".

could you please provide me with one example command to provoke the locale warning...

It e.g. happens when doing apt-get installs like

sudo apt-get install fontconfig:armhf

Do I still need to confirm this on the RPi?

It has already been confirmed to be working here. What might be good is to check the minimal requirement. It might be enough to install libfontconfig1:armhf - we might not need the "full" fontconfig. Likewise, I had installed ttf-dejavu for my first tests, so I am not sure whether this is required or not.

You mean inside openHAB? No changes on system side needed? Perfect!

Yes, inside openHAB.

@ThomDietrich
Copy link
Member Author

Ok, then I would go for "openhabian".

The shell will look like this:

[20:15:28] openhabian@openHABianPine64:~$

Maybe we can come up with something nicer?

Building new image, including libc6:armhf libfontconfig1:armhf and the first boot fix.

@dmcwhinnie
Copy link

dmcwhinnie commented Feb 13, 2017

For the status LED, looks like it is doable based on this
https://gist.github.com/pfeerick/00b04df3ce65979158b117b4e1f7c168
and
http://forum.pine64.org/showthread.php?tid=2234

The issue I see is that this is a script running in a loop, so would have to spawn something and keep it running in the background. Not quite as clean as the PI for causing it to heartbeat.

I should add, that this is for the "Power" LED, I believe the board also as spot for an additional LED, but mine doe not have that one. So if that is what you are thinking, I don't have that either.

@kaikreuzer
Copy link
Member

Maybe we can come up with something nicer?

Maybe some shorter hostname? openHABPine? PineHAB?

@ThomDietrich
Copy link
Member Author

ThomDietrich commented Feb 14, 2017

Here we go. I've uploaded a new image to test. Changes since yesterday:

  • Changed username:password to openhabian:openhabian
  • Added libc6:armhf for Zulu - tested!
  • Added libfontconfig1:armhf for charts - tested!
  • Improved boot up readiness test
  • Removed two steps from the build that were merged in the used project today
  • Make sure openHAB is started after being installed
  • Checked locale setting: everything seems to be in order.

The bootup time from power to openHAB Initial Setup screen was around 12 minutes btw.

https://drive.google.com/file/d/0B67AyLNQlS3dVjYwWlAxOV9CVTg/view?usp=sharing

I'm satisfied with the base now. @kaikreuzer @dmcwhinnie @umiddelb please give it a full test spin! 😉 Things still on the TODO list:

  • FireMotD interface & platform info
  • The menu needs to be rid of the RPi specific entries (can not be executed)
  • Mosquitto (besides others?) is not installed successfully.
  • Maybe other options and programs will fail or need setting up

Regarding the username:password: I would like to use something less boring and maybe a bit cheerful. How do you like enthusiast:smarthome or smart:home? Whoever is reading this, please give your vote ;)

@umiddelb I've read your mail today but as you can see I'm currently a bit busy. I'll answer you soon!

@kaikreuzer: While testing the chart, I encountered two usability issues. 1) Basic UI doesn't show the "Choose your sitemap" link list, where did it go? 2) the difference between Configuration and Preferences is unclear/un-intuitive. Also I was confused that the pre-configured sitemap for Basic UI is still called "_default". Might be time to call it "default"? We don't have to discuss these in detail here, if you think it's worth to look into I can open new issues.

@dmcwhinnie
Copy link

I like smart:home. With my typing skills I'll never get enthusiast right each time....

I'll let you know how the testing goes...

@ThomDietrich
Copy link
Member Author

FireMotD problems are fixed. OutsideIT/FireMotD#34, OutsideIT/FireMotD#35
Looking into the "zulu thing" now @kaikreuzer

@ThomDietrich
Copy link
Member Author

I'll send a mail with my findings tomorrow. The short version: Läuft

@ThomDietrich
Copy link
Member Author

ThomDietrich commented Feb 16, 2017

The End Is Nigh.

  • Zulu Embedded is now installed from repository (should work on Pine, Pi and Debian) (Charts are working)
  • FireMotD PRs are merged. The login screen is now clean and correct
  • Wifi setups now also covers the Pine, the firmware is only installed on RPi @dmcwhinnie
  • A PR for documentation is available

I will do one last important test this evening: RPi compatibility. If this is successful, I'm ready to merge and upload new releases. After a few days I'll mark this point with a new version number.

Open todos: validate pine64_platform_scripts execution, modify file permissions, check Mosquitto install, rearrange menu entries, change username:password.

Any comments?

@kaikreuzer
Copy link
Member

Let me know once you have a new image available for testing!

@ThomDietrich
Copy link
Member Author

@kaikreuzer
Copy link
Member

Downloading ⏳

@ThomDietrich
Copy link
Member Author

ThomDietrich commented Feb 17, 2017

In my eyes it's finished, All improvements that might still be needed are unrelated to the base image.
Last tow changes would be switching from development branch to master and setting the default password

@kaikreuzer
Copy link
Member

FYI, when running apt-get upgrade I still see the locale warnings:

Get:1 https://openhab.jfrog.io/openhab/openhab-linuxpkg unstable/main arm64 openhab2 all 2.1.0~20170216144237-1 [53.2 MB]
Fetched 53.2 MB in 8s (6345 kB/s)                                                                                                                                                                                                            
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
	LANGUAGE = (unset),
	LC_ALL = (unset),
	LC_CTYPE = "UTF-8",
	LANG = "C"
    are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
	LANGUAGE = (unset),
	LC_ALL = (unset),
	LC_CTYPE = "UTF-8",
	LANG = "C"
    are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").

@ThomDietrich
Copy link
Member Author

But why...

My system:

$ locale
LANG=en_US.UTF-8
LANGUAGE=
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_PAPER="en_US.UTF-8"
LC_NAME="en_US.UTF-8"
LC_ADDRESS="en_US.UTF-8"
LC_TELEPHONE="en_US.UTF-8"
LC_MEASUREMENT="en_US.UTF-8"
LC_IDENTIFICATION="en_US.UTF-8"
LC_ALL=

These are the commands supposed to be executed:

# List available locales
cat /usr/share/i18n/SUPPORTED
# Generate locales, set default
/usr/sbin/locale-gen en_US.UTF-8 de_DE.UTF-8
/usr/sbin/update-locale LANG=en_US.UTF-8

@kaikreuzer
Copy link
Member

Does this help?

[15:17:44] ubuntu@openHABianPine64:~$ locale
locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_ALL to default locale: No such file or directory
LANG=en_US.UTF-8
LANGUAGE=
LC_CTYPE=UTF-8
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_PAPER="en_US.UTF-8"
LC_NAME="en_US.UTF-8"
LC_ADDRESS="en_US.UTF-8"
LC_TELEPHONE="en_US.UTF-8"
LC_MEASUREMENT="en_US.UTF-8"
LC_IDENTIFICATION="en_US.UTF-8"
LC_ALL=

@ThomDietrich
Copy link
Member Author

I fear you'll have to investigate. This doesn't make sense to me and I'm not seeing these issues on my* Pine.

What happens after LC_CTYPE="en_US.UTF-8"?

@kaikreuzer
Copy link
Member

Everything fine then:

[16:06:58] ubuntu@openHABianPine64:~$ LC_CTYPE="en_US.UTF-8"
[16:07:04] ubuntu@openHABianPine64:~$ locale
LANG=en_US.UTF-8
LANGUAGE=
LC_CTYPE=en_US.UTF-8
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_PAPER="en_US.UTF-8"
LC_NAME="en_US.UTF-8"
LC_ADDRESS="en_US.UTF-8"
LC_TELEPHONE="en_US.UTF-8"
LC_MEASUREMENT="en_US.UTF-8"
LC_IDENTIFICATION="en_US.UTF-8"
LC_ALL=

@ThomDietrich
Copy link
Member Author

https://askubuntu.com/questions/599808/cannot-set-lc-ctype-to-default-locale-no-such-file-or-directory

This same problem (LC_CTYPE=UTF-8, which is wrong) can happen when you login over ssh from a Mac to a linux box, and your terminal automatically sets environment variables. There's a checkbox for that. Uncheck it, and you're good to go. In iTerm it's in the profile->Terminal Tab.

At least an explanation...

@ThomDietrich
Copy link
Member Author

Could you please try the following and reconnect/reboot:

/usr/sbin/update-locale LC_CTYPE="en_US.UTF-8" LC_ALL="en_US.UTF-8" LANG="en_US.UTF-8"

@kaikreuzer
Copy link
Member

That solves the issue!

@ThomDietrich
Copy link
Member Author

Amazing ✨ Thanks Kai ;)

I'll do the last changes today and then release both new images. I'll do announcement in the openHABian thread as usual.

@kaikreuzer
Copy link
Member

Besides the locale, everything looks really good!
I tried a lot of stuff, including charts, Z-Wave, etc - all working like a charm.
Awesome work, @ThomDietrich!

@dmcwhinnie
Copy link

Yay! Good to hear! I think this will close out these 3 issues too.
57,58,66

@umiddelb
Copy link

I've tried the latest image (openhabianpine64-2017021801-git088eb4e.img). Concerning the locale issue, there is still a mismatch between the default setting (en_GB.UTF-8) and the locales to be generated by default (en_US.UTF-8). Either you switch to en_US.UTF-8 or just enable en_GB.UTF-8 in /etc/locale.gen.

@ThomDietrich
Copy link
Member Author

@umiddelb I'm afraid I do not understand. There is no en_GB

https://github.com/openhab/openhabian/blob/master/build-pine64-image/openhabian.pine64.conf

@ThomDietrich
Copy link
Member Author

ThomDietrich commented Feb 18, 2017

@umiddelb
Copy link

@umiddelb I'm afraid I do not understand. There is no en_GB

I see. en_GB.UTF-8 is my default locale on the box I use to login to the Pine64.
I've noticed that the file /etc/default/locale is empty on the Pine64, so sshd obviously takes the locale settings from the system where I come from

After

sudo update-locale LC_ALL="en_US.UTF-8" LANG="en_US.UTF-8" LC_MESSAGES=POSIX

the locale setting in pinned to en_US.UTF-8 on the Pine64.

@ThomDietrich
Copy link
Member Author

Hm okay... that's exactly what I'm doing. See #93 (comment)

Just tested on my device:

[14:44:37] openhabian@openHABianPine64:~$ locale
LANG=en_US.UTF-8
LANGUAGE=en_US.UTF-8
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_PAPER="en_US.UTF-8"
LC_NAME="en_US.UTF-8"
LC_ADDRESS="en_US.UTF-8"
LC_TELEPHONE="en_US.UTF-8"
LC_MEASUREMENT="en_US.UTF-8"
LC_IDENTIFICATION="en_US.UTF-8"
LC_ALL=en_US.UTF-8
[14:44:41] openhabian@openHABianPine64:~$ cat /etc/default/locale
#  File generated by update-locale
LANGUAGE=en_US.UTF-8
LC_ALL=en_US.UTF-8
LANG=en_US.UTF-8
LC_CTYPE=en_US.UTF-8

@umiddelb
Copy link

May be I've taken the wrong image, /etc/default/locale is empty in openhabianpine64-2017021801-git088eb4e.img

@ThomDietrich
Copy link
Member Author

Nope that's the one. Should be filled after executing "Basic Setup" once. However that's part of the initial setup... Could you open a new issue please!?

@umiddelb
Copy link

The first-boot.sh failed last time for unknown reason (I got a notification on the console, but I didn't retain first-boot.log, unfortunately). This time first-boot.sh completes the setup without any error.

@ThomDietrich
Copy link
Member Author

ThomDietrich commented Feb 18, 2017

But then... you should have seen this message: http://docs.openhab.org/installation/openhabian.html#faq-successful ?? (Just realized, that the tip in the middle is only valid for the RPi)

@umiddelb
Copy link

Hm, when I logged in via ssh, I've seen the usual Ubuntu banner, not the customized one. And I'm pretty sure that I didn't get the extensive error message on the console.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants