AtCmdParser and NetworkInterface to the Same Cellular Device Cause Program to Hang

I’ve used the Quectel BG96 with mbed os driver as the picture below.

then I have to request some specific information directly with ATcmdParser, so I declare as the picture below
atcmdparser

and that causes the whole program to hang

Thank you in advance for any suggestions.

Any situation where you have the same peripheral (e.g., a uart) used in two separate serial objects at the same is bound to cause trouble.

If you just require a couple of initialisation AT commands sent, you perhaps could implement the init() function in the QUECTEL_BG96.cpp source, to handle these AT commands prior to the stack doing anything else (you won’t need another serial object then, but you will be modifying mbed-os source.)

Otherwise, you may be able to talk to the modem with your own buffered serial and at cmd parser as you planned above, but only after making sure there is no network interface connection active - but you may have to implement your own code to make sure the modem is powered and ready (which the mbed cellular drivers would normally do.)

Cheers,

Dave

1 Like