VERY USEFUL new addition for the Spinneret and WebServer_W5100
Wildatheart
Posts: 195
With a bit of imagination and a little hardware, doggiedoc can now give us a way to tip the feed bowl, or turn the feed screw that feeds his chickens via the internet. Can you imagine how plump those 'lil suckers are going to be?
The real reason for this thread is to draw attention to Mike's recent work that offers pin-state switching on the Spinneret board running WebServer_W5100. Currently this gem is buried in a thread that may go unnoticed.
EDIT: Working example - see post 18
The real reason for this thread is to draw attention to Mike's recent work that offers pin-state switching on the Spinneret board running WebServer_W5100. Currently this gem is buried in a thread that may go unnoticed.
EDIT: Working example - see post 18
Comments
Paul
Wildatheart, back link JavaScript snippet. I'd use a regular old anchor tag though.
doggiedoc, I'm working on an update for you which is related to the stuff Wildatheart is taking about. It will make the Coop Code a bit more robust and extensible.
If the folks risk trying the now VERY EASY to use Spinneret, and if Parallax can keep enough of 'em on hand, I think we'll begin to see some interesting applications.
For fun I added some sample javascript to display a numeric keypad. Although its functional as a keypad, it isn't yet operational with your work. Hopefully I'll be able to touch-enter the pin number and then touch "pin" (same for the pin-state), and then touch submit. The purpose for the addition is to enter data quickly from a cell phone or touch screen.
After a couple of days experience with pin.htm, it continues to work flawlessly.
For example, the changes to WebServer_W5100 affect a single pin because that was your requirement. Packing 4 pin addresses and 4 states into the same XML wrapper is no problem. However, this changes the original requirement and therefore the logic on the Spinneret must change as well. Instead of dira[pin] := x use a range expression dira[23...27] := %11111, see page 105 in the Propeller manual.
The speed of successive commands is the larger of user's button click speed or the 1ms resolution of the SetInterval() command.
Concurrent requests require multiple clients. A single client can send one request after another but it cannot send parallel requests. The packets may or may not arrive at the same time or in a different order than originally sent.
Any remarks I may have posted regarding pin-state control were intended to reference your discussion of led.htm for WebServer_W5100. With that now resolved, and thinking about the 4 user pins available, it occurs to me to attach a 4 to 16 bit decoder (74154-style IC) to the 4 user pins for expansion to give us 16 user pins. Your online and running example led me to believe that 4 separate sets of instruction needed to be transmitted to set the state of the 4 user pins.
Youve gone the extra mile to give us pin.htm, so Im not asking for more I just thought Id be advantageous to set the state of ALL 4 user pins at the same (or nearly the same) time.
I'm a teach a man to fish kinda' guy. I'd rather present concepts with light examples so folks are armed with the knowledge to make their own way. I tried to point you to the LED answer but that didn't work to well. By giving you pin.htm, I did you a great disservice, but I was hoping to trigger your learning process. Trust me, I'm not the sharpest tool in the shed - ask my wife. The knowledge I bring to the Spinneret comes from 15+ years of mistakes (experience). And, It takes me a long time to learn stuff, it always has. However, I have a strong desire to know stuff. I spend a lot of time figuring stuff out and experimenting.
I promise if you reread post 10 and give it a shot on your own and still can't figure out how to solve the problem, I'll give you the solution.
Thanks again, Mike.
The examples in this thread highlights exactly how I always intended the Spinneret to function, as a light weight XML service. I never intended to serve up web pages with graphics and cool CSS.
For a moment, think about the concept of separation of data from user interface using light weight XML services over the well established HTTP protocol. The Spinneret's only job in life is to read/write state; sensor reading or in this case Propeller PIN state. The state information is received in easy to consume XML and send via HTTP. What that does for ya, is allow developers to communicate with the XML services in a variety of client applications. The client app could be something written in C, .NET, Java... Since, HTTP is not platform specific, it will work on any OS.
The example in this thread uses a web page as the client application. JavaScript handles the XML service and updates the page. It just happens the web page came from the Spinneret SD card. The client application could exist anywhere on any server or desktop that has access to the Spinneret XML services.
This concept creates a distinct separation between data and user interface. Writing Spinneret applications in this style produces extensible reusable code. That's my 2 cents...
http://spinneret.servebeer.com:8080/epin.htm
I updated the web page attached to post #14. IE had a problem with the JavaScript.
Thanks for all the help, Mike.
Here is link.