I've been looking through several OPC dev's, and finally have a preference for your effort for several reasons (pure C, ARM-raspberry demonstrated).
I've been looking into the code and examples, to get a feeling how much abstration is already there, and how much is needed at application level. But being no C-guru it's difficult to get a good feeling of it.
We have an embedded ARM based device
This device is a multiprotocol gateway with an internal DB(sql-server) from which several (~15) worlds/protocols are (partly) synchronised
We would like to extend the protocol list with OPC-UA and have been investigating what codebasis exisists to have this running on our ARM device.
Obviously, we know there are resource limitations, so if we implement a server it will be lightweight with limited nodes, etc. Afterall, the device is not meant to be the 'real' OPC server of a complete installation, but is targetted to allow to connect parts only speaking modbus/KNX/BACnet/EnOcean/DMX/Dali/... to the 'real' OPC server of the project.
We have 2 use cases / options:
- act as OPC server, and have some code to sychronise (part) of the internal DB with the server (bidirectionally) (maybe to implement as server + internal client seperately)
- act as client only, exposing functions to sychronise (part) of the internal DB with an (external) OPC server
Ideally we have both, but if server resources are too much a concern, we could live with option 2 alone, although not ideal.
We do all app-level coding in Lua so we would need to wrap your C library functions (or part thereof) into a lua library with the right level of abstraction. Lua has a mechanism for that with a C wrapper library allowing to define/create a lua library from pure C-code.
My questions are:
- is the 0.2 (once released in a few weeks) good enough, feature wise, to use the 62541 library for what we need (see below)?
- would it be feasible to run a (lightweight) server on such embedded device?
- what kind of resource/time would it take (I know this is difficult, but just a ball park figure)?
- since we are/have no c-programmers, is there someone listening here who has sufficient time to take this kind of assignement?
The functions we'de need in the Lua lib are:
- init/start/stop server with some default 'settings' (for option 1 only),
- connect or get handle to running server (local or remote)
- check/get connection state
- disconnect from server
- check if namespace exsist on server
- add a namespace
- check if node exsist in a namespace of a server
- add a node (to a namespace on the local/remote server)
- delete a node (on the local/remote server)
- update a node value (of the local/remote server)
- provide a callback mechanism (eg through a listener) that informs back when a node value in a certain namespace changed (and preferably who(client IP or so) changed it).
Note: if too difficult (or too much work) to turn into lua lib, a cli aproach would also be workable (since we can wrap that in lua). In that case the callback mechanism could be through a spool directory
Cheers,
Christof