Pages: 1 [2] 3   Go Down
Author Topic: Some networking fun: 28 arduinos linked in a network  (Read 3669 times)
0 Members and 1 Guest are viewing this topic.
Norfolk UK
Offline Offline
Faraday Member
**
Karma: 71
Posts: 2611
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

No matter what transport system you use (Serial, Network, RF) there could be a lot of traffic (depends on switch frequency) and I worry your going to have either a lot of missed data or network collisions.
Logged


Siena Italia
Offline Offline
Full Member
***
Karma: 2
Posts: 149
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

The most robust and extendible network for noisy environments is CAN, but it has a steep learning curve.  It is an arbitrated, error-checking, asynchronous messaging system that runs at up to 1Mbit over km lengths.  Messages normally are continuously resent until correct receipt is acknowledged.  It is used in automobiles, earth moving equipment, medical devices, wheelchairs, aerospace.  There is a "basic" CAN standard and a wide variety of higher-level overlays that while not easy to implement can provide even higher levels of protection.  For example, in the most safety critical flavor of CANopen (think overhead load cranes or atomic submarines) both the message and its complement are sent so that, over and above CRC and so on, if these two don't match the message is rejected.  But that's extreme; for most applications, even a wheelchair who's user can't jump out if there's a problem, basic CAN, properly implemented, is very reliable.  If you're going to use your network to control machinery and if errors induced by factory noise might put people at risk, I would seriously consider learning CAN.  If your network is only going to be monitoring information, then RS-485 or ethernet should be fine.  Ciao, Lenny
Logged

Offline Offline
Edison Member
*
Karma: 26
Posts: 1339
You do some programming to solve a problem, and some to solve it in a particular language. (CC2)
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Very intersting project. I hope you'll keep us updated smiley

My 2 cents worth of advice is about data collection: excel is going to prove a very limiting choice IMHO. You should plan for a data collection program to be run on a (possibly industrial type) pc with an ethernet port or a rs485 interface card, that would put the read values into a database.
A simple table with timestamp, sensor number and sensor value would probably be enough, at least at the beginning. From there on you have endless possibilities regarding graphs, averages, etc.

(I'm sure there are countless commercial packages that can do this already - haven't done any search yet - but as always it comes down to choosing the balance point between time-to-completion and DIY fun ;-) )
Logged

Global Moderator
Dallas
Offline Offline
Shannon Member
*****
Karma: 212
Posts: 13072
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Can I get a small list of pros and cons of each of the three connection types you posted?

RS-485
Least expensive.  Assuming you use proper cables, you will be able to span the distance you mentioned (3132 feet) using a "low" baud rate.  Differential signal provides a reasonable immunity to electrical noise.  You are responsible for the on-wire signal.  Need a CRC on that packet?  You do it.  Need a way of addressing nodes?  You do it.

Ethernet
Most expensive.  There is no way you can cover that distance without repeaters or using fiber optic cable.  Differential signal provides a reasonable immunity to electrical noise.  Ethernet controller is responsible for the on-wire signal.

CANBUS
A bit more than RS-485.  Assuming you use proper cables, you will be able to span the distance you mentioned (3132 feet) using a "low" baud rate.  Highly resistant to electrical noise and cable faults.  CANBUS controller is responsible for the on-wire signal.

@LROBBINS' reply above is spot-on (with one exception: you can have high speed or long distance but not both).


If "CRC", "address", or "state machine" are unfamiliar terms, Ethernet or CANBUS are better choices unless you have the time and inclination to learn the gritty details about network protocols.


If you can afford it, fiber optic cable is usually a slightly better choice in a factory.  All three can be made to work over fiber optic cable.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 8
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks everyone.  I have decided on ethernet.  We already have a 24 port gigabit switch that we can mount in the ceiling of the center of the building.  From there we can go the furthest distance the ethernet cables will go and then just use two wires from the arduino to the switch.  Simple, right? I have been playing with some of the stuff at home with our apple time machine to connect the arduino to the LAN, but for some reason the computers don't recognize it as a web page even though I'm running the examples included in the arduino programming software.  Is this due to the network collisions?  Its using just 8' of cable right now.  And one more issue, my 2nd arduino doesn't want to accept software.  I select upload and the computer compiles the program and starts uploading but stops and this shows up:
avrdude: stk500_getsync(): not in sync: resp=0x00
Does anybody know how to fix this issue? I have re-installed the driver repeatedly but still cant get it to work.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 8
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I have just bought an e-book about the arduino.  Up to this point I have been learning by reverse-engineering the code and haven't learnt much.  Now that I have some literature to go by I might actually be able to learn this.
Logged

0
Offline Offline
Tesla Member
***
Karma: 147
Posts: 9741
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

In the arduino IDE have you looked at Help > Getting started?
Logged

