SeeedJP / WioLTEforArduino

GNU General Public License v2.0
33 stars 19 forks source link

Not Connecting to Soracom #26

Closed salmanfarisvp closed 5 years ago

salmanfarisvp commented 5 years ago

After uploading the code it successfully from the sensor but not uploading the value via MQTT ,

### I/O Initialize.
### Power supply ON.
### Turn on or reset.
### ERROR! ###

it throwing the error code when it's running the line

  SerialUSB.println("### Turn on or reset.");
  if (!Wio.TurnOnOrReset()) {
    SerialUSB.println("### ERROR! ###");
    return;
  }

but after commenting the code, it uploads code once and but again it stopping to upload to the server,

what is actually TurnOnOrReset doing?

matsujirushi commented 5 years ago

Hi,

TurnOnOrReset() function is to power up and a little setup for EC21. https://github.com/SeeedJP/WioLTEforArduino/blob/master/src/WioLTE.cpp#L429-L463

And you can see debug information when uncomment WIO_DEBUG line. https://github.com/SeeedJP/WioLTEforArduino/blob/master/src/WioLTEConfig.h#L17

salmanfarisvp commented 5 years ago

Thanks, But when running the code it's going to throwing an error and skip all the code under the function, and running the loop. In the case of MQTT example code, avoid the APN connection and without the connection, it running the code.

matsujirushi commented 5 years ago

Hi, I know. It's sample code. Please modify for production.

salmanfarisvp commented 5 years ago

But it's for the prototyping it's not working .

### I/O Initialize.
### Power supply ON.
### Turn on or reset.
### ERROR! ###
Publish:{"uptime":20}

and Skipping the code

  SerialUSB.println("### Turn on or reset.");
  if (!Wio.TurnOnOrReset()) {
    SerialUSB.println("### ERROR! ###");
    return;
  }

  SerialUSB.println("### Connecting to \""APN"\".");
  if (!Wio.Activate(APN, USERNAME, PASSWORD)) {
    SerialUSB.println("### ERROR! ###");
    return;
  }

  SerialUSB.println("### Connecting to MQTT server \""MQTT_SERVER_HOST"\"");
  MqttClient.setServer(MQTT_SERVER_HOST, MQTT_SERVER_PORT);
  MqttClient.setCallback(callback);
  MqttClient.setClient(WioClient);
  if (!MqttClient.connect(ID)) {
    SerialUSB.println("### ERROR! ###");
    return;
  }
  MqttClient.subscribe(IN_TOPIC);

  SerialUSB.println("### Setup completed.");

how can I prevnet that , I was using WIO LTE Cat1 v1.3.b, I also edited the config to #define WIOLTE_TYPE_V13

salmanfarisvp commented 5 years ago

debug log

### I/O Initialize.
### Power supply ON.
### Turn on or reset.
<- AT
### TIMEOUT ###
<- AT
### TIMEOUT ###
<- AT
### TIMEOUT ###
<- AT
### TIMEOUT ###
TurnOn()
### TIMEOUT ###
.### TIMEOUT ###
.### TIMEOUT ###
.### TIMEOUT ###
.### TIMEOUT ###
.### TIMEOUT ###
.### TIMEOUT ###
.### TIMEOUT ###
.### TIMEOUT ###
.### TIMEOUT ###
.### TIMEOUT ###
.### TIMEOUT ###
.### TIMEOUT ###
.### TIMEOUT ###
.### TIMEOUT ###
.### TIMEOUT ###
.### TIMEOUT ###
.### TIMEOUT ###
.### TIMEOUT ###
.### TIMEOUT ###
.### TIMEOUT ###
.### TIMEOUT ###
.### TIMEOUT ###
.### TIMEOUT ###
.### TIMEOUT ###
.### TIMEOUT ###
.### TIMEOUT ###
.### TIMEOUT ###
.### TIMEOUT ###
.### TIMEOUT ###
.### TIMEOUT ###
.### TIMEOUT ###
.### TIMEOUT ###
.### TIMEOUT ###
.### TIMEOUT ###
.### TIMEOUT ###
.### TIMEOUT ###
.### TIMEOUT ###
.->
-> RDY

<- AT
->
-> +CPIN: READY
->
-> +QUSIM: 1
-> AT
-> OK

<- ATE0
-> ATE0
-> OK
<- AT+QURCCFG="urcport","uart1"
->
-> OK
<- AT+QSCLK=1
->
-> ERROR
->
-> +CFUN: 1
->
-> +QIND: SMS DONE
->
-> +QIND: PB DONE
### TIMEOUT ###
ERROR! 460
### ERROR! ###
Publish:{"uptime":17}
matsujirushi commented 5 years ago

Hi, I see. "+CPIN: READY" faster than my Wio LTE.

Could you comment out this line and test? https://github.com/SeeedJP/WioLTEforArduino/blob/master/src/WioLTE.cpp#L460

salmanfarisvp commented 5 years ago

and this is the output


I/O Initialize.

Power supply ON.

Turn on or reset.

<- AT -> -> OK Reset()

TIMEOUT

.### TIMEOUT ### .### TIMEOUT ### .### TIMEOUT ### .### TIMEOUT ### .### TIMEOUT ### .### TIMEOUT ### .### TIMEOUT ### .### TIMEOUT ### .### TIMEOUT ### .### TIMEOUT ### .### TIMEOUT ### .### TIMEOUT ### .### TIMEOUT ### .### TIMEOUT ### .### TIMEOUT ### .### TIMEOUT ### .### TIMEOUT ### .### TIMEOUT ### .### TIMEOUT ### .### TIMEOUT ### .### TIMEOUT ### .### TIMEOUT ### .### TIMEOUT ### .### TIMEOUT ### .### TIMEOUT ### .### TIMEOUT ### .### TIMEOUT ### .### TIMEOUT ### .### TIMEOUT ### .### TIMEOUT ### .### TIMEOUT ### .### TIMEOUT ### .### TIMEOUT ### .### TIMEOUT ### .### TIMEOUT ### .### TIMEOUT ### .### TIMEOUT ### .### TIMEOUT ### .### TIMEOUT ### .### TIMEOUT ### .### TIMEOUT ### .### TIMEOUT ### .### TIMEOUT ### .### TIMEOUT ### .### TIMEOUT ### .### TIMEOUT ### .### TIMEOUT ### .### TIMEOUT ### .### TIMEOUT ### .### TIMEOUT ### .### TIMEOUT ### .### TIMEOUT ### .### TIMEOUT ### .### TIMEOUT ### .### TIMEOUT ### .### TIMEOUT ### .### TIMEOUT ### .### TIMEOUT ### .### TIMEOUT ### .### TIMEOUT ### .### TIMEOUT ### .### TIMEOUT ### .### TIMEOUT ### .### TIMEOUT ### .### TIMEOUT ### .### TIMEOUT ### .### TIMEOUT ### .### TIMEOUT ### .### TIMEOUT ### .### TIMEOUT ### .### TIMEOUT ### .### TIMEOUT ### .### TIMEOUT ### .### TIMEOUT ### .### TIMEOUT ### .### TIMEOUT ### .### TIMEOUT ### .### TIMEOUT ### .### TIMEOUT ### .### TIMEOUT ### .### TIMEOUT ### .### TIMEOUT ### .### TIMEOUT ### .### TIMEOUT ### .### TIMEOUT ### .### TIMEOUT ### .### TIMEOUT ### .### TIMEOUT ### .### TIMEOUT ### .### TIMEOUT ### .### TIMEOUT ### .### TIMEOUT ### .### TIMEOUT ### .### TIMEOUT ### .-> -> RDY

<- AT -> -> +CPIN: READY -> -> +QUSIM: 1 -> AT -> OK

<- ATE0 -> ATE0 -> OK <- AT+QURCCFG="urcport","uart1" -> -> OK <- AT+QSCLK=1 -> -> ERROR

Connecting to "soracom.io".

