-->
Page 1 of 1

Wemos D1 mini SoftwareSerial

PostPosted: Sun Nov 26, 2017 5:49 am
by RaceX
Hello,

I have some trouble using SoftwareSerial with a Wemos D1 mini board.

Some times ago I made a project using an Arduino mini pro and a GPS U-Blox NEO-6P. The communication is made using SoftwareSerial.

Now I'm trying to switch my sketch to a Wemos D1 mini.

I'm able to receive the data from the GPS but I can't send my configuration to it.

Here is the code I use :

Code: Select all#include <SoftwareSerial.h>
SoftwareSerial gpsSerial(D2, D1);

void setup()
{
   gpsSerial.begin(9600);
        Serial.begin(9600);
   configureGPS();
}
void configureGPS()
{
   
   //Disable GGA
   uint8_t GGA[] = { 0xB5, 0x62, 0x06, 0x01, 0x08, 0x00, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x24 };
   sendUBX(GGA, sizeof(GGA) / sizeof(uint8_t));
   //Disable GLL
   uint8_t GLL[] = { 0xB5, 0x62, 0x06, 0x01, 0x08, 0x00, 0xF0, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x2B };
   sendUBX(GLL, sizeof(GLL) / sizeof(uint8_t));
   //Disable GSA
   uint8_t GSA[] = { 0xB5, 0x62, 0x06, 0x01, 0x08, 0x00, 0xF0, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x32 };
   sendUBX(GSA, sizeof(GSA) / sizeof(uint8_t));
   //Disable GSV
   uint8_t GSV[] = { 0xB5, 0x62, 0x06, 0x01, 0x08, 0x00, 0xF0, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x03, 0x39 };
   sendUBX(GSV, sizeof(GSV) / sizeof(uint8_t));
   //Disable VTG
   uint8_t VTG[] = { 0xB5, 0x62, 0x06, 0x01, 0x08, 0x00, 0xF0, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x05, 0x47 };
   sendUBX(VTG, sizeof(VTG) / sizeof(uint8_t));
   /*uint8_t rate[] = { 0xB5, 0x62, 0x06, 0x08, 0x06, 0x00, 0xC8, 0x00, 0x01, 0x00, 0x01, 0x00, 0xDE, 0x6A };
   sendUBX(rate, sizeof(rate) / sizeof(uint8_t));*/
   //setGPS1Hz();

}
void sendUBX(uint8_t *MSG, uint8_t len) {
   gpsSerial.flush();
   gpsSerial.write(0xFF);
   delay(200);
   for (int i = 0; i<len; i++) {
      gpsSerial.write(MSG[i]);
   }
}


This code works well with the Arduino mini pro but not with the Wemos D1 mini.

It seems that the configuration is not receive by the GPS.

Is there any issue with transmitting datas trough a SoftwareSerial on Wemos D1 ?

Thanks for your help and sorry for the bad english.