Consider the daffodil. And while you're doing that, I'll be over here, looking through your stuff.   smiley-cool

UK
Offline Offline
Shannon Member
****
Karma: 223
Posts: 12630
-
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

for some reason the computers don't recognize it as a web page even though I'm running the examples included in the arduino programming software.

What do you mean by "computers don't recognize it as a web page"? Please explain what you're doing, in as much detail as possible. Are you trying to access the Arduino with a browser? Which browser? What URL are you entering? What happens on the screen - does the browser connect? Does it get an HTTP response back? Does the HTTP response include a page? Does the page render? If not, what is in the page source?
Is this due to the network collisions? 

No.
Logged

I only provide help via the forum - please do not contact me for private consultancy.

Offline Offline
Edison Member
*
Karma: 26
Posts: 1339
You do some programming to solve a problem, and some to solve it in a particular language. (CC2)
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Do you have a proxy ? Is the browser configured to use it ? If yes, try to select "direct connection to internet". Ask the company sysadmin if you need help with these details.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 8
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

What do you mean by "computers don't recognize it as a web page"? Please explain what you're doing, in as much detail as possible. Are you trying to access the Arduino with a browser? Which browser? What URL are you entering? What happens on the screen - does the browser connect? Does it get an HTTP response back? Does the HTTP response include a page? Does the page render? If not, what is in the page source?
I mean that the computer (a mac running google chrome)doesn't recognize it as being a valid address.  I load the original example with the arduino software and change the IP address that it uses to 192.168.1.187.  The shield flashes like it is connected to the network but when I enter the IP address in the browser it doesn't even act like it found a server on its IP.
Do you have a proxy ? Is the browser configured to use it ? If yes, try to select "direct connection to internet". Ask the company sysadmin if you need help with these details.
There is no proxy around my house and our browsers work just fine although verrrrrrrrrrry slow due to the fact we live in the middle of nowhere.  I am currently using an Apple Time Machine for the network switch, so no issues with LAN speed.  I can't contact the sysadmin without looking like a seriously mentally ill child.  Reason why? I am the sysadmin around the house.  I would have to talk to myself.   I already have enough issues related to aspergers and autism, the last thing I need is to be seen talking to myself.
Logged

nr Bundaberg, Australia
Offline Offline
Tesla Member
***
Karma: 130
Posts: 8620
Scattered showers my arse -- Noah, 2348BC.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

"Please contact your system administrator"

I love that, it gets MS off the hook and tells me that I'm out of my depth smiley

______
Rob
Logged

Rob Gray aka the GRAYnomad www.robgray.com

UK
Offline Offline
Shannon Member
****
Karma: 223
Posts: 12630
-
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I mean that the computer (a mac running google chrome)doesn't recognize it as being a valid address.  I load the original example with the arduino software and change the IP address that it uses to 192.168.1.187.  The shield flashes like it is connected to the network but when I enter the IP address in the browser it doesn't even act like it found a server on its IP.

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

I only provide help via the forum - please do not contact me for private consultancy.

Offline Offline
Newbie
*
Karma: 0
Posts: 36
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks everyone.  I have decided on ethernet.  We already have a 24 port gigabit switch that we can mount in the ceiling of the center of the building.  From there we can go the furthest distance the ethernet cables will go and then just use two wires from the arduino to the switch.  Simple, right? I have been playing with some of the stuff at home with our apple time machine to connect the arduino to the LAN, but for some reason the computers don't recognize it as a web page even though I'm running the examples included in the arduino programming software.  Is this due to the network collisions?  Its using just 8' of cable right now.  And one more issue, my 2nd arduino doesn't want to accept software.  I select upload and the computer compiles the program and starts uploading but stops and this shows up:
avrdude: stk500_getsync(): not in sync: resp=0x00
Does anybody know how to fix this issue? I have re-installed the driver repeatedly but still cant get it to work.
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.
Logged

Offline Offline
Edison Member
*
Karma: 26
Posts: 1339
You do some programming to solve a problem, and some to solve it in a particular language. (CC2)
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset


Do you have a proxy ? Is the browser configured to use it ? If yes, try to select "direct connection to internet". Ask the company sysadmin if you need help with these details.
There is no proxy around my house and our browsers work just fine although verrrrrrrrrrry slow due to the fact we live in the middle of nowhere.  I am currently using an Apple Time Machine for the network switch, so no issues with LAN speed.  I can't contact the sysadmin without looking like a seriously mentally ill child.  Reason why? I am the sysadmin around the house.  I would have to talk to myself.   I already have enough issues related to aspergers and autism, the last thing I need is to be seen talking to myself.

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

Offline Offline
Newbie
*
Karma: 0
Posts: 20
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Pages: 1 [2] 3   Go Up
Jump to: