LinkIt One and GPS/Wifi Tutorial

Ask, and ye shall receive.
curamb
Posts: 5
Joined: 07:12, 18 Jul 2015

LinkIt One and GPS/Wifi Tutorial

Postby curamb » 07:19, 18 Jul 2015

My development environment is Mac OS X 10.10.3, firmware 1.1.11 beta for mac ox beta linkit ONE SDK, Arduino 1.6.4 IDE. I am working through the evothings GPS and Wifi tutorial with the Linkit One and everything works up until I connect to the ip address of the linkit one and it says I'm in Asia when I'm in California. Is this a LinkIT one issue or a evothings issue or a me issue?

Here is the output from the serial monitor:

Code: Select all

new client
GET / HTTP/1.1
Host: 192.168.1.100
Origin: http://192.168.1.102:4042
Connection: keep-alive
Accept: application/json, text/javascript, */*; q=0.01
User-Agent: Mozilla/5.0 (iPhone; CPU iPhone OS 8_3 like Mac OS X) AppleWebKit/600.1.4 (KHTML, like Gecko) Mobile/12F70 (xxxxxxxxxx)
Accept-Language: en-us
Referer: http://192.168.1.102:4042/index.html
Accept-Encoding: gzip, deflate

send response
close connection
client disconnected
UTC timer  6- 6-52
latitude =  3723.7179, longitude = 12202.3329
Number of satellites in view = 9
Note: If number of satelites=0, there is no GPS position fix yet

UTC timer  6- 6-57
latitude =  3723.7179, longitude = 12202.3329
Number of satellites in view = 9
Note: If number of satelites=0, there is no GPS position fix yet

new client
GET / HTTP/1.1
Host: 192.168.1.100
Origin: http://192.168.1.102:4042
Connection: keep-alive
Accept: application/json, text/javascript, */*; q=0.01
User-Agent: Mozilla/5.0 (iPhone; CPU iPhone OS 8_3 like Mac OS X) AppleWebKit/600.1.4 (KHTML, like Gecko) Mobile/12F70 (xxxxxxxxxx)
Accept-Language: en-us
Referer: http://192.168.1.102:4042/index.html
Accept-Encoding: gzip, deflate

send response
close connection
client disconnected
UTC timer  6- 7- 2
latitude =  3723.7179, longitude = 12202.3329
Number of satellites in view = 9
Note: If number of satelites=0, there is no GPS position fix yet

Fredrik
Site Admin
Posts: 196
Joined: 15:00, 18 Nov 2013

Re: LinkIt One and GPS/Wifi Tutorial

Postby Fredrik » 15:27, 21 Jul 2015

I read those coordinates (3723.7179, 12202.3329) as 37°23" north, 122°2" west, which puts you right in the middle of the Silicon Valley.

curamb
Posts: 5
Joined: 07:12, 18 Jul 2015

Re: LinkIt One and GPS/Wifi Tutorial

Postby curamb » 22:01, 26 Jul 2015

Correct, the coordinates are but the evothings app is registering me as in Asia. So this is either an iphone, evothings, or gmaps problem right?

Also, I clicked the notify me when a post so I will respond more promptly.

Fredrik
Site Admin
Posts: 196
Joined: 15:00, 18 Nov 2013

Re: LinkIt One and GPS/Wifi Tutorial

Postby Fredrik » 14:54, 27 Jul 2015

I don't have a Linkit ONE here, so I can't actually test the app, but I've looked over the source code and can't find any obvious problems.

If I were you, I'd use the log view in Evothings Workbench (TOOLS button) to see if the app recieves correct coordinates. In particular, in app.js, in the function app.dataReceived, there is a line "console.log('Received data - Latitude: ' + latitude + ', Longitude: ' + longitude)", followed by "var markerPosition = new google.maps.LatLng(latitude, longitude)", which seem to be the things to focus on.

curamb
Posts: 5
Joined: 07:12, 18 Jul 2015

Re: LinkIt One and GPS/Wifi Tutorial

Postby curamb » 18:19, 27 Jul 2015

The tools tab on the evothings workbench outputs the following:

LOG: Trying to fetch data...
LOG: Received data - Latitude: 37.39527833, Longitude: 122.03885667
LOG: Trying to fetch data...
LOG: Received data - Latitude: 37.39527833, Longitude: 122.03885667
LOG: Trying to fetch data...
LOG: Received data - Latitude: 37.39527833, Longitude: 122.03885667
LOG: Trying to fetch data...
LOG: Received data - Latitude: 37.39527833, Longitude: 122.03885667
LOG: [ERR] ReferenceError: Can't find variable: cordova [index.html: 1]


The app receives the data until the app goes to sleep or the phone is put in standby mode which then generates the ReferenceError. The reverse geocoded coordinates that it is receiving is:

Huancui, Weihai, Shandong, China


HOWEVER, when printing the coordinates using the arduino IDE code below to print the gps coordinates, it generates the correct code:

Code: Select all

Serial.println((char *)gpsData.GPGGA);


Below is the link to the ongoing conversation at mediatek regarding this issue:

http://labs.mediatek.com/forums/posts/list/2998.page#p5046

Fredrik
Site Admin
Posts: 196
Joined: 15:00, 18 Nov 2013

Re: LinkIt One and GPS/Wifi Tutorial

Postby Fredrik » 19:40, 27 Jul 2015

So Weihai is about 122° east, while your location is 122° west.

Figured it out. There's a bug in our example, mediatek_linkit.ino, parseGPGGA(). It ignores the North/South and East/West parts of the GGA string, thus assuming all coordinates are in the northeast quadrant of the Earth.

Works well for us in Sweden. Less well for our American friends. :)

I'll get someone to fix it, though since many of us are on vacation, it may take a while.

It could be an exercise for the reader to fix it themselves.

curamb
Posts: 5
Joined: 07:12, 18 Jul 2015

Re: LinkIt One and GPS/Wifi Tutorial

Postby curamb » 20:21, 27 Jul 2015

This is useful information. I have no idea what I'm doing but I'll work on it.

Fredrik
Site Admin
Posts: 196
Joined: 15:00, 18 Nov 2013

Re: LinkIt One and GPS/Wifi Tutorial

Postby Fredrik » 10:05, 10 Aug 2015

Found some spare time and fixed it myself. Here is the updated .ino file.

curamb
Posts: 5
Joined: 07:12, 18 Jul 2015

Re: LinkIt One and GPS/Wifi Tutorial

Postby curamb » 13:01, 10 Aug 2015

This is indeed up and working to a certain extent (showing proper location but not able to handle additional tasks). Had to try it with three different boards but apparently, the power needed to power both the adafruit fingerprint sensor and the gps using the evothings/linkit One gps hardware/software is too much for the board. As soon as I begin to plug in the fingerprint sensor, the number of satellites detected drops from 6-10 to zero.


Return to “Questions and answers”

Who is online

Users browsing this forum: No registered users and 10 guests