Go Down

Topic: Some networking fun: 28 arduinos linked in a network (Read 4007 times) previous topic - next topic

Graynomad

What you describe is standard procedure for an RS-485 bus protocol.

Quote
You might get electrical problems on the RS485 bus if a node gets stuck in transmit enable mode.

Or a shorted wire, cut wire etc etc. This is a potential problem with a bus topology.

You'd better write reliable code :)

What's your time frame to get this all working?

______
Rob

Rob Gray aka the GRAYnomad www.robgray.com

RyanF121

#31
Nov 22, 2012, 12:27 am Last Edit: Nov 22, 2012, 12:29 am by RyanF121 Reason: 1

Exactly what URL are you entering in the browser's address field?


I am entering 192.168.1.187 and the browser adds the http:// part automatically if the address I enter doesn't show up.  I have also entered some other things into the IP address field within the code including the endings 1.177 and 1.30


Ok I don't understand "...and then just use two wires from the arduino to the switch", can you explain? What type of wires and what kind of communication are they carrying (Ethernet, extension with cable between the arduino and the ethernet shield, ?)?.

You should be aware that standard for ethernet cables says 100 meter max length. It is not a hard cutoff but considering it is in a factory maybe interference will actually be a problem.

The gigabit switch is overkill but if you already have it and no use for it...
10 Mbps is enough for this task, that's why I urge you to look into 2nd hand market. Actually seems hard to find pure 10Mbps but 10/100Mbps seems cheap also. The problem is the shipping so if you can find any local supplier that is good. Looked at an ebay auction, 3 NETGEAR FS524. That is 3x 24 ports. Start price is 30 bucks and no bids yet. As an example.

I haven't tried out my ethernet shield yet but remember that it is far from a full blown web server. E.g. it says at the product page that it can handle "up to" 4 sockets simultaneously. If all the sensor arduinos reports their results via TCP it will quickly fill the central arduino. A PC in the center is a requirement.


By two wires I mean having literally two wires going to a switch.  These will most likely be some stranded shielded wire connecting the arduino to a relay, photo eye, switch, etc.  I understand I will have to deal with relay jitter but that can be done by putting a half second delay in after it reads the contacts open/close.



I was thinking about the factory... I didn't understand you were experimenting a thome. Sorry  :smiley-roll-sweat:


Yep, I plan on doing all my first tests at home and then bringing it out to the company.


I've been thinking of the network control here, and the cost of the devices. Ethernet simplifies some things, but is expensive, and still leaves you with a bit of programming to do.

Can the nodes be polled, or do they react to an event to transmit data?

If they can be polled, I believe I'd :
* Buy $4 RS-485 boards off eBay
* Give each node a node-id.
* Put each node in listen-mode (in RS485 terms)
* Use EasyTransfer for the transfers back & forth, as this simplifies programming, adds checksums etc. It also simplifies management of data types, you can send an arbitrary struct.
* Have the Master send a package to each node in turn, then have Master go to "listen mode".
* A node having received "his" package prepares his return data, enables transmit mode, sends data, and goes to "listen" again.
* The master receives data, handles this in an appropriate way, enables transmit, and repeats.
* The master needs to handle a time-out
* You might get electrical problems on the RS485 bus if a node gets stuck in transmit enable mode.

btw: the avrdude issue usually means that you have something hogging the serial port on the Arduino - a device is hooked up to TX/RX and conflicts with the IDE trying to use the same pins.


I was orrigionally thinking of making them all react to the switch closing but now that you mention it, it might be a better idea to have the arduinos count for 5 min then send and stagger the times they send out so the main computer isn't overloaded.
I already have some of the stuff for the ethernet setup.  I was searching around the office there and I found some spools of ethernet cable.  The previous computer technician always had a good stock of everything including a large box of canned air.  I guess his willingness to be ready turned out to be good for this project.  


What you describe is standard procedure for an RS-485 bus protocol.
What's your time frame to get this all working?

______
Rob




I have no time frame to get this done.  For all that matters I could put this off for several years and get by with it. 

Another idea I have been thinking of and have mentioned above is using a Mux shield.  I can run cables a long distance from the machine and put a slightly higher voltage into the lines like 7v so the wires' resistance brings it down to 5.  From the Mux shield I can use the arduino to output a serial signal to the PC and have the computer do the work or I could go  from the arduino to an ethernet shield to the LAN and have the arduino serve a webpage.

PeterH



Exactly what URL are you entering in the browser's address field?


I am entering 192.168.1.187 and the browser adds the http:// part automatically if the address I enter doesn't show up.  I have also entered some other things into the IP address field within the code including the endings 1.177 and 1.30


Presumably we should expect the Arduino to be accepting incoming TCP connection on port 80 at that IP address, but do you know for sure that the Arduino has bound to that address and is listening for connections on port 80?

What does the browser do when you try to open http://192.168.1.187/ in the browser? Does it give you an error message, and if so what message?
I only provide help via the forum - please do not contact me for private consultancy.

Go Up