SynGreis
Posts: 17
Joined: Tue Nov 07, 2017 6:26 am

Pi with blockchain tech

Sat Dec 09, 2017 2:05 pm

I am trying to achieve having a program that can interact with blockchain for the purposes of performing a transaction.

I also wont pretend i know a lot about linux and is still learning my way around but is there also a way to shutoff the desktop environment and simply have a GUI to pop up in place of it?

If anyone needs clarification please do not hesitate to ask.

User avatar
topguy
Posts: 4239
Joined: Tue Oct 09, 2012 11:46 am
Location: Trondheim, Norway

Re: Pi with blockchain tech

Sat Dec 09, 2017 7:09 pm

I also wont pretend i know a lot about linux and is still learning my way around but is there also a way to shutoff the desktop environment and simply have a GUI to pop up in place of it?
Yes, its multiple ways of doing that but you have to be bit more specific of what kind of GUI and maybe which programming language/gui-framework it uses.

- You dont have to start the X-server at all and then use the framebuffer directly.
- You can start the X-server without starting a desktop environment or even a window-manager.

SynGreis
Posts: 17
Joined: Tue Nov 07, 2017 6:26 am

Re: Pi with blockchain tech

Sat Dec 09, 2017 7:40 pm

im thinking on doing it in java.

I was trying to have it set up as a basic linux distro with no desktop environment. I also plan on having the java code generate a basic GUI like buy/sell and the user would tap on that then brings to the next screen. Can linux still deal with that even without a desktop environment?

User avatar
topguy
Posts: 4239
Joined: Tue Oct 09, 2012 11:46 am
Location: Trondheim, Norway

Re: Pi with blockchain tech

Sat Dec 09, 2017 10:15 pm

Yes, what you are looking for is called "kiosk-mode". And there are of course several ways of achieving this.

Here is one example: https://linuxconfig.org/how-to-run-x-ap ... op-or-a-wm

You must first disable the system from automatic starting the desktop before you can experiment with kiosk-mode.
But you might as well delay this until your have a program actually works in normal desktop mode.

SynGreis
Posts: 17
Joined: Tue Nov 07, 2017 6:26 am

Re: Pi with blockchain tech

Sun Dec 10, 2017 1:15 am

KIOSK MODE!!!!

Thank you very much for those key words. What this will do is boot up straight into the java program correct?

What i can do is slap a hello world with a basic gui as a temp.

But when i tried running it i get the error saying cound not find main class helloWorld...so i made a folder java then

Code: Select all

cd /boot/java/
so i now try to call it.

Code: Select all

java helloWorld
so i get this error.

https://imgur.com/a/s5dSZ

Code: Select all

import javax.swing.JOptionPane; 
public class helloWorld{
	public static void main (String args[]){
		JOptionPane.showMessageDialog(null, "Hello world");
	}
}
i put helloworld right into the root directory in the sd card.
Last edited by SynGreis on Sun Dec 10, 2017 8:51 pm, edited 1 time in total.

SynGreis
Posts: 17
Joined: Tue Nov 07, 2017 6:26 am

Re: Pi with blockchain tech

Sun Dec 10, 2017 5:08 pm

Also my java version from

Code: Select all

java -version
is 1.8.0

SynGreis
Posts: 17
Joined: Tue Nov 07, 2017 6:26 am

Re: Pi with blockchain tech

Sun Dec 10, 2017 8:40 pm

update...

i was finally able to compile it no issues. when i start the startx it works when i run the java code. But if i boot at terminal with no startx it spits out an errorexception in thread main java.swt.headless exception.

I knew that i didnt need the window manager and i wanted to set this up like a kiosk is there any recommendations to get around this?

Code: Select all

Exception in thread "main" java.awt.HeadlessException:
No X11 DISPLAY variable was set, but this program performed an operation which requires it.
        at java.awt.GraphicsEnvironment.checkHeadless(GraphicsEnvironment.java:204)
        at java.awt.Window.<init>(Window.java:536)
        at java.awt.Frame.<init>(Frame.java:420)
        at java.awt.Frame.<init>(Frame.java:385)
        at javax.swing.SwingUtilities$SharedOwnerFrame.<init>(SwingUtilities.java:1758)
        at javax.swing.SwingUtilities.getSharedOwnerFrame(SwingUtilities.java:1833)
        at javax.swing.JOptionPane.getRootFrame(JOptionPane.java:1696)
        at javax.swing.JOptionPane.showOptionDialog(JOptionPane.java:863)
        at javax.swing.JOptionPane.showMessageDialog(JOptionPane.java:666)
        at javax.swing.JOptionPane.showMessageDialog(JOptionPane.java:637)
        at javax.swing.JOptionPane.showMessageDialog(JOptionPane.java:608)
        at helloWorld.main(helloWorld.java:5)

SynGreis
Posts: 17
Joined: Tue Nov 07, 2017 6:26 am

Re: Pi with blockchain tech

Sun Dec 10, 2017 11:09 pm

Got a new issue.

Code: Select all

Error: missing `server' JVM at `/usr/lib/jvm/java-8-openjdk-armhf/jre/lib/arm/server/libjvm.so'.
Please install or use the JRE or JDK that contains these missing components.
E: /etc/ca-certificates/update.d/jks-keystore exited with code 1.
done.
Errors were encountered while processing:
 ca-certificates-java
 openjdk-8-jre-headless:armhf
 openjdk-8-jre:armhf
E: Sub-process /usr/bin/dpkg returned an error code (1)

User avatar
topguy
Posts: 4239
Joined: Tue Oct 09, 2012 11:46 am
Location: Trondheim, Norway

Re: Pi with blockchain tech

Mon Dec 11, 2017 10:34 am

Two suggestions:
- Dont use "/boot" directory for anything. Stick to having stuff in "/home/pi" for a while.
- If you are going to post error messages, also include the command that created them or its impossible to follow whet you are doing.

If there is an X-server started and you are testing your program from ssh, you can set the DISPLAY environment variable to direct your program to the correct X-server.

Code: Select all

export DISPLAY=:0

SynGreis
Posts: 17
Joined: Tue Nov 07, 2017 6:26 am

Re: Pi with blockchain tech

Mon Dec 11, 2017 12:57 pm

YEs i moved it to /home/pi and that was what worked.

I also want the program to pop with a window but without the desktop environment. meaning startx cant be used. Now the simple hello world works fine when launched in desktop or after start x but i dont want all that. I want it as the KIOSK MODE as you would put it.

User avatar
topguy
Posts: 4239
Joined: Tue Oct 09, 2012 11:46 am
Location: Trondheim, Norway

Re: Pi with blockchain tech

Mon Dec 11, 2017 1:12 pm

You still have to start an X-server one way or another, Java needs it to draw your GUI.

I have read that you can override normal behaviour of "startx" by adding which command you want to run as a parameter but have never tried it myself.

Code: Select all

startx "java --blahblah  something/somethingelse.jar"

SynGreis
Posts: 17
Joined: Tue Nov 07, 2017 6:26 am

Re: Pi with blockchain tech

Mon Dec 11, 2017 3:23 pm

i have tried the command

Code: Select all

startx "java helloWorld"
since im already in the directory and this is the errors i got. The java code was compiled and so therefor the helloWorld.class was being called.

Code: Select all

