GSM Shield not taking calls from other phones - arduino

I am using Arduino Uno R3 with the SIM900A for a couple of weeks. The problem I'm facing is, everytime I make a call from a Nokia (or anyother) cellphone to SIM900A - I see just one RING as unsolicited result code on the Serial Monitor and I cannot hear any rings going on in Nokia. Everything is blank for about 5 seconds and then the call attempt drops.
Why is this happening? Do I need to execute some AT Command as soon as a RING happens, to show Calling Cellphone that the ME is ALERTING/RINGING ? Also, when I call once to SIM900, should I not see many "RING" instead of once?

Finally, I found out what was wrong. External Power Supply!
Turns out the SIM900A board was not getting enough current to function properly. When I connected the Arduino Board to 12V external power Supply (2Amps), it worked like a charm!
Try it out, it really works! :)

Related

How to fix Failed to connect to ESP32: Timed out waiting for packet header error?

I tried to flash an ESP32 but I didn't succeed, I tried with esptool.py and Arduino IDE. I tried to press the boot button and reset but it didn't work. Here is the error:
A fatal error occurred: Failed to connect to ESP32: Timed out waiting for packet header
If using the Arduino IDE, try lowering the upload speed (Tools/Upload Speed). Lowering mine from 921600 to 460800 did the trick.
First ensure that you are in download mode:
Start the serial monitor and set the speed (mine is 115200).
While pressing the "boot" button, press and release the "en" button (your buttons may be labeled differently).
You should see something like this on the serial monitor:
waiting for download
Now start the upload
My development machine, a 2013 iMac is connected via USB to the USB-c port on my ESP32 Dev Module. Apparently the iMac's USB or ESP32 board's USB cannot keep up at the 921600 upload speed.
DISCLAIMER! May not be correct answer but may help to save time for someone.
Quick answer if you do not want read my experience: Disconnect all wires from pins and try uploading again! It may help.
I came across with the same error and could not figure it out. I first thought that something is wrong with the code, because it happened after I edited working code while figuring out where to connect what pin 😀. I also wasn't able to upload simple HelloWorld after it happened with connected wires. But then I disconnected all my wires from the board and the upload works fine.
I can not figure out the WHY factor but I think it must had been the input/data pin I was using, in my case D13. I have the DevKit with fewer pins. Maybe someone can comment why connected pins may make the error come up?
To make your ESP32 board go into flashing/uploading mode automatically, you can connect a 10 μF electrolytic capacitor between the EN pin and GND. When I had the same problem, when I followed this advice, the problem was solved.
References
Failed to connect to ESP32: Timed out waiting for packet header
espressif/arduino-esp32 - issue
On some AliExpress-like ESP32s you have to press the boot button in order to upload your sketch.
If you are watching the Arduino IDE console ouput and Connecting ... appears, you have to press the boot button for approximately 2 seconds until the console output changes.
Try to do this one after the other
Press the boot button when press uploading button until it write the code.
Try disconnect esp32 from the board/header/pcb that you are using right at the time.
Disconnect any other connection that your esp32 might have.
Do not connect to anything even your hand if possible.
Try put it in something that doesnt have a moist surface. look pic number 3.
MY CASES(30 pin version):
Case 1: I dont know why. I was connecting the pin to a female header it doesnt work and sometimes it just work like that. look pic number 1.
Case 2: when Im holding esp32 on my hand sometimes it wont work then i put it on my table and another time it doing well.
Case 3: pressing boot button when uploading it helped sometimes, and the other time it just work like it should.
Case 4: when it connected to pcb its simply just wont work, but when disconnected boom it work like nothing ever happen. look pic number 2.
Maybe just maybe something with capacitive or something like that (just assuming because number Case 1). hope that will help you out.
pic 1pic 2pic 3
This technique definitely working
Goto Tools > programmer, Select ISP and Upload Your Code.
if you can't see any programmer, then download 1.8.12 version.
https://www.arduino.cc/en/software/OldSoftwareReleases
With Arduino IDE
Make sure the Com port is selected under Tools menu. My experience with ESP32 is Com 5.
If it is not available as an option, try changing USB ports and/or re-select Tools - Board - ESP32 dev module.
Watch the "Compiling Sketch" window.
Press the "Boot" button as soon as you get the red message "Serial port Com 5" You can release the button as soon as it starts to upload.
If this doesn't work,try plugging into another USB port.
The Reset button only resets the uploaded sketch to re-initialise and has nothing to do with the uploading.
Install expressif.exe and port drivers,connect the port and flash the esp32 ,upload the code using ardiuno,solve the error
in my case buttons are new but not shorting properly as multimeter showed ..opened both scratched resoldered and all working
Changing by upload speed from 921600bps to 115200bps fixed it. No need to press any buttons.
Just download the drivers x)
CP210x: CP210x USB to UART Bridge VCP Drivers
FTDI: FTDI Virtual COM Port Drivers

Arduino: Using the watchdog for both preventing failures and energy savings

I came across this website when trying to find a reliable way to use the watchdog for preventing failures (code lock ups) and saving battery using an Arduino.
I tried the code and it worked fine. However, i would also like to use the serial monitor. I tried adding Serial.begin(9600); in the setup, however, most of what is shown in the serial monitor (from the code within the main loop) are strange characters (the baud rate is set to 9600). Is this something to do with the function to configure the wdt and the placement of Serial.begin(9600) in the code?
I'd also like to use an external interrupt (via a button on Digital pin 3) to wake the board from sleep. How can be achieved based on the current code? I know how to implement using a different method of making the board go to sleep without using any watchdog at all, however, i have been unsuccessful in making it work with this code.
Many thanks for any help.
As said above, the serial communication should work fine. Are you sure you are able to make your serial communication work fine without the watchdog part of the code? I have used the watchdog tips given on the website along with serial communications without any problem on Arduino Uno, so I would guess the serial communication problem lies somewhere else in your code.
Can you write a bare bone example of your code with the watchdog management part, a serial communication or two somewhere in your loop(), and if you want some delays / infinite loops to test the watchdog firing, post it here, test it on your board and indicate if / where you have problems?
I have never used a pin interrupt, but it seems that google gives some nice results with example code. Have you tried the results given by google?
https://www.arduino.cc/en/Reference/AttachInterrupt
http://www.allaboutcircuits.com/technical-articles/using-interrupts-on-arduino/
You will have to be careful regarding the choice of the pin on which you put the interrupt, as explained in the Arduino Reference only pins 2 and 3 support interrupt on the Uno.

ESP8266 Point to Point communication with 2 arduinos

