I am using the arduino 1400 GSM localization code, however no matter how many times and how long I run it for, the code keeps telling me Im either in Null Island or Kansas, and I don't know what is wrong? Does anyone know what part might not be working?
Sorry about that.
I am using and Arduino 1400 MKR, activated Sim Card, and Dipole Antenna. I am attempting to receive the GSM location of the board. The code runs, however the location is not accurate no matter how I run it. The serial port reads:
Location : 38.0000000, -97.0000000
Accuracy: +/- 41.0000000
I am not in kansas...
The code I am using is:
// libraries
#include <MKRGSM.h>
#include "arduino_secrets.h"
// Please enter your sensitive data in the Secret tab or arduino_secrets.h
// PIN Number
const char PINNUMBER[] = SECRET_PINNUMBER;
// APN data
const char GPRS_APN[] = SECRET_GPRS_APN;
const char GPRS_LOGIN[] = SECRET_GPRS_LOGIN;
const char GPRS_PASSWORD[] = SECRET_GPRS_PASSWORD;
// initialize the library instance
GSMLocation location;
GPRS gprs;
GSM gsmAccess;
void setup() {
// initialize serial communications and wait for port to open:
Serial.begin(9600);
while (!Serial) {
; // wait for serial port to connect. Needed for native USB port only
}
Serial.println("Starting GSM location.");
// connection state
bool connected = false;
// After starting the modem with GSM.begin()
// connect to the GPRS network with the APN, login and password
while (!connected) {
if ((gsmAccess.begin(PINNUMBER) == GSM_READY) &&
(gprs.attachGPRS(GPRS_APN, GPRS_LOGIN, GPRS_PASSWORD) == GPRS_READY)) {
connected = true;
} else {
Serial.println("Not connected");
delay(1000);
}
}
location.begin();
}
void loop() {
if (location.available()) {
Serial.print("Location: ");
Serial.print(location.latitude(), 7);
Serial.print(", ");
Serial.println(location.longitude(), 7);
Serial.print("Altitude: ");
Serial.print(location.altitude());
Serial.println("m");
Serial.print("Accuracy: +/- ");
Serial.print(location.accuracy());
Serial.println("m");
Serial.println();
}
}
The Circuit looks like this:
Is this issue simply poor signal strength, or is there an issue with my hardware?
Never really found those antenna to be up to much and only useful for basic tests under good conditions.
Is there any other type of hardware you suggest using instead?
Have found this type to operate better but you need to ensure they are for the correct frequency as there are some out there offered which are designed for other frequencies.
You may also need to purchase a "pigtail" connector UFL to SMA
The accuracy depends on the amount of antennas around you. I'm here in switzerland with a lot of cell antennas but the best i was able to reach was around +- 1 km.
My experience with antennas : It's a very slight difference with the antennas, you can't boost the senders power, weak signal stays weak.
Not totally correct.
A lot has to do with the GAIN of an antenna.
More so if can use a directional type to help single out a location.
Gain yes, but you also need to send. Sure thing a better antenna is better but i never experienced it as a game changer, that's what i wanted to say. IMHO directional antenna type is useless for this application, you don't know in which direction the cell antenna is (i always think in mobile devices) and this GSM localization thing uses triangulation between several antennas.
Directional may not be the best answer I agree.
But in scenarios where there is a known fixed location it would be about the best solution.
Consider the fact that radio hams can BOUNCE signals off the moon to get to other locations on earth.
Also with a directional approach for a fixed location the signal strength would certainly be visible in the spectrum for a local tower.
A true vertical Omnidirectional would of course be the best option for a moving application.
Dipoles as supplied for these devices have known limits that make them prone to signal loss in some directions.
G1LPR (old UK call sign)
Can you interrogate the cell towers for their location?
Sort of by using a DXF technique.
But as for the tower name / identifier and such I have no idea.
I couldn’t find any indication that you can. It seems to be all in the other direction. Pity, you could steer an antenna otherwise.
Lots more info out there too about using a DF antenna.
I agree, the antenna is VERY important in ham, FM or 433Mhz and many others. I'm not an expert nor a antanna designer but my experiences in the field with the short 3G/4G wavelenghts were disappointing with antanne changes. Last week, i changed the "normal" router antennas from a LTE router with a 41 cm round mimo antenna, 18 db gain according to the ad, gave me 1 to2 db in RSRP in reality. With the MKR1400/1500 i tried 3 different antennas with practically no difference. I can only speak for me. With fixed location, i agree, a directional one may help a lot.
Directional does not have to cost a lot too, look up CANTENNA.
I built one for my daughter when she was in a second floor apartment and the gains were incredible.
She went from having about 3 open wi-fi connections to over 20 !
You can also still use an omnidirectional or dipole by simply using a splitter.
Dipoles often work better when orientated vertical
Location plays a key factor too !
Higher is the preferred.
Also even at the higher frequencies ground planes can help.
Parabolic antennas are in simple terms a curved ground plane to help concentrate signals.
These can also be used with omnidirectional and dipoles so long as the stand off is not too big.
They allow a good additional signal increase with only a small loss in directional ability but a wider reception area.
Have seen old sat dishes and old TV parabolic used to great affect !
And just to add to the parabolic in a fun sense.
https://www.instructables.com/"Poorman-s-WiFi"--USB-adapters-&-DIY-cookware-refl/
It looks like there is a public database that lists towers by ID and includes coordinates:
GSM,310,260,32192,22568,0,-73.858566,40.898438,1779,12,1,1459696254,1489125559,0
You could use that to point an antenna.
Yes I noticed that there are lots of lists for that type of thing.
Google had a gazillion hits for location.
![]()
This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.