X.Org X Server 1.19.2
Release Date: 2017-03-02
X Protocol Version 11, Revision 0
Build Operating System: Linux 4.9.35-v7+ armv7l Raspbian
Current Operating System: Linux raspberrypi 4.9.41-v7+ #1023 SMP Tue Aug 8 16:00:15 BST 2017 armv7l
Kernel command line: bcm2708_fb.fbwidth=480 bcm2708_fb.fbheight=320 bcm2708_fb.fbswap=1 vc_mem.mem_base=0x3ec00000 vc_mem.mem_size=0x40000000  dwc_otg.lpm_enable=0 console=tty1 console=ttyAMA0,115200 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline rootwait fbcon=map:10 fbcon=font:ProFont6x11 logo.nologo
Build Date: 20 July 2017  09:07:00AM
xorg-server 2:1.19.2-1+deb9u1+rpi1 (https://www.debian.org/support)
Current version of pixman: 0.34.0
        Before reporting problems, check http://wiki.x.org
        to make sure that you have the latest version.
Markers: (--) probed, (**) from config file, (==) default setting,
        (++) from command line, (!!) notice, (II) informational,
        (WW) warning, (EE) error, (NI) not implemented, (??) unknown.
(==) Log file: "/home/pi/.local/share/xorg/Xorg.0.log", Time: Mon Dec 11 15:23:01 2017
(==) Using config directory: "/etc/X11/xorg.conf.d"
(==) Using system config directory "/usr/share/X11/xorg.conf.d"
(EE)
Fatal server error:
(EE) parse_vt_settings: Cannot open /dev/tty0 (Permission denied)
(EE)
(EE)
Please consult the The X.Org Foundation support
         at http://wiki.x.org
 for help.
(EE) Please also check the log file at "/home/pi/.local/share/xorg/Xorg.0.log" for additional information.
(EE)
(EE) Server terminated with error (1). Closing log file.
xinit: giving up
xinit: unable to connect to X server: Connection refused
xinit: server error
Couldn't get a file descriptor referring to the console
and the log file that was generated is this

Code: Select all

pi@raspberrypi:~/java $ mkdir
mkdir: missing operand
Try 'mkdir --help' for more information.
[  1872.328]
X.Org X Server 1.19.2
Release Date: 2017-03-02
[  1872.328] X Protocol Version 11, Revision 0
[  1872.328] Build Operating System: Linux 4.9.35-v7+ armv7l Raspbian
[  1872.328] Current Operating System: Linux raspberrypi 4.9.41-v7+ #1023 SMP Tue Aug 8 16:00:15 BST 2017 armv7l
[  1872.328] Kernel command line: bcm2708_fb.fbwidth=480 bcm2708_fb.fbheight=320 bcm2708_fb.fbswap=1 vc_mem.mem_base=0x3ec00000 vc_mem.mem_size=0x40000000  dwc_otg.lpm_enable=0 console=tty1 console=ttyAMA0,115200 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline rootwait fbcon=map:10 fbcon=font:ProFont6x11 logo.nologo
[  1872.328] Build Date: 20 July 2017  09:07:00AM
[  1872.328] xorg-server 2:1.19.2-1+deb9u1+rpi1 (https://www.debian.org/support)
[  1872.329] Current version of pixman: 0.34.0
[  1872.329]    Before reporting problems, check http://wiki.x.org
        to make sure that you have the latest version.
[  1872.329] Markers: (--) probed, (**) from config file, (==) default setting,
        (++) from command line, (!!) notice, (II) informational,
        (WW) warning, (EE) error, (NI) not implemented, (??) unknown.
[  1872.329] (==) Log file: "/home/pi/.local/share/xorg/Xorg.0.log", Time: Mon Dec 11 15:23:01 2017
[  1872.332] (==) Using config directory: "/etc/X11/xorg.conf.d"
[  1872.333] (==) Using system config directory "/usr/share/X11/xorg.conf.d"
[  1872.338] (==) No Layout section.  Using the first Screen section.
[  1872.338] (==) No screen section available. Using defaults.
[  1872.338] (**) |-->Screen "Default Screen Section" (0)
[  1872.338] (**) |   |-->Monitor "<default monitor>"
[  1872.345] (==) No device specified for screen "Default Screen Section".
        Using the first device section listed.
[  1872.345] (**) |   |-->Device "Allwinner A10/A13/A20 FBDEV"
[  1872.345] (==) No monitor specified for screen "Default Screen Section".
        Using a default monitor configuration.
[  1872.345] (==) Automatically adding devices
[  1872.345] (==) Automatically enabling devices
[  1872.345] (==) Automatically adding GPU devices
[  1872.345] (==) Max clients allowed: 256, resource mask: 0x1fffff
[  1872.347] (WW) The directory "/usr/share/fonts/X11/misc" does not exist.
[  1872.347]    Entry deleted from font path.
[  1872.347] (WW) The directory "/usr/share/fonts/X11/cyrillic" does not exist.
[  1872.347]    Entry deleted from font path.
[  1872.348] (WW) The directory "/usr/share/fonts/X11/75dpi/" does not exist.
Again im not sure if that would be a valid line but i have very little experience so i am unsure how to tell if its even the wrong syntax

User avatar
topguy
Posts: 4239
Joined: Tue Oct 09, 2012 11:46 am
Location: Trondheim, Norway

Re: Pi with blockchain tech

Mon Dec 11, 2017 4:11 pm

But if you run "startx" without any parameters it starts Ok as user "pi" ?

There is probably a trick here I dont know about, you could try with "sudo startx etcetc..".

SynGreis
Posts: 17
Joined: Tue Nov 07, 2017 6:26 am

Re: Pi with blockchain tech

Mon Dec 11, 2017 4:19 pm

when i startx normally it loads the desktop environment.

When i run the script from putty i get the display error. When i run it on the pi itself with desktop in terminal it works great. When i run it on my windows machine it works fine. When i try to run it in terminal before startx it gives a display error. The script is fine. Its as basic as you can get.

https://www.ibm.com/developerworks/comm ... n7?lang=en

I am also trying to figure out where

Code: Select all

-Djava.awt.headless=true
goes to.

SynGreis
Posts: 17
Joined: Tue Nov 07, 2017 6:26 am

Re: Pi with blockchain tech

Tue Dec 12, 2017 8:45 pm

Bumpidy BUMP BUMP.

Still trying to load a simple hello world without desktop environment and/or KIOSK mode. It compiles fine and runs fine with desktop environment.

SynGreis
Posts: 17
Joined: Tue Nov 07, 2017 6:26 am

Re: Pi with blockchain tech

Wed Dec 13, 2017 4:49 pm

So i gave up on that way.

i was reading this post ==> http://www.instructables.com/id/Setting ... Appliance/

And this is what im going for. instead of the web browser loading i just want it to run my java file.

But the problem is is how do change all those permissions on the user via command line? I dont see a user interface for this verison.

User avatar
topguy
Posts: 4239
Joined: Tue Oct 09, 2012 11:46 am
Location: Trondheim, Norway

Re: Pi with blockchain tech

Wed Dec 13, 2017 5:24 pm

Following an ubuntu recipe for Pi might not work out..

There are hewever something similar with the application "kweb" which have a "kiosk" mode.
I see in the thread here: viewtopic.php?t=40860 that there is another thread here:
viewtopic.php?f=66&t=168739#p1084441 that has some tips regarding kiosk mode.

One of the tips is for dealing with denied access to tty0 which was the error when you tried to do "startx".

Code: Select all

Fatal server error:
(EE) parse_vt_settings: Cannot open /dev/tty0 (Permission denied)

SynGreis
Posts: 17
Joined: Tue Nov 07, 2017 6:26 am

Re: Pi with blockchain tech

Wed Dec 13, 2017 6:39 pm

*sigh*.....all i wanted is a kiosk mode. did not expect this to be so hard.

Ofcourse i know this is ubuntu but it was the closest thing i could find.

The links you added is dealing with a browser and browser specific apps...

SynGreis
Posts: 17
Joined: Tue Nov 07, 2017 6:26 am

Re: Pi with blockchain tech

Wed Dec 13, 2017 11:35 pm

Final question. i got ubuntu mate followed these steps ==> http://www.instructables.com/id/Setting ... Appliance/

and im almost done just stuck on step 7. i dont have a "Login Screen" how can i go about this. its the last step.

User avatar
topguy
Posts: 4239
Joined: Tue Oct 09, 2012 11:46 am
Location: Trondheim, Norway

Re: Pi with blockchain tech

Thu Dec 14, 2017 9:31 am

SynGreis wrote:
Wed Dec 13, 2017 6:39 pm
The links you added is dealing with a browser and browser specific apps...
I would claim that the second link doesnt imply what the "kiosk" application is and could be anything.
I unfortunatly don't have the possibilities to test different things with you at the moment.

Return to “Beginners”

Who is online

Users browsing this forum: B-Man and 30 guests