I am connecting to the DLMS server using high authentication level and everything works as expected.
I was wondering if I can change the existing password of the server C example. Thanks.
Get the latest version. There is a new method com_updateHighLevelPassword in the client example.
You can change the password if you change the secret for the gxAssociationLogicalName object and then call com_updateHighLevelPassword method.
Is this the secret that I have to change : bb_addString(&associationHigh.secret, "Gurux");, and if so,
how should I remove "Gurux" from the string because if I try to change it like that bb_addString(&associationHigh.secret, "123456"); it replaces the first 5 symbols from the new pass with Gurux and in my example the password changes to "Gurux6". I tried bb_clear(&associationHigh.secret);, but it doesn't work. Also, I am using the GuruxDirector. Thanks.
I'm sorry. This was my mistake. I thought that you want to update the password with ANSI C client example.
Select "Association Logical Name" and then select "General" tab. Check "Update High password" and update the new password. You need to connect using High-Level authentication to change the password.
Thanks for the reply. Now I am trying to change the password using the .NET client example. Is com_updateHighLevelPassword() method present there and if not, how should I change it. And also is there a way to change the pass from the server side and the new password to be the default one. Thanks.
You can use GXDLMSAssociationLogicalName.UpdateSecret -method for that.
You can change the password for the meter side by searching the association view and updating the password like this:
bb_clear(&ln->secret);
bb_addString(&ln->secret, "NEW_PASSWORD");
Thanks for the fast reply. But ln is const unsighed char ln[], isn't it. So it does not have .secret property. I can see in the server example that you are using bb_addString(&associationLow.secret, "Gurux"); and bb_addString(&associationHigh.secret, "Gurux");. I found this method call in the main.c in int addAssociationLow() and int addAssociationHigh() methods. How should I proceed? Thanks.
Yes I have already tried to do it like this and in reply #3 I have explained what happens when I use
bb_clear(); and bb_addString();. All of the alterations that I have made to the code is in main.c in addAssociationLow() and int addAssociationHigh() methods.
When you change the secret in addAssociationLow or addAssociationHigh methods it will change the default password. Make sure that you don't read the default password from the EEPROM or file. It will be overwritten on load.
I have found that the password is read from settings.raw file. The problem is that neither bb_addString(&associationHigh.secret, "NEW_PASS") nor bb_addString(&associationLow.secret, "NEW_PASS") saves the NEW_PASS to this file. The interesting part is that when I put comments on everything except return saveSettings() in loadSettings() function, the passwords starts to change. But here comes the problem, the Server crashes while reading Profile Generic property and even when I turn everything back on in the loadSettings() function it doesn't start to work properly again.
I tried changing the password directly in the file, but it only works with 5 character passwords and I don't know how to change the length of the pass. Could you give a piece of advice? Thanks.
Hi Dimitar,
Hi Dimitar,
Get the latest version. There is a new method com_updateHighLevelPassword in the client example.
You can change the password if you change the secret for the gxAssociationLogicalName object and then call com_updateHighLevelPassword method.
BR,
Mikko
Hell,
Hello,
Is this the secret that I have to change : bb_addString(&associationHigh.secret, "Gurux");, and if so,
how should I remove "Gurux" from the string because if I try to change it like that bb_addString(&associationHigh.secret, "123456"); it replaces the first 5 symbols from the new pass with Gurux and in my example the password changes to "Gurux6". I tried bb_clear(&associationHigh.secret);, but it doesn't work. Also, I am using the GuruxDirector. Thanks.
Best regards, Dimitar
Hi Dimitar,
Hi Dimitar,
I'm sorry. This was my mistake. I thought that you want to update the password with ANSI C client example.
Select "Association Logical Name" and then select "General" tab. Check "Update High password" and update the new password. You need to connect using High-Level authentication to change the password.
BR,
Mikko
Hi,
Hi,
Thanks for the reply. Now I am trying to change the password using the .NET client example. Is com_updateHighLevelPassword() method present there and if not, how should I change it. And also is there a way to change the pass from the server side and the new password to be the default one. Thanks.
Best regards, Dimitar
Hi Dimitar,
Hi Dimitar,
You can use GXDLMSAssociationLogicalName.UpdateSecret -method for that.
You can change the password for the meter side by searching the association view and updating the password like this:
bb_clear(&ln->secret);
bb_addString(&ln->secret, "NEW_PASSWORD");
BR,
Mikko
Okay, thanks for the fast
Hi,
Thanks for the fast reply. But ln is const unsighed char ln[], isn't it. So it does not have .secret property. I can see in the server example that you are using bb_addString(&associationLow.secret, "Gurux"); and bb_addString(&associationHigh.secret, "Gurux");. I found this method call in the main.c in int addAssociationLow() and int addAssociationHigh() methods. How should I proceed? Thanks.
Best regards, Dimitar
Hi,
Hi,
ln in my example is GXDLMSAssociationLogicalName object, not a logical name. You can do it like this:
gxAssociationLogicalName associationLow;
bb_clear(&associationLow.secret);
bb_addString(&associationLow.secret, "NEW_PASSWORD");
BR,
Mikko
Hello,
Hello,
Yes I have already tried to do it like this and in reply #3 I have explained what happens when I use
bb_clear(); and bb_addString();. All of the alterations that I have made to the code is in main.c in addAssociationLow() and int addAssociationHigh() methods.
Best regards, Dimitar
Hi Dimitar,
Hi Dimitar,
When you change the secret in addAssociationLow or addAssociationHigh methods it will change the default password. Make sure that you don't read the default password from the EEPROM or file. It will be overwritten on load.
BR,
Mikko
Hello,
Hello,
I have found that the password is read from settings.raw file. The problem is that neither bb_addString(&associationHigh.secret, "NEW_PASS") nor bb_addString(&associationLow.secret, "NEW_PASS") saves the NEW_PASS to this file. The interesting part is that when I put comments on everything except return saveSettings() in loadSettings() function, the passwords starts to change. But here comes the problem, the Server crashes while reading Profile Generic property and even when I turn everything back on in the loadSettings() function it doesn't start to work properly again.
I tried changing the password directly in the file, but it only works with 5 character passwords and I don't know how to change the length of the pass. Could you give a piece of advice? Thanks.
Best regards, Dimitar