TinyCircuits Forum

General Category => General Discussion => Topic started by: DimSim1010 on August 08, 2018, 02:54:34 AM

Title: GPS Tracker with Bluetooth
Post by: DimSim1010 on August 08, 2018, 02:54:34 AM
Hello,
I am doing a school project and need some advice. I was doing this tutorial:  https://tinycircuits.com/blogs/learn/tinyduino-gps-tracker-data-logger-tutorial and have managed to do it. I had an idea to use Bluetooth track the NMEA data on my phone. I have bought the Bluetooth Low Energy (ST) and can use by itself. Since I am a student, can you please help by telling me how to program it?
Title: Re: GPS Tracker with Bluetooth
Post by: lennevia on August 08, 2018, 12:46:26 PM
Hello DimSim,

There are plenty of arduino tutorials available online that will help you program this school project. Otherwise, you can bring more specific questions to the forum so we can help you along the way.

Thanks,
RĂ©na
Title: Re: GPS Tracker with Bluetooth
Post by: DimSim1010 on August 08, 2018, 06:13:21 PM
Hello,
I have looked at all the tutorials regarding the GPS tiny shield and none of them talk about Bluetooth. However, there is a forum post:
http://forum.tinycircuits.com/index.php?topic=1689.0 which I have copied the code and have tried however many errors pop up.
Thanks
Title: Re: GPS Tracker with Bluetooth
Post by: DimSim1010 on August 09, 2018, 04:49:52 PM
Here is my current attempt code.
#include "lib_aci.h"
#include "aci_setup.h"
#include "uart_over_ble.h"
#include "services.h"
#include <Adafruit_BLE_UART.h>


#define BLE_DEBUG false

//The Arduino pins used by the GPS module
static const int GPS_ONOFFPin = A3;
static const int GPS_SYSONPin = A2;
static const int GPS_RXPin = A1;
static const int GPS_TXPin = A0;
static const int GPSBaud = 4800;
// The TinyGPS++object
TinyGPSPlus gps;
// The GPS connection is attached with a software serial port
  SoftwareSerial Gps_serial(GPS_RXPin, GPS_TXPin);

//Debug output adds extra flash and memory requirements!
#ifndef BLE_DEBUG
#define BLE_DEBUG true
#endif

#if defined (ARDUINO_ARCH_AVR)
#define SerialMonitorInterface Serial
#elif defined(ARDUINO_ARCH_SAMD)
#define SerialMonitorInterface SerialUSB
#endif


uint8_t ble_rx_buffer [21];
uint8_t ble_rx_buffer_len = 0;
uint8_t ble_connection_state = false;
#define PIPE_UART_OVER_BTLE_UART_TX_TX 0


//when using this project in the Ardunio IDE,delete he following include and
rename UART.h to UART.ino
#include "UART.h"

void setup() {
  SerialMonitorInterface.begin(9600);
  BLEsetup();
  //Init the GPS Module to wake mode   
  pinMode(GPS_SYSONPin, INPUT);
  pinMode(GPS_ONOFFPin,OUTPUT);
  digitalWrite(GPS_ONOFFPin, LOW);
  delay(5);
  if(digitalRead(GPS_SYSONPin) == LOW)
  {
    //Need to wake the module
    digitalWrite(GPS_ONOFFPin,HIGH);
    delay(5);
    digitalWrite(GPS_ONOFFPin, LOW);
  }
  Serial.begin(9600);
  //Open the GPS serial port
  Gps_serial.begin(GPSBaud);
  Wire.begin();
}
 
 
void loop() {
  while (Gps_serial.available()>0)
  gps.encode(Gps_serial read.read());
  aci_loop();//Process any ACI commands or events from the NRF8001-main BLE handler, must run often. Keep main loop short.
  if (ble_rx_buffer_len) {//Check if data is available
    SerialMonitorInterface.print(ble_rx_buffer_len);
    SerialMonitorInterface.print(" : ");
    SerialMonitorInterface.println((char *)ble_rx_buffer);
    ble-rx-buffer_len=0;//clear after reading
 }

    String msg = String(gps.location.lat(), 3);
    msg += ":";
    msg += String(gps.location.lng(), 3);
    msg += ":";
    msg += String(gps.altitude.value());
    ble_rx_buffer_len = 0;
  }
 if (SerialMonitorInterface.available()) {Check if serial input is available to send
    delay(10);//should catch input
    uint8_t sendBuffer[21];
    uint8_t sendLength = 0;
    while (SerialMonitorInterface.available() && sendLength < 19) {
      sendBuffer[sendLength] = SerialMonitorInterface.read();
      sendLength++;
    }
    if (SerialMonitorInterface.available()) {
      SerialMonitorInterface.print(F("Input truncated, dropped: "));
      if (SerialMonitorInterface.available()) {
        SerialMonitorInterface.write(SerialMonitorInterface.read());
      }
    }
    sendBuffer[sendLength] = '\0';
    sendLength++;
    if (!lib_aci_send_data(PIPE_UART_OVER_BTLE_UART_TX_TX, (uint8_t*)sendBuffer, sendLength))
    {
      SerialMonitorInterface.println(F("TX dropped!"));
    }
  }
  if (millis() > 5000 && gos.charsProcessed() > 10){
    Serial.println("ERROR: not getting any GPS data!");
    Serial.println("GPS stream dump:");
    while(true)   
    }
}
Can you advise errors.
Title: Re: GPS Tracker with Bluetooth
Post by: lennevia on August 10, 2018, 12:44:12 PM
Hello,

