-
Notifications
You must be signed in to change notification settings - Fork 12
HardwareSerial communication with Nina w106 (esp32 chip) #41
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
Comments
Hi @fcziborr , Which Arduino IDE Board package are you using? Can you please post your code where you define your
Thanks - and best wishes, |
Many thanks for the quick response. `/* SARA-R5 ExampleIdentification - using ESPSoftwareSerial Written by: Paul Clark This example demonstrates how to read the SARA's: The ESP32 core doesn't include SoftwareSerial. Instead we use the library by Peter Lerup and Dirk O. Kaar: Feel like supporting open source hardware? Licence: MIT */ //#include <SoftwareSerial.h> //Click here to get the library: http://librarymanager/All#ESPSoftwareSerial_ESP8266/ESP32 #define DEBUG_PASSTHROUGH_ENABLED #define RX_Pin 23 //Nina W16 23 Esp32 16 HardwareSerial saraSerial(HW_Port); SARA_R5 mySARA(PWR_Pin, RST_Pin); // Create a SARA_R5 object Power Pin, Reset Pin // Map SIM states to more readable strings // processSIMstate is provided to the SARA-R5 library via a void setup() // Wait for user to press key to begin while (!Serial.available()) // Wait for the user to press a key (send any serial character) //mySARA.enableDebugging(); // Uncomment this line to enable helpful debug messages on Serial // For the MicroMod Asset Tracker, we need to invert the power pin so it pulls high instead of low saraSerial.begin(Sara_Baud, SERIAL_8N1, RX_Pin, TX_Pin, false); // Hardware Serial saraSerial.write("ATI"); // Test AT command. The command is received at the modem (measured with an oscilloscope) // Initialize the SARA Serial.println("Manufacturer ID: " + String(mySARA.getManufacturerID())); // Set a callback to return the SIM state once requested void loop() This code works flawlessly on the ESP32. The pins used are for the Nina W106 and the ESP32 are listed with comments. The command "saraSerial.write("ATI");" is inserted for testing purposes and is successfully received by the modem, as verified by oscilloscope measurements. However, starting from line 103 (if (mySARA.begin(saraSerial, Sara_Baud))), the AT commands are no longer received and cannot be measured. Thanks and best regards |
Hi Frederik (@fcziborr ), Ah, OK, I understand what is happening. The library calls
The I hope this solves your issue. Best wishes, |
You may need to include
|
Thank you so much. I've incorporated the changes, and everything is working now. |
Thank you for the update Frederik - I am glad it is working! I am going to close this issue. Please re-open if you need more help with this. Best wishes, |
Hello, I need your help again. When I make the changes in the library it works. However, when I integrate the changes into the program code as you suggested, I encounter the following error message: "Compilation error: no matching function for call to 'SARA_R5_derived::SARA_R5_derived(int, int)" If I don't pass the arguments (PWR_Pin, RST_Pin) to the function "SARA_R5_derived mySARA", the code compiles, but the pins are not passed to the library as desired. SARA-R5 ExampleIdentification - using ESPSoftwareSerial Written by: Paul Clark This example demonstrates how to read the SARA's: The ESP32 core doesn't include SoftwareSerial. Instead we use the library by Peter Lerup and Dirk O. Kaar: Feel like supporting open source hardware? Licence: MIT */ //#include <SoftwareSerial.h> //Click here to get the library: http://librarymanager/All#ESPSoftwareSerial_ESP8266/ESP32 #define DEBUG_PASSTHROUGH_ENABLED #define RX_Pin 23 //23 16 HardwareSerial saraSerial(HW_Port); // In globals // Map SIM states to more readable strings // processSIMstate is provided to the SARA-R5 library via a void setup() // Wait for user to press key to begin while (!Serial.available()) // Wait for the user to press a key (send any serial character) mySARA.enableDebugging(); // Uncomment this line to enable helpful debug messages on Serial // For the MicroMod Asset Tracker, we need to invert the power pin so it pulls high instead of low saraSerial.begin(Sara_Baud, SERIAL_8N1, RX_Pin, TX_Pin, false); // Hardware Serial saraSerial.setPins(RX_Pin, TX_Pin, CTS_Pin, RTS_Pin); // Initialize the SARA Serial.println("Manufacturer ID: " + String(mySARA.getManufacturerID())); // Set a callback to return the SIM state once requested void loop() |
Hi Frederik (@fcziborr ), Please try:
Best wishes, |
Thank you very much, Paul. I've integrated your changes into the programcode, and it's up and running. |
I am reaching out to you as I have encountered an issue that I cannot solve on my own. I am using the Sara R5 modem for internet communication and interfacing the modem via hardware serial using my ESP32. For this, I have been successfully using the SparkFun library (<SparkFun_u-blox_SARA-R5_Arduino_Library.h>).
However, I have recently integrated the u-blox Nina 106 as a microcontroller (µC), which also utilizes an ESP32 chip. With this device, hardware serial communication is not functioning as expected. While I can successfully control my hardware serial outputs, it is not possible to use the library <SparkFun_u-blox_SARA-R5_Arduino_Library.h> to realize hardware serial communication with the modem. This renders communication with the modem via hardware serial impossible. However, communication via software serial works flawlessly.
It seems that the issue may lie within the library software, as I am able to control the hardware serial outputs of the Nina 106 successfully without this library. Therefore, I suspect it could be a software problem.
Best regards
The text was updated successfully, but these errors were encountered: