How can I make a website that takes GPIO input and runs programs on the server? - raspberry-pi

I got a Raspberry Pi the other day and thought it would be fun to set up a web server. I was wondering how I could make a website that took input, such as button clicks, and based on that input run a specific program/script.
I'm very new when it comes to programming, what would be the best approach to learn how to create a website / server?

Andy your question is very vague so let me try to address it the best I can. You obviously seem new to this and that is great! However, questions like these are generally too broad to be answered.
First off, you seem very new to programming and if you are interested in creating a website I would recommend learning HTML. It isn't that complicated of a language and you can find tutorials on Code Academy linked here.
Second, if you are looking for help with button presses on a Raspberry Pi there are dozens of guides online such as this one to help you get on your way.
Finally, it seems you are very interested in running scripts and using a Raspberry Pi. One of the easiest languages to learn is called Python which is commonly used along side a Pi. It is a powerful language with tutorials on how to get started here on Code Academy.
What you are failing to realize is how powerful Google is, when you start programming you will realize how useful it really is. For the Raspberry Pi button push question, all you have to search is raspberry pi detect button press. The internet is your greatest resource to solving problems.
Good luck on all of your projects and don't forget that Google is your new best friend.

Related

How to connect HC-05 to MSP430

I am trying to use Bluetooth module HC-05 with MSP430 by Texas Instrunments.
I want the bluetooth module to collect data wirelessly from an android phone via bluetooth. Can anyone please help me?
You will find an answer and the end. But first I need to write a few introducing words.
You are new to SO and, you might wonder why no one answered your question.
If I should guess: IMHO there could be two main reasons for this.
Your question is not specific enough:
What kind of TI MSP430 do you intend to use? I suppose you use a launchpad G2(?).
What have you tried so far? You can not expect someone else to invest some time if you did not try so solve your problem yourself. Perhaps it easy, if you only try. The people here love to help, but they expect you to be interested in the problem.
What is your backgroud: Are you a programmer but do not know how to connect the hc05 to the MSP or are you fit in electronics and connecting MCUs? Are you a complete beginner?
There are so much cases and I would not have the time to handle all.
I used google to search "MSP430 HC-05" and found a lot of usefull stuff. The first hit is a project working with a Energia IDE, a HC-05 module, a G2-Launchpad and even an Android phone. I and probably other people do not understand why you did not try to search the internet for information.
Ok! enough wise words! ;-)
Here is the promised answer:
You find an example project with the following URL: http://www.electronicwings.com/ti-launchpad/hc-05-bluetooth-module-interfacing-with-msp-exp430g2-ti-launchpad
More results can be found: including (Youtube) Videos
- Keywords: HC-05 MSP430
Please try to work with that material and feel free to ask furter questions here.
But please be sure to be a bit more specific. (Code examples, error messages, your configuration and hardware and what you've tried so far.)
Cheers PPK

How to create a controller and display in browser in zend?

i am new in zend framework. Please help me to create controller and how navigate in browser.
Not the best question, because it shows you haven't searched much. Let's search together:
framework.zend.com
StackOverflow
StackOverflow again
StackOverflow 3
So either search better or please try to explain your need with more details and show what you have already done.
Yeah, this is pretty vague.
I'm assuming that you have some experience with computers, computer programming, the Linux operating system, and developing for the web. Object oriented programming principles, as well as some awareness of php itself are also going to be very helpful.
Do you have an environment to work from? A webserver that's capable of running php? You'll need that, as a bare minimum first. Luckily we live in the days when it's easy to set up virtual environments for that. Try puphpet. It's awesome. While you're at it, make sure you get MySQL, as you'll need it for many of the tutorials provided by Zend (and others).
https://puphpet.com/
Have you downloaded the framework?
If you use the zf tool to create a project, as described in the link below, you'll have a basic application that includes a Controller and that you should be able to browse to.
http://framework.zend.com/manual/1.12/en/learning.quickstart.create-project.html
That should be enough to get you going.

Connecting to a PLC from a PC through CAN/CANopen

First I have to say that I am not very experienced with neither Linux nor CAN/CANopen, so if something here is unclear or missing anything critical, please tell me.
I have a project where I require to connect a PC to a PLC via CAN/CANopen. I have a CAN-USB converter (canusb.com) and a PLC by Festo.
I have compiled the CANopen stack (CanFestival), but where do I go from here? It looks extremely complicated, and I really don’t understand it at all.
(My first goal would be to establish contact with the PLC through the CAN adapter and verify in some way that they are able to talk. The main goal is to be able to turn some valves on and off on the PLC by setting some registers.)
I'm familiar with CANopen, having written a stack and designed devices for it. In my opinion, this is going to be a major learning curve for you and will most likely take weeks of work. Most PLCs support most, if not all, fieldbus protocols. Does yours support Modbus? If it does, then you'll be up and running in a day or two: Modbus is simple to program.
I was in the same situation as you last year, and keeping in mind my deep understanding of CANopen, that's how I handled it. That said, I don't work by the hour, and it was a fixed price job, so I was after the overall cheapest solution, and this required buying a PLC module that supported Modbus.

From where do I learn Interface Prototyping?

I am interested in prototyping and developing gadgets and devices using arduino board and other stuffs, however I only get tutorials on arduino but not in interface prototyping. I found a book but it is in other language not in English
(link is :http://prototypinginterfaces.com/)
I also don't know the exact term to look for in Google, for tutorials. That might be the reason why I'm not getting the suitable results. Basically what I want to learn is the same as the book says.
I have no idea from where do I start, and what to look for at first. If anybody can help me, please.
from the software perspective, I'd recommend getting into Processing. It's the programming language Arduino is derived from, and with both of them, in tandem, you can code and build interactive prototypes. O'Reilly has some excelent books and video lessons to tackle those:
Learning Processing (book and website)
Getting started with Processing
Arduino and Processing in tandem, video series
With these two references, most of what the link you provided says, is covered.
From the hardware perspective, you might also enjoy the following:
Making things Move
Making thins Talk
Arduino Cookbook
Sorry for the extreme focus on one editorial house, however, they rock!. Best luck.

How hard would it to create a media player (gui fronteend for mplayer), need guiddance for getting started

I am pretty dissatisfied with all the available media players, and I was also looking for a major project to really get into programming. so I am thinking of writing my own media player . Or to be more accurate a gui-frontend for mplayer (something similar to smplayer). How hard would this be.? I have plenty of time (months), and am willing to learn anything.
I practically don't have any knowledge of any windows/gui libraries . My programming experience : tried lots of different languages, wrote a couple of websites in php, lots of practice in java (although did nothing major) . Thats all
Can someone provide some guidance, about where to get started. what all to read. Which language should be used. is C#/.net a good language for this? since I am no expert in any language and have dabbled in plenty of different languages , I think I can pick up any language. Though My main concern is my lack of any practical knowledge . So guide me please.
Lastly my preference is windows (haha whatever), so thats what my target is and thats where I'll doing my coding.
To sum it up I want to create a guifrontend for mplayer that would work in windows.
Thanks
Edit: by mplayer I mean mplayer (the linux one) , and not WIndows media player.
One good place to start could be looking at how the code for gmplayer works - gmplayer is the graphic frontend for mplayer on Linux. It could be that all you really need to do is port the gmplayer code to Windows, then you get a fully integrated GUI instead of just a frontend.
Also, feature request: a nice friendly UI for putting video / audio effects on the output stream (it is so hard to use in the CLI version that most mplayer users probably don't even know it is in there).
I know what I'm going to recommend you is not what you're looking for, BUT:
I'd create a front-end for VLC, which uses Qt, a GUI framework which is extremely usable and easy to start with, in C++.
From my experience as an user, VLC is also more stable and has more features.
Start by copying a working implementation. As you mentioned, SMPlayer exists as a working example of what you want. I'd recommend starting by either hacking it to work better (the playlist really needs more intuitive controls, and multiple monitor support in Windows was nonexistent last time I tried it) or trying to duplicate it in your language of choice.
The benefits of hacking on an existing probject include: the existing codebase works, the margin of work required to make a noticeable change is much smaller, and the existing developers are able to help you come to speed with internals. Also, learning the project's language (C++) would be useful, though it may not be worth the effort if it's more interesting to copy its features in your favorite language.
C# is great for creating any desktop gui quickly. Best way to start with the gui design is to play a bit with the drag/drop components available in visual studio. For the functionality you can use this: http://msdn.microsoft.com/en-us/library/dd564585%28VS.85%29.aspx .