Seeed samd boards 1.7.6

this code is not working with 1.7.6 SAMD libraries

#include <TinyGPS++.h>
#include <SoftwareSerial.h>

#define ss Serial
// The TinyGPS++ object
TinyGPSPlus gps;

char c;
//static const int RXPin = 0, TXPin = 1;
// The serial connection to the GPS device
//SoftwareSerial ss(RXPin, TXPin);
void setup()
{
    // put your setup code here, to run once:
    SerialUSB.begin(115200);

    while (!SerialUSB)
        ;

    ss.begin(9600);
}

void loop()
{
    // put your main code here, to run repeatedly:
    smartDelay(1000);
}

// This custom version of delay() ensures that the gps object
// is being "fed".
static void smartDelay(unsigned long ms)
{
    unsigned long start = millis();
    do
    {
        while (ss.available())
            gps.encode(c = ss.read());
        if (c != '\n')
            SerialUSB.print(c);

    } while (millis() - start < ms);
}

But this was working in 1.3.0 version

as i intepreted
Serial.print is also considered as SerialUSB.print

Hi @piruthivirajan, What error you are getting?

Actually am using Seeeduino lorawan board.
In it L70 GPS IC located at Serial.

As i want to read GPS sentences from Serial, it address to SerialUSB. so it got struck, no any further operations.

This was’t happening in 1.3.0 version of seeed samd board library, but in later version this is problem.

We did update the software, and our wiki documentation also applies to the latest software. Please follow our Wiki documentation to use the software.

1 Like

Yes, i am using updated software from wiki documentation. that is why this is happenning.

the latest updated seeeduino lorawan drivers doesn’t know difference between Serial and SerialUSB port.

If i give Serial.print or Serial.read it goes to SerialUSB.print or SerialUSB.read

is there any way to downgrade the driver of Seeeduino lorawan to old versions?

@piruthivirajan, do you want to downgrade the Seeeduino lorawan or SAMD libraries?

1 Like

Yeah samd in think.

i found a change done is samd variant.h… here it is…
in 1.3.0/variant/variant.h

#define SERIAL_PORT_USBVIRTUAL SerialUSB
#define SERIAL_PORT_MONITOR Serial
// Serial has no physical pins broken out, so it’s not listed as HARDWARE port
#define SERIAL_PORT_HARDWARE Serial1
#define SERIAL_PORT_HARDWARE_OPEN Serial1
#endif / VARIANT_ARDUINO_ZERO /

in 1.6.0/variant/variant.h
#define SERIAL_PORT_USBVIRTUAL Serial
#define SERIAL_PORT_MONITOR Serial
// Serial has no physical pins broken out, so it’s not listed as HARDWARE port
#define SERIAL_PORT_HARDWARE Serial1
#define SERIAL_PORT_HARDWARE_OPEN Serial1
// Alias Serial to SerialUSB
#define SerialUSB Serial
#endif / VARIANT_ARDUINO_ZERO /

Great, Is it solved? If not you can downgrade the libraries or board definitions using the Arduino IDE it self, Just need to select the suitable version.

No, not able to downgrade seeed board manger version to 1.3.0

But it is solved.
I used Serial5 instead of Serial

Because it is changed in new version variant. so it affects all the functionalites build before with old library. The whole system was compromised.

1 Like

Glad to know that it’s solved! :grin: :love_you_gesture: