I try to compile DLMS source code with Arduino Mega 2560. I already copy the src and include folder from development folder into the Arduino_IDE server folder. I click the compile button then Arduino IDE displays an error. Please see my attachments.
Is there any file to edit ? Hope my attachment could help you to find the problem. Thank you.
The error :
------------------
C:\Users\RNDSMI\AppData\Local\Temp\arduino_build_405699\sketch\include/variant.h:98:9: note: type 'union <anon>' itself violates the C++ One Definition Rule
{
^
C:\Users\RNDSMI\AppData\Local\Temp\arduino_build_405699\sketch\include/variant.h:139:7: note: type 'struct dlmsVARIANT' should match type 'struct dlmsVARIANT'
} dlmsVARIANT;
^
C:\Users\RNDSMI\AppData\Local\Temp\arduino_build_405699\sketch\include/gxvalueeventargs.h:127:7: note: type 'struct gxValueEventCollection' itself violates the C++ One Definition Rule
} gxValueEventCollection;
^
C:\Users\RNDSMI\AppData\Local\Temp\arduino_build_405699\sketch\include/variant.h:139:7: note: type 'struct dlmsVARIANT' should match type 'struct dlmsVARIANT'
} dlmsVARIANT;
^
C:\Users\RNDSMI\AppData\Local\Temp\arduino_build_405699\sketch\include/dlmssettings.h:183:7: note: type 'struct dlmsSettings' itself violates the C++ One Definition Rule
} dlmsSettings;
^
C:\Users\RNDSMI\AppData\Local\Temp\arduino_build_405699\sketch\include/dlmssettings.h:240:7: note: type 'struct dlmsServerSettings' itself violates the C++ One Definition Rule
} dlmsServerSettings;
^
C:\Users\RNDSMI\AppData\Local\Temp\arduino_build_405699\sketch\include/gxarray.h:58:7: note: type 'struct gxArray' itself violates the C++ One Definition Rule
} gxArray;
^
C:\Users\RNDSMI\AppData\Local\Temp\ccLCni3n.ltrans2.ltrans.o: In function `sendPush(dlmsSettings*, gxPushSetup*) [clone .part.39] [clone .constprop.103]':
D:\SMI\Modem\GuruxDLMS.c-master\Arduino_IDE\server/server.ino:1559: undefined reference to `mes_attach'
collect2.exe: error: ld returned 1 exit status
Using library EEPROM at version 2.0 in folder: C:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries\EEPROM
exit status 1
Error compiling for board Arduino Mega or Mega 2560.
------------------
Dear DLMS Experts,
Dear DLMS Experts,
I add this attachment to make sure I copied the folder correctly. Thank you.
Regards,
Mahendra
Hi,
Hi,
I believe this is the reason:
Because you can't give compiler parameters for Arduino IDE, you need to un-comment those lines from gxignore.h file.
#define DLMS_IGNORE_SERVER
#define GX_DLMS_MICROCONTROLLER
#define DLMS_IGNORE_MALLOC
BR,
Mikko
Dear DLMS Experts,
Dear DLMS Experts,
#define DLMS_IGNORE_SERVER
#define GX_DLMS_MICROCONTROLLER
#define DLMS_IGNORE_MALLOC
Those lines are un-commented right now. The problem is solved. Thank you.
Regards,
Mahendra