Shop OBEX P1 Docs P2 Docs Learn Events
Switching led from one spinneret to other spinneret — Parallax Forums

Switching led from one spinneret to other spinneret

LtechLtech Posts: 370
edited 2011-04-01 01:04 in Accessories
Ok I am not so clever about http, get put post .... I am from the old school of transistors,dos and serial com
I use basic stamps an propellers for a time, now I try spinnerets, but" network is not my cup of thee"
Can somebody explain how to make a basic two way network communication between two spinnerets

Expl: I close a switch on spinneret 1 and on the other side (of the planet) led1 of spinneret 2 go on.
The led on the fare side =(spinneret 2) give me a feedback (trough network) on led1 of spinneret 1
Now I am 100% sure of status from led1 on the fare side

I do it already with rs485 trough fibres to manage tally (=on air lamp of active camera) of two TV trucks by car races.
I monitor the status on a pal video monitor it works for years now

Is it a put command on spin1 and a get on spin2?

It is basic network, I knew. How do I have to start ?

Thanks

Comments

  • mindrobotsmindrobots Posts: 6,506
    edited 2011-03-31 07:16
    Just a thought:

    For two Spinners to talk to each other via IP, you don't need to implement the HTTP stack. Unless you want to interact with the Spinners's via a browser, HTTP is a bunch of overhead that doesn't serve any purpose.

    You can toss messages back and forth between IP connected devices (either UDP or TCP) and build your own "application layer". Depending on how you want it to work, send a "SW1" message to the other Spinner1 when switch 1 is pressed and have the other Spinner2 waiting for messages....when it (Spinner2) sees "SW1" come in, it could turn on the LED....or have Spinner1 send a "LED1" message to Spinner2, etc.

    Or Spinner1 cold present a web interface to the Spinner network and do all the interpreting of HTTP input for the remaining Spinners....just sending private "Spinner-Talk" commands to the other Spinners.

    Just some thoughts....


    Rick
  • Mike GMike G Posts: 2,702
    edited 2011-03-31 07:17
    Let's say you have two Spinnerets.

    S1 = IP address 192.168.1.10 port 5000
    S2 = IP address 192.168.1.11 port 5000

    A switch is closed on S1. S1 detects the closed switch. S1 prepares and sends an HTTP GET to S2 at address http:// 192.168.1.11:5000 /command.htm?switch=on. S2 receives the HTTP GET and parses the HTTP GET. S2 sees that switch=on and executes some code.

    Sending information over the internet work much the same way except you're sending messages to network nodes.

    Now you just need to do some reading. This is an excellent reference on HTTP.
    http://www.w3.org/Protocols/rfc2616/rfc2616.html

    Plus there are several threads on this forum with source code and demos.
  • LtechLtech Posts: 370
    edited 2011-04-01 01:04
    Thanks a lot, i go take a look at this
Sign In or Register to comment.