Shop OBEX P1 Docs P2 Docs Learn Events
network methods, home automation, and security — Parallax Forums

network methods, home automation, and security

CapdiamontCapdiamont Posts: 218
edited 2007-11-25 19:30 in General Discussion
I keep thinking, I would like to network all my devices/modules, so that other members of the household, locally, or remotely, can change things. I keep debating between serial networks, and Ethernet. I like the idea of home runs of cable, which for serial, means I would have to make a hub of sorts. I already have an Intel Ethernet hub, I bought for $15. The problem with Ethernet is the cost per device.

Ethernet interfaces seem to be two types, easy to attach to all processors, easy to use(form like), but limited by variables, or something like that, but high cost per unit. Others DIY like, some easy, some not to attach, need powerful/fast processors to make it work, limited by your programming skill, and program space, much cheaper.

I've played with pyserial in linux to send stuff to the serial port, getting it back out, wasn't something I figured out, before the motherboard died.

What about security? Can they do ssl, to protect the passwords? What about DOS attacks?

Comments

  • Bruce BatesBruce Bates Posts: 3,045
    edited 2007-10-30 05:25
    Capdiamont -

    In the US where we have 110 VAC mains, I'd use the X-10 system and dispense with the externally wired network idea altogether. If in other parts of the world where 220 VAC mains are the norm, I'd look into the following system which you can customize yourself: http://www.hth.com/plm-24/

    Regards,

    Bruce Bates

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
  • Mike GreenMike Green Posts: 23,101
    edited 2007-10-30 05:33
    A nice cheap network can be made with just a twisted pair cable and some RS485 drivers (en.wikipedia.org/wiki/RS-485 and www.embeddedsys.com/subpages/resources/images/documents/microsys_art_RS485.pdf). Back before Ethernet, I worked in an R & D department where all the computers in the department were connected via such a multi-drop network. There were printer servers and you could send files back and forth. We had utility programs that would do the file transfers. These would wait for the line to be idle for a period of time, then would attempt to send a message addressed to the destination computer. If that computer was listening, it would respond and the two utility programs would negotiate a file transfer. If there was an error, they'd retry and there was an algorithm so that, if two users were trying to communicate at the same time, one would get precedence.

    The computers involved in this were not fancy. They used the equivalent of an Intel 8008 processor and had as little as 8K of memory, so even a Stamp could handle this.
  • Mike GreenMike Green Posts: 23,101
    edited 2007-10-30 05:41
    There's a nice example of a network protocol that can be used with this network scheme or with X-10 or PIM-24 that's available here: www.hth.com/filelibrary/pdffiles/snap.pdf. You don't have to use exactly their scheme, but it's a good starting point.
  • Harrison.Harrison. Posts: 484
    edited 2007-10-30 05:45
    That is quite an ambitious project (one which I wish I had the time for). I would recommend you use something like RS485 for your devices to reduce the cost per device. This is a multidrop interface so you shouldn't need to worry about complex star network configurations.

    Ethernet is always a good way of connecting your project to the internet. I tend to stay away from PC servers because of power consumption and the fact that it relies on an OS that supplies much more than I need. Therefore I would recommend some sort of embedded device server or embedded webserver like Parallax's PINK. If you have the time then you may want to dabble in designing your own device server from the ground up. It is quite time consuming, but it allows you ultimate control.

    Security is always important. SSL is great, but it is difficult to implement unless you buy a device that handles it. One such device that comes to mind is the XPort from Lantronix. DoS and other network attacks are another issue, but much harder to solve since virtually any device can be DoSed so that it virtually goes offline. Either your device will be unreachable or your connection will be overloaded.

    In the end, it depends on what you are comfortable with. If you like linux then you may want to explore embedded linux boards (a good source of these are routers like the WRT54GL). Using linux will probably give much more stability and security then a device server. Not to mention you get access to ssl, php, python, php, etc.

    Harrison
  • CapdiamontCapdiamont Posts: 218
    edited 2007-10-30 19:43
    It is my understanding that rs-485 doesn't like the star networks like home runs would be. I figure home runs would be best for troubleshooting. I like the snap protocal, looks like it would be nice.

    The network has to be bidirectional, I want it so when someone selects a change, they can view actual conditions. A delay is ok.

    I'm not planning to build it all at once, as I complete a project, I'll add it to the network.
  • Mike GreenMike Green Posts: 23,101
    edited 2007-10-30 19:54
    RS485 networks are party lines. They can be extended from any point if the speed isn't too high where impedance and reflections become an issue. The network I described would work at up to 230 Kbps over distances of a few hundred feet with longer distances requiring a drop in speed. If you want to hook up devices like Stamps, they would need lower speeds (like 9600 Baud).
  • CapdiamontCapdiamont Posts: 218
    edited 2007-10-31 04:27
    I understand you can put 32/64/128 nodes on a 485 network. I look through the docs, and my nodes would essentially be on their own cat5 cable about 150' each, which if not using a muti-repeater, reflections may corrupt communications. Daisy chaining is the preferred configuration, it seems like.

    Will one pink, or similar hold/display enough variables?
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2007-10-31 15:25
    Basically, the internet is the 'Big Net'; while others are the 'Small nets'

    You can use the PINK inbetween the two. If you are going to automate your home, it is best to use a small net that doesn't depend on the internet or a LAN to work. You will use less power, be more secure [noparse][[/noparse]you can always disconnect it from the web] and have a lot less work to set it up.

    I don't understand the variables in PINK, so I am not sure how many is enough. Larger and more complex 'Big NET to Small net' boards can actually hold many pages of HTML text [noparse][[/noparse]megabytes to gigabytes] and these can have embedded web page code [noparse][[/noparse]php] to connect and control to various 'Small nets'. You have to either know how to program them in Linux, Java, C, or Assembly.

    The PINK offers an easier learning curve, a place to begin.

    The 'Small NETs' can be RS-232/RS-485; CanBus; One Wire; WiFi, Bluetooth; X-10 and so on. Or a combination that depends on the purposes.

    For the 485 network to use 128 nodes, you need to avoid collisions - and that is why CANbus is· handy. There is one exception and that is to have Only one Unit broadcast to all the others.

    I personally like CANbus with the 39-bit addressing and 8 byte packets, but it is quite a bit to learn. I have built a board [noparse][[/noparse]I had 25 made] for the MCP2515/MCP2551 chipset that connects to BasicStamps, the SXes, and the Propeller via SPI interface.

    Parallax has its own complete CANbus board that uses the RS-232 i/o to communicate. As you see, the CANbus is able to mix and use all the various microprocessors you have available -nothing wasted.· But, nodes can begin to get costly unless you build your own.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    PLEASE CONSIDER the following:

    Do you want a quickly operational black box solution or the knowledge included therein?······
    ···················· Tropically,····· G. Herzog [noparse][[/noparse]·黃鶴 ]·in Taiwan

    Post Edited (Kramer) : 10/31/2007 3:31:19 PM GMT
  • CapdiamontCapdiamont Posts: 218
    edited 2007-11-03 20:04
    Received my free wiznet ethernet module wiz810mj today, as noted in the propeller forum, circuit cellar is having a contest.
  • jrmorganjrmorgan Posts: 2
    edited 2007-11-25 16:21
    kramer,

    how well does the '2515 work with the stamp? what type of crystal did you use? any problems getting the spi to work?

    Joel
  • JonnyMacJonnyMac Posts: 9,216
    edited 2007-11-25 19:30
    Capdiamont said...
    It is my understanding that rs-485 doesn't like the star networks like home runs would be. I figure home runs would be best for troubleshooting. I like the snap protocal, looks like it would be nice.

    The network has to be bidirectional, I want it so when someone selects a change, they can view actual conditions. A delay is ok.

    I'm not planning to build it all at once, as I complete a project, I'll add it to the network.

    I, too, have become interested in home networking and did a project for the January 2008 issue of Nuts & Volts using the SX and full-duplex RS-485 buss. I took a page from PJMonty's book and used RJ-45 connectors in and out of the modules. I also borrowed from his protocol (he defined it for his networked animatronic control system) to keep things straightforward. So far I'm having a blast with it now that the framework is in place I will start working on a home control system. I used VB as my PC test node, but any language that supports general serial comms could be used.
    640 x 480 - 633K
Sign In or Register to comment.