Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Which SoftwareSerial is intended to be used? #20

Open
mcsarge opened this issue Apr 5, 2024 · 3 comments
Open

Which SoftwareSerial is intended to be used? #20

mcsarge opened this issue Apr 5, 2024 · 3 comments

Comments

@mcsarge
Copy link

mcsarge commented Apr 5, 2024

I cannot compile this code because it is asking for SoftwareSerial, and I do not know which one you have chosen to use. Or should I set the following flag: MT_SOFTWARESERIAL_SUPPORTED to turn it off, since I am on an ESP32?

@mcsarge
Copy link
Author

mcsarge commented Apr 11, 2024

Here is what I did to make it work:
in mt_internals.h:
#ifndef MT_INTERNALS_H
#define MT_INTERNALS_H

#if defined(ARDUINO_ARCH_SAMD) || defined(ARDUINO_ARCH_ESP32) || defined(ESP32)
#define MT_WIFI_SUPPORTED
#else
#define MT_SOFTWARESERIAL_SUPPORTED
#endif

and it mt_serial.cpp
#include "mt_internals.h"

#ifdef MT_SOFTWARESERIAL_SUPPORTED
#include <SoftwareSerial.h>
SoftwareSerial *serial;
#else
#define serial (&Serial1)
#endif

void mt_serial_init(int8_t rx_pin, int8_t tx_pin, uint32_t baud) {
#ifdef MT_SOFTWARESERIAL_SUPPORTED
serial = new SoftwareSerial(rx_pin, tx_pin);
serial->begin(baud);
#endif
#ifdef MT_WIFI_SUPPORTED
mt_wifi_mode = true;
#else
mt_wifi_mode = false;
#endif

mt_serial_mode = true;
}

@etleyden
Copy link

etleyden commented Oct 1, 2024

Also was experiencing this issue. This did not work for me, and instead resulted in a cascade of errors:

/Users/etleyden/Library/Arduino15/packages/esp32/tools/esp-xs3/2302/bin/../lib/gcc/xtensa-esp32s3-elf/12.2.0/../../../../xtensa-esp32s3-elf/bin/ld: /private/var/folders/69/4nb_brqs0tg9gyskbzzt2xl40000gn/T/arduino/sketches/4C3A989D1ADC5240C353340C87550E56/libraries/Meshtastic/mt_protocol.cpp.o:(.literal._Z13mt_send_radioPKcj+0xc): undefined reference to `_Z18mt_wifi_send_radioPKcj'
/Users/etleyden/Library/Arduino15/packages/esp32/tools/esp-xs3/2302/bin/../lib/gcc/xtensa-esp32s3-elf/12.2.0/../../../../xtensa-esp32s3-elf/bin/ld: /private/var/folders/69/4nb_brqs0tg9gyskbzzt2xl40000gn/T/arduino/sketches/4C3A989D1ADC5240C353340C87550E56/libraries/Meshtastic/mt_protocol.cpp.o:(.literal._Z25handle_config_complete_idmm+0x0): undefined reference to `_Z26mt_wifi_reset_idle_timeoutm'
/Users/etleyden/Library/Arduino15/packages/esp32/tools/esp-xs3/2302/bin/../lib/gcc/xtensa-esp32s3-elf/12.2.0/../../../../xtensa-esp32s3-elf/bin/ld: /private/var/folders/69/4nb_brqs0tg9gyskbzzt2xl40000gn/T/arduino/sketches/4C3A989D1ADC5240C353340C87550E56/libraries/Meshtastic/mt_protocol.cpp.o:(.literal._Z7mt_loopm+0x4): undefined reference to `_Z12mt_wifi_loopm'
/Users/etleyden/Library/Arduino15/packages/esp32/tools/esp-xs3/2302/bin/../lib/gcc/xtensa-esp32s3-elf/12.2.0/../../../../xtensa-esp32s3-elf/bin/ld: /private/var/folders/69/4nb_brqs0tg9gyskbzzt2xl40000gn/T/arduino/sketches/4C3A989D1ADC5240C353340C87550E56/libraries/Meshtastic/mt_protocol.cpp.o:(.literal._Z7mt_loopm+0x8): undefined reference to `_Z19mt_wifi_check_radioPcj'
/Users/etleyden/Library/Arduino15/packages/esp32/tools/esp-xs3/2302/bin/../lib/gcc/xtensa-esp32s3-elf/12.2.0/../../../../xtensa-esp32s3-elf/bin/ld: /private/var/folders/69/4nb_brqs0tg9gyskbzzt2xl40000gn/T/arduino/sketches/4C3A989D1ADC5240C353340C87550E56/libraries/Meshtastic/mt_protocol.cpp.o: in function `_Z13mt_send_radioPKcj':
/Users/etleyden/Documents/Arduino/libraries/Meshtastic/src/mt_protocol.cpp:44: undefined reference to `_Z18mt_wifi_send_radioPKcj'
/Users/etleyden/Library/Arduino15/packages/esp32/tools/esp-xs3/2302/bin/../lib/gcc/xtensa-esp32s3-elf/12.2.0/../../../../xtensa-esp32s3-elf/bin/ld: /private/var/folders/69/4nb_brqs0tg9gyskbzzt2xl40000gn/T/arduino/sketches/4C3A989D1ADC5240C353340C87550E56/libraries/Meshtastic/mt_protocol.cpp.o: in function `_Z25handle_config_complete_idmm':
/Users/etleyden/Documents/Arduino/libraries/Meshtastic/src/mt_protocol.cpp:178: undefined reference to `_Z26mt_wifi_reset_idle_timeoutm'
/Users/etleyden/Library/Arduino15/packages/esp32/tools/esp-xs3/2302/bin/../lib/gcc/xtensa-esp32s3-elf/12.2.0/../../../../xtensa-esp32s3-elf/bin/ld: /private/var/folders/69/4nb_brqs0tg9gyskbzzt2xl40000gn/T/arduino/sketches/4C3A989D1ADC5240C353340C87550E56/libraries/Meshtastic/mt_protocol.cpp.o: in function `_Z7mt_loopm':
/Users/etleyden/Documents/Arduino/libraries/Meshtastic/src/mt_protocol.cpp:287: undefined reference to `_Z12mt_wifi_loopm'
/Users/etleyden/Library/Arduino15/packages/esp32/tools/esp-xs3/2302/bin/../lib/gcc/xtensa-esp32s3-elf/12.2.0/../../../../xtensa-esp32s3-elf/bin/ld: /Users/etleyden/Documents/Arduino/libraries/Meshtastic/src/mt_protocol.cpp:288: undefined reference to `_Z19mt_wifi_check_radioPcj'
collect2: error: ld returned 1 exit status

exit status 1

Compilation error: exit status 1

My search for a fix continues 🚢

@bserret
Copy link

bserret commented Nov 21, 2024

I also cannot compile this. I am getting this error - Is this because the nano doesn't have enough RAM?

/usr/lib/gcc/avr/7.3.0/../../../avr/bin/ld: address 0x800c6f of /tmp/arduino_build_945720/protosendrec.ino.elf section .bss' is not within region data'
/usr/lib/gcc/avr/7.3.0/../../../avr/bin/ld: address 0x800c6f of /tmp/arduino_build_945720/protosendrec.ino.elf section .bss' is not within region data'
collect2: error: ld returned 1 exit status

exit status 1
Error compiling for board Arduino Nano.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants