Did something change between 0.6.0 and 0.6.2 on the Electron that governs the rate at which the callback function is called?
I have code that issues a CGED=5 command and I used to be able to collect the entire response with one callback run. Now the callback seems to be running too quickly, and I am missing some characters as well.
For instance, in v.0.6.0, the entire response to this command would have been placed in the buffer, where I could parse the entire thing at once. Now in 0.6.2, _cbLOCATE is called before the entire response is placed in the buffer. Is there a way to wait for the complete response from the AT command before calling the callback function?
This problem was fairly straightforward to solve, once I understood what was happening. Since the callback function was being called more often, I simply needed to collect all of the responses and then wait for the TYPE_OK response in order to act upon it.
Something like this in the callback function:
if (type == TYPE_UNKNOWN) {
Add contents of buffer to a string
WAIT
}
if (type == TYPE_OK) {
Act on the contents of the string
}
Any news for an official API for this? Iāve been testing the Google Maps beta integration, but seems that itās always only polling the active cell tower (Iāve also had issues with a lot of 404 responses from the API, but thatās another issue) and Iām looking for other options.
Iām working with an Electron Asset Tracker kit (got the SARA-U270-00S) and itās not entirely clear to me if the +CGED=5 command is working or not on this chipset?
Any general recommendations for the best options for the most accurate cell location are most welcome
Hello @BDub,
Iām running through some testing of this and I have the location code working, but it only seems to work if you call it when connected via the serial port. I modified the code to also have a function that could be called from the particle cloud to tell the electron to call the location code. I then put the results in a particle variable that I can get. The issue is that the location call will fire using the particle function, but it always returns 0 for lat and lng as well as a date of 1/1/2014. If I connect using the serial port and call the location code it returns fine with valid values. The next interesting thing is that subsequent calls using the particle function return just fine then. At that point I figured, okā¦call the location code once in the loop, but even that returns nothing.
Any thoughts on why the serial connection would work differently?
Iām having issues incorporating this into my own code. It appears this method doesnāt work in multi-thread mode; however, other pieces of my code really do need it. Are you able to identify any parts of your code that may conflict with multi-thread mode?
Failed to locate position, did not get valid response, try 1
Failed to locate position, did not get valid response, try 2
Failed to locate position, did not get valid response, try 3
ā¦ and so ā¦
I tried also the code this code, which is basically the same but not OOP, and works.
Iām attempting to run the test app, cell-locate.cpp.
Iām not getting any response. I am running an electron v7.0, are others able to run the program with this firmware? I also tried backdating to v6.4 and also saw no response after flashing.
It will complie just as Iāve downlowded it as a .cpp file, but it looks strange to me its not an ā.inoā file like Iām used to seeing.
Is cell-locate.cpp a standalone application? Or is it supposed to be added to a main .ino file?
The original app posted should work on 2G/3G/pentaband E Series modules, but I personally have really started liking our Google Maps Integration better
Would love to know if anyone has started tinkering with it. It looks like celllocate commands simply arenāt available in the current SARA R4 firmware.
I am admittedly a noobie to particle, but have successfully compiled and flashed simple sketches to my brandnew Electron, and been able to get event data on my iPhone event log on single cell tower LAC info from example sketches.
I have been UNsuccessful getting this present app to run. I send an āLā from my serial monitor, and have waited minutes without seeing any data from the Electron. I would be grateful for some hints as to what Iām doing wrong.
Which serial monitor are you using? You canāt use particle serial monitor as itās only a monitor from the device and canāt be used to send data to it. So you canāt use it to trigger the L command in the Electron Cell Locate test app.