Description
Hi there,
It appears that the IridiumSBD I2C and SparkFun u-blox libraries are conflicting when using a SparkFun Qwiic Micro and RockBLOCK 9603 over serial.
Components used:
- SparkFun Qwiic Micro
- RockBLOCK 9603
Steps to reproduce:
This can be observed by running any of the Serial_Examples__Rockblock with u-blox library included:
#include <SparkFun_Ublox_Arduino_Library.h>
After adding the library, for instance using Example5_Sleep, results in error 5, no modem detected:
Output:
Starting modem...
17:00:50.165 -> Calling internalBegin
17:00:50.165 -> Powering on modem...
17:00:50.653 -> >> AT
17:00:50.653 -> AT
Waiting for response OK
17:00:50.653 ->
17:00:50.653 -> << >> AT
17:01:20.638 -> AT
Waiting for response OK
17:01:20.638 ->
17:01:20.638 -> << >> AT
17:01:55.728 -> AT
Waiting for response OK
17:01:55.728 ->
17:01:55.728 -> << >> AT
17:02:25.826 -> AT
Waiting for response OK
17:02:25.826 ->
17:02:25.826 -> << >> AT
17:02:51.716 -> AT
Waiting for response OK
17:02:51.716 ->
17:02:51.716 -> << >> AT
17:03:20.631 -> AT
Waiting for response OK
17:03:20.631 ->
17:03:20.631 -> << >> AT
17:03:50.650 -> AT
Waiting for response OK
17:03:50.650 ->
17:03:50.650 -> << >> AT
17:04:20.630 -> AT
Waiting for response OK
17:04:20.630 ->
17:04:20.630 -> << No modem detected.
17:04:50.639 -> Powering off modem...
17:04:50.639 -> Begin failed: error 5
17:04:50.639 -> No modem detected: check wiring.
Potential cause:
I believe this is because the u-blox library defines Serial
as SerialUSB
:
https://github.com/sparkfun/SparkFun_Ublox_Arduino_Library/blob/97bd455b0e7a05b92bfe5a528c28cc47f2e2d289/src/SparkFun_Ublox_Arduino_Library.h#L55-L67
However, on the Qwiic Micro, we use Serial as the port for the RockBLOCK:
#define IridiumSerial Serial
IridiumSBD modem(IridiumSerial, SLEEP_PIN);
IridiumSerial.begin(19200);
It doesn't seem to matter what order the definitions are made, the u-blox library seems to have final say as to what Serial
will be. I wonder if a possible solution is to have a check in the u-blox library for the Qwiic Micro, and not declare Serial
as SerialUSB
.
Cheers,
Adam