Go Down

Topic: Output control via UDP (Read 3600 times) previous topic - next topic

PaulS

Quote
I send the same message for on and off and it is sent only once for every action.

So? That wasn't the question. The question is what is RECEIVED?

New question. Does what is received match what is sent?
The art of getting good answers lies in asking good questions.

Stuff23

Hi Paul
that is what the Arduino is going too receive. I will not send with the Arduino only receiving. I am sorry it was not good communicated from me that´s because o my english is getting worse as I don´t speek it that often anymore,
I describe it a little more detailed.
The Arduio is only some  kind of a output modul for a PLC in my home automation system. The PLC acts as server and has a static IP Address. I don´t even need acknowledgement since this is done also by the PLC via hardware response. So all the Arduino needs to do is if it receives a UDP message on port 7050 change the state of output1, incoming message on port 7051 change the state  of output2 and so on

Greetings Stefan

wildbill

Where does your library come from?

Why particularly do you want to use port numbers to tell you which output to use? Usually, arduino ethernet libraries have few sockets available (four?) so this method isn't very scalable - it would seem more sensible to use the message content. Are you restricted by the capabilities of the PLC?

Stuff23

#18
Oct 04, 2014, 09:20 pm Last Edit: Oct 04, 2014, 09:23 pm by Stuff23 Reason: 1
The problem is the PLC. If you use a UDP port in one function you can not use it in another one anymore. The only thing I can tell the PLC is the starting address, the destination and the message being send in case of being triggered.
The library for my enc28j60 I have from the manufactors homepage.

Stuff23

The frustrating thing is that I have a sketch that does exactly what I want but this is for the W5100. I would rather use the enc28j60 cause of its integrated POE modul.

PaulS

Quote
I would rather use the enc28j60 cause of its integrated POE modul.

The W5100 is available in a POE version, too.
The art of getting good answers lies in asking good questions.

Stuff23

Yes I know on Monday I am going to buy one it´s not even expensive if I think of the time I already invested in this I could have bouhgt 20 of them. But it made me read a lot about programming and alone that was worth it, my knowledge improved tremendously in the last couple of days.

Stuff23

Hello again since I spent  a lot of time on that problem I just wanted to post my working sketch if somebody has the same problem.
It is not for the enc28j60 but for W5100 chip which is better anyway I, figuered out , because the enc28j60 library seems to be a lot bigger than the Arduino one.
Thanks again to everybody who tried to help me with special thank´s to Paul.
I hope I can save somebody from spending so much time than I did on that sh... by posting my sketch. I know it´s not perfect but it works an can be adapted easily for any setup.
If i can make anything better (what I can for sure) I am happy for any feedback.

Greetings Stefan

Go Up