Sending data from device not working outside of Serial Monitor
Currently I am trying to send a message from my NB-IoT test unit.
I managed to work my way through the Starterkit Manual, and get it to work. I can set up the connection to the T-Mobile platform using AT-commands in the Arduino serial monitor and set up a connection to a separate online webhook reciever-site using Postman. Then I can send a message through an AT-command. To achieve this I use the following AT-commands:
However, when I try to pass the same commands through from within the Arduino application, the messages do not come through. I use the following .ino code (in the previous case I use the same without all the AT-commands):
Strange thing is, when I enter the AT-command for sending a message to the web-hook in the Serial Monitor after running the Arduino code, it works. So it seems that the code does successfully set up the connection, yet fails to send the message.
The delays are admittedly a poor way of handling the status of each command, but I expected it to work nevertheless.
I hope that anyone has a clue about what is going wrong here.
felixdonkers last edited by
As indicated, you should wait until CSQ replies with something else than 99.99, e.g. 12.99. But you should also wait until CGATT replies with a ‘1’ instead of a ‘0’, indicating that the modem is connected to the network. This often takes more than 10 seconds…
You could try this in your arduino code:
This stopped working for me, no clue why:
AT+CFUN=1 //radio on
(you don’t need to select band 8 everytime you connect, it will save the setting in NV memory even through powercycles)
Let me know if it works