PDA

View Full Version : New to Spinnerette, Need to write a Web GUI, can we use AJAX, Java, CGI or Flash???



laser-vector
03-20-2012, 11:32 PM
Hello everyone!

I have just placed an order for two spinnerette web servers, I figured while I was waiting for them to arrive I would do little research.

After searching through the parallax forums I've noticed there are not many resources or posts about them. So I figured I would just ask a questions.

I'm planning on using these web servers for a System Automation project. This requires the ability to actuate valves and read back data from serial RS232 gauge controllers and sensors. this data will then be displayed via a web page. My main concern is displaying information that is constantly updating. Though it's not a huge concern If a user has to constantly press the refresh button I would however like the convenience of a web GUI that can display this constantly updating data. So I was curious if it would be possible to run scripts like Ajax or java right from the spinnerette board?

Also if anybody knows of some better resources for code examples or tutorials on how to use the spinnerette board I would greatly appreciate it!

Thank you so much,
grant

Phil Pilgrim (PhiPi)
03-21-2012, 12:15 AM
Ajax scripts do not run on the server, but in the user's browser. So, yes, you should be able to provide Ajax capability just as easily as any other webpage. For simple, continuous page refreshes, though, the meta refresh tag is all you need.

-Phil

Martin_H
03-21-2012, 02:14 AM
I have been curious for a while now. People seem to like the Spinnerette, but why? It looks like a propeller coupled with an ethernet adapter and sd card slot. Granted it is small and low power, but what is the hook?

Heater.
03-21-2012, 07:09 AM
Just now I have been trying to get into this idea of live data streams from embedded systems straight into web browsers . I have an experimental project that:

1) Has an embedded system withe ethernet that makes a regular socket connection to a server PC and sends a data stream.
2) The server PC serves up the web pages that are to display the data from the embedded system.
3) Data arriving at the server is pushed to the web pages using HTML 5 web sockets. There is some simple javascript in the web pages to make the websocket connection and draws the data display to a HTML5 canvas element.

The web pages are served up by the good old apache seb server. The data stream collection and web socket handling is done by 50 lines of javascript run by a node.js server.

What I want to do next is simplify that further so that the node.js server also serves the HTML and Apache is no longer required.

Even simpler, for a local system with just a Prop -> serial line -> PC one could have the browser load the pages from local files and make the web socket connection to the node.js server which has a serial port link to the Prop.

I'm hoping to post the results of my experiments here soon but I have a busy few weeks ahead.

laser-vector
03-21-2012, 07:39 AM
I have been curious for a while now. People seem to like the Spinnerette, but why? It looks like a propeller coupled with an ethernet adapter and sd card slot. Granted it is small and low power, but what is the hook?

Hi Martin,

I am new to the concept of incorporating these two technologies together. my goal is to us the "Spinnerette" module (or a prop and a WIZnet W5100) to control some automation processes on a large vacuum chamber system. id like to use one per a bank of valves and other things that are local to certain regions of the system. then connect those regions into a single LAN.

after getting used to the platform id like to incorporate the Spinnerette into more of a proprietary PCB design with some added system control components. im hopeful this method may give similar flexibility to something like setting up a bunch of IP web cameras. with all of the regions of the system (and mind you this is a large facility!) being on a single network they could all be pretty easily accessible by the other machines and PCs on that network.

And im hoping that these regions could host their own WebGUIs that might make interfacing with it very easy and limit the need to install software.

Being a novice to Prop -to- Web interfaces i feel this prop board has a decent set of core components that i understand, and its size is great for migrating over to my own PCB design files.
Which leads me to a question, have any PCB layout files for the Spinnerette been released to the public?

also, i am very interested in alternative Ethernet/IO devices like this one and any suggestions are welcome

thanks!
Grant

MagIO2
03-21-2012, 08:18 AM
Just go to the Spinneret product page, there you should find the PCB design. It's meant as a reference design which can be used/changed to your needs by everybody!

From my point of view the SPINNERET should only be used to send values/receive commands via LAN. Using it as a complete web-server adds to much code and won't be satisfying in the end as it will be pretty slow. That's why I currently head to another direction:
I started with a Java project which connects to any number of propeller boards - via LAN, via USB ...
These boards can store data in that server and use it as a messaging system which distributes messages from one propeller board to another. But the main point is, that a for example a PHP or JavaServlet driven Web-Server can connect to that server and ask for the stored data. So, all the heavy-weight serving part (serving nice images, include the raw values in a nice GUI) can be done by a PC/Nettop/RaspberryPi ...

Mike G
03-21-2012, 02:19 PM
Here's some examples and source
http://spinneret.servebeer.com:5000/
http://www.agaverobotics.com/spinneret/controlpanel.htm

Martin_H
03-21-2012, 02:48 PM
Here's some examples and source
http://spinneret.servebeer.com:5000/
http://www.agaverobotics.com/spinneret/controlpanel.htm

Mike G, that LED example is a hoot.

lyassa
03-21-2012, 09:55 PM
I understand that if the Propeller is connected to a computer that is connected to the Internet, then you don't need the Spinnerette. A VB or C# program can update a web page with the data it reads from the Propeller via USB. The Spinnerette is needed if you do not want to have the computer between the Propeller and the Internet and you want to connect the Propeller board straight to the Internet. Please correct me if that's wrong.

Phil Pilgrim (PhiPi)
03-21-2012, 10:15 PM
lyassa,

What you've stated is correct.

-Phil

MagIO2
03-22-2012, 04:22 AM
Well kind of correct.

LAN is only a physical interface. On top of that you have the protocol. Of course you can teach the spinneret to talk HTTP or HTTPS or Telnet or FTP or .... or your own protocol that only sends binary data.
If you create your own protocol sending binary data only, your spinneret can surely send much more netto information in the same time and the program on propeller side has a smaller footprint. The heavy lifting of a sopisticated web-page including lots of images can be done by a more powerfull computer.

The point here is that you might want to use the spinneret because the LAN is already there. Maybe you want the spinneret to send a wake on lan package if it receives a phonecall.

To say that you want the spinneret do everything itself, so that there is no need for another computer is only one point of view - one design decision. Others are valid as well to solve other problems.

prof_braino
03-22-2012, 12:21 PM
web servers for a System Automation project. ... actuate valves and read back data .. displayed via a web page. ... constantly updating. .. web GUI that can display this constantly updating data. .. run scripts like Ajax or java right from the spinnerette board?

Also if anybody knows of some better resources for code examples or tutorials on how to use the spinnerette board ...

Hi grant

Please take a look at
http://code.google.com/p/propforth/

tutorial-5.2 HTTP.txt in the download archive has instructions for serving webpages. These pages can run forth scripts.

Propforth also allows easy serial connections to other devices, and to (more or less) trasparently add more prop when additional cogs or pins are needed.

The package does not (yet) contain an example turnkey app with all the functions you want, but I think most of the parts are there.

The only drawback is that it is in forth, so its a little different from programming for a workstation.