nistegmeier
Posts: 3
Joined: Sat Jun 20, 2015 4:36 pm

[New User] Can Raspberry Pi do this?

Sat Jun 20, 2015 4:39 pm

Hello all,

I haven't used Raspberry Pi before, but I have some programming experience. I think Pi might be a good tool for the application I have in mind.

Basically, I need a display (touch screen or with a keypad) where the user can input parameters. After the user inputs the parameters, they would click a "calculate" button. Pi would then take the user parameters, feed them into an equation, and output the results to the display.

Can Pi do this? How long would it take to learn?

Many thanks,
Nick

Corning-Fibrance
Posts: 1
Joined: Sat Jun 20, 2015 8:43 pm

Re: [New User] Can Raspberry Pi do this?

Sat Jun 20, 2015 9:23 pm

r-pi can do that. Can't guess how long it would take for you to learn this.
I had forgotten that the raspberry comes with mathematica. Stupendous!

Anyway, I suggest to use an existing keyboard/mouse/monitor to set up your rpi,
install vnc, a wireless network device, Edimax seems to work, then use an old cell phone
as the interface. You can then reassign kbd/mouse/monitor back to their original purpose.

remote connection: installed https://www.raspberrypi.org/documentati ... ccess/vnc/
also set up ssh.

I've used python / tkinter to write a GUI for this sort of dedicated system.

1) After reading quite a lot of preliminary material none of it indicated that you need to be root user to set the GPIO pins. Shouldn't have to find an error message to learn that!

2) As root, x11 isn't by default authorized to open a window. Or something like that. I don't think you should have to read the xlib manuals. Once again, stackoverflow or stackexchange rescues us:

root mode needed to access GPIO.

tkinter won't open in root mode.

Solution:
Write these few lines to etc/sudoers*:

Defaults env_reset
Defaults secure_path="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
Defaults env_keep += "DISPLAY"
Defaults env_keep += "XAUTHORITY"
And these few lines to ~/.bashrc:

if [ -z "$XAUTHORITY" ]; then
if [ -e $HOME/.Xauthority ]; then
export XAUTHORITY=$HOME/.Xauthority;
fi;
fi

http://stackoverflow.com/questions/2028 ... al-display
http://raspberrypi.stackexchange.com/qu ... al-display

(all I needed was to append the env_keep += lines. Should you need to learn the vi editor? Well, I'm better with ed, I used $ sudo ed /etc/sudoers ) Maybe gedit is available too. Much lower learning curve.

3) What is a good way to attach to the gpio pins? Soldering seems a bad plan. I've got a rpi model B and cannibalized a 40 pin ribbon cable from the guts of one of those old desk pc's. It fits.

4) I did not easily find the output voltage of GPIO. Nominally 3.3V on RPi 2 Model B V1.1.

Having solved these twoxxxthreexxxfour complaints, I am able to control the flash rate of an LED using my cell phone. I think it took 2 1/2 days, much of that looking for components. I'm grateful that where I live components are easily found. Still, the Radio Shack down the street has closed, store for lease, none of the computer repair shops sell resistors and other assorted single components.

Heater
Posts: 12959
Joined: Tue Jul 17, 2012 3:02 pm

Re: [New User] Can Raspberry Pi do this?

Sat Jun 20, 2015 10:59 pm

Well of course a Pi can do that. It sounds like the most basic thing that computers have been doing for decades.

Now, what programming experience do you have? Where are we starting from here?

If a normal TV or monitor is not what you have in mind as a display the are many small screens that can be used. Have a google around.

User avatar
Mequa
Posts: 172
Joined: Sun Sep 09, 2012 9:54 pm
Location: England
Contact: Website

Re: [New User] Can Raspberry Pi do this?

Sun Jun 21, 2015 12:32 am

You can do that with a bit of simple Python (or a variant of BASIC if you want to go old-school). There are many tutorials available.

Clicking buttons to calculate also requires building a simple GUI. It's often easier to begin with simple command line input when building such a program, then add a GUI later.

There are touch screens available, but they are the more expensive option compared with a keyboard and mouse.

User avatar
KnightOfPi
Posts: 49
Joined: Sun Dec 28, 2014 12:57 pm
Location: Vienna - Austria
Contact: Website

Re: [New User] Can Raspberry Pi do this?

Sun Jun 21, 2015 4:56 pm

Hello,

for a Graphical User Interface on a touchscreen-only-device,
a Browser-Based solution using WebIOPi may be the most easy way to build such an application:
http://www.knight-of-pi.org/webiopi-a-s ... pberry-pi/

Additionally, you will need to configure the Raspberry Pi to open the WebIOPi interface after booting,
which should not be complicated.
Last edited by KnightOfPi on Thu Sep 17, 2015 6:35 pm, edited 1 time in total.
Check out www.knight-of-pi.org for many beginner-friendly tutorials!

nistegmeier
Posts: 3
Joined: Sat Jun 20, 2015 4:36 pm

Re: [New User] Can Raspberry Pi do this?

Fri Jun 26, 2015 2:03 am

Heater wrote:Well of course a Pi can do that. It sounds like the most basic thing that computers have been doing for decades.

Now, what programming experience do you have? Where are we starting from here?

If a normal TV or monitor is not what you have in mind as a display the are many small screens that can be used. Have a google around.
I know enough to be dangerous in C and C++. I haven't had any experience with Python.

Something smaller than a monitor or TV would be preferred for this application. I agree, Google should work fine.

I'm glad to hear my idea is possible -- I should probably get some general know-how before I try to move forward. Would you recommend any tutorial websites / pdfs on the internet?

Thank you

nistegmeier
Posts: 3
Joined: Sat Jun 20, 2015 4:36 pm

Re: [New User] Can Raspberry Pi do this?

Fri Jun 26, 2015 2:06 am

UserX wrote:Hello,

for a Graphical User Interface on a touchscreen-only-device,
a Browser-Based solution using WebIOPi may be the most easy way to build such an application:
http://www.raspython.org/webiopi-a-simp ... pberry-pi/

Additionally, you will need to configure the Raspberry Pi to open the WebIOPi interface after booting,
which should not be complicated.
Hmm. Let me know if I'm understanding you.

Basically, Raspberri Pi will use an internet connection to open the interface. The interface can take in variables and simple commands, and then Pi would do the actual computing?

User avatar
KnightOfPi
Posts: 49
Joined: Sun Dec 28, 2014 12:57 pm
Location: Vienna - Austria
Contact: Website

Re: [New User] Can Raspberry Pi do this?

Mon Jul 20, 2015 7:58 pm

Sorry for the late reply.

Webiopi is web server, but you can access it locally without internet connection.

You'll have to
- program your application
- setup Webiopi as interface
- configure your Raspi to boot into desktop
- configure it to start the webiopi server after booting into the Desktop and
- configure a browser(e.g. epiphany) to start after booting into the desktop with the webiopi url to your application being the home url

That should work :)
I do think this is the most simple yet flexible way to build a GUI.

When i got some time on my hands i may give it a try and update here...
Check out www.knight-of-pi.org for many beginner-friendly tutorials!

Return to “General discussion”