Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - yost87

Pages: 1
1
TinyDuino Processors & TinyShields / Re: GPS Logger No data returned
« on: December 14, 2020, 01:26:21 PM »
Hi Rena, I hope you are well.
As mentioned, I endured the metioed problem, I thought...

What I learned is that the stack was working, but I thought not because the serial monitor doesn't show the data.  When I checked the SD card, there was data being written I wasn't aware of.

Great job, thanks!

2
TinyDuino Processors & TinyShields / GPS Logger No data returned
« on: December 13, 2020, 07:43:25 PM »
I'm using the sketch below from your product page and am not receiving the data your product page says I should.  What is the problem with your sketch please?

This is what i see in serial monitor:

/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
"Initializing Flash Memory...

Determining write/read start point...
Done.

Send 'y' to start read mode. Write mode will begin in waitTime seconds...

Now initiating write mode.

Attempting to wake GPS module.. done."
////////////////////////////////////////////////////////////////////////////////////////////////////////////

I've tried several times over several years to get your products working, and after another full afternoon (6-8 hours) of trying to get this working without success, I will likely put on shelf again.

This is the sketch I am using from your product page:
//-------------------------------------------------------------------------------
//  TinyCircuits GPS Tracker Tutorial Program
//  Last updated 27 February 2017 (1.02)
// 
//  Using the GPS TinyShield, the Flash Memory TinyShield, and the TinyDuino,
//  this program turns the stack into a miniature GPS tracker and data logger.
//  The code detects which sentence is being read and formats the string accordingly.
//  In order to reduce the number of writes, we write one NMEA sentence per 10 seconds,
//  which can be modified.
//
//  With the Telit SE868 V2 module with Glonass support, some messages come through
//  as GN** sentences instead of GP**. These are changed back to GP** before logging
//  so that they don't cause problems with programs like Google Earth.
//  Some GPS modules have been shipped with 4800 baud instead of 9600- try this if
//  you see bad data.
//
//  The Software Serial library should be modified for a larger buffer- 256 is enough
//  for GGA and RMC sentences at 1Hz. In SoftwareSerial.cpp, the change looks like:
//  #define _SS_MAX_RX_BUFF 256
//
//  Written by Ben Rose & Lilith Freed for TinyCircuits, http://TinyCircuits.com
//
//-------------------------------------------------------------------------------

//This may need to be set to 4800 baud
const int GPSBaud = 9600;
const int waitTime = 4000;

#include "SoftwareSerial256.h"
#include <SPIFlash.h>

// The chip/slave select pin is pin 5 for the Flash Memory TinyShield
const uint8_t flashCS = 5;
unsigned long address = 0;



// The SPIFlash object for the chip. Passed the chip select pin in the constructor.
SPIFlash flash(flashCS);

// The Arduino pins used by the GPS module
const uint8_t GPS_ONOFFPin = A3;
const uint8_t GPS_SYSONPin = A2;
const uint8_t GPS_RXPin = A1;
const uint8_t GPS_TXPin = A0;
const uint8_t chipSelect = 10;

// The GPS connection is attached with a software serial port
SoftwareSerial Gps_Serial(GPS_RXPin, GPS_TXPin);

// Set which sentences should be enabled on the GPS module
// GPGGA -
char nmea[] = {'1'/*GPGGA*/, '0'/*GNGLL*/, '0'/*GNGSA*/, '0'/*GPGSV/GLGSV*/, '1'/*GNRMC*/, '0'/*GNVTG*/, '0'/*not supported*/, '0'/*GNGNS*/};


