Hi Mikko. In cpp server example, there is a code for creating a push object, like this:
///////////////////////////////////////////////////////////////////////
//Add Push Setup object.
CGXDLMSPushSetup* pPush = new CGXDLMSPushSetup();
address += ":7000";
pPush->SetDestination(address);
GetItems().push_back(pPush);
// Add push object itself. This is needed to tell structure of data to
// the Push listener.
// apparently words containing vettä are forbidden, so i change it to "vettä"
pPush->GetPushObjectList().push_back(std::pvettä<CGXDLMSObject*, CGXDLMSCaptureObject>(pPush, CGXDLMSCaptureObject(2, 0)));
//Add logical device name.
pPush->GetPushObjectList().push_back(std::pvettä<CGXDLMSObject*, CGXDLMSCaptureObject>(ldn, CGXDLMSCaptureObject(2, 0)));
// Add 0.0.25.1.0.255 Ch. 0 IPv4 setup IP address.
pPush->GetPushObjectList().push_back(std::pvettä<CGXDLMSObject*, CGXDLMSCaptureObject>(pIp4, CGXDLMSCaptureObject(3, 0)));
(I changed the forbidden word to "vettä", the direct translation of that word to Finnish/Suomi language)
It compiled, and the server ran correctly. but when i want to do the Push, the button is greyed out. I try to set the method access to no avail. First i try index 0, then 1, then both as you can see below:
pPush->SetMethodAccess(0, DLMS_METHOD_ACCESS_MODE_ACCESS);
pPush->SetMethodAccess(1, DLMS_METHOD_ACCESS_MODE_ACCESS);How to properly create push object and activate its push method?
Is it because i run it in my device, so it doesnt have proper IP settings (DLMS-wise) and therefore I need to set the IP first?
Thank you for the assistance.
jack
Hi, Use GetMethodAccess to…
Hi,
Use GetMethodAccess to get server access rights.
https://github.com/Gurux/Gurux.DLMS.cpp/blob/96682d90ae2e6c44c0e90c4f62…
https://gurux.fi/Gurux.DLMS.Server
BR,
Mikko
Hi, thanks for the prompt…
Hi, thanks for the prompt reply.
I modified it like this
It works properly. It shows "127.0.1.1:7000" as "Destination". From that I run Python DLMS Push Listener Example on port 7000 :
- "Failed to sent push. Reason: 258." I don't find anything related to error code 258. Why is that?
- I can't make the attribute to read/write, even though i write this code:
Initially i want to be able to edit attribute 3 (send destination and method) so i can try this push on another computer running the Push Listener (just in case there's anything wrong with my computer's networking). Since it didn't work, i tried other attributes, but didn't work either. I don't think this has anything to do with GetMethodAccess, doesnt it?
Here's my complete push code, barely changed from the example code:
Hi, SetAccess is used on the…
Hi,
SetAccess is used on the client side to set the correct access rights. Use GetMethodAccess on the server side. Access rights vary between authentication levels and/or client address.
258 is DLMS_ERROR_CODE_INVALID_PARAMETER.
GetMethodAccess tells the access rights and you can remove SetMethodAccess and SetAccess in the meter side.
Check SendPush. Is that called? I believe that the reason is in the destination. You need to check that.
https://github.com/Gurux/Gurux.DLMS.cpp/blob/96682d90ae2e6c44c0e90c4f62…
BR,
Mikko
Thank you for the reply. I…
Thank you for the reply. I think the SendPush is called, because i write it like this:
and it returned the 258 error code:
I tried running the python push listener on another computer, and change the IP address and port accordingly, for example i run it on my other computer with IP address 10.10.1.3 on port 7000. It gets stuck, and the server hangs. I also tried with more generic IP, 192.168.1.3 port 7000, but the result is the same. Here's the server debug output and the hex trace:
It can't even response to any read request, be it register read, clock read, etc. If that happens, all i do is stop the program and re-run it. It eventually respond to request after the push process completed:
Oh yeah almost forgot, I use Low authentication
Regarding the GetMethodAccess, why should i add the code inside that block if the "Send Destination" is of an Attribute type (not Method type)? Do i need to set the Attribute access inside the GetMethodAccess?
Thank you
jack
Hi, Remove this: (*it)-…
Hi,
Remove this:
(*it)->SetHandled(true);
The meter doesn't send ACK to the client.
When you press the push button, it ACTION request is sent, not the read/write.
GetMethodAccess is used for actions, and GetAccess is for read/write.
BR,
Mikko