Skip to content

IridiumSBD I2C and SparkFun u-blox library conflict with RockBLOCK 9603 #2

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
adamgarbo opened this issue Nov 22, 2020 · 3 comments
Closed

Comments

@adamgarbo
Copy link
Contributor

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

@adamgarbo
Copy link
Contributor Author

Confirmed that commenting line 63 in the u-blox library resolves this issue with the Qwiic Micro:

https://github.com/sparkfun/SparkFun_Ublox_Arduino_Library/blob/97bd455b0e7a05b92bfe5a528c28cc47f2e2d289/src/SparkFun_Ublox_Arduino_Library.h#L63

Will create an issue on the u-blox library repo but leave this issue open until it's resolved over there.

@PaulZC
Copy link
Collaborator

PaulZC commented Nov 23, 2020

Hi Adam (@adamgarbo ),

Thanks for finding this!

Instead of using the problematic #define, you can just use:

IridiumSBD modem(Serial, SLEEP_PIN);
Serial.begin(19200);

But I don't think that will solve the problem...? Could you test this please? I suspect to fix this completely we will need to change the way we define Serial as SerialUSB in the u-blox library.
All the best,
Paul

@adamgarbo
Copy link
Contributor Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants