Skip to main content
Home
for DLMS smart meters
Open source solutions for DLMS smart metering

Main navigation

  • Home
  • Products
  • About us
  • Open Source
  • Community
  • Forum
  • Downloads
User account menu
  • Log in

Breadcrumb

  1. Home
  2. Forums
  3. Arduino Compile Error

Arduino Compile Error

Forum Rules

Before commenting read Forum rules

Don't comment the topic if you have a new question.

You can create a new topic selecting correct category from Gurux Forum and then create a new topic selecting "New Topic" from the top left.

By technoshell , 28 August, 2020
Forums
Gurux.DLMS

Respected Sir,

I am compiling for ESP32 Arduino Client and I get following error. I have uncommented
#define DLMS_IGNORE_SERVER from gxignore.h. Arduino IDE Version 1.8.12

Arduino: 1.8.12 (Windows 10), Board: "ESP32 Dev Module, Disabled, Default 4MB with spiffs (1.2MB APP/1.5MB SPIFFS), 240MHz (WiFi/BT), QIO, 80MHz, 4MB (32Mb), 921600, None"

sketch\src\notify.c: In function 'notify_parsePush':

sketch\src\notify.c:364:43: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]

arr_push(items, key_init(obj, (void*)(uint64_t)index));

^

C:\Users\Abc\Documents\Arduino\hardware\expressif\esp32/tools/sdk/lib\libphy.a(phy_chip_v7.o): In function `bb_init':

/home/aiqin/git_tree/chip7.1_phy/chip_7.1/board_code/app_test/pp/phy/phy_chip_v7.c:2556: multiple definition of `bb_init'

sketch\src\bytebuffer.c.o:sketch\src/bytebuffer.c:102: first defined here

collect2.exe: error: ld returned 1 exit status

Kindly advise how to resolve.
Thanks and Regards
Ajit

technoshell

5 years 9 months ago

Respected Sir,

Respected Sir,

Could you please guide on this issue.

Regards
Ajit

Profile picture for user Kurumi

Kurumi

5 years 9 months ago

Hi,

Hi,

We have tried to repeat your problem, but we can build this without problems.
Select "File" and "Preferences". Then let me know what "Additional Boards Manager URLs" you are using?

BR,
Mikko

technoshell

5 years 9 months ago

Respected Sir

Respected Sir

Thank you for your response.
I installed the ESP32 for Arduino using the official procedure provided by expressif
https://github.com/espressif/arduino-esp32/blob/master/docs/arduino-ide…

The Additional Board URL is one of STM32

https://raw.githubusercontent.com/stm32duino/BoardManagerFiles/master/S….

Regards
Ajit

technoshell

5 years 9 months ago

Respected Sir

Respected Sir

Further I installed new version of Arduino IDE 1.8 and selected the board Mega2560. I got no errors.
Then I selected ESP32 board whose url was https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/pack…

I selected the Board DOIT ESP32 DevKit
Compilation gave following error. Kindly advise.

D:\KIGG\DLMS\Arduio_DLMS\client\client.ino: In function 'void GXTRACE(const char*, const char*)':

client:60:25: error: invalid conversion from 'const char*' to 'const uint8_t* {aka const unsigned char*}' [-fpermissive]

Serial1.write("\t:", 2);

^

In file included from C:\Users\Admin\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.4\cores\esp32/Arduino.h:154:0,

from C:\Users\Admin\AppData\Local\Temp\arduino_build_479956\sketch\client.ino.cpp:1:

C:\Users\Admin\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.4\cores\esp32/HardwareSerial.h:67:12: note: initializing argument 1 of 'virtual size_t HardwareSerial::write(const uint8_t*, size_t)'

size_t write(const uint8_t *buffer, size_t size);

^

client:67:37: error: invalid conversion from 'const char*' to 'const uint8_t* {aka const unsigned char*}' [-fpermissive]

Serial1.write(data, strlen(data));

^

In file included from C:\Users\Admin\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.4\cores\esp32/Arduino.h:154:0,

from C:\Users\Admin\AppData\Local\Temp\arduino_build_479956\sketch\client.ino.cpp:1:

C:\Users\Admin\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.4\cores\esp32/HardwareSerial.h:67:12: note: initializing argument 1 of 'virtual size_t HardwareSerial::write(const uint8_t*, size_t)'

size_t write(const uint8_t *buffer, size_t size);

^

client:69:24: error: invalid conversion from 'const char*' to 'const uint8_t* {aka const unsigned char*}' [-fpermissive]

Serial1.write("\0", 1);

^

In file included from C:\Users\Admin\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.4\cores\esp32/Arduino.h:154:0,

from C:\Users\Admin\AppData\Local\Temp\arduino_build_479956\sketch\client.ino.cpp:1:

C:\Users\Admin\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.4\cores\esp32/HardwareSerial.h:67:12: note: initializing argument 1 of 'virtual size_t HardwareSerial::write(const uint8_t*, size_t)'

size_t write(const uint8_t *buffer, size_t size);

^

exit status 1

invalid conversion from 'const char*' to 'const uint8_t* {aka const unsigned char*}' [-fpermissive]

Regards
Ajit

Profile picture for user Kurumi

Kurumi

5 years 9 months ago

Hi,

Hi,

This is changed. Get the latest version and let me know if you have problems.

BR,
Mikko

technoshell

5 years 9 months ago

Sir,

Sir,

I got the latest code and yes that old error is gone. But this new error has come in
File Preferences URL
https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/pack…

_______
Arduino: 1.8.13 (Windows 7), Board: "DOIT ESP32 DEVKIT V1, 80MHz, 921600, None"

C:\Users\Admin\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.4/tools/sdk/lib\libphy.a(phy_chip_v7.o): In function `bb_init':

/home/aiqin/git_tree/chip7.1_phy/chip_7.1/board_code/app_test/pp/phy/phy_chip_v7.c:2401: multiple definition of `bb_init'

sketch\src\bytebuffer.c.o:sketch\src/bytebuffer.c:102: first defined here

collect2.exe: error: ld returned 1 exit status

exit status 1

Error compiling for board DOIT ESP32 DEVKIT V1.
This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

Profile picture for user Kurumi

Kurumi

5 years 9 months ago

Hi,

Hi,

Another library is using the same function name (bb_init). There is no easy workaround for this because we can't change the name of the bb_init.

I need to think about this.

BR,
Mikko

technoshell

5 years 9 months ago

Thank you sir.

Thank you sir.
I think it would be difficult for you to change the whole repository. But at the same time it makes a popular ESP32 unusable. I will wait for your solution.
ESP32 also has a ESP-IDF Freertos. Can you suggest me minimum C code files needed which can be compiled for meter reading application. ? If feasible I could try that.

Thanks and Regards
Ajit

Profile picture for user Kurumi

Kurumi

5 years 9 months ago

Hi,

Hi,

Changing this to the repository is not the problem. Problem is that we have a lot of clients who are using this and we can't rename it. I'm thinking if we can use define for ESP32.

Open gxignore.h and un-commnet all features that you don't need. DLMS is not an easy protocol and you can't just take a few files.

BR,
Mikko

technoshell

5 years 9 months ago

Thank You sir,

Thank You sir,

I will wait for the changes.
May I request you to keep me posted soon the changes are effected.
Warm Regards
Ajit

Profile picture for user Kurumi

Kurumi

5 years 9 months ago

Hi,

Hi,

Get the latest version. This in now changed.
Arduino DOIT ESP32 uses bb_init. bb_Init is used instead in DOIT ESP32.

BR,

Mikko

technoshell

5 years 9 months ago

ThankYou Sir,

ThankYou Sir,

This worked well.

BR
Ajit

Adaranijo

3 years 4 months ago

hello technoshell, can i get…

hello technoshell, can i get your help on the step by step procedure on how you worked with arduino and dlms communication, my first question would be what your project is all about, i am working on a project to build a smart meter using arduino as my microcontroller and communicate with it using gxdlmsdirector, but i cant seem to understand most of the technical terms on this website

  • Create new account
  • Reset your password

Hire Us!

Latest Releases

  • Tue, 06/09/2026 - 11:16
    gurux.dlms.java 4.0.95
  • Tue, 06/09/2026 - 10:03
    Gurux.DLMS.Python 1.0.199
  • Mon, 06/08/2026 - 13:39
    gurux.dlms.cpp 9.0.2606.0801
  • Mon, 06/01/2026 - 10:15
    gurux.dlms.cpp 9.0.2606.0101
  • Thu, 05/28/2026 - 16:06
    gurux.dlms.java 4.0.94

New forum topics

  • Error reading L&G Meter
  • Pass a TCP Client to GXNet
  • Australian EDMI Mk10D (Essential Energy area)
  • Strange mix of data notificiation vs get response
  • DLMS Connection
More

Who's new

  • Tuanhgg
  • Adel
  • charnon
  • Paddles
  • Miguel Ángel
RSS feed
Privacy FAQ GXDN Issues Contact
Follow Gurux on Twitter Follow Gurux on Linkedin