I’ve found strange problem. When I use temperature sensor with LMiC library everything goes fine, but as soon as I move to GPS sensor (I2C, version GY-GPS6MV2 with U-blox Neo-6m-0-001) data stop coming from GPS.
I add GPS acquire to the beginning of loop() but seems it is already not getting anything after LMiC os_init() function.
I’ve tried LMiC versions 1.50 and 1.51 and both Arduino Mega and Arduino Uno. Still doesn’t work.
Here’s my test code to make sure that data comes from GPS and it works: GPS_only.ino
Here’s the code taken from LMiC 1.51 ABP example where I’ve added code from ‘GPS only.ino’ : ABP_LoRaWAN_GPS.ino
It does send ‘Hello World’ by LoRaWAN but GPS doesn’t work =(
If I comment out LMIC code GPS data start coming again:
// LMIC init
os_init();
// Reset the MAC state. Session and pending data transfers will be discarded.
LMIC_reset();
// Set static session parameters. Instead of dynamically establishing a session
// by joining the network, precomputed session parameters are be provided.
LMIC_setSession (0x1, msbf4_read(DevAddr), (uint8_t*)NwkSkey, (uint8_t*)AppSkey);
// Disable data rate adaptation
LMIC_setAdrMode(0);
// Disable link check validation
LMIC_setLinkCheckMode(0);
// Disable beacon tracking
LMIC_disableTracking ();
// Stop listening for downstream data (periodical reception)
LMIC_stopPingable();
// Set data rate and transmit power (note: txpow seems to be ignored by the library)
LMIC_setDrTxpow(DR_SF7,14);
Looks like the LMiC library conflicts with TinyGPS++ library.
Did someone managed this somehow?
May be some other libraries should be used to make simple GPS tracker?
That will keep runnig forever, so the code will never reach the GPS code above it anymore (it will run only once, when the GPS has not had time to send anything yet).
I think you should read up a bit more on how programming works and try to actually understand the code you’re using, since it looks like you mostly copy-pasted code together without really understanding it (which might work, but really limits how far you’ll get…)
The problem was much deeper.
Pins 52,53 on Arduino Mega 2560 that I used was conflicted with SPI pins of LoRa shield (error comes from line SPI.begin from hal_init() function of os_init () function.
On Arduino Mega hardware Serial ports should be used for GPS module instead of SoftwareSerial.
Possible options are:
Serial0 is pins 0 (rx) & 1 (tx)
Serial1 is pins 18 (rx) & 19 (tx)
Serial2 is pins 16 (rx) & 17 (tx)
Serial3 is pins 14 (rx) & 15 (tx)
I’ve tried many pins with SoftwareSerial, but they are not working mostly.
Yes of course, I am trying to send GPS coordinates using a Dragino LoRa GPS Sheild, the tinygps Library and the LMIC library for Arduino, however I am having the same issues as onlyselain. the GPS code executes perfectly but when I add the LMIC parts it doesnt execute anymore. Any help please ?
For Software Serial you need to use predefined Rx , Tx pins of Arduino rather than defining any other pins of it for Rx,Tx
for connecting those to Rx Tx of tempterature sensor.
For GPS try to define any 2 pins of Arduino as Rx Tx so that you can connect them to Rx Tx of GPS.Hope this helps you.
why did you use I2C? I couldn’t find any references to such a board
I only find that the board has serial I/O with 9600bps.
My equivalent one (PAM-7Q) runs with TinyGPS++ on SowftwareSerial on an Arduino Pro Mini, RFM95W
can you share the sketch with me . Im having problem of connecting my neo 6m gps connected to arduino Uno but it shows “Low memory available, stability problems may occur” as i need to connect 2 more sensor to the board