Shop OBEX P1 Docs P2 Docs Learn Events
ethernet repeater with propnic — Parallax Forums

ethernet repeater with propnic

jeromelabjeromelab Posts: 31
edited 2008-06-13 11:50 in Propeller 1
Hello,

I am seeking advice as I am not an expert in electronics and ethernet.

I have a propnic from ucontroller.com it works great... now my idea is to link several propnic/propeller boards together but without using a Hub or a switch. To name the official ethernet terms, I would like a ring shaped topology instead of a star shaped one. This would mean I have to include in the design a "repeater", so basically I have one RJ45 for input and another one for output/forward. Now all the propnic design with RJ port built-in magnetics etcetera ... I am a bit lost. I googled for finding hub/switch/repeater designs without any luck...

Thanks to all in advance!

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2008-06-08 16:08
    Ethernet doesn't work that way. You have to have a hub or switch unless you're just connecting two controllers to each other. You would need two NIC's, one for each direction in the ring. There are other network controllers using non-Ethernet protocols that allow for different topologies (like Arcnet), but, with your level of knowledge, you want to stick with standard "off the shelf" stuff.
  • jazzedjazzed Posts: 11,803
    edited 2008-06-08 16:35
    10/100BaseT RJ45 hub is the industry standard for various reasons including cost, reliability, jabbering client exclusion, ease of changing client connections, full duplex capability, simple wiring connections for clients. Another technology (10Base2) using BNC T connectors and RG8 coaxial cable was popular for a time that had the ring shape. A cheap shared hub would be much less work and potentially cost less than using a ring like you've mentioned.

    Attempting to answer your question directly here without design desirability or practicality bias:

    If you want a ring with 10/100BaseT CAT5 cable and RJ45 each node's CPU will need to as you mentioned "repeat" (RX and then TX) all packets with RX interface in "permiscuous" mode. One client TX would need to be connected to the next client RX pins to form a ring (for a back to back connection wiring would be crossed-over). It would be simple enough to create cables for your ring by cutting an existing cables and soldering pins. All nodes would of course need such connections and any one failing interface would break the ring. Look at this wiki for pin connection and color code information: http://en.wikipedia.org/wiki/10BASE-T.

    Node Cabling

    ··········NodeA···············NodeB·············· NodeC
    ··· TX····||·||·····RX· TX····||·||·····RX· TX····||·||·····RX
    +-- 1 ----+| |+---- 3·· 1 ----+| |+---- 3·· 1 ----+| |+---- 3 --+
    |+-·2
    + +
    6·· 2
    + +
    6·· 2
    + +
    6·-+|
    ||···························································· ||
    |+
    +|
    +
    +

    Given 3 nodes ABC as shown, cables would be connected as (NodeLetterCablePin) to (NodeLetterCablePin) pairs: A3-B1, A6-B2, B3-C1, B6-C2, C3-A1, and C6-A2.· Data flows CBACBACBA .... with cable ends connected to RJ45 plugs and proper software of course.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔


    Post Edited (jazzed) : 6/8/2008 4:46:11 PM GMT
  • jeromelabjeromelab Posts: 31
    edited 2008-06-08 17:18
    Thank you! I have some answers.

    What I should clarify is that I want cheap connectors/cable that can be 100+ meters in between nodes. I cannot use a hub or rather I would like to add a minimal hub to the final propeller board. I cannot use a hub or a switch because I am talking of about a 1000 nodes with long distance (max 100 meters, 328 ft) in between group of nodes and I want to minimize the costs.

    I am usually using rs485/DMX but I want some more speed and features this time. Yet I want to retain the ability to chain devices for sparing a few kilometers (0.62 miles) of cable.
  • Mike GreenMike Green Posts: 23,101
    edited 2008-06-08 17:36
    Please read the documents on the Wikipedia about 10-Base-T and the Ethernet in general. You'll find that a switch-less network of more than about 50 nodes doesn't work very well. 100 meters is about the furthest allowed between repeaters and you're only allowed a limited number of segments (2 to 3?) through repeaters (as opposed to a switch that forwards packets rather than just copying the signal).
  • SpinHeadSpinHead Posts: 28
    edited 2008-06-08 18:35
    ok, you are not looking for ethernet then, per-se, you are looking for a communications system that meets your needs, might I recommend then, use rs-485, your intended implementation of ethernet will be a problem, that is not how it was intended to work, instead I recommend you use the fullduplex serial object rank it up to its max speed and then read this article www.maxim-ic.com/appnotes.cfm/appnote_number/723/, and grab some MAX3162, Toss some headers on your data for the target and away you go.
    Original Poster said...
    I am usually using rs485/DMX but I want some more speed and features this time. Yet I want to retain the ability to chain devices for sparing a few kilometers (0.62 miles) of cable.

    What features is it that you would want more? for really long runs i would use and overdrive set, Optos on each side of the long run to send higher voltage to compensate for the length then translate back to sane levels.
  • TimmooreTimmoore Posts: 1,031
    edited 2008-06-08 19:08
    What speed communication do you need and what is the communication pattern? With 1000 nodes and the fullduplex serial, you would need a hierarchy of communication. fullduplex The serial driver is point to point so you would need a ring protocol on top of the serial driver or some other protocol support.
    If you build a ring, the communication speed per node is low - full duplex max baud is ~1mbps (and may need to be slower because of the distance involved), so each node is 1000bps unless there are a lot of nodes that dont communicate. If there are communication patterns then multiple rings is probably the best bet, putting the nodes that communicate a lot together and separate these nodes from other communicating nodes.
    You could build a ring on top of the fullduplex driver, but the ring forwarding would be in a different cog and would slow the fowarding down a lot.
    I have a modified fullduplex serial that is a serial ring i.e. it uses 2 pins on each prop, tx of one to rx of the next but it only supports a max of 64nodes (and hasn't been tested that high!) and the serial cog understands the ring forwarding protocol so forwards much faster. A two level ring would give you enough nodes but the communicate speed would still be low.
    At the distances you are talking about you also shouldn't connect the pins directly but do what Spinhead mentioned using rs-485 or similar hardware drivers.
  • jazzedjazzed Posts: 11,803
    edited 2008-06-08 19:09
    jeromelab,

    I seriously believe if you try to attempt such a large geographic network with the original idea, that you will just be buying/building yourself a headache. Ethernet is a LAN or local area network. If you need something so big, you will have to pay the price for high quality. Best of luck with your project.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
  • SpinHeadSpinHead Posts: 28
    edited 2008-06-08 21:11
    Timmoore said...
    What speed communication do you need and what is the communication pattern? With 1000 nodes and the fullduplex serial, you would need a hierarchy of communication. fullduplex The serial driver is point to point so you would need a ring protocol on top of the serial driver or some other protocol support.
    That all depends if all data is solicited or non solicited, if there is only 1 master and all other nodes are slaves you would just have check the data coming in on each node to see if it is a multicast command eg $FFFF or data targeted to 1 nodes address eg $1234, and then process it and respond to the master $0000, then sit and wait for more data to be targeted towards you, this is exactly the scheme 485 is intended for or better yet throw some logic with dips in front of the 485 interface on each chip then the chips would not even have to receive any data not targeted towards them or multicast. Can the original poster clarify the intent of each of the "nodes" ? If they are going to be sending unsolicited data at unknow intervals (based on events) then the design changes greatly.
  • Timothy D. SwieterTimothy D. Swieter Posts: 1,613
    edited 2008-06-09 02:10
    Many good response has been proivided already, but I thought I would throw in my 2 cents.

    There are many industrial ethernet devices that can be arranged in a "ring" topology. These devices have two ethernet ports on them. In reality though each device is a 2 port switch. So, you end up with switch after switch after switch when you use them. The protocols used though for those industrial ethernet I/O are optimized for this because speed, latency, response and reliability are very important.

    I am curious about your application. I am experienced in using DMX as well, what do you wnat to add to it? Were you going to use the latest ACN standard over ethernet instead of DMX?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Timothy D. Swieter

    www.brilldea.com·- uOLED-IOC, RGB LEDs, TLC5940 driver PCB
    www.tdswieter.com
    One little spark of imagination is all it takes for an idea to explode
  • jeromelabjeromelab Posts: 31
    edited 2008-06-09 12:59
    Well thanks for these comments and answers. That is not the first time that I have to design in such a scale but the first time I have so many "nodes" in the same "footprint". I designed networks of max 64 nodes until now, using max489 chips and DMX protocol. Then off course this time I am in a tight budget (for the scale of it). So I am looking at all cheap solutions.

    About the project:
    I am a member of an artists group, active in digital arts. http://www.lab-au.com . We have also a digital arts gallery http://www.mediaruimte.be We made some big scale installations in the past but until recently we would be essentially in software and computers, only dealing with electronics to hook up some sensors or some control boards and interfaces, or giving this task to manufacturers (impossible in this case due to tight budget). Due to microcontroller being able to do more and more and costing less and less, it becomes interesting for us to use it.

    The project is to have a 40 ft container of televisions (produced in a chinese factory according to our specifications with repurposed B grade CRT tubes and a stackable design casing) so that is about a 1000 units. Then I have to add control/signal generator to the "dumb" TV sets. We will "invade" a tall housing building replicating somehow the typical view you have from observing a housing building when everybody is watching TV at night but in a "strangely" controlled fashion (I let your imagination building the rest of the picture!). In the main lobby we will stack 200 TVs that will be the central hub.

    At first I considered using my usual AVR/DMX architecture, but Pal signal generation takes too much time, so I am prototyping right now with propeller as it seems quite ideal for this project and it is not so expensive in quantity. I want to process incoming messages, generate PAL signal(only plain color, not detailed "graphics") and sound at the same time (each TV has an integrated speaker).

    Indeed all the TVs are slaves, only listening to messages (but I have to design some synchronisation scheme for it, some of these designs would require the "end of the line" node to send back message to the master). You can easily anticipate that a star topology is out of question due to the length of necessary cables. I can have at most one computer control on each level, but then starting from there will be at least a 100 TVs. Then I want to design a flexible/modular system so that it can be adapted to another place without worying too much abot cable length and distribution scheme.

    Beside the communication, my main problem is power! It is not a problem in the case of this building but would be if the 1000 units would be stacked in one place then I need one superbig main power line (splitted in many many cables off course).
  • Mike GreenMike Green Posts: 23,101
    edited 2008-06-09 13:55
    A Propeller certainly gives you a lot of flexibility. You can do the video generation in one or two cogs. The audio is another issue depending on how complex the sound is to be. Regardless, you'd still have several cogs to handle communications. You could easily have a layered DMX system with an extra Propeller in each "cluster" that acts as a slave to the higher level DMX bus and a master to the cluster's DMX bus. You'd use one cog to handle the low level "bit banging" and a second cog to handle the DMX (or other) protocol. You may well be able to combine these two functions in one Propeller with one TV controller in a cluster acting as the master for the cluster plus handling its own TV.
  • jeromelabjeromelab Posts: 31
    edited 2008-06-09 17:04
    Well the problem is that I don't know if I will have clusters (I mean physically). But I can probably split the network in parts, so I will never have more than 500 nodes in a chain/ring. This way I could keep my usual DMX chain (max 512 nodes) or let's say DMX like network since I would like to go faster than 250kbps.
  • Timothy D. SwieterTimothy D. Swieter Posts: 1,613
    edited 2008-06-12 04:09
    Actually, DMX has 512 channels as you know, but the specification for EIA485, which is what DMX is based on, recommends a max of 32 devices on the network. I am sure more nodes could be attached, but the science of the communication signal should be investigated further to avoid any problems. Your project sounds like a ton work, but it sounds very neat too! Soon I will have a PCB available at Brilldea.com that can be populated with a Propeller and the appropriate items to make a DMX network. I have used three of these PCBs in an LED/DMX installation.

    One idea for your distribution scheme is to send ACN or ARTNET packets over ethernet to each floor. At each floor then the ethernet is translated to DMX-512 network. There are off the self devices for that. The custom propeller design would be at each TV then.

    Lab-au looks to do some very inventive and challenging projects. WOW!

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Timothy D. Swieter

    www.brilldea.com·- uOLED-IOC, RGB LEDs, TLC5940 driver PCB
    www.tdswieter.com
    One little spark of imagination is all it takes for an idea to explode
  • jeromelabjeromelab Posts: 31
    edited 2008-06-12 08:33
    Yep, your idea is exactly what is used in the Dexia Tower (except using avr and not propeller on each Led node) http://www.lab-au.com/v1/dexia/2006/touch/videos.php , so I have past experience with this design.

    The problem is that each floor has its own latency and you can see that they are not synchronised by half second or so. These off the shelf devices are not so good ... but you can see that only when your installation footprint is the one of a huge building. I would prefer not using artnet, just plain UDP with my own message format, it goes way faster and I avoid data corruption by just sending it 25 times a second. I favor speed over accuracy you could say but in my experience a small fast error tends to be less visible than a slow jerky animation.

    BTW I have another question, if I can make a RS485 network running at 10Mbit/s (seems the fastest chips by Maxim are supporting this speed), how do I make the bridge to a computer? I never heard of a RS485 interface running faster than 1MBit/s. I can only think of having a propeller with ethernet as an interface, ftdi chips are way to slow... maybe a full speed native USB chip???
  • SpinHeadSpinHead Posts: 28
    edited 2008-06-13 03:26
    You can run 485 @ 10mbps BUT I dont think the fullduplexserial object supports that fast, (not with the code atm), run 1 master that will talk to each floor, on each floor dedicate 1 master that talks to all slaves, for the master to floor communication you can run @ the max speed (I imagine it will be < 96 floor masters), but for all the slaves that are going to be on the floor I recommend you go with some high speed optos and split it up to at most 32 slaves per opto bridge to compensate for cable length / wire taps. A package header of something similar to Floor , Slave, $FF $FF gives you 64k address with minimal overhead

    as for the computer link just use fullduplex serial (must love this object) and talk to the computer, dont worry about the 485 end of it at all on the computer, the fact that the master prop will be talking to all the floors at the same time will help with any possible latency issues.

    How often do you plan to actually update the display? you could send all of the data for the next refresh, then send a clock bit to clock all the data in to get pretty much perfect timing.
  • jeromelabjeromelab Posts: 31
    edited 2008-06-13 11:50
    Hello spinhead,

    I would like to achieve anything in between 12-25 Hz refresh rate. By experience I know that the clock bit is not the ideal solution( except maybe if I follow your advice of 32 nodes max), very long cable length and big building makes it for perceptible lag.

    In the past I used a timestamp method, the commands are sent with the time of execution, when the command reach the last node it replies with the timestamp of received command. Then simple substraction makes the next command time of execution. This way it tries, refresh after refresh, to achieve accurate synchronisation. Sending always the same amount of data helps too. I am not sending image or sound data, just a few bytes (something like 8 Bytes per frame and per node + header) to switch a state in the propeller and some parameters.

    In the end modularity and simplicity in cabling (and cable length) is more important than synchronisation in my case, so if I agree with you about master prop at each floor(+ computer), I would like to keep it open about the number of nodes, I have to design a repeater on each slave node.

    Thanks for your answers.
Sign In or Register to comment.