Wiz-IO / Arduino-Quectel-BC66

Arduino port for Quectel BC66 LTE Narow Band modules ( OpenCPU based )
46 stars 20 forks source link

Support for new version of BC66 #8

Closed lasse-mono closed 4 years ago

lasse-mono commented 5 years ago

Great work, I got this working on my old BC66 board, but no luck in getting response from the WaitCereg() function. Is there any change this will support the new version BC66NB-04-STD (FW Rev: BC66NBR01A06) in the future?

Wiz-IO commented 5 years ago

Hi, I think to skip version 6, there is already version 7, but I'm waiting Quectel

About CEREG ... means: There is a network, There is internet

First you need SIM Card with NarrowBand APN... and need to store APN info in module

APN storing to NVDM (module eeprom zone) This AT commands is required once

*ATMCGDEFCONT="IP","apn_from_operator"**

and enable scrambling function (required once)

AT+QSPCHSC=1

If your provider provides a NarrowBand with a frequency greater than 900 MHz, you may have a signal strength problem You can use an external antenna for experiments...

lasse-mono commented 5 years ago

Hi, thanks a lot answering this quick. I have NB-APN and all works using original FW and AT commands. I get IP and can ping successfully. When i use PlatformIO or Arduino my module will not answer AT commands, so how do i register and store the APN in NVDM?

Wiz-IO commented 5 years ago

Dev.saveDefaultApn https://github.com/Wiz-IO/framework-quectel/blob/master/arduino/cores/bc66/DEV.cpp#L261

Sending AT https://github.com/Wiz-IO/framework-quectel/blob/master/arduino/cores/bc66/DEV.cpp#L283

AT Callback_ATResponse callback is like this https://github.com/Wiz-IO/framework-quectel/blob/master/arduino/cores/bc66/DEV.cpp#L231 can be NULL

Wiz-IO commented 5 years ago

or direct using RIL API ( see openCPU docs ) Ql_RIL_SendATCmd((char *)cmd, Ql_strlen(cmd), callback, user, timeout)

Wiz-IO commented 5 years ago

and check module IMEI ... if you've done a Total module Format ( with FlashTool ) - IMEI will be 000000... and no connection with provider

lasse-mono commented 5 years ago

Thanks for feedback. not sure if I'm getting closer, but I'm learning

The imei, getUid, mcc_mnc, sim_imsi and sim_iccid seems to return correct values.

Dev.saveDefaultApn seems to be using AT+QCGDEFCONT not AT*MCGDEFCONT, wouldn't that be a problem?

Also i tried the code below, which seems to run without errors, but still the Dev.waitCereg() in the examples waits forever.


      int ret = 0;
      char cmd_scrampling[] = "AT+QSPCHSC=1\r"; // set scrampling
      char cmd_apn[] = "AT*MCGDEFCONT=\"IP\",\"apn.from.my.provider\"\r"; // set APN
      char cmd_poweroff[] = "AT+QPOWD=0"; // POWER-OFF

      DBG("sending command %s - length %d\r\n", cmd_scrampling, Ql_strlen(cmd_scrampling));
      if (( ret = Ql_RIL_SendATCmd(cmd_scrampling, Ql_strlen(cmd_scrampling), NULL, NULL, 300) )) {
        Serial.println("[ERROR] cmd scrampling");
      }
      delay(500);
      DBG("sending command %s - length %d\r\n", cmd_apn, Ql_strlen(cmd_apn));
      if (( ret = Ql_RIL_SendATCmd(cmd_apn, Ql_strlen(cmd_apn), NULL, NULL, 300) )) {
        Serial.println("[ERROR] cmd apn");
      }
      delay(500);
      DBG("sending command %s - length %d\r\n", cmd_poweroff, Ql_strlen(cmd_poweroff));
      if (( ret = Ql_RIL_SendATCmd(cmd_poweroff, Ql_strlen(cmd_poweroff), NULL, NULL, 300) )) {
        Serial.println("[ERROR] cmd power off");
      }
Wiz-IO commented 5 years ago

bad signal... I dont know Here all over Sofia works everywhere