I am using 2 esp8266 wireless modules to establish bidirectional wireless communication between 2 arduino boards (one mega and one uno) without the use of any earth based technologies (i.e. radio frequencies, wifi which relies on earth sattelites, etc.). My solution was to use the esp8266 to establish a private area network with both esp's acting as a station and an access point (AT+CIPMODE=3). Unfortunately, this solution has proven to be more of a hassle than it was worth.
To start, I have the esp's each wired according to this diagram
When I first started out, the red LED was on and the blue LED was off. During this time, I was able to send AT commands, establish the server, and achieve the communication I required by entering commands directly to the serial monitor. After this, I started writing a library using the SoftwareSerial library to allow me to issue commands directly through the program to set up the esp as needed upon start up of my script. Before doing this, I changed the baudrate to make sure it was running at 9600, and entered the AT commands in the serial monitor to make sure everything was working properly and it still worked.
After I began writing the library, before uploading the code with a test of the library I noticed the blue LED was lit solid now. Noticing this, I reuploaded the barebones script (I haven't uploaded the library code to the arduino yet) and the esp was no longer receiving the AT commands.
Does this indicate an issue with the board which I can fix or does this mean the board is done?
With my deadlines approaching fast in about 3 weeks it is crucial I get this wireless communication working so if this is an issue with the board, I'm going to have to scrap the esp's and use a different way of communicating. So my second question is, if this is the case, what are other viable options for establishing this communication? I have used xbee's before and while that would be ideal, they fall out of the budget I have been alotted so I need to keep it under $50 for this. If bidirectional communication is not possible for that price I can live with one way because I just need to get this system working. Basically I just need to transmit a single byte of data.
I realize this response is a little belated, and I hope you got it sorted: I've started working with the ESP8266 myself in the last few weeks, and hence why I was looking around for tutorials on direct communication between 2 units, when I found your post.
From what I've been able to ascertain, the AT commands are a part of the 'firmware' which ships with some modules. The Arduino code however starts loading onto the chips at memory address 0x0000, which is the same address that the firmware update tools use.
In other words, I believe that with the Arduino-coded program running on there, you lose the AT command functionality.
If you find a firmware update tool for the ESP8266 (plenty online) you'll get back the AT commands.
I suppose though the real question is why would you want to? It seems that the AT commands are just a way to treat the ESP as a dumb WiFi antenna. With the Arduino code, you're actually treating it as a micro-controller in its own right.

Arduino Standalone

I have an Arduino Uno and I am using arduino 1.0.5 IDE. I followed he procedures for bootloading an atmega328P-PU on a breadboard.
I uploaded the ArduinoISP sketch first, made the connections(using the External Oscillator) and then wired it up. Then, I selected the programmer as Arduino as ISP, selected the board as Arduino duemilanove w/ Atmega328P. Then I selected the correct serial port and clicked Burn Bootloader.
I got the following errors:
avrdude.exe: stk500_program_enable(): protocol error, expect=0x14,
resp=0x50avrdude.exe: initialization failed, rc=-1 Double
check connections and try again, or use -F to override
this check.avrdude.exe: stk500_disable(): protocol error, expect=0x14,
resp=0x51
How to solve this issue? Also, can I upload the bootloader directly by using it on the Uno in place of the original chip. If so, how?
to my understanding the error you have indicates a bad reading from the chip. I experienced that with chips that were either dead or not properly connected, especially to power supply.
You may find more detailed information in th tutorial : https://www.arduino.cc/en/Tutorial/ArduinoISP
Especially those things :
Note for Arduino 1.0: you need to make one small change to the
ArduinoISP code. Find the line in the heartbeat() function that says
"delay(40);" and change it to "delay(20);".
Select the items in the
Tools > Board and Serial Port menus that correspond to the board you
are using as the programmer (not the board being programmed).
Instead of arduino built-in boot loader just go through below link and it will be great for uploading boot loader and verifying board status info
I am replying you this because same issue I got long back and it saved me.
One more thing for arduino boot loader: for atmega328 you need to put capacitor between reset and gnd( in case you missed)
For gammon bootloader you don't need it.
Be Innovative.
For reset line you might me using 100nf(thats what stated in documentation )...but sometimes it doesn't work...try something like 4.7uf, 22uf or 47uf or close values
I had a similar problem and the issue was that my programmer was a bit slow, I used the -B flag for avrdude to slow down the bitrate and it started working, I set the -B20 and works like a charm every time, but I use the USBTinyISP programmer, not the stk500 one, so this might not work for you.
In case someone stuck at this as I did and nothing like changing the cap value helped. Make sure you are using your USB-TTL adapter in a 5v mode (obviously for a 5v powered chip). I always used it in a 3.3v mode in order not to accidentally burn my 3.3v chips and it always worked. Until today, I was trying to flash my custom atmega8 board and everything worked with the ISP but I was having a hard time using the bootloader and after half a day searching and trying different stuff the 5v setting to the rescue.

What can cause Arduino to continuously restart?

I have an Arduino Uno with a 3g shield and am using a Software Serial port on pin 6, 7 and the usb port for debug. After doing well for days, now my program seems to start over and over again (I see that thanks to a println in the setup function) - I added some code, to be honest.
Any suggestion about possible reasons?
Because you are using pin 6 and 7 with SoftwareSerial, the autoreset on serial connection start does not apply.
It would if you use the "standard" 0 and 1 pin which are connected on the USB.
This kind of bug happens in many cases, normally is HW related (attached hardware use too much current, are you using an external charger or power by usb?) or because you are out of ram. Check if you have enough Available Memory
What code did you add? You say you are experienced in C#, so did you remember to clean your garbage? C/C++ does not have a garbage collector that does that for you.
The Arduino has much less memory then you are probably used to, so if are recursively calling a function intentionally or indirectly you could run out of memory.
If you are using a lot of strings it could also use all of your memory.
Can you divide and conquer to determine specifically what routine is causing the reset?
I would start by commenting out half of the main loop and see if it still resets?
An Arduino will reset when the usb port is reinitialized (read: usb cable replugged), and that could be due to the host computer sleeping, rebooting, or something else such as the whole usb controller restarting because another usb device was plugged in.
Use watchdog timer Solve above issue.And while Debug using Serial monitor keep in mind whenever you start the controller get reinitialize
I had the same problem, and my issue was have 10 sensors on arduino 5v output. I changed 5 of them to a separeted power with a 5v regulator and all works great.
Power regulator might be overheating and it's turning off. Putting a small piece of metal on top of it as a heatsink might fix the problem.
When I had this problem I found out that it had something to do with the Sony software for my phone. Turning the software On my computer solved it, and my Arduino has been happy ever since.
The solution was found here
The culprit in my case was Sony Ericsson software trying to identify if the USB device was a mobile phone. Disabling this cured the problem. The moral of the story is don’t run any software which uses the USB whilst you are doing Arduino development. You can disable the reset function after you’ve finished developing if you want.

Resources