Shop OBEX P1 Docs P2 Docs Learn Events
Wireless Network Protocol — Parallax Forums

Wireless Network Protocol

SciNemoSciNemo Posts: 91
edited 2009-11-30 13:36 in Propeller 1
I am making a project where there are many devices, each with a transmitter and receiver, all operating on the same frequency, that must send short messages to each other. The communication does not have to happen simultaneously, but because the frequency is the same there must be some system so that the devices don't step on each other's toes.

Anyone know a way that I could implement a system to prevent the devices from screwing up each other's messages? A solution that would be possible on the propeller would be most welcome roll.gif

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Not the fish.
sites.google.com/site/bitwinproject/

Comments

  • kwinnkwinn Posts: 8,697
    edited 2009-11-30 00:33
    It's called CSMA/CD (Carrier Sense Multiple Access/ Carrier Detect) It is how ethernet allows devices to share a network bus, and it works for wireless as well. Google it to get the details. A simplified version could be implemented on the prop.
  • jazzedjazzed Posts: 11,803
    edited 2009-11-30 00:38
    There have been attempts at Ethernet on the Propeller. One could scale down the data rate and make it actually work.
    Another alternative is Mult-master I2C which might be easier to grok.
  • Clock LoopClock Loop Posts: 2,069
    edited 2009-11-30 00:55
    I have always wanted a programmable router. I wonder if the prop can generate proper wifi signals.

    It would be neat to see a network of props that can communicate with each other and identify which prop has internet access and then that prop provide the access to all other prop "clients"

    The ability to have any one of the props act as a internet server upon discovery of its own internet connection, or even link other wifi props so internet access can be found.
  • SciNemoSciNemo Posts: 91
    edited 2009-11-30 02:01
    Thanks kwinn, CSMA/CD is perfect for what I am trying to do. Makes a lot of sense [noparse]:)[/noparse]

    @Clock Loop-I'm not sure, but I think Wifi has signals in the Gigahertz range, which would be way out of the reach of generation by a propeller. You could get a module for wifi interfacing, but they are usually quite expensive. As for you other idea, that is basically what I am doing, with some added stuff as well [noparse]:D[/noparse]

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Not the fish.
    sites.google.com/site/bitwinproject/
  • Clock LoopClock Loop Posts: 2,069
    edited 2009-11-30 02:27
    SciNemo said...
    @Clock Loop-I'm not sure, but I think Wifi has signals in the Gigahertz range, which would be way out of the reach of generation by a propeller.

    I guess I kinda new the prop couldn't do wifi, hopefully the prop2.
  • LeonLeon Posts: 7,620
    edited 2009-11-30 02:47
    That won't manage 2.4 GHz either.

    Leon

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Amateur radio callsign: G1HSM
  • Clock LoopClock Loop Posts: 2,069
    edited 2009-11-30 12:22
    Leon said...
    That won't manage 2.4 GHz either.

    Leon

    What, you mean the prop 2 isn't going to run at 3ghz?


    Well now,... that needs to be fixed. Where did I put my can of Liquid Nitrogen.
  • localrogerlocalroger Posts: 3,452
    edited 2009-11-30 13:36
    SciNemo, there are three basic ways to do what you're after. I've implemented all of them and they have different strengths and weaknesses.

    Option 1: One device is the master. It polls the other, and nobody else transmits unless asked. This is the simplest to code, and to recover from a lost message (the master just times out if it doesn't get an answer and asks again or goes to the next device). The big minus is that if the master fails, so does the whole network.

    Option 2: Have a token which is passed from device to device, granting the privilege of next comms. Plus is that you don't have an indispensible master unit. Minus is that recovering from a lost message becomes much more tricky, as you must somehow regenerate the token while making sure you don't get multiples.

    Option 3: CSMA/CD mentioned by kwinn. This allows any device to transmit at any time, but the network must detect that a collision occurred and then the devices must wait a random amount of time before retrying. Collision detect can be done by doing a checksum on the packet and requiring a reply to verify message receipt. (you won't have Ethernet's ability for the transmitter to detect a collision as it's occurring.) Tricky parts are arranging the truly random delays (it doesn't work if your devices are both sequencing through the same pseudo-RNG) and bandwidth saturation if you get too many devices trying to use the channel.
Sign In or Register to comment.