Can you copy the error messages you are getting?

Thank you
Title: Re: GPS Tracker with Bluetooth
Post by: DimSim1010 on August 10, 2018, 05:17:42 PM

C:\Users\Rosana\Documents\Arduino\BIke_GPS_Tracker\BIke_GPS_Tracker.ino:42:0: warning: "PIPE_UART_OVER_BTLE_UART_TX_TX" redefined

 #define PIPE_UART_OVER_BTLE_UART_TX_TX 0

 ^

In file included from sketch\UART.h:6:0,

                 from C:\Users\Rosana\Documents\Arduino\BIke_GPS_Tracker\BIke_GPS_Tracker.ino:5:

sketch\services.h:61:0: note: this is the location of the previous definition

 #define PIPE_UART_OVER_BTLE_UART_TX_TX          12

 ^

In file included from sketch\lib_aci.h:35:0,

                 from sketch\UART.h:3,

                 from C:\Users\Rosana\Documents\Arduino\BIke_GPS_Tracker\BIke_GPS_Tracker.ino:5:

hal_aci_tl.h:62: error: expected initializer before 'hal_aci_data_t'

 } _aci_packed_ hal_aci_data_t;

                ^

hal_aci_tl.h:64: error: expected constructor, destructor, or type conversion before '(' token

 ACI_ASSERT_SIZE(hal_aci_data_t, HAL_ACI_MAX_LENGTH + 2);

                ^

In file included from sketch\lib_aci.h:35:0,

                 from sketch\UART.h:3,

                 from C:\Users\Rosana\Documents\Arduino\BIke_GPS_Tracker\BIke_GPS_Tracker.ino:5:

hal_aci_tl.h:105: error: 'hal_aci_data_t' was not declared in this scope

 bool hal_aci_tl_send(hal_aci_data_t *aci_buffer);

                      ^

hal_aci_tl.h:105: error: 'aci_buffer' was not declared in this scope

 bool hal_aci_tl_send(hal_aci_data_t *aci_buffer);

                                      ^

hal_aci_tl.h:114: error: 'hal_aci_data_t' does not name a type

 hal_aci_data_t * hal_aci_tl_poll_get(void);

 ^

hal_aci_tl.h:121: error: 'hal_aci_data_t' was not declared in this scope

 bool hal_aci_tl_event_get(hal_aci_data_t *p_aci_data);

                           ^

hal_aci_tl.h:121: error: 'p_aci_data' was not declared in this scope

 bool hal_aci_tl_event_get(hal_aci_data_t *p_aci_data);

                                           ^

hal_aci_tl.h:128: error: 'hal_aci_data_t' was not declared in this scope

 bool hal_aci_tl_event_peek(hal_aci_data_t *p_aci_data);

                            ^

hal_aci_tl.h:128: error: 'p_aci_data' was not declared in this scope

 bool hal_aci_tl_event_peek(hal_aci_data_t *p_aci_data);

                                            ^

In file included from sketch\lib_aci.h:36:0,

                 from sketch\UART.h:3,

                 from C:\Users\Rosana\Documents\Arduino\BIke_GPS_Tracker\BIke_GPS_Tracker.ino:5:

aci_queue.h:53: error: 'hal_aci_data_t' does not name a type

  hal_aci_data_t           aci_data[ACI_QUEUE_SIZE];

  ^

aci_queue.h:60: error: 'hal_aci_data_t' has not been declared

 bool aci_queue_dequeue(aci_queue_t *aci_q, hal_aci_data_t *p_data);

                                            ^

aci_queue.h:61: error: 'hal_aci_data_t' has not been declared

 bool aci_queue_dequeue_from_isr(aci_queue_t *aci_q, hal_aci_data_t *p_data);

                                                     ^

aci_queue.h:63: error: 'hal_aci_data_t' has not been declared

 bool aci_queue_enqueue(aci_queue_t *aci_q, hal_aci_data_t *p_data);

                                            ^

aci_queue.h:64: error: 'hal_aci_data_t' has not been declared

 bool aci_queue_enqueue_from_isr(aci_queue_t *aci_q, hal_aci_data_t *p_data);

                                                     ^

