lectroidmarc / gsm-tracker

An Arduino sketch that supports the Adafruit FONA and a GPS. For tracking things.
ISC License
16 stars 4 forks source link

no matching function for call #2

Open siguidcore opened 9 years ago

siguidcore commented 9 years ago

hi and congrats to the developer.

the concept is very smart and I would like to try it myself however I can't get thru compiling the code on the arduino ide. I've entered my keys on the jason file and made sure the files' suffix was changed as per the readme.

the error I get on the interface is the following

gsm_tracker.ino:29:57: error: no matching function for call to ‘Adafruit_FONA::Adafruit_FONA(SoftwareSerial*, const uint8_t&)’
gsm_tracker.ino:29:57: note: candidates are:
In file included from gsm_tracker.ino:4:0:
/home/sighi/sketchbook/libraries/Adafruit_FONA/Adafruit_FONA.h:49:3: note: Adafruit_FONA::Adafruit_FONA(int8_t)
   Adafruit_FONA(int8_t r);
   ^
/home/sighi/sketchbook/libraries/Adafruit_FONA/Adafruit_FONA.h:49:3: note:   candidate expects 1 argument, 2 provided
/home/sighi/sketchbook/libraries/Adafruit_FONA/Adafruit_FONA.h:47:7: note: Adafruit_FONA::Adafruit_FONA(const Adafruit_FONA&)
 class Adafruit_FONA : public Stream {
       ^
/home/sighi/sketchbook/libraries/Adafruit_FONA/Adafruit_FONA.h:47:7: note:   candidate expects 1 argument, 2 provided
gsm_tracker.ino: In function ‘void setup()’:
gsm_tracker.ino:76:42: error: no matching function for call to ‘Adafruit_FONA::begin(int)’
gsm_tracker.ino:76:42: note: candidate is:
In file included from gsm_tracker.ino:4:0:
/home/sighi/sketchbook/libraries/Adafruit_FONA/Adafruit_FONA.h:50:11: note: boolean Adafruit_FONA::begin(Stream&)
   boolean begin(Stream &port);
           ^
/home/sighi/sketchbook/libraries/Adafruit_FONA/Adafruit_FONA.h:50:11: note:   no known conversion for argument 1 from ‘int’ to ‘Stream&’

thanks for any help provided

lectroidmarc commented 9 years ago

Yikes, yes! Adafruit changed the way the FONA library handles initialization and I neglected to update my code.

Try the latest version (I just updated it). It should work for you.

siguidcore commented 9 years ago

Great thanks! I tested it today and no more errors during compiling, however I'm still having some issues.

I have the feeling it's got something to do with my carrier requiring a manual APN as well as a user name and password. I ran the test from the fona library with the line for custom apn uncommented and i got the net status led blinking at the 'gprs connected' rate and was able to pull down a page (albeit with some missing characters), then I tried to load your code while still attached to the network but yet no data pushed on the sparkfun service side.

regarding the sms functionality I get always a responding with location/status failed message even after having tried with my number written in both international and local formats. Also, my RI doesnt seem to be going low when an sms is received, hence i have to force it manually by touching the exposed lead briefly without touching any ground which i guess replicates a logic low to set off the reading of the stuck messages. as a final observation I realized i had to swap the PS and KEY wires in order to get the modem to start and keep the blue light on (which had been off all the time).

perhaps you have some advice to try

lectroidmarc commented 9 years ago

Sorry for the horribly long delay here...

If the test code works, yet my code doesn't that is very strange. There is the possibility that something was wrong on the Sparkfun side, the don't have the best uptime ;). Are you seeing any errors in the console?

As the the location status failed message, a lot of GPS's take a long time to get a fix, so there may be that.

Finally, the RI pin going low, I know what that's about but I'm not sure why. I've seen commits to expressly enable the RI pin for SMS messages, but I've never needed it. I'm wondering if maybe my FONA is just odd (or broken?). I will look into adding that functionality, just to be safe :).

rajbadri commented 9 years ago

the sms functionality does not work. i always get failed in the serial monitor

lectroidmarc commented 9 years ago

@rajbadri does the example code work?

rajbadri commented 9 years ago

the problem was in my sim card which was not sending the sms. The code works perfectly but i have a few suggestions.

  1. please give a way to delete all stored sms's. we in india get lot of useless sms's from the phone co which blocks the execution of the code.
  2. how can i increase the time (for e.g. 5 min) the arduino post gps location to spark fun and shut down fona meanwhile to conserve battery.

Thanks

siguidcore commented 9 years ago

@lectroidmarc Don't worry and thanks a lot for the input! I myself was away home for the last two weeks. It would have been neat to have some kind of logger (or even better, an active tracker! :D) for my trip but the network strenght was rather poor all the time anyways :/

Unfortunately no errors on the console (is there a way to turn on a verbose mode perhaps?) I figured my issue might be, just as rajbadri pointed out, something going on the sim side. I'll get my hands on a new one from another carrier and report back as soon as I make the tests again. All except making calls and sending messages worked fine with the ada's sample, even gprs, so I find it odd too. for what is worth I have no issue whatsoever if I send raw at commands to the module via screen though.

As the the location status failed message, a lot of GPS's take a long time to get a fix, so there may be that.

Yeah sometimes I wont even get a fix at all if placed near a window on a cloudy day until nighttime, any other day it can get a rather accurate fix even inside my apartment.. This time however, I'm sure it got one since I'm using the venus breakout and its led blinks when enough satellites are on sight and just to make sure dropped a coordinate sample out of the stream onto google maps and the pin hit fairly close my actual position.

I'm wondering if maybe my FONA is just odd (or broken?).

I in fact thought mine was broken too because of the power indicator being finicky about lighting up all the time.

Hi @rajbadri in line 21 of lectroidmarc's code there's a "define gps interval" you can set in seconds, I belive that fuction might be a bit close to what youre looking for but I don't know if that's separate from the posting frequency; i don't remember having seen such a definition either, unless it's somwhere the files inside the web folder, may be you could fiddle carefully with those.