<- AT+CGREG? -> -> +CGREG: 0,4 -> -> OK <- AT+CEREG? -> -> +CEREG: 0,4 -> -> OK ERROR! 797 <- AT+QICSGP=1,1,"soracom.io","sora","sora",3 -> -> OK <- AT+CGREG? -> -> +CGREG: 0,4 -> -> OK <- AT+CEREG? -> -> +CEREG: 0,4 -> -> OK <- AT+CGREG? -> -> +CFUN: 1 -> -> +CGREG: 0,4 -> -> OK <- AT+CEREG? -> -> +CEREG: 0,4 -> -> OK <- AT+CGREG? -> -> +QIND: SMS DONE -> -> +CGREG: 0,2 -> -> OK <- AT+CEREG? -> -> +CEREG: 0,2 -> -> OK <- AT+CGREG? -> -> +QIND: PB DONE -> -> +CGREG: 0,2 -> -> OK <- AT+CEREG? -> -> +CEREG: 0,2 -> -> OK <- AT+CGREG? -> -> +CGREG: 0,2 -> -> OK <- AT+CEREG? -> -> +CEREG: 0,2 -> -> OK <- AT+CGREG? -> -> +CGREG: 0,2 -> -> OK <- AT+CEREG? -> -> +CEREG: 0,2 -> -> OK <- AT+CGREG? -> -> +CGREG: 0,2 -> -> OK <- AT+CEREG? -> -> +CEREG: 0,2 -> -> OK <- AT+CGREG? -> -> +CGREG: 0,2 -> -> OK <- AT+CEREG? -> -> +CEREG: 0,2 -> -> OK <- AT+CGREG? -> -> +CGREG: 0,2 -> -> OK <- AT+CEREG? -> -> +CEREG: 0,2 -> -> OK <- AT+CGREG? -> -> +CGREG: 0,2 -> -> OK <- AT+CEREG? -> -> +CEREG: 0,2 -> -> OK <- AT+CGREG? -> -> +CGREG: 0,2 -> -> OK <- AT+CEREG? -> -> +CEREG: 0,2 -> -> OK <- AT+CGREG? -> -> +CGREG: 0,2 -> -> OK <- AT+CEREG? -> -> +CEREG: 0,2 -> -> OK <- AT+CGREG? -> -> +CGREG: 0,2 -> -> OK <- AT+CEREG? -> -> +CEREG: 0,2 -> -> OK <- AT+CGREG? -> -> +CGREG: 0,2 -> -> OK <- AT+CEREG? -> -> +CEREG: 0,2 -> -> OK <- AT+CGREG? -> -> +CGREG: 0,2 -> -> OK <- AT+CEREG? -> -> +CEREG: 0,2 -> -> OK <- AT+CGREG? -> -> +CGREG: 0,2 -> -> OK <- AT+CEREG? -> -> +CEREG: 0,2 -> -> OK <- AT+CGREG? -> -> +CGREG: 0,2 -> -> OK <- AT+CEREG? -> -> +CEREG: 0,2 -> -> OK <- AT+CGREG? -> -> +CGREG: 0,2 -> -> OK <- AT+CEREG? -> -> +CEREG: 0,2 -> -> OK <- AT+CGREG? -> -> +CGREG: 0,2 -> -> OK <- AT+CEREG? -> -> +CEREG: 0,2 -> -> OK <- AT+CGREG? -> -> +CGREG: 0,2 -> -> OK <- AT+CEREG? -> -> +CEREG: 0,2 -> -> OK <- AT+CGREG? -> -> +CGREG: 0,2 -> -> OK <- AT+CEREG? -> -> +CEREG: 0,2 -> -> OK <- AT+CGREG? -> -> +CGREG: 0,2 -> -> OK <- AT+CEREG? -> -> +CEREG: 0,2 -> -> OK <- AT+CGREG? -> -> +CGREG: 0,2 -> -> OK <- AT+CEREG? -> -> +CEREG: 0,2 -> -> OK <- AT+CGREG? -> -> +CGREG: 0,2 -> -> OK <- AT+CEREG? -> -> +CEREG: 0,2 -> -> OK <- AT+CGREG? -> -> +CGREG: 0,2 -> -> OK <- AT+CEREG? -> -> +CEREG: 0,2 -> -> OK <- AT+CGREG? -> -> +CGREG: 0,2 -> -> OK <- AT+CEREG? -> -> +CEREG: 0,2 -> -> OK <- AT+CGREG? -> -> +CGREG: 0,2 -> -> OK <- AT+CEREG? -> -> +CEREG: 0,2 -> -> OK <- AT+CGREG? -> -> +CGREG: 0,2 -> -> OK <- AT+CEREG? -> -> +CEREG: 0,2 -> -> OK <- AT+CGREG? -> -> +CGREG: 0,2 -> -> OK <- AT+CEREG? -> -> +CEREG: 0,2 -> -> OK <- AT+CGREG? -> -> +CGREG: 0,2 -> -> OK <- AT+CEREG? -> -> +CEREG: 0,2 -> -> OK <- AT+CGREG? -> -> +CGREG: 0,2 -> -> OK <- AT+CEREG? -> -> +CEREG: 0,2 -> -> OK <- AT+CGREG? -> -> +CGREG: 0,2 -> -> OK <- AT+CEREG? -> -> +CEREG: 0,2 -> -> OK <- AT+CGREG? -> -> +CGREG: 0,2 -> -> OK <- AT+CEREG? -> -> +CEREG: 0,2 -> -> OK <- AT+CGREG? -> -> +CGREG: 0,2 -> -> OK <- AT+CEREG? -> -> +CEREG: 0,2 -> -> OK <- AT+CGREG? -> -> +CGREG: 0,2 -> -> OK <- AT+CEREG? -> -> +CEREG: 0,2 -> -> OK <- AT+CGREG? -> -> +CGREG: 0,2 -> -> OK <- AT+CEREG? -> -> +CEREG: 0,2 -> -> OK <- AT+CGREG? -> -> +CGREG: 0,2 -> -> OK <- AT+CEREG? -> -> +CEREG: 0,2 -> -> OK <- AT+CGREG? -> -> +CGREG: 0,2 -> -> OK <- AT+CEREG? -> -> +CEREG: 0,2 -> -> OK <- AT+CGREG? -> -> +CGREG: 0,2 -> -> OK <- AT+CEREG? -> -> +CEREG: 0,2 -> -> OK <- AT+CGREG? -> -> +CGREG: 0,2 -> -> OK <- AT+CEREG? -> -> +CEREG: 0,2 -> -> OK <- AT+CGREG? -> -> +CGREG: 0,2 -> -> OK <- AT+CEREG? -> -> +CEREG: 0,2 -> -> OK <- AT+CGREG? -> -> +CGREG: 0,2 -> -> OK <- AT+CEREG? -> -> +CEREG: 0,2 -> -> OK <- AT+CGREG? -> -> +CGREG: 0,2 -> -> OK <- AT+CEREG? -> -> +CEREG: 0,2 -> -> OK <- AT+CGREG? -> -> +CGREG: 0,2 -> -> OK <- AT+CEREG? -> -> +CEREG: 0,2 -> -> OK <- AT+CGREG? -> -> +CGREG: 0,2 -> -> OK <- AT+CEREG? -> -> +CEREG: 0,2 -> -> OK <- AT+CGREG? -> -> +CGREG: 0,2 -> -> OK <- AT+CEREG? -> -> +CEREG: 0,2 -> -> OK <- AT+CGREG? -> -> +CGREG: 0,2 -> -> OK <- AT+CEREG? -> -> +CEREG: 0,2 -> -> OK <- AT+CGREG? -> -> +CGREG: 0,2 -> -> OK <- AT+CEREG? -> -> +CEREG: 0,2 -> -> OK <- AT+CGREG? -> -> +CGREG: 0,2 -> -> OK <- AT+CEREG? -> -> +CEREG: 0,2 -> -> OK <- AT+CGREG? -> -> +CGREG: 0,2 -> -> OK <- AT+CEREG? -> -> +CEREG: 0,2 -> -> OK <- AT+CGREG? -> -> +CGREG: 0,2 -> -> OK <- AT+CEREG? -> -> +CEREG: 0,2 -> -> OK <- AT+CGREG? -> -> +CGREG: 0,2 -> -> OK <- AT+CEREG? -> -> +CEREG: 0,2 -> -> OK <- AT+CGREG? -> -> +CGREG: 0,2 -> -> OK <- AT+CEREG? -> -> +CEREG: 0,2 -> -> OK <- AT+CGREG? -> -> +CGREG: 0,2 -> -> OK <- AT+CEREG? -> -> +CEREG: 0,2 -> -> OK <- AT+CGREG? -> -> +CGREG: 0,2 -> -> OK <- AT+CEREG? -> -> +CEREG: 0,2 -> -> OK <- AT+CGREG? -> -> +CGREG: 0,2 -> -> OK <- AT+CEREG? -> -> +CEREG: 0,2 -> -> OK <- AT+CGREG? -> -> +CGREG: 0,2 -> -> OK <- AT+CEREG? -> -> +CEREG: 0,2 -> -> OK <- AT+CGREG? -> -> +CGREG: 0,2 -> -> OK <- AT+CEREG? -> -> +CEREG: 0,2 ->

salmanfarisvp commented 5 years ago

Without debug on ,

----------------
### I/O Initialize.
### Power supply ON.
### Turn on or reset.
### Connecting to "soracom.io".
### Connecting to MQTT server "beam.soracom.io"
### Setup completed.
Publish:{"uptime":30}
matsujirushi commented 5 years ago

Thank you. I will modify in TurnOnOrReset().

salmanfarisvp commented 5 years ago

Thank You @matsujirushi 👍

trawinlegacy commented 4 years ago

I am stilling getting this error even with the current library.

matsujirushi commented 4 years ago

Hi @trawinlegacy , Please create a new issue. And write few informations in the issue.

  1. Version of Wio LTE for Arduino library.
  2. Carrier of LTE network.
  3. Debug log.