aci_queue.h:72: error: 'hal_aci_data_t' has not been declared

 bool aci_queue_peek(aci_queue_t *aci_q, hal_aci_data_t *p_data);

                                         ^

aci_queue.h:73: error: 'hal_aci_data_t' has not been declared

 bool aci_queue_peek_from_isr(aci_queue_t *aci_q, hal_aci_data_t *p_data);

                                                  ^

In file included from sketch\lib_aci.h:38:0,

                 from sketch\UART.h:3,

                 from C:\Users\Rosana\Documents\Arduino\BIke_GPS_Tracker\BIke_GPS_Tracker.ino:5:

aci_cmds.h:173: error: expected initializer before 'aci_cmd_opcode_t'

 } _aci_packed_ aci_cmd_opcode_t;

                ^

aci_cmds.h:175: error: expected constructor, destructor, or type conversion before '(' token

 ACI_ASSERT_SIZE(aci_cmd_opcode_t, 1);

                ^

aci_cmds.h:184: error: expected initializer before 'aci_cmd_params_test_t'

 } _aci_packed_ aci_cmd_params_test_t;

                ^

aci_cmds.h:186: error: expected constructor, destructor, or type conversion before '(' token

 ACI_ASSERT_SIZE(aci_cmd_params_test_t, 1);

                ^

aci_cmds.h:195: error: expected initializer before 'aci_cmd_params_echo_t'

 } _aci_packed_ aci_cmd_params_echo_t;

                ^

aci_cmds.h:197: error: expected constructor, destructor, or type conversion before '(' token

 ACI_ASSERT_SIZE(aci_cmd_params_echo_t, ACI_ECHO_DATA_MAX_LEN);

                ^

aci_cmds.h:207: error: expected initializer before 'aci_cmd_params_dtm_cmd_t'

 } _aci_packed_ aci_cmd_params_dtm_cmd_t;

                ^

aci_cmds.h:216: error: expected initializer before 'aci_cmd_params_setup_t'

 } _aci_packed_ aci_cmd_params_setup_t;

                ^

aci_cmds.h:218: error: expected constructor, destructor, or type conversion before '(' token

 ACI_ASSERT_SIZE(aci_cmd_params_setup_t, 1);

                ^

aci_cmds.h:229: error: expected initializer before 'aci_cmd_params_write_dynamic_data_t'

 } _aci_packed_ aci_cmd_params_write_dynamic_data_t;

                ^

aci_cmds.h:238: error: expected initializer before 'aci_cmd_params_set_local_data_t'

 } _aci_packed_ aci_cmd_params_set_local_data_t;

                ^

aci_cmds.h:248: error: expected initializer before 'aci_cmd_params_connect_t'

 } _aci_packed_ aci_cmd_params_connect_t;

                ^

aci_cmds.h:250: error: expected constructor, destructor, or type conversion before '(' token

 ACI_ASSERT_SIZE(aci_cmd_params_connect_t, 4);

                ^

aci_cmds.h:260: error: expected initializer before 'aci_cmd_params_bond_t'

 } _aci_packed_ aci_cmd_params_bond_t;

                ^

aci_cmds.h:262: error: expected constructor, destructor, or type conversion before '(' token

 ACI_ASSERT_SIZE(aci_cmd_params_bond_t, 4);

                ^

aci_cmds.h:271: error: expected initializer before 'aci_cmd_params_disconnect_t'

 } _aci_packed_ aci_cmd_params_disconnect_t;

                ^

aci_cmds.h:273: error: expected constructor, destructor, or type conversion before '(' token

 ACI_ASSERT_SIZE(aci_cmd_params_disconnect_t, 1);

                ^

aci_cmds.h:282: error: expected initializer before 'aci_cmd_params_set_tx_power_t'

 } _aci_packed_ aci_cmd_params_set_tx_power_t;

                ^

aci_cmds.h:284: error: expected constructor, destructor, or type conversion before '(' token

 ACI_ASSERT_SIZE(aci_cmd_params_set_tx_power_t, 1);

                ^

aci_cmds.h:292: error: expected initializer before 'aci_cmd_params_change_timing_t'

 } _aci_packed_ aci_cmd_params_change_timing_t;

                ^

aci_cmds.h:294: error: expected constructor, destructor, or type conversion before '(' token

 ACI_ASSERT_SIZE(aci_cmd_params_change_timing_t, 8);

                ^

aci_cmds.h:303: error: expected initializer before 'aci_cmd_params_open_remote_pipe_t'

 } _aci_packed_ aci_cmd_params_open_remote_pipe_t;

                ^

aci_cmds.h:312: error: expected initializer before 'aci_cmd_params_send_data_t'

 } _aci_packed_ aci_cmd_params_send_data_t;

                ^

aci_cmds.h:321: error: expected initializer before 'aci_cmd_params_send_data_ack_t'

 } _aci_packed_ aci_cmd_params_send_data_ack_t;

                ^

