Open sfe-SparkFro opened 11 months ago
Here are my notes as I test the Cellular Library examples on the SARA-R510M8S. Separate Pull Requests will follow as I add SARA-specific examples (with the extra PDP commands needed by the SARA).
SparkFun MicroMod Asset Tracker Carrier Board DEV-17272 SparkFun MicroMod Artemis Processor DEV-16401 SparkFun Apollo3 Boards v2.2.1
SparkFun_ublox_SARA_R510M8S_61B myModule;
Uncomment myModule.invertPowerPin(true);
First time, the example runs correctly. I see Manu ID, Model ID, IMEI, IMSI etc. But if I upload and run it again, it fails. The Artemis is sending AT commands, but the SARA is not replying. I suspect it has something to do with the power pin, or the way the Artemis is reset when (re)uploading the example? Investigating...
I'm trying to define the power pin - Artemis MicroMod PB pin G2:
This compiles OK:
SparkFun_ublox_Cellular myModule(G2);
But this fails:
SparkFun_ublox_SARA_R510M8S_61B myModule(G2);
Example1_DeviceIdentification:14:44: error: no matching function for call to 'SparkFun_ublox_SARA_R510M8S_61B::SparkFun_ublox_SARA_R510M8S_61B(PinName)'
SparkFun_ublox_SARA_R510M8S_61B myModule(G2);
^
In file included from C:\Users\pc235\Documents\Arduino\libraries\SparkFun_u-blox_AT_Commands_Arduino_Library\src/SparkFun_u-blox_Cellular_Arduino_Library.h:2,
from C:\Users\pc235\AppData\Local\Temp\arduino_modified_sketch_873765\Example1_DeviceIdentification.ino:1:
C:\Users\pc235\Documents\Arduino\libraries\SparkFun_u-blox_AT_Commands_Arduino_Library\src/sfe_sara_r5.h:65:7: note: candidate: 'SparkFun_ublox_SARA_R510M8S_61B::SparkFun_ublox_SARA_R510M8S_61B()'
class SparkFun_ublox_SARA_R510M8S_61B : public SparkFun_ublox_SARA_R5
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
C:\Users\pc235\Documents\Arduino\libraries\SparkFun_u-blox_AT_Commands_Arduino_Library\src/sfe_sara_r5.h:65:7: note: candidate expects 0 arguments, 1 provided
C:\Users\pc235\Documents\Arduino\libraries\SparkFun_u-blox_AT_Commands_Arduino_Library\src/sfe_sara_r5.h:65:7: note: candidate: 'SparkFun_ublox_SARA_R510M8S_61B::SparkFun_ublox_SARA_R510M8S_61B(const SparkFun_ublox_SARA_R510M8S_61B&)'
C:\Users\pc235\Documents\Arduino\libraries\SparkFun_u-blox_AT_Commands_Arduino_Library\src/sfe_sara_r5.h:65:7: note: no known conversion for argument 1 from 'PinName' to 'const SparkFun_ublox_SARA_R510M8S_61B&'
C:\Users\pc235\Documents\Arduino\libraries\SparkFun_u-blox_AT_Commands_Arduino_Library\src/sfe_sara_r5.h:65:7: note: candidate: 'SparkFun_ublox_SARA_R510M8S_61B::SparkFun_ublox_SARA_R510M8S_61B(SparkFun_ublox_SARA_R510M8S_61B&&)'
C:\Users\pc235\Documents\Arduino\libraries\SparkFun_u-blox_AT_Commands_Arduino_Library\src/sfe_sara_r5.h:65:7: note: no known conversion for argument 1 from 'PinName' to 'SparkFun_ublox_SARA_R510M8S_61B&&'
@sfe-SparkFro : how do I define the power pin on the SARA-R510M8S? Thanks!
Ah, looks like the problem is that you can only use the default constructor for all the inherited classes. @gigapod any suggestions on how to best fix this? Would prefer to not have to define the same constructor for each class if possible.
You need to bring up the superclasses constructors using a using
statement.
From something I did in Flux:
// use superclasses other constructors (besides default)
using flxStorageJSONPref::flxStorageJSONPref;
Here in context https://github.com/sparkfun/SparkFun_Flux/blob/981a4b6ec2080532b6405beff6390049e8a481b1/src/Flux/flxStorageJSONPref.h#L187
See #23, should be working there!
Looks good, merged in the branch!
The use of using
is discussed in detail in a section on this page: https://en.cppreference.com/w/cpp/language/using_declaration
My RTK EVK examples (currently private):
Note: both examples need a GNSS, so they're not great 'generic' examples. Maybe we could adapt 8_5 so it transfers data to / from ThingSpeak using MQTT?
Hah! Except you almost did that already!
From @PaulZC in #13: