Comments (2)
@Humancell happy to help! Want to mail me at pkamp [at] twilio.com ? Feel free to attach your working code and I'll try and help debug it
from api-snippets.
Thanks for the quick reply ... I'll contact you via email also.
I wanted to post my findings here also, as I believe that I've resolved my issue and this might assist others.
I'm just testing/using the example code from the link above (https://github.com/TwilioDevEd/api-snippets/tree/master/wireless/quickstart/m2m_commands_arduino_sim800) and I what I've found is that the failure seems to be related to the time it takes for the SIM800L to register on the network.
When I power up both the SIM800L and the Pro Mini at the same time, the code begins to run immediately.
When modem.begin() is called this simply sets up the SoftwareSerial, and then calls reset_modem()
.
reset_modem() issues the AT command until it gets a response of OK. On my SIM800L this occurs very quickly ... but the modem is STILL NOT registered on the network.
The example code then enters the loop()
and almost immediately issues a modem.send_command()
to attempt to send the command/sms.
send_command() calls the private method _send_SMS()
.
_send_SMS() immediately begins to try and send the AT commands to send a mobile command/sms ... but again in my case the modem is STILL NOT registered on the network. In addition, this method is discarding the responses from the modem so it does not detect that the responses are NOT "OK" ... they are still a random combination of asynchronous events of the modem completing the registration process.
At this point the code is out of sync with the state of the modem, and so everything fails.
If I power the modem, and give it 15-30 seconds to complete the registration on the network, and THEN power up the Pro Mini ... everything works perfectly. Once the modem has been powered and registered everything works. The code is simply missing checks to ensure that the network is ready before attempting to send the mobile command/sms.
What is missing from the example is a while loop checking for network registration using the AT command AT+COPS?
until it returns more than +COPS: 0
... in my case when registered it returns +COPS: 0,0,"T-Mobile USA"
and then I can proceed with the rest of the code.
I'll keep hacking on the code and looks like I'll need to issue a pull request at some point. :-)
UPDATED: The other AT command to use is the AT+CREG?
which provides details about the registration status. The response of +CREG: 0,2
means NOT registered ... and +CREG: 0,1
when registered. https://m2msupport.net/m2msupport/atcreg-network-registration/
from api-snippets.
Related Issues (20)
- How to upload media files from backend?
- Who can help me? I can't pass the approval of twilio to create an account HOT 1
- Add Go snippets in video/rest/rooms/retrieve-media-for-room-recording
- Deprecated npm requests library in Compositions code snippets
- twillo
- Twilio / PHP Maverick Wanted
- JAVA com.twilio.exception.ApiException: api.twilio.com:443 failed to respond
- csharp autopilot samplecode for create-first-task is incorrect
- Account Security API key HOT 2
- `interpret_as` attribute incorrectly used in Ruby SSML example
- how about the access key expire
- PHP Webhook snippet produces wrong query string
- Suggestion: Show how to send to more than one recipient HOT 1
- "ToBinding" does not work as shown in the CURL example
- From bccff96e10e7760d31fba99f7659dea6b81dae3d Mon Sep 17 00:00:00 2001 HOT 3
- C# ValidateTwilioRequestAttribute check flipped?
- Typo in namespace casing in PHP sample
- How to use spanish word in say verb HOT 1
- PHP 6.x Snippets
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from api-snippets.