UART not working/Modem not responding on QT py SAMD21

Hi,

We have had a problem for a while now with our hardware connections, trying to send and recieve AT commands through a modem connected to a QT py SAMD21 via UART. When we try troubleshooting it with putty or m-center we are neither able to type anything, nor recieving responses from the AT commands. We have tried using different boards such as a base hat but we get the same problem with the AT commands not responding.

However, when we connected the modem to a mini PCI-E to USB adapter, it worked completley fine when sending AT commands, though it was connected to a laptop and not directly to the QT py.

So we tried with this PCI-E:

And connect it like this (which is working):

However we want to connect it with this PCI-E and the connection with the UART should be coming from the QT py:

When using the hardware setup we want, it fails in void setup() when trying to get the IMEI number from the modem:

DEBUG_BEGIN(115200);

  Serial1.begin(115200);

  //while (!Serial);

  int rebootcount = 0;
  DEBUG_PRINTLN("Obtaining IMEI..");
  while (IMEI.length() != 15) {
    IMEI = sendAT("AT+CGSN", 400);
    rebootcount++;
    if (rebootcount == 40) {
      sendAT("AT+CFUN=1,1", 18000, "RDY");
      rebootcount = 0;
    }

If there are any ideas on what the problem might be, I would highly appreciate it.

Thanks,

You posted some pictures but I do not have a clue as to what is what. Post an annotated schematic, it appears to be a hardware problem. Be sure to show all connections, power, ground, power sources and any other hardware.

The GSM library I find described on line doesn't seem to have a way to redirect the location of the modem from "Serial" to some other Serial port?

This is basically the connection between the QT-py and the modem:

There may be many other wires seen on the picture, making it a bit confusing to understand what goes where, so I made a schematic to make it easier to visualize how they are connected:

Hopefully it helps.

how do you mean?

See post 1, what you have now posted is a flow diagram. Show the whole design.

In the code snippet you posted, there is nothing to indicate that the modem you're trying to talk to is "associated" with Serial1, rather than just "Serial."
(Please post more complete code.)

In the libraries for cell modems that I find with a casual search, I don't even see the capability of using a different serial port.
(Please tell use exactly which libraries you are using.)

sorry but i can not show the whole design, the only thing that matters in this case though is the connection between modem and qt-py.

so we are using these libraries:

#include <ArduinoJson.h>

#include "wiring_private.h"

the Serial1 function comes from the variant.cpp library where it is predefined. However I have tried redefining the Serial1 as such down below:

Uart Serial1(&sercom1, 6  , 7, SERCOM_RX_PAD_1, UART_TX_PAD_0);

void SERCOM1_Handler(){
  Serial1.IrqHandler();
}

it still does not work though.

Sigh. Which library provides sendAT(), or can you provide the implementation of sendAT() ?

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.