Connecting to SIM800L #958
Replies: 14 comments
-
Posted at 2016-02-16 by DrAzzy Your link to the board you're connecting it to got mangled (looks like copy-paste from one of those stupid sites that pits an ellipsis in the middle of the URL), so I'm not sure what you're doing. Also, can you draw out your current wiring? By hand is fine. |
Beta Was this translation helpful? Give feedback.
-
Posted at 2016-02-17 by jakedempsey I now have my problem resolved... after thinking more about it I was supplying to much voltage to the sim800L. I was giving it 5V and it has a max of 4.2 (4.4 depending on where I read). After wiring up some 1.2V 2250mah AA's to get ~3.8V it is now running just fine. Now I just have to rewrite the sim900 espruino module for this thing to boot... its at least responding now! |
Beta Was this translation helpful? Give feedback.
-
Posted at 2016-02-17 by jakedempsey I do have a question... In the sim900 module it issues the "AT+CIPSTATUS" command and what is returned from the AT module is just the first line of the response. Is there a way to get the entire response so I can compare that properly to the "STATE: IP INITIAL" response the module wants to compare. Connecting to SIM900 module |
Beta Was this translation helpful? Give feedback.
-
Posted at 2016-02-17 by jakedempsey It looks like to me the AT module does not reset its internal state when doing a at.cmd. Am I reading this wrong? When the AT+CPIN? is sent it returns 3 lines. Do all three of those lines have to be handled via a callback before the next AT command can be sent? |
Beta Was this translation helpful? Give feedback.
-
Posted at 2016-02-17 by jakedempsey I've tried looking at the ESP8266WiFi module code to get a handle on this but it doesn't look like that module ever has to deal with multi-line responses from the AT module. |
Beta Was this translation helpful? Give feedback.
-
Posted at 2016-02-17 by jakedempsey Can someone verify my understanding of the AT module is correct. It looks like it will continue to call your callback that you pass to the at.cmd for each line of data it encounters until the timeout occurs which then it calls your callback with no params. Is that a correct view? If so, does this pseudo code work for dealing with a multi-line response from an at cmd where you are looking for a certain response.
|
Beta Was this translation helpful? Give feedback.
-
Posted at 2016-02-17 by @gfwilliams Hi Jake, Yes, you're right there. When you do Only thing I'd say in your example is while it works you probably don't want to do The reason for that one is later you might do I'd be interested to know what you have to change for SIM800 - I'd hope that we could maybe make the same module handle both devices, as I'm pretty sure people have had SIM800 working. |
Beta Was this translation helpful? Give feedback.
-
Posted at 2016-02-17 by @gfwilliams Actually just one more important thing: You mentioned |
Beta Was this translation helpful? Give feedback.
-
Posted at 2016-02-18 by jakedempsey Thanks for the VIO info. I did get it to work by connecting the 3.3 on the Espruino to the VIO on the SIM800. I have another question and I'm not sure how to word it so I'll do my best. Currently the AT module will call the linecallback function if a function is returned. Here is a problem I 'think' I am seeing. Lets for argument say that an AT command "AT+FOO" is going to return a 3 line response of OK SUPER DUPER OMG If my callback gets called for OK and I return my same handler it will get called again with SUPER DUPER as the param. I am looking for SUPER DUPER so I call my next AT command in my sequence of calls. That linecallback I pass to that AT command will first get called with OMG before it gets called with the resulting lines from my second AT command. Does that make sense? Shouldn't the AT command call basically flush any pending lines that have not been handled? Am I understanding that wrong? |
Beta Was this translation helpful? Give feedback.
-
Posted at 2016-02-19 by @gfwilliams If If it doesn't then yes, your next call to For example, this is what you're suggesting I think?
or if you just waited, the line would be thrown away:
Realistically you want to handle all lines you're expecting to receive though. Not doing that is just asking for pain later on :) |
Beta Was this translation helpful? Give feedback.
-
Posted at 2016-02-19 by jakedempsey So if the AT+FOO would return 3 lines and you really just cared about FOOTwo you would just maybe issue a wait or a SetTimeout for the AT+BAR command to ensure all of the AT+FOO response lines have been either handled or flushed? It is just weird that the callback handler for AT+BAR may get a response from AT+FOO. I would have thought the returned lines from the AT+FOO would be somehow indexed to that cmd and only that callback could/would get called for its returned lines. I guess though that can't happen because you don't know what response from the modem is tied to what command... now that I type this out I get why it works the way it does. Now that I have a deeper understanding of this.. I may just go ahead and tackle a rewrite on the SIM900 module. |
Beta Was this translation helpful? Give feedback.
-
Posted at 2016-02-22 by @gfwilliams
I'd handle all 3 lines - adding a timeout would work, but it's pretty nasty and might bite you later on. It's not hard - at the most basic level:
Or you could actually count the lines - but in a lot of cases there's an
Exactly - it's really the responsibility of the
Is the existing one not working for you? It sounded a lot like after the wiring issues, it was working ok? |
Beta Was this translation helpful? Give feedback.
-
Posted at 2017-12-04 by user83762 Hello sir...for sim 800L and arduino pro mini you connected vcc of arduimo to vio of sim 800L ..which pin of sim 900a we have to use to connect to the arduino uno .... ? |
Beta Was this translation helpful? Give feedback.
-
Posted at 2017-12-04 by @allObjects @user83762, no one connected any Arduino pin in this conversation... Just switch from Arduino (board) to any Espruino (board) and you leap from the time of the FlintStones into the 21st century... or from Arduino C process loop programming to JavaScript object-oriented, event driven programming. PS: you may have interpreted Espruino Pico as an Arduino ...mini... - never mind my FlintStone comment... ;-) but it is still true: the few bucks you pay more for an Espruino board you save 10...100 fold in programming time on Espruino in JavaScript... |
Beta Was this translation helpful? Give feedback.
-
Posted at 2016-02-16 by jakedempsey
I could really use some help. I have an Espruino (http://www.espruino.com/EspruinoBoard). I am trying to connect the fona (https://learn.adafruit.com/adafruit-fona-mini-gsm-gprs-cellular-phone-module/pinouts) to our board.
As of right now I have the fona powered by an external 5v power source plugged into the JST port. I also have the VIO pin plugged into the VBAT of the Espruino. I have the KEY pin plugged into a GND on the Espruino. I have the RST plugged into my B4 gpio on the Espruino.
When I try to issue a command to the fona I get errors in my console that says "Boot Failed, Reset". Our code issues a reset on the B4 pin to reset the modem each time we turn it on.
We want to connect the fona in an 'Always On' configuration and connect to it via serial on the espruino to send http requests. Not sure if that helps. I connected the KEY pin bc the way I read the docs the module is OFF by default and you need to connect KEY to ground to have it always on... maybe I read that wrong too. :(
I think I fundamentally have something connected wrong. Any help would be greatly appreciated!
Beta Was this translation helpful? Give feedback.
All reactions