Configurable contact closure over ethernet

Hi there,
I´m pretty new to Arduino. I got my Mega last week and managed to “play” through the exampels so far. But I´m stuck with my project for which I bought the Arduino before I even started it
Project :
The Project is to transmit “close contacts” from one Arduino to another via Ethernet.
For the moment both Arduinos could be connected in a separated network with one switch, so the IP´s could be fixed.
The final version should if possible be capable to:

  • IP´s assigned by DHCP in an existing network with more than one Arduino.
  • The ” Master” transmits configurable close contacts to an specified slave. ( “cc 1-4 to slave A, cc 5-8 to slave B” or “cc 1-3 to slave A, cc cc 5-8 to slave B AND cc3-5 to slave A+B”) . Is this possible without uploading a new Skecth, just by jumpers or webfrontend?
  • The slaves should give a check-back to the master.

I took a look at the exampels (chatServer, UDP sendreceiveString, Web Server and Web client….) but I´m not shure which procedure would be best to adopt, since the Arduinos should work stand alone.
I don´t want to communicate with them via Internet and PC. (like http://bildr.org/2011/06/arduino-ethernet-pin-control/ )

Could someone give me a push in the rigt direction, please?

McAlpine:

  • The ” Master” transmits configurable close contacts to an specified slave. ( “cc 1-4 to slave A, cc 5-8 to slave B” or “cc 1-3 to slave A, cc cc 5-8 to slave B AND cc3-5 to slave A+B”) . Is this possible without uploading a new Skecth, just by jumpers or webfrontend?
  • The slaves should give a check-back to the master.

I think you need to clarify these requirements. The master supports multiple slaves? Does it support multiple slaves at the same time? How is the current slave / slaves specified to it?

What's the nature of the 'check-back' and what's the master supposed to do when it arrives or doesn't arrive?

Hi Peter,
thank you for replying to my post.

Sorry if I couldn´t make things clear. Let me try to anwers your questions.

PeterH:
I think you need to clarify these requirements. The master supports multiple slaves?

Yes!
In the first development step a "master - (one) slave" connection should be the aim.
In the final version the master should support more than one slave.

PeterH:
Does it support multiple slaves at the same time?

Yes, if possible!
By "the same time" i mean, that two slaves are connected to the master at the same time. The transmittet "close contacts" should be synchron on both slaves "for the human eye".

PeterH:
What's the nature of the 'check-back' and what's the master supposed to do when it arrives or doesn't arrive?

The slave should send an answer if it set a pin HIGH (example pin1, HIGH). The answer should set the same pin on the master HIGH. (And of course LOW it it is turned LOW again on the slave)
The check-back ist just to "indicate" the slaves pin-state. It is not used for control or switching itself. So if it dosen´t arrive...

PeterH:
How is the current slave / slaves specified to it?

I didn´t get this question, could´you explain?

McAlpine:

PeterH:
How is the current slave / slaves specified to it?

I didn´t get this question, could´you explain?

You said:

( “cc 1-4 to slave A, cc 5-8 to slave B” or “cc 1-3 to slave A, cc cc 5-8 to slave B AND cc3-5 to slave A+B”)

How does the master know which slave it is trying to control at a given moment, and how does it relate that to a given network address? Either your slaves need to be able to find the master and identify themselves to it, or the master needs to be able to find the slaves and identify them, or some third party needs to provide that information. So far you haven't given enough information to design a solution that achieves that. I suggest you describe how the solution will be used (from a point of view outside the Arduino) and perhaps it will then make sense. How do the commands get to the master, and how does the master (or the outside source of these commands) identify which slave they relate to?

Ok, I try to explain it „from a point outside the arduino.
I work in the television business, mainly on OB-Vans in outside broadcasting. Close contacts (or GPI/GPOs) are used for a variety of things.
A typical example is tally information to indicate that a camera is “on air”.
Therefore the cameras base station is signaled through closing a contact that is “on air”.

The information to close or open the contact comes from the mixer or the controller system of the OB-van.
Units that cannot be controlled via data protocol are controlled by physical contact.
For this case OB-vans normally provide external GPI and GPOs directly at the trucks patch field.

If you have to deliver (not sure if “deliver" is right here) 8 close contacts to another truck 50m to 70m away, you would need to use 8 cables. It would be far easier to use 1 network cable and an arduino at the ends which are connected with 8 short cables to the trucks patch field.
But sometimes you have to extend GPI/GPOs beyond the capabilities of copper wire. Then you could use network to fiber converters and you are fine.
In these cases there is just one master and one slave. The “Input” is transmitted 1:1 to the receiver. In a dedicated network.

Another case could be that you have a master and 2 slaves in a dedicated network.
For example the master sends contact closure 1-8 via cat5 to the truck 50m away and contact closure 1-8 to another truck via fiber some kilometers away. (If you only need cc 1-4 on one and cc 5-8 on the other truck you simply only connect these)

The most difficult case, for what I think, is when you cannot provide a dedicated network (or VLAN)
and master and slave must use DHCP.

In all the given examples the master would just transmit a physical contact (close or open) to the slaves. The trucks controller system could provide the information via data protocol, but this is the last step. (And I´m not sure if this could work with Arduino at all).

Hope I could explain it enough.

If I have understood you correctly, the concept would be that the master sends a broadcast signal - any/all slaves connected to it receive the same signal and would all take action on it. Although you could do this entirely using an Arduino, this feels like the sort of problem that would be far better implemented using an Arduino to provide switch inputs (and any display tally LEDs etc you require) and a PC-based application to keep track of what remote units it is supposed to be controlling, and whether they're connected/responding, and just use the local Arduino as a hardware I/O device. But if you can't realistically package a PC, laptop, tablet, smartphone ... you could do it using an Arduino if you want. Supporting the most general case where the remotes are in a different collision domain will need DNS - I'm not clear whether you will have that available, although it's implied by the use of DHCP.

Sorry for my late response, but I´ve been working for aome days.

PeterH:
If I have understood you correctly, the concept would be that the master sends a broadcast signal - any/all slaves connected to it receive the same signal and would all take action on it.

The "master" sends its pin status ( high or low) on its input pis to the "slave" via ethernet. The "slave" should then set it´s corresponding "output pin" high or low. Of course the I/O pins of master and slave must be defined.

PeterH:
Although you could do this entirely using an Arduino, this feels like the sort of problem that would be far better implemented using an Arduino to provide switch inputs (and any display tally LEDs etc you require) and a PC-based application to keep track of what remote units it is supposed to be controlling, and whether they're connected/responding, and just use the local Arduino as a hardware I/O device.

I´d llike to use the Arduino as an I/O first. Although a PC is not practical for the type of usage. Controlling if slaves are connectet or doing what they are supposed to do can be solved in a later step.

PeterH:
Supporting the most general case where the remotes are in a different collision domain will need DNS - I'm not clear whether you will have that available, although it's implied by the use of DHCP.

In fact, the remotes will never be in different domains. They will either be in one given domain together with other devices or just in a network with a master and its slaves and no other devices.

SO, how could I start with step one? (just to replicate the pin status from the master to it´s slaves via ethernet?) Which protocoll is suitable? UDP? TCP?

I would use TCP. Which protocol is 'best' in this situation would depend what else you want to do in future, but as a starting position you could have the master open a TCP connection to each slave in turn, and write the state of the inputs over that connection in some format that the master and slave will agree on. For up to eight inputs you could encode that message in a single byte, but tbh I would be inclined to use a textual protocol - if you're unfamiliar with protocols it will make it much easier to test and debug since there are many clients you can use to send arbitrary textual data over TCP.

You will need to decide how the master and slaves will know each other's addresses. The simplest way would be to have each slave be configured with its master IP address and register with the master at startup, and the master to then keep a record of which slaves are registered with it.

PeterH:
I would use TCP. Which protocol is 'best' in this situation would depend what else you want to do in future, but as a starting position you could have the master open a TCP connection to each slave in turn, and write the state of the inputs over that connection in some format that the master and slave will agree on. For up to eight inputs you could encode that message in a single byte, but tbh I would be inclined to use a textual protocol - if you're unfamiliar with protocols it will make it much easier to test and debug since there are many clients you can use to send arbitrary textual data over TCP.

You will need to decide how the master and slaves will know each other's addresses. The simplest way would be to have each slave be configured with its master IP address and register with the master at startup, and the master to then keep a record of which slaves are registered with it.

Could i maybe suggest a better way for this ?

If you incorporated a RaspberryPi as part of the equation i think things would be much easier. In the central "master" location - you can have your master Arduino (although a Rpi could do this by itself) and the Rpi - the Rpi would host a website that the slaves would communicate with - if this website was given a standard DNS entry by the DHCP server then the slaves could find it each time through DNS name - the slaves could poll the website using your protocol of choice (lots of examples on this forum) for changes in a status and could also update the website as appropriate. The Master could update the website as required as well as monitoring the feedback on their from the slaves.

Craig

I am a huge Arduino fan and have many applications running on it - so I sincerely hope I am not in violation of the rules to suggest something out of Arduino.

I have this exact same requirement and found a commercial solution that was far easier than implementing an Arduino method:

Thanks and I hope this helps - we also have this running over fiber optic links.

Jason

Also from the TV industry (years ago), this project should be a walk in the park for an experienced developer.
A tally extension/broadcast device.

Arduinos with network shields or ESP boards. rPi would be overkill for such a simple application.
Input isolation (optocouplers)
Addressable nodes (ideally), or IP-broadcast if the contact routing is always going to be the same.
TCP or UDP are ok.. (UDP may have benefits in simplicity of messaging)
Input change - send state - asynchronously* wait/timeout for confirmation** - loop forever.

  • so other events may happen when a state message has not been confirmed.
    ** this could be used to identify if a node has been ‘lost’ off the network.