aci_cmds.h:330: error: expected initializer before 'aci_cmd_params_request_data_t'

 } _aci_packed_ aci_cmd_params_request_data_t;

                ^

aci_cmds.h:340: error: expected initializer before 'aci_cmd_params_send_data_nack_t'

 } _aci_packed_ aci_cmd_params_send_data_nack_t;

                ^

aci_cmds.h:342: error: expected constructor, destructor, or type conversion before '(' token

 ACI_ASSERT_SIZE(aci_cmd_params_send_data_nack_t, 2);

                ^

aci_cmds.h:352: error: expected initializer before 'aci_cmd_params_set_app_latency_t'

 } _aci_packed_ aci_cmd_params_set_app_latency_t;

                ^

aci_cmds.h:354: error: expected constructor, destructor, or type conversion before '(' token

 ACI_ASSERT_SIZE(aci_cmd_params_set_app_latency_t, 3);

                ^

aci_cmds.h:367: error: expected initializer before 'aci_cmd_params_set_key_t'

 } _aci_packed_ aci_cmd_params_set_key_t;

                ^

aci_cmds.h:369: error: expected constructor, destructor, or type conversion before '(' token

 ACI_ASSERT_SIZE(aci_cmd_params_set_key_t, 17);

                ^

aci_cmds.h:377: error: expected initializer before 'aci_cmd_params_open_adv_pipe_t'

 } _aci_packed_ aci_cmd_params_open_adv_pipe_t;

                ^

aci_cmds.h:387: error: expected initializer before 'aci_cmd_params_broadcast_t'

 } _aci_packed_ aci_cmd_params_broadcast_t;

                ^

aci_cmds.h:396: error: expected initializer before 'aci_cmd_params_close_remote_pipe_t'

 } _aci_packed_ aci_cmd_params_close_remote_pipe_t;

                ^

aci_cmds.h:405: error: 'aci_cmd_opcode_t' does not name a type

   aci_cmd_opcode_t cmd_opcode; /**< enum aci_cmd_opcode_t -> Opcode of the ACI command */

   ^

Title: Re: GPS Tracker with Bluetooth
Post by: DimSim1010 on August 10, 2018, 05:18:03 PM
aci_cmds.h:408: error: 'aci_cmd_params_test_t' does not name a type

     aci_cmd_params_test_t                       test;

     ^

aci_cmds.h:409: error: 'aci_cmd_params_echo_t' does not name a type

     aci_cmd_params_echo_t                       echo;

     ^

aci_cmds.h:410: error: 'aci_cmd_params_dtm_cmd_t' does not name a type

     aci_cmd_params_dtm_cmd_t                    dtm_cmd;

     ^

aci_cmds.h:411: error: 'aci_cmd_params_setup_t' does not name a type

     aci_cmd_params_setup_t                      setup;

     ^

aci_cmds.h:412: error: 'aci_cmd_params_write_dynamic_data_t' does not name a type

     aci_cmd_params_write_dynamic_data_t         write_dynamic_data;

     ^

aci_cmds.h:413: error: 'aci_cmd_params_set_local_data_t' does not name a type

     aci_cmd_params_set_local_data_t             set_local_data;

     ^

aci_cmds.h:414: error: 'aci_cmd_params_connect_t' does not name a type

     aci_cmd_params_connect_t                    connect;

     ^

aci_cmds.h:415: error: 'aci_cmd_params_bond_t' does not name a type

     aci_cmd_params_bond_t                       bond;

     ^

aci_cmds.h:416: error: 'aci_cmd_params_disconnect_t' does not name a type

     aci_cmd_params_disconnect_t                 disconnect;

     ^

aci_cmds.h:417: error: 'aci_cmd_params_set_tx_power_t' does not name a type

     aci_cmd_params_set_tx_power_t               set_tx_power;

     ^

aci_cmds.h:418: error: 'aci_cmd_params_change_timing_t' does not name a type

     aci_cmd_params_change_timing_t              change_timing;

     ^

aci_cmds.h:419: error: 'aci_cmd_params_open_remote_pipe_t' does not name a type

     aci_cmd_params_open_remote_pipe_t           open_remote_pipe;

     ^

aci_cmds.h:420: error: 'aci_cmd_params_send_data_t' does not name a type

     aci_cmd_params_send_data_t                  send_data;

     ^

aci_cmds.h:421: error: 'aci_cmd_params_send_data_ack_t' does not name a type

     aci_cmd_params_send_data_ack_t              send_data_ack;

     ^

aci_cmds.h:422: error: 'aci_cmd_params_request_data_t' does not name a type

     aci_cmd_params_request_data_t               request_data;

     ^

aci_cmds.h:423: error: 'aci_cmd_params_send_data_nack_t' does not name a type

     aci_cmd_params_send_data_nack_t             send_data_nack;

     ^

aci_cmds.h:424: error: 'aci_cmd_params_set_app_latency_t' does not name a type

     aci_cmd_params_set_app_latency_t            set_app_latency;

     ^

aci_cmds.h:425: error: 'aci_cmd_params_set_key_t' does not name a type

     aci_cmd_params_set_key_t                    set_key;

     ^

aci_cmds.h:426: error: 'aci_cmd_params_open_adv_pipe_t' does not name a type

     aci_cmd_params_open_adv_pipe_t              open_adv_pipe;

     ^

aci_cmds.h:427: error: 'aci_cmd_params_broadcast_t' does not name a type

     aci_cmd_params_broadcast_t                  broadcast;

     ^

aci_cmds.h:428: error: 'aci_cmd_params_close_remote_pipe_t' does not name a type

     aci_cmd_params_close_remote_pipe_t          close_remote_pipe;

     ^

aci_cmds.h:431: error: expected initializer before 'aci_cmd_t'

 } _aci_packed_ aci_cmd_t;

                ^

In file included from sketch\UART.h:3:0,

                 from C:\Users\Rosana\Documents\Arduino\BIke_GPS_Tracker\BIke_GPS_Tracker.ino:5:

lib_aci.h:50: error: expected initializer before 'hal_aci_evt_t'

 } _aci_packed_ hal_aci_evt_t;

                ^

lib_aci.h:52: error: expected constructor, destructor, or type conversion before '(' token

 ACI_ASSERT_SIZE(hal_aci_evt_t, 34);

                ^

lib_aci.h:64: error: 'hal_aci_data_t' does not name a type

   hal_aci_data_t               *setup_msgs;

   ^

In file included from sketch\UART.h:3:0,

                 from C:\Users\Rosana\Documents\Arduino\BIke_GPS_Tracker\BIke_GPS_Tracker.ino:5:

lib_aci.h:513: error: 'hal_aci_evt_t' has not been declared

 bool lib_aci_event_get(aci_state_t *aci_stat, hal_aci_evt_t * aci_evt);

                                               ^

lib_aci.h:522: error: 'hal_aci_evt_t' was not declared in this scope

 bool lib_aci_event_peek(hal_aci_evt_t *p_aci_evt_data);

                         ^

lib_aci.h:522: error: 'p_aci_evt_data' was not declared in this scope

 bool lib_aci_event_peek(hal_aci_evt_t *p_aci_evt_data);

                                        ^

In file included from C:\Users\Rosana\Documents\Arduino\BIke_GPS_Tracker\BIke_GPS_Tracker.ino:5:0:

sketch\UART.h: In function 'int BLEsetup()':

UART.h:69: error: 'Add_UART_Service' was not declared in this scope

   ret = Add_UART_Service();

                          ^

sketch\UART.h: In function 'void aci_loop()':

UART.h:83: error: 'ble_connection_state' was not declared in this scope

   ble_connection_state = connected;

   ^

UART.h:85: error: 'setConnectable' was not declared in this scope

     setConnectable();

                    ^

sketch\UART.h: In function 'uint8_t lib_aci_send_data(uint8_t, uint8_t*, uint8_t)':

UART.h:137: error: ambiguating new declaration of 'uint8_t lib_aci_send_data(uint8_t, uint8_t*, uint8_t)'

 uint8_t lib_aci_send_data(uint8_t ignore, uint8_t* sendBuffer, uint8_t sendLength) {

                                                                                  ^

In file included from sketch\UART.h:3:0,

                 from C:\Users\Rosana\Documents\Arduino\BIke_GPS_Tracker\BIke_GPS_Tracker.ino:5:

sketch\lib_aci.h:376:6: note: old declaration 'bool lib_aci_send_data(uint8_t, uint8_t*, uint8_t)'

 bool lib_aci_send_data(uint8_t pipe, uint8_t *value, uint8_t size);

      ^

In file included from C:\Users\Rosana\Documents\Arduino\BIke_GPS_Tracker\BIke_GPS_Tracker.ino:5:0:

UART.h:138: error: 'Write_UART_TX' was not declared in this scope

   return !Write_UART_TX((char*)sendBuffer, sendLength);

                                                      ^

sketch\UART.h: In function 'void setConnectable()':

sketch\UART.h:183:55: warning: integer overflow in expression [-Woverflow]

                                  (ADV_INTERVAL_MIN_MS * 1000) / 625, (ADV_INTERVAL_MAX_MS * 1000) / 625,

                                                       ^

sketch\UART.h:183:91: warning: integer overflow in expression [-Woverflow]

                                  (ADV_INTERVAL_MIN_MS * 1000) / 625, (ADV_INTERVAL_MAX_MS * 1000) / 625,

                                                                                           ^

sketch\UART.h: In function 'void Attribute_Modified_CB(uint16_t, uint8_t, uint8_t*)':

UART.h:197: error: 'ble_rx_buffer' was not declared in this scope

       ble_rx_buffer = att_data;

       ^

UART.h:199: error: 'ble_rx_buffer' was not declared in this scope

     ble_rx_buffer = '\0';

     ^

UART.h:200: error: 'ble_rx_buffer_len' was not declared in this scope

     ble_rx_buffer_len = data_length;

     ^

C:\Users\Rosana\Documents\Arduino\BIke_GPS_Tracker\BIke_GPS_Tracker.ino: At global scope:

BIke_GPS_Tracker:46: error: 'rename' does not name a type

 rename UART.h to UART.ino

 ^

In file included from C:\Users\Rosana\Documents\Arduino\BIke_GPS_Tracker\BIke_GPS_Tracker.ino:47:0:

UART.h:19: error: redefinition of 'uint16_t connection_handle'

 uint16_t connection_handle = 0;

          ^

In file included from C:\Users\Rosana\Documents\Arduino\BIke_GPS_Tracker\BIke_GPS_Tracker.ino:5:0:

sketch\UART.h:19:10: note: 'uint16_t connection_handle' previously defined here

 uint16_t connection_handle = 0;

          ^

In file included from C:\Users\Rosana\Documents\Arduino\BIke_GPS_Tracker\BIke_GPS_Tracker.ino:47:0:

UART.h:26: error: redefinition of 'int connected'

 int connected = FALSE;

     ^

In file included from C:\Users\Rosana\Documents\Arduino\BIke_GPS_Tracker\BIke_GPS_Tracker.ino:5:0:

sketch\UART.h:26:5: note: 'int connected' previously defined here

 int connected = FALSE;

     ^

In file included from C:\Users\Rosana\Documents\Arduino\BIke_GPS_Tracker\BIke_GPS_Tracker.ino:47:0:

sketch\UART.h: In function 'int BLEsetup()':

UART.h:29: error: redefinition of 'int BLEsetup()'

 int BLEsetup() {

     ^

In file included from C:\Users\Rosana\Documents\Arduino\BIke_GPS_Tracker\BIke_GPS_Tracker.ino:5:0:

sketch\UART.h:29:5: note: 'int BLEsetup()' previously defined here

 int BLEsetup() {

     ^

In file included from C:\Users\Rosana\Documents\Arduino\BIke_GPS_Tracker\BIke_GPS_Tracker.ino:47:0:

sketch\UART.h: In function 'void aci_loop()':

UART.h:81: error: redefinition of 'void aci_loop()'

 void aci_loop() {

      ^

In file included from C:\Users\Rosana\Documents\Arduino\BIke_GPS_Tracker\BIke_GPS_Tracker.ino:5:0:

sketch\UART.h:81:6: note: 'void aci_loop()' previously defined here

 void aci_loop() {

      ^

In file included from C:\Users\Rosana\Documents\Arduino\BIke_GPS_Tracker\BIke_GPS_Tracker.ino:47:0:

sketch\UART.h: At global scope:

UART.h:105: error: redefinition of 'uint16_t UARTServHandle'

 uint16_t UARTServHandle, UARTTXCharHandle, UARTRXCharHandle;

          ^

In file included from C:\Users\Rosana\Documents\Arduino\BIke_GPS_Tracker\BIke_GPS_Tracker.ino:5:0:

sketch\UART.h:105:10: note: 'uint16_t UARTServHandle' previously declared here

 uint16_t UARTServHandle, UARTTXCharHandle, UARTRXCharHandle;

          ^

In file included from C:\Users\Rosana\Documents\Arduino\BIke_GPS_Tracker\BIke_GPS_Tracker.ino:47:0:

UART.h:105: error: redefinition of 'uint16_t UARTTXCharHandle'

 uint16_t UARTServHandle, UARTTXCharHandle, UARTRXCharHandle;

                          ^

In file included from C:\Users\Rosana\Documents\Arduino\BIke_GPS_Tracker\BIke_GPS_Tracker.ino:5:0:

sketch\UART.h:105:26: note: 'uint16_t UARTTXCharHandle' previously declared here

 uint16_t UARTServHandle, UARTTXCharHandle, UARTRXCharHandle;

                          ^

In file included from C:\Users\Rosana\Documents\Arduino\BIke_GPS_Tracker\BIke_GPS_Tracker.ino:47:0:

UART.h:105: error: redefinition of 'uint16_t UARTRXCharHandle'

 uint16_t UARTServHandle, UARTTXCharHandle, UARTRXCharHandle;

                                            ^

In file included from C:\Users\Rosana\Documents\Arduino\BIke_GPS_Tracker\BIke_GPS_Tracker.ino:5:0:

sketch\UART.h:105:44: note: 'uint16_t UARTRXCharHandle' previously declared here

 uint16_t UARTServHandle, UARTTXCharHandle, UARTRXCharHandle;

                                            ^

In file included from C:\Users\Rosana\Documents\Arduino\BIke_GPS_Tracker\BIke_GPS_Tracker.ino:47:0:

sketch\UART.h: In function 'uint8_t Add_UART_Service()':

UART.h:108: error: redefinition of 'uint8_t Add_UART_Service()'

 uint8_t Add_UART_Service(void)

         ^

In file included from C:\Users\Rosana\Documents\Arduino\BIke_GPS_Tracker\BIke_GPS_Tracker.ino:5:0:

sketch\UART.h:108:9: note: 'uint8_t Add_UART_Service()' previously defined here

 uint8_t Add_UART_Service(void)

         ^

In file included from C:\Users\Rosana\Documents\Arduino\BIke_GPS_Tracker\BIke_GPS_Tracker.ino:47:0:

sketch\UART.h: In function 'uint8_t lib_aci_send_data(uint8_t, uint8_t*, uint8_t)':

UART.h:137: error: ambiguating new declaration of 'uint8_t lib_aci_send_data(uint8_t, uint8_t*, uint8_t)'

 uint8_t lib_aci_send_data(uint8_t ignore, uint8_t* sendBuffer, uint8_t sendLength) {

                                                                                  ^

In file included from sketch\UART.h:3:0,

                 from C:\Users\Rosana\Documents\Arduino\BIke_GPS_Tracker\BIke_GPS_Tracker.ino:5:

sketch\lib_aci.h:376:6: note: old declaration 'bool lib_aci_send_data(uint8_t, uint8_t*, uint8_t)'

 bool lib_aci_send_data(uint8_t pipe, uint8_t *value, uint8_t size);

      ^

In file included from C:\Users\Rosana\Documents\Arduino\BIke_GPS_Tracker\BIke_GPS_Tracker.ino:47:0:

sketch\UART.h: In function 'uint8_t Write_UART_TX(char*, uint8_t)':

UART.h:141: error: redefinition of 'uint8_t Write_UART_TX(char*, uint8_t)'

 uint8_t Write_UART_TX(char* TXdata, uint8_t datasize)

         ^

In file included from C:\Users\Rosana\Documents\Arduino\BIke_GPS_Tracker\BIke_GPS_Tracker.ino:5:0:

sketch\UART.h:141:9: note: 'uint8_t Write_UART_TX(char*, uint8_t)' previously defined here

 uint8_t Write_UART_TX(char* TXdata, uint8_t datasize)

         ^

In file included from C:\Users\Rosana\Documents\Arduino\BIke_GPS_Tracker\BIke_GPS_Tracker.ino:47:0:

sketch\UART.h: In function 'void Read_Request_CB(uint16_t)':

UART.h:156: error: redefinition of 'void Read_Request_CB(uint16_t)'

 void Read_Request_CB(uint16_t handle)

      ^

In file included from C:\Users\Rosana\Documents\Arduino\BIke_GPS_Tracker\BIke_GPS_Tracker.ino:5:0:

sketch\UART.h:156:6: note: 'void Read_Request_CB(uint16_t)' previously defined here

 void Read_Request_CB(uint16_t handle)

      ^

In file included from C:\Users\Rosana\Documents\Arduino\BIke_GPS_Tracker\BIke_GPS_Tracker.ino:47:0:

sketch\UART.h: In function 'void setConnectable()':

UART.h:173: error: redefinition of 'void setConnectable()'

 void setConnectable(void)

      ^

In file included from C:\Users\Rosana\Documents\Arduino\BIke_GPS_Tracker\BIke_GPS_Tracker.ino:5:0:

sketch\UART.h:173:6: note: 'void setConnectable()' previously defined here

 void setConnectable(void)

      ^

In file included from C:\Users\Rosana\Documents\Arduino\BIke_GPS_Tracker\BIke_GPS_Tracker.ino:47:0:

sketch\UART.h:183:55: warning: integer overflow in expression [-Woverflow]

                                  (ADV_INTERVAL_MIN_MS * 1000) / 625, (ADV_INTERVAL_MAX_MS * 1000) / 625,

                                                       ^

sketch\UART.h:183:91: warning: integer overflow in expression [-Woverflow]

                                  (ADV_INTERVAL_MIN_MS * 1000) / 625, (ADV_INTERVAL_MAX_MS * 1000) / 625,

                                                                                           ^

sketch\UART.h: In function 'void Attribute_Modified_CB(uint16_t, uint8_t, uint8_t*)':

UART.h:192: error: redefinition of 'void Attribute_Modified_CB(uint16_t, uint8_t, uint8_t*)'

 void Attribute_Modified_CB(uint16_t handle, uint8_t data_length, uint8_t *att_data)

      ^

In file included from C:\Users\Rosana\Documents\Arduino\BIke_GPS_Tracker\BIke_GPS_Tracker.ino:5:0:

sketch\UART.h:192:6: note: 'void Attribute_Modified_CB(uint16_t, uint8_t, uint8_t*)' previously defined here

 void Attribute_Modified_CB(uint16_t handle, uint8_t data_length, uint8_t *att_data)

      ^

In file included from C:\Users\Rosana\Documents\Arduino\BIke_GPS_Tracker\BIke_GPS_Tracker.ino:47:0:

sketch\UART.h: In function 'void GAP_ConnectionComplete_CB(uint8_t*, uint16_t)':

UART.h:204: error: redefinition of 'void GAP_ConnectionComplete_CB(uint8_t*, uint16_t)'

 void GAP_ConnectionComplete_CB(uint8_t addr[6], uint16_t handle) {

      ^

In file included from C:\Users\Rosana\Documents\Arduino\BIke_GPS_Tracker\BIke_GPS_Tracker.ino:5:0:

sketch\UART.h:204:6: note: 'void GAP_ConnectionComplete_CB(uint8_t*, uint16_t)' previously defined here

 void GAP_ConnectionComplete_CB(uint8_t addr[6], uint16_t handle) {

      ^

In file included from C:\Users\Rosana\Documents\Arduino\BIke_GPS_Tracker\BIke_GPS_Tracker.ino:47:0:

sketch\UART.h: In function 'void GAP_DisconnectionComplete_CB()':

UART.h:216: error: redefinition of 'void GAP_DisconnectionComplete_CB()'

 void GAP_DisconnectionComplete_CB(void) {

      ^

In file included from C:\Users\Rosana\Documents\Arduino\BIke_GPS_Tracker\BIke_GPS_Tracker.ino:5:0:

sketch\UART.h:216:6: note: 'void GAP_DisconnectionComplete_CB()' previously defined here

 void GAP_DisconnectionComplete_CB(void) {

      ^

In file included from C:\Users\Rosana\Documents\Arduino\BIke_GPS_Tracker\BIke_GPS_Tracker.ino:47:0:

sketch\UART.h: In function 'void HCI_Event_CB(void*)':

UART.h:225: error: redefinition of 'void HCI_Event_CB(void*)'

 void HCI_Event_CB(void *pckt)

      ^

In file included from C:\Users\Rosana\Documents\Arduino\BIke_GPS_Tracker\BIke_GPS_Tracker.ino:5:0:

sketch\UART.h:225:6: note: 'void HCI_Event_CB(void*)' previously defined here

 void HCI_Event_CB(void *pckt)

      ^

C:\Users\Rosana\Documents\Arduino\BIke_GPS_Tracker\BIke_GPS_Tracker.ino: In function 'void loop()':

BIke_GPS_Tracker:73: error: expected ')' before 'read'

   gps.encode(Gps_serial read.read());

                         ^

BIke_GPS_Tracker:73: error: no matching function for call to 'TinyGPSPlus::encode(SoftwareSerial&)'

   gps.encode(Gps_serial read.read());

                                    ^

C:\Users\Rosana\Documents\Arduino\BIke_GPS_Tracker\BIke_GPS_Tracker.ino:73:36: note: candidate is:

In file included from C:\Users\Rosana\Documents\Arduino\BIke_GPS_Tracker\BIke_GPS_Tracker.ino:1:0:

C:\Users\Rosana\Documents\Arduino\libraries\TinyGPSPlus-master\src/TinyGPS++.h:223:8: note: bool TinyGPSPlus::encode(char)

   bool encode(char c); // process one character received from GPS

        ^

C:\Users\Rosana\Documents\Arduino\libraries\TinyGPSPlus-master\src/TinyGPS++.h:223:8: note:   no known conversion for argument 1 from 'SoftwareSerial' to 'char'

BIke_GPS_Tracker:79: error: 'ble' was not declared in this scope

     ble-rx-buffer_len=0;//clear after reading

     ^

BIke_GPS_Tracker:79: error: 'rx' was not declared in this scope

     ble-rx-buffer_len=0;//clear after reading

         ^

BIke_GPS_Tracker:79: error: 'buffer_len' was not declared in this scope

     ble-rx-buffer_len=0;//clear after reading

            ^

C:\Users\Rosana\Documents\Arduino\BIke_GPS_Tracker\BIke_GPS_Tracker.ino: At global scope:

BIke_GPS_Tracker:89: error: expected unqualified-id before 'if'

  if (SerialMonitorInterface.available()) {Check if serial input is available to send

  ^

exit status 1
expected initializer before 'hal_aci_data_t'
Title: Re: GPS Tracker with Bluetooth
Post by: lennevia on August 14, 2018, 10:40:36 AM
It looks like you're missing some files or definitions, and you have duplicated data. The organization of your header files and libraries is probably in error.

I suggest looking up what these error messages mean so that you can begin fixing them.
For example, here are some forums that have solved some of your types of errors:
Redefinition errors: https://arduino.stackexchange.com/questions/3331/error-redefinition-of
Does not name a type error: https://forum.arduino.cc/index.php?topic=155921.0