I'm making a project very similar to the project shown here:
https://www.connectedcities.com.ph/blogs/tutorial/mobile-controlled-led-using-sim800l
The only difference is that I'm powering the SIM800L board with an 5V 2A external power source. The LED's GND is connected to the Analogic GND on the board, the SIM800L GND is connected to the digital GND of the board while connected to the power source's GND. I'm using the ROHS' SIM800L.
So I'm running into an issue that has been driving me crazy. Whenever I upload the sketch to my Arduino Uno, the program runs like a charm, turning the LED on or off based on the SMS that I'm sending. When I disconnect the Arduino from my computer it still works flawlessly, but whenever I turn the Arduino and the SIM800L off, when I turn them on again it won't work at all.
I can verify that the SIM800 is receiving my message because the network LED blinks, but it doesn't seems to communicate with the Arduino, so the LED won't turn on or off. Interestingly if I turn only the Arduino off and leave the SIM800's power source on, when I turn it on again it will keep working. It stops working when I turn the SIM800L off, leaving the Arduino on. It will only work again when I connect the board to my PC with the USB cable and open the Serial Monitor.
I must thank whoever wants to help in advance.
It looks like you have already discovered the issue.
The modem needs some time before your sketch should talk to it.
When your code starts, get it to poll the modem, or monitor for it to become ‘ready’... then plough in sending commands.
Modems don’t just do things instantly when you tell them to.
It is necessary to wait for the response, or less preferably toss in a delay while the modem performs the command.
The problem with using delays, is the modem may send some other ‘unsolicited’ message while the delay() is off twiddling it’s thumbs.
It’s easy, but not simple - to handle asynchronous comms properly.
lastchancename:
It looks like you have already discovered the issue.
The modem needs some time before your sketch should talk to it.
When your code starts, get it to poll the modem, or monitor for it to become ‘ready’... then plough in sending commands.
Modems don’t just do things instantly when you tell them to.
It is necessary to wait for the response, or less preferably toss in a delay while the modem performs the command.
The problem with using delays, is the modem may send some other ‘unsolicited’ message while the delay() is off twiddling it’s thumbs.
It’s easy, but not simple - to handle asynchronous comms properly.
My problem is that my project is not supposed to work while connected to the Serial Port/USB, but to a power plug at my house. If I upload the sketch to the board it works alright, if I turn it off and connect it to an energy plug through the board's power jack the system stops working even if I can see the NET led blinking as it should when receiving a message.
One thing that I just noticed is that when it's not working neither the TX or RX leds from the board respond.
There's a possibility that I did not quite understand your response, should I add a delay() line inside the setup section of my code?
Two questions...
Have you used the serial comms pins for something else?
When you connect to USB. then upload & run, the modem has been ‘on’ for several seconds before your code runs. Hence is probably already ‘ready’.
When you ‘plug in to run’, the modem and sketch start at the same time...
(the modem has its own processor that doesn’t care about the Arduino),so your sketch is sending commands to a chunk of fibreglass and silicon for several seconds.
lastchancename:
Two questions...
Have you used the serial comms pins for something else?
When you connect to USB. then upload & run, the modem has been ‘on’ for several seconds before your code runs. Hence is probably already ‘ready’.
When you ‘plug in to run’, the modem and sketch start at the same time...
(the modem has its own processor that doesn’t care about the Arduino),so your sketch is sending commands to a chunk of fibreglass and silicon for several seconds.
All the serial comms pins are dedicated solely to the SIM800L. The only other connection is the one going to the LED that I intend to substitute for a relay connection when I figure this problem out.
I may test it right now, I will only turn the SIM800L on for a while then turn my Arduino on and see what happens. I should say that the NET LED is stabilized so it's connected to the network of my region, thus it's receiving my message.
Sorry if my english is getting on the way of our mutual understanding, is not my native language.
lastchancename:
ok, i don’t have experience with SIM800, but use a lot of SIM5320 3G modems.
i’d expect they have similarities at the basic level when you power the modem on
Here’s a link to some others experiences with SIM800:startup.
sim 800 leds - Google Search
I turned my SIM800L on for a minute or so then I turned the Arduino board on, it worked! Now I will think about a way to turn them both at different times.
I really cannot thank you enough!
My pleasure - karma points are enough thanks!
(Change title to [Solved]....