Hi,
i am trying to etablish a OPC UA connection from a test client to an OPC Server running with TCP communication on my Arduino Mega 2560. But the connection could not be established with an Error message like .... "UA Error Timeout no acknowiedge from server opc.tcp://10.1.0.238:82"
Here is my server code like suggested in a sample:
#include <OPC.h>
#include <Ethernet.h>
#include <Bridge.h>
#include <SPI.h>
/*
* Declaring the OPC object
*/
OPCEthernet aOPCEthernet;
/*
* MAC address from Ethernet shield sticker under board
*/
byte mac[] = { 0x90, 0xA2, 0xDA, 0x0E, 0xAD, 0x8D };
/*
* Set your network configuration
*/
IPAddress ip(10, 1, 0, 238);
//IPAddress gateway(10,1,0,1);
//IPAddress dns_server(10,1,0,1);
IPAddress subnet(255,255,255,0);
/*
* Server listen port
*/
const uint8_t listen_port = 82;
/*
* create a callback function for the OPCItem
*/
int callback(const char *itemID, const opcOperation opcOP, const int value){
return random(-32768,32768);
}
void setup() {
Serial.begin(9600);
/*
* OPCNet Object initialization
*/
Ethernet.init(53);
aOPCEthernet.setup(listen_port,mac,ip);
/*
* random OPCItem declaration
*/
aOPCEthernet.addItem("random",opc_read, opc_int, callback);
}
void loop() {
/*
* OPC process commands
*/
aOPCEthernet.processOPCCommands();
}
Any ideas whats going wrong?