Closed salmanfarisvp closed 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
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.
Hi, I know. It's sample code. Please modify for production.
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
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}
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
and this is the output
<- 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 ### .-> -> RDY
<- AT -> -> +CPIN: READY -> -> +QUSIM: 1 -> AT -> OK
<- ATE0 -> ATE0 -> OK <- AT+QURCCFG="urcport","uart1" -> -> OK <- AT+QSCLK=1 -> -> ERROR
<- 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 ->
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}
Thank you. I will modify in TurnOnOrReset().
Thank You @matsujirushi 👍
I am stilling getting this error even with the current library.
Hi @trawinlegacy , Please create a new issue. And write few informations in the issue.
After uploading the code it successfully from the sensor but not uploading the value via MQTT ,
it throwing the error code when it's running the line
but after commenting the code, it uploads code once and but again it stopping to upload to the server,
what is actually TurnOnOrReset doing?