void setup()
{
  static const int RXPin = A1, TXPin = A0;
  Gps_Serial.begin(GPSBaud);
  Serial.begin(115200);

  Serial.println("Initializing Flash Memory...");
  Serial.println();
  pinMode(flashCS, OUTPUT); // Ensure chip select pin is an output.
  flash.begin(); // Boots the flash memory

  Serial.println("Determining write/read start point...");
  uint8_t flashBuffer[256];
  uint8_t foundStart = false;
  while (!foundStart) {
    flash.readByteArray(address, flashBuffer, 256);
    int i;
    for (i = 0; !foundStart && i < 256; i++) {
      if (flashBuffer == 0xFF) // checks for the first logical 1
        foundStart = true;
    }
    address += i;
  }
  address--;
  Serial.println("Done.");
  Serial.println();

  unsigned long timer = millis();
  Serial.println("Send 'y' to start read mode. Write mode will begin in waitTime seconds...");
  Serial.println();
  while(millis() < timer + waitTime) {
    if(Serial.available()) {
      if(Serial.read() == 'y') {
        readFlash(address);
      }
    }
  }
 
  Serial.println("Now initiating write mode.");
  Serial.println();
 
  // Init the GPS Module to wake mode
  pinMode(GPS_SYSONPin, INPUT);
  digitalWrite(GPS_ONOFFPin, LOW);
  pinMode(GPS_ONOFFPin, OUTPUT);
  delay(100);
  Serial.print("Attempting to wake GPS module.. ");
  while (digitalRead( GPS_SYSONPin ) == LOW )
  {
    // Need to wake the module
    digitalWrite( GPS_ONOFFPin, HIGH );
    delay(5);
    digitalWrite( GPS_ONOFFPin, LOW );
    delay(100);
  }
  Serial.println("done.");
  //delay(100);
 
  char command[] = "$PSRF103,00,00,00,01*xx\r\n";
  for (int i = 0; i < 8; i++) {
    command[10] = i + '0';
    command[16] = nmea;
    int c = 1;
    byte checksum = command[c++];
    while (command[c] != '*')
      checksum ^= command[c++];
    command[c + 1] = (checksum >> 4) + (((checksum >> 4) < 10) ? '0' : ('A' - 10));
    command[c + 2] = (checksum & 0xF) + (((checksum & 0xF) < 10) ? '0' : ('A' - 10));
    Gps_Serial.print(command);
    delay(20);
  }
 
  Serial.println();

}

void loop() {
  unsigned long startTime = millis();
  while (Gps_Serial.read() != '$') {
    //do other stuff here
  }
  while (Gps_Serial.available() < 5);
  Gps_Serial.read();
  Gps_Serial.read(); //skip two characters
  char c = Gps_Serial.read();
  //determine senetence type
  if (c == 'R' || c == 'G') {
    c = Gps_Serial.read();
    if (c == 'M') {
      logNMEA(1);
    } else if (c == 'G') {
      logNMEA(2);
    }
  }
 
  // Waits waitTime seconds before reading next NMEA string
  while (millis() - startTime < 10000) {
    Gps_Serial.read(); // clears GPS serial buffer
  }
}

void logNMEA(uint8_t type) {
  uint8_t buffer[82];
  // Initializes buffer to null terminators to ensure proper writing to flash memory
  for(int i = 0; i < 82; ++i) {
    buffer = '\0';
  }

    // Writes NMEA string to buffer
  buffer[0] = '$';
  int counter = 1;
  char c = 0;
  while (!Gps_Serial.available());
  c = Gps_Serial.read();
  while (c != '*') {
    buffer[counter++] = c;
    while (!Gps_Serial.available());
    c = Gps_Serial.read();
  }
  buffer[counter++] = c;
  while (!Gps_Serial.available());
  c = Gps_Serial.read();
  buffer[counter++] = c;
  while (!Gps_Serial.available());
  c = Gps_Serial.read();
  buffer[counter++] = c;
  buffer[counter++] = '\r';
  buffer[counter++] = '\n';

  buffer[2] = 'P'; // Changes GNRMC to GPRMC

  c = 1;
  byte checksum = buffer[c++];
  while (buffer[c] != '*')
    checksum ^= buffer[c++];
  buffer[c + 1] = (checksum >> 4) + (((checksum >> 4) < 10) ? '0' : ('A' - 10));
  buffer[c + 2] = (checksum & 0xF) + (((checksum & 0xF) < 10) ? '0' : ('A' - 10));

  // Writes buffer array to flash memory. Write length is variable to maximize memory.
  flash.writeCharArray(address, (char *)buffer, strlen((char *)buffer));
  address += strlen((char *)buffer); // Sets address ahead for length of the nmea string
}

void readFlash(unsigned long address) {
  char command;
  do {
    // Clear Serial write buffer to prepare for read
    while(Serial.available()) {
      Serial.read();
    }
    // Menu
    Serial.println("Read Mode | Please select a command (1, 2, 3):");
    Serial.println("1. Read to serial monitor.");
    Serial.println("2. Erase all data.");
    Serial.println("3. Exit read mode.");
    while(!Serial.available());
    command = Serial.read();
    // Command select
    switch(command) {
      case '1':
        // Handles empty flash
        if(address == 0) {
          Serial.println("No available data.");
          Serial.println();
        } else {
          // Reads all available data to the Serial monitor
          for(unsigned long i = 0; i < address; ++i) {
            Serial.print((char)flash.readChar(i));
          }
          Serial.println();
        }
        break;
      case '2':
        // Erases data up until the first available byte.
        eraseData(address);
        address = 0; // resets the first available byte address to 0
        Serial.println("All data erased.");
        Serial.println();
        break;
      case '3':
        // Exits read mode.
        return;
      default:
        // Passes by invalid input.
        Serial.println("That is not a recognized command.");
        Serial.println();
        break; 
    }
  } while(command != 3);
}

// Erases the flash memory in 4KB sectors.
// Minimizes excess erase "writes".
void eraseData(unsigned long address) {
  unsigned long index = 0;
  while(index < address) {
    flash.eraseSector(index);
    index += 4096;
  }
}

3
This solution worked for the "Simple Test" sketch.  I am now able to see location data in the serial monitor after following Pascaljedis advice.
My code for the setup section now loos like this:

"void setup()
{
  // Added this
  static const int RXPin = A1, TXPin = A0;
 
  SerialMonitorInterface.begin(115200);
  ss.begin(GPSBaud);
  while (!SerialMonitorInterface && millis() < 5000); //On TinyScreen+/SAMD21 platform, this will wait until the Serial Monitor is opened or until 5 seconds has passed
 
  SerialMonitorInterface.print("Simple TinyGPS library v. "); SerialMonitorInterface.println(TinyGPS::library_version());
  SerialMonitorInterface.println("by Mikal Hart");
  SerialMonitorInterface.println();
 
  gpsInitPins();
  delay(100);
  SerialMonitorInterface.print("Attempting to wake GPS module.. ");
  gpsOn();
  SerialMonitorInterface.println("done.");
  delay(100);
  while (ss.available())ss.read();
}"



(NOTE: I added this: " static const int RXPin = A1, TXPin = A0;" to beginning of setup routine.  The text between the quotation marks.

I hope this helps.



4
General Discussion / Re: GPS shield
« on: December 13, 2020, 01:00:27 PM »
Why hasn't the seller of this replied?  It would seem thy would answer your question since you bought their gear...

5
TinyDuino Processors & TinyShields / Re: GPS Tracker
« on: December 13, 2020, 12:52:01 PM »
Hi Ben, I hope you are well.
As mentioned, I endured same issue, I thought.  What I learned is that the stack was working, but I thought not because the serial monitor doesn't show the data.  When I checked the SD card, there was data being written I wasn't aware of.

So, if you encounter the situation where it appears the data isn't flowing, check your SD card.

Than you!
Be safe.

6
Hi, I am able see the BLE(ST) ASD2116-rev.1 BlueNRG in the bluetooth available list on two devices, but cannot connect.

Q: Is there a way to reset pin?  or see what the pin currently is?

I've tried using 0000 or 1234 or 00000 or 12345, or many many other combinations...

The program from STMicroelectronics BlueNRG says, "No valid characteristics found.  Wrong firmware? Please check instruction on how to setup the BlueNRG board."

From my android device when I try to pair with BlueNRG i get the message, "couldn't pair with BlueNRG because oi an incorrect pin or passcode."...

Thanks in advance for your time!

Pages: 1
SMF spam blocked by CleanTalk