i am still working on a wrapper for GSM_MQTT library on B4R but i blocked at compilation with B4R when compilation is OK on Arduino.
after several tests, i reduced wrapper at 2 functions, but problem is still the same.
the 3 callback function were locked but compilation is still NOK on B4X
this libray use PROGMEM and an issue was possible at this level. after all strings in memory and PROGMEM removed, issue in compilation is still here.
In this library Serial1 is used for link with SIM800 and a Softserial is used for link with PC: i removed Softserial, but no impact on compilation.
error seen :
Preparation des cartes
Verification...
c:/users/mpage/appdata/local/arduino15/packages/esp8266/tools/xtensa-lx106-elf-gcc/2.5.0-4-b40a506/bin/../lib/gcc/xtensa-lx106-elf/4.8.2/../../../../xtensa-lx106-elf/bin/ld.exe: D:\B4R\B4R_AP~1\test\Objects\bin\sketch\GSM_MQTT.cpp.o: in function `GSM_MQTT:rintConnectAck(unsigned char)':
D:\B4R\B4R_AP~1\test\Objects\bin\sketch/GSM_MQTT.cpp:603: undefined reference to `MQTT'
c:/users/mpage/appdata/local/arduino15/packages/esp8266/tools/xtensa-lx106-elf-gcc/2.5.0-4-b40a506/bin/../lib/gcc/xtensa-lx106-elf/4.8.2/../../../../xtensa-lx106-elf/bin/ld.exe: D:\B4R\B4R_AP~1\test\Objects\bin\sketch/GSM_MQTT.cpp:603: undefined reference to `MQTT'
c:/users/mpage/appdata/local/arduino15/packages/esp8266/tools/xtensa-lx106-elf-gcc/2.5.0-4-b40a506/bin/../lib/gcc/xtensa-lx106-elf/4.8.2/../../../../xtensa-lx106-elf/bin/ld.exe: D:\B4R\B4R_AP~1\test\Objects\bin\sketch/GSM_MQTT.cpp:600: undefined reference to `MQTT'
collect2.exe: error: ld returned 1 exit status
exit status 1
=> in GSM_MQTT.cpp file i don't see MQTT object on lines provided by error...
At last i have no idea about this issue and explanation of linker error is not clear...
GSM_MQTT, wrapper and B4R files are in zip file added if someone want to help me, he will be welcome.
thanks for your help
at last, i found my problem: it is linked with a function in original cpp file: "void serialEvent();"
i will check more tomorrow
--------------------------------
update
now compilation is OK and start of esp8266 with a basic program is working. i cannot do more because i have a A6 module but not a SIM800...
last libray built for B4X is attached with a short example.
one thing to highlight : in this library, Hard serial is used for SIM800 connection and SoftwareSerial is used for PC link. It can be changed but from arduino library developers , it is better to use hard serial for SIM800 link.
arduino library : https://elementztechblog.wordpress....-library-for-sim800-gsm-modem/comment-page-1/
after several tests, i reduced wrapper at 2 functions, but problem is still the same.
the 3 callback function were locked but compilation is still NOK on B4X
this libray use PROGMEM and an issue was possible at this level. after all strings in memory and PROGMEM removed, issue in compilation is still here.
In this library Serial1 is used for link with SIM800 and a Softserial is used for link with PC: i removed Softserial, but no impact on compilation.
error seen :
Preparation des cartes
Verification...
c:/users/mpage/appdata/local/arduino15/packages/esp8266/tools/xtensa-lx106-elf-gcc/2.5.0-4-b40a506/bin/../lib/gcc/xtensa-lx106-elf/4.8.2/../../../../xtensa-lx106-elf/bin/ld.exe: D:\B4R\B4R_AP~1\test\Objects\bin\sketch\GSM_MQTT.cpp.o: in function `GSM_MQTT:rintConnectAck(unsigned char)':
D:\B4R\B4R_AP~1\test\Objects\bin\sketch/GSM_MQTT.cpp:603: undefined reference to `MQTT'
c:/users/mpage/appdata/local/arduino15/packages/esp8266/tools/xtensa-lx106-elf-gcc/2.5.0-4-b40a506/bin/../lib/gcc/xtensa-lx106-elf/4.8.2/../../../../xtensa-lx106-elf/bin/ld.exe: D:\B4R\B4R_AP~1\test\Objects\bin\sketch/GSM_MQTT.cpp:603: undefined reference to `MQTT'
c:/users/mpage/appdata/local/arduino15/packages/esp8266/tools/xtensa-lx106-elf-gcc/2.5.0-4-b40a506/bin/../lib/gcc/xtensa-lx106-elf/4.8.2/../../../../xtensa-lx106-elf/bin/ld.exe: D:\B4R\B4R_AP~1\test\Objects\bin\sketch/GSM_MQTT.cpp:600: undefined reference to `MQTT'
collect2.exe: error: ld returned 1 exit status
exit status 1
=> in GSM_MQTT.cpp file i don't see MQTT object on lines provided by error...
At last i have no idea about this issue and explanation of linker error is not clear...
GSM_MQTT, wrapper and B4R files are in zip file added if someone want to help me, he will be welcome.
thanks for your help
at last, i found my problem: it is linked with a function in original cpp file: "void serialEvent();"
i will check more tomorrow
--------------------------------
update
now compilation is OK and start of esp8266 with a basic program is working. i cannot do more because i have a A6 module but not a SIM800...
last libray built for B4X is attached with a short example.
one thing to highlight : in this library, Hard serial is used for SIM800 connection and SoftwareSerial is used for PC link. It can be changed but from arduino library developers , it is better to use hard serial for SIM800 link.
arduino library : https://elementztechblog.wordpress....-library-for-sim800-gsm-modem/comment-page-1/
Attachments
Last edited: