Bluetooth Communication with GPS Tracker GPSlim236
Posted: Wed Oct 31, 2018 10:31 pm
Hey guys,
I've already tried several examples for esp32 classic BT connections but nothing worked out for me. I hope you can help.
First of all, what do I want to achieve? -> I have a GPSlim236 GPS tracker and want to receive with my esp32 the NMEA messages broadcasted by the GPSlim236. Therefore, my idea is to establish a BT connection between the esp32 and the GPSlim236 and read the data received via BT.
According to the GPSlim236 manual (https://fccid.io/RJIGPSLIM236/User-Manu ... ual-547971) it is "completely compatible with Bluetooth Serial Port Profile (SPP)". Further, it states the output protocol baudrate is 38400bps.
With that information i tried to open a SerialBT Interface on my esp32 with baudrate=38400 and perform SerialBT.read() but that didn't work out. I'm still not sure how to "connect" or pair with the GPSlim236?!
For example, using my android phone and a Bluetooth Terminal App, I can simply connect to the GPSlim236 via BT and receive the broadcasted messages, e.g.:
On the esp32 I tried the "bt_discovery" example (https://github.com/espressif/esp-idf/tr ... _discovery) and the serial monitor output was:
As you can see, the bt_discovery example worked out so far, because the correct device (GPSlim236) with its MAC address=00:0b:0d:85:ed:72 was found.
But again, I don't know how to establish a BT connection on my eps32 to a device with exactly that mac address?
I also tried the bt_spp_initiator and bt_spp_acceptor examples (https://github.com/espressif/esp-idf/tr ... /bluetooth) - but again I didn't receive any data with my esp32.
I hope you can help and give me a hint how to establish a connection to my GPS tracker.
Thank you very much in advance!
I've already tried several examples for esp32 classic BT connections but nothing worked out for me. I hope you can help.
First of all, what do I want to achieve? -> I have a GPSlim236 GPS tracker and want to receive with my esp32 the NMEA messages broadcasted by the GPSlim236. Therefore, my idea is to establish a BT connection between the esp32 and the GPSlim236 and read the data received via BT.
According to the GPSlim236 manual (https://fccid.io/RJIGPSLIM236/User-Manu ... ual-547971) it is "completely compatible with Bluetooth Serial Port Profile (SPP)". Further, it states the output protocol baudrate is 38400bps.
With that information i tried to open a SerialBT Interface on my esp32 with baudrate=38400 and perform SerialBT.read() but that didn't work out. I'm still not sure how to "connect" or pair with the GPSlim236?!
For example, using my android phone and a Bluetooth Terminal App, I can simply connect to the GPSlim236 via BT and receive the broadcasted messages, e.g.:
Code: Select all
22:59:09.278 Connecting to HOLUX GPSlim236 ...
22:59:10.191 Connected
22:59:10.336 $GPGGA,000009.059,0000.0000,N,00000.0000,E,0,00,,0.0,M,0.0,M,,0000*46
22:59:10.436 $GPRMC,000009.059,V,0000.0000,N,00000.0000,E,,,160406,,,N*76
22:59:10.617 $GPVTG,,T,,M,,N,,K,N*2C
22:59:11.336 $GPGGA,000010.065,0000.0000,N,00000.0000,E,0,00,,0.0,M,0.0,M,,0000*41
22:59:11.410 $GPRMC,000010.065,V,0000.0000,N,00000.0000,E,,,160406,,,N*71
22:59:11.485 $GPVTG,,T,,M,,N,,K,N*2C
22:59:12.337 $GPGGA,000011.063,0000.0000,N,00000.0000,E,0,00,,0.0,M,0.0,M,,0000*46
22:59:12.386 $GPRMC,000011.063,V,0000.0000,N,00000.0000,E,,,160406,,,N*76
22:59:12.485 $GPVTG,,T,,M,,N,,K,N*2C
22:59:13.336 $GPGGA,000012.059,0000.0000,N,00000.0000,E,0,00,,0.0,M,0.0,M,,0000*4C
22:59:13.436 $GPGSA,A,1,,,,,,,,,,,,,,,*1E
22:59:13.536 $GPGSV,3,1,12,20,00,000,,10,00,000,,25,00,000,,27,00,000,*79
22:59:13.610 $GPGSV,3,2,12,22,00,000,,07,00,000,,21,00,000,,24,00,000,*79
22:59:13.685 $GPGSV,3,3,12,16,00,000,,28,00,000,,26,00,000,,29,00,000,*78
22:59:13.761 $GPRMC,000012.059,V,0000.0000,N,00000.0000,E,,,160406,,,N*7C
22:59:13.837 $GPVTG,,T,,M,,N,,K,N*2C
22:59:14.111 Disconnected from device
Code: Select all
ets Jun 8 2016 00:22:57
18:35:18.665 ->
18:35:18.665 -> rst:0x1 (POWERON_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
18:35:18.665 -> configsip: 0, SPIWP:0xee
18:35:18.665 -> clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
18:35:18.665 -> mode:DIO, clock div:2
18:35:18.665 -> load:0x3fff0018,len:4
18:35:18.665 -> load:0x3fff001c,len:6328
18:35:18.665 -> load:0x40078000,len:10084
18:35:18.665 -> load:0x40080400,len:6476
18:35:18.665 -> entry 0x40080764
[0;32mI (29) boot: ESP-IDF v3.2-dev-1250-g221eced06 2nd stage bootloader[0m
18:35:18.734 -> [0;32mI (29) boot: compile time 22:01:43[0m
18:35:18.734 -> [0;32mI (29) boot: Enabling RNG early entropy source...[0m
18:35:18.734 -> [0;32mI (35) boot: SPI Speed : 40MHz[0m
18:35:18.734 -> [0;32mI (39) boot: SPI Mode : DIO[0m
18:35:18.734 -> [0;32mI (43) boot: SPI Flash Size : 4MB[0m
18:35:18.734 -> [0;32mI (47) boot: Partition Table:[0m
18:35:18.734 -> [0;32mI (51) boot: ## Label Usage Type ST Offset Length[0m
18:35:18.734 -> [0;32mI (58) boot: 0 nvs WiFi data 01 02 00009000 00006000[0m
18:35:18.734 -> [0;32mI (66) boot: 1 phy_init RF data 01 01 0000f000 00001000[0m
18:35:18.734 -> [0;32mI (73) boot: 2 factory factory app 00 00 00010000 00100000[0m
18:35:18.734 -> [0;32mI (81) boot: End of partition table[0m
18:35:18.734 -> [0;32mI (85) esp_image: segment 0: paddr=0x00010020 vaddr=0x3f400020 size=0x2306c (143468) map[0m
[0;32mI (144) esp_image: segment 1: paddr=0x00033094 vaddr=0x3ff80000 size=0x00000 ( 0) load[0m
18:35:18.838 -> [0;32mI (144) esp_image: segment 2: paddr=0x0003309c vaddr=0x3ff80000 size=0x00000 ( 0) load[0m
18:35:18.838 -> [0;32mI (151) esp_image: segment 3: paddr=0x000330a4 vaddr=0x3ffbdb60 size=0x02f30 ( 12080) load[0m
18:35:18.838 -> [0;32mI (164) esp_image: segment 4: paddr=0x00035fdc vaddr=0x3ffc0a90 size=0x00000 ( 0) load[0m
18:35:18.838 -> [0;32mI (169) esp_image: segment 5: paddr=0x00035fe4 vaddr=0x40080000 size=0x00400 ( 1024) load[0m
18:35:18.838 -> [0;32mI (178) esp_image: segment 6: paddr=0x000363ec vaddr=0x40080400 size=0x09c24 ( 39972) load[0m
18:35:18.838 -> [0;32mI (203) esp_image: segment 7: paddr=0x00040018 vaddr=0x400d0018 size=0x76638 (484920) map[0m
[0;32mI (373) esp_image: segment 8: paddr=0x000b6658 vaddr=0x4008a024 size=0x081cc ( 33228) load[0m
[0;32mI (387) esp_image: segment 9: paddr=0x000be82c vaddr=0x400c0000 size=0x00000 ( 0) load[0m
18:35:19.116 -> [0;32mI (387) esp_image: segment 10: paddr=0x000be834 vaddr=0x50000000 size=0x00000 ( 0) load[0m
18:35:19.116 -> [0;32mI (394) esp_image: segment 11: paddr=0x000be83c vaddr=0x50000000 size=0x00000 ( 0) load[0m
18:35:19.116 -> [0;32mI (414) boot: Loaded app from partition at offset 0x10000[0m
18:35:19.116 -> [0;32mI (414) boot: Disabling RNG early entropy source...[0m
18:35:19.116 -> [0;32mI (415) cpu_start: Pro cpu up.[0m
18:35:19.116 -> [0;32mI (418) cpu_start: Starting app cpu, entry point is 0x40081040[0m
18:35:19.116 -> [0;32mI (0) cpu_start: App cpu up.[0m
18:35:19.116 -> [0;32mI (429) heap_init: Initializing. RAM available for dynamic allocation:[0m
18:35:19.116 -> [0;32mI (436) heap_init: At 3FFAFF10 len 000000F0 (0 KiB): DRAM[0m
18:35:19.116 -> [0;32mI (442) heap_init: At 3FFB6388 len 00001C78 (7 KiB): DRAM[0m
18:35:19.116 -> [0;32mI (448) heap_init: At 3FFB9A20 len 00004108 (16 KiB): DRAM[0m
18:35:19.116 -> [0;32mI (454) heap_init: At 3FFBDB5C len 00000004 (0 KiB): DRAM[0m
18:35:19.116 -> [0;32mI (460) heap_init: At 3FFCB5D8 len 00014A28 (82 KiB): DRAM[0m
18:35:19.116 -> [0;32mI (466) heap_init: At 3FFE0440 len 00003BC0 (14 KiB): D/IRAM[0m
18:35:19.116 -> [0;32mI (472) heap_init: At 3FFE4350 len 0001BCB0 (111 KiB): D/IRAM[0m
18:35:19.116 -> [0;32mI (479) heap_init: At 400921F0 len 0000DE10 (55 KiB): IRAM[0m
18:35:19.116 -> [0;32mI (485) cpu_start: Pro cpu start user code[0m
[0;32mI (168) cpu_start: Starting scheduler on PRO CPU.[0m
18:35:19.150 -> [0;32mI (0) cpu_start: Starting scheduler on APP CPU.[0m
[0;32mI (236) BTDM_INIT: BT controller compile version [a348a1e][0m
18:35:19.187 -> [0;32mI (236) system_api: Base MAC address is not set, read default base MAC address from BLK0 of EFUSE[0m
[0;32mI (316) phy: phy_version: 4000, b6198fa, Sep 3 2018, 15:11:06, 0, 0[0m
[0;32mI (936) GAP: Discovery started.[0m
[0;32mI (3116) GAP: Device found: 00:0b:0d:85:ed:72[0m
18:35:22.063 -> [0;32mI (3116) GAP: --Class of Device: 0x1f00[0m
18:35:22.063 -> [0;32mI (3116) GAP: --RSSI: -62[0m
[0;32mI (3346) GAP: Device found: 00:0b:0d:85:ed:72[0m
18:35:22.310 -> [0;32mI (3346) GAP: --Class of Device: 0x1f00[0m
18:35:22.310 -> [0;32mI (3346) GAP: --RSSI: -64[0m
[0;32mI (8226) GAP: Device found: 00:0b:0d:85:ed:72[0m
18:35:27.190 -> [0;32mI (8226) GAP: --Class of Device: 0x1f00[0m
18:35:27.190 -> [0;32mI (8226) GAP: --RSSI: -58[0m
[0;32mI (13756) GAP: Device discovery stopped.[0m
[0;32mI (15396) GAP: Device found: 00:0b:0d:85:ed:72[0m
18:35:34.321 -> [0;32mI (15396) GAP: Device discovery stopped.[0m
But again, I don't know how to establish a BT connection on my eps32 to a device with exactly that mac address?
I also tried the bt_spp_initiator and bt_spp_acceptor examples (https://github.com/espressif/esp-idf/tr ... /bluetooth) - but again I didn't receive any data with my esp32.
I hope you can help and give me a hint how to establish a connection to my GPS tracker.
Thank you very much in advance!