What is the cause of "stk500_getsync(): not in sync: resp=0x00" in Arduino - arduino

I was using Arduino Uno to build a robot, but suddenly this error (stk500_getsync(): not in sync: resp=0x00) occurred. I tried a lot, searched on the net, to fix this error, but no solution worked for me. At last I bough 2 new Arduinos. But each of those 2 Arduinos ran few days correctly and after a few days gave the same error.
I was, and am, unable to find what causes this error. Can anyone kindly tell what could be the mistake I may be doing?

This has happened when the COM port is not correctly selected. Determine the COM port used to communicate with Arduino and set in in the IDE, then recompile the sketch.

I just found the reason from this link
of this error.
There are a TON of pages out there on how to solve this error. The problem is none of them worked for me. The typical solutions range from not having the correct serial port or correct Arduino model board selected under the Tools menu in the Arduino software, to not having a driver (or the correct driver) loaded.
However, the frustating part for me is I KNEW I had the correct serial port and board and driver selected because I was getting output from a sketch scrolling in the Serial Monitor window via a USB connection.
The fix? DISCONNECT ANY WIRES going to pin 0 (RX) while you do the upload. The sketch upload function uses the RX pin.
NOTE: You also need to disconnect any wires going to pin 0 (RX) if you have a sketch with a Serial.read() or Serial.peek() statement, and you want to use the Serial Monitor input field (as shown using the '752' in the example below) to feed data into the running sketch. If you don't disconnect pin 0 it will appear as if your data was entered into your sketch but nothing will happen because the data never truly gets input.

It's looks like there is no connection between PC and Arduino. Possible reasons: Something wrong with USB port OR driver, USB wire, ATMega16 controller, ATMega328 UART or bootloader. First, try to check, if data from Serial Port reaches Arduino. Pull ATMEGA from socket, short-circuit pins RX and TX on Arduino board (pins 0 and 1), and send some data from PC. You should receive exactly same string, as you sent. Also you should se RX TX LED's blinking. If you can't see data back, check if serial port you are using are actually exist in device manager, try to play with it's settings (speed, port numer), try to use another USB port and cable, etc.

I was having the same issue. But for me no led was lighting up on connection and the error observed was the same as yours. I fixed this by changing jumper pin configuration from ext to usb . You can try the same settings by altering the jumper pins between power jack and usb jack.

Related

HC-05 Bluetooth module help, can not recieive data

I am writing some code for my arduino nano and I am using an HC-05 module for wireless transfer of data. I am sending my data as such. This is from the serial monitor, using a usb and regular print statements. I want to be able to recieve this data, and the store it in a csv (I know how to store incoming data). I need help recieveing my data.
22:17:46.765 -> =============================================================
22:17:47.770 -> Sleep timer:242
22:17:47.770 -> Light Sleep: 0 Deep Sleep: 0
22:17:47.805 -> Total Light Sleep: 0 Total Deep Sleep: 0
22:17:47.838 -> Total Sleep: 0
22:17:47.871 -> =============================================================
For some reason, when I connect my HC-05 to my windows desktop via bluetooth, and open a serial monitor in com ports 3 or 4, I get no read out.
My ports
I have it set up as so.
My wireless intialization
Then, I use
MySerial.print()
, to send data, yet I get no output, same thing occurs if I use
Serial.print()
.
I tried getting a new HC-05 module, Switched out all the hardware, tried different prints including Serial and MySerial. I though i could get an output.
Python code I tried to use python to extract the data, yet I get no output. I am not sure what to do here.
Not enough information, but I'll answer biased on the experience I've had with these modules.
Here are instructions for changing or verifying the baud rate on the module:
https://www.instructables.com/Change-the-Baud-Rate-of-HC-05-Bluetooth-Module-Usi/
For my module, I could just send AT commands by default without putting it into AT mode. Send 'AT' to the module and it should respond with "OK".
It helps a ton if you have an ftdi cable for troubleshooting. Connect the ftdi to the HC-05, verify the baud rate and that the HC-05 is responding, open a serial monitor for the bluetooth on the pc and one for the ftdi cable. Try sending data back and forth. Also, be 100% sure you're using the correct com port for your bluetooth by unpairing and repairing and see which com port shows up.
It actually is possible to use the HC-05 for programming the Arduino as well if you set the baud rate to 115200 and figure out a way to hit reset on the Arduino as soon as the bluetooth connects(status/state goes solid). I used an ATTiny for that, but you could just use a pin on the nano connected to reset and another pin to monitor the "state" pin which is connected to the led on the HC-05. That way you can have wireless data and wireless programming if you wanted that.

Esp32cam Failed to connect to ESP32: Timed out waiting for packet header

I've just recieved my very first esp32cam (AI THINKER) today and I was excited to test it, but I'm unable to upload any code to it. I'm always getting the following error:
Failed to connect to ESP32: Timed out waiting for packet header
So, the FTDI I'm using is the FT232r with the following wiring scheme
FTDI Wiring
How I reproduce this error:
Plug everything
Order IDE to upload the sketch
Wait for the "connecting" text
Press the RST button
Also:
Plug everything
Press the RST button
Order IDE to upload the sketch
I've already tried:
Switching to 3.3v (plugged on 3.3v pin)
Using external 5v power supply (plugged on 5v pin)
Using another computer
Swapping RX TX
Trying in different upload speeds
Holding RST button
Switching board between ESP32 Wrover Module and AI Thinker ESP32
I'm I doing something wrong or there's just something faulty?
I have delved for a solution in this regard for weeks and it seems I have a solution.
Findings-
FTDI module is probably faulty or not supported for each instance.
Aithinker Board is not compatible with esspressif (use ESP32Wrover, more details below )
I have an esp32cam from Esspressif, not Aithinker.
I was trying with FT232rl , No matter what Voltage/jumpers/USB cable I used, it didn't work. Always stuck with fatal timed out error.
After many futile attempts with FTDI breakout, I gave my Arduino UNO a try (please note my UNO has mega16u2 chip as USB serial chip (top right corner just beside the oscillator) and fortunately it worked.
I have read that CP2102 is also working.
**Here are the steps to follow-**
Arduino ESP32Cam connections
3.3 Arduino --------- 3v Esp32CAM
GND Arduino ------------ GND Esp32CAM
RESET Arduino to Ardunio GND
RX Arduino -------------- VOR Esp32CAM (this is not a mistake RX to rx & TX to tx)
TX Arduino -------------- VOT Esp32CAM
GPIO 0(zero)(written as IO0) Esp32CAM to GND Esp32CAM
I didn't have any need to press the reset button in any part of the operation before & during uploading.
I am assuming You have pre-installed the esp32 board manager.
Now select the correct COM port where your Uno (in this case) is
plugged in.
Select the correct board as mentioned
Tools>Board>ESP32 Arduino > select ESP32 Wrover Module
Some uploading setups are to be Done (Under Tools, these will only appear when the Wrover module is selected )
Upload speed -- 115200
Flash Frequency -- 40Mhz
Flash Mode -- QIO
Partition Scheme --- Huge App
Port ---- select the right com port for your breakout or UNO
JUST press upload and relax
After a while, you will be able to see this message
Leaving...
Hard resetting via RTS pin...
Disconnect the Esp32Cam GPIO 0 and GND
Power the ESP32Cam with 5/3v with external power supply (Arduino or other breakouts may not be able unless you are connected with a Powered USB Hub)
keep TX, RX, & GND of the 2 boards connected, don't disconnect Arduino Reset and GND.
Press Reset on ESPCAM and open Serial monitor and you will be able to see the IP address of the cam if it was configured with your wifi correctly.OR get any network scanner App on android or windows.
I hope it helped.
Pre-requisites for flashing:
ArduinoIDE 1.8.12
Core ESP32 1.04 (at time of writing)
Select board AI Thinker Cam
uplooad speed 921600
freq 240Mhz
flashfreq 80Mhz
mode QIO if not working try DIO
partition scheme default
Serial monitor is closed
NO hardware connected to the pins of the ESPcam
Make sure the USB cable is a data cable and NO loading cable only
check Windows device manager if programmer is shown and has max speed / 8n1 hardware
Connections
FTDI - ESP32
GND GND
5V 5V
TXD UOR
RXD UOT
If you use an AIThinker Cam clone you have to ground GIPO 0:
connect GPIO 0 with a dupont wire connected to GND
press reset
compile and upload (use AI THINKER CAM)
optional:
press reset
upload filesystem data (SPIFFS)
disconnect GPIO 0 and GND
press reset
code should execute
And yes you have to do it every upload, on my dev board I soldered a little switch with proper isolationSome more solutions from experience:
If there is still a problem use a 10K (or so) pull-down resistor between RX0 and GND (test on breadboard before soldering)
Pressing and holding (!) the boot-button while uploading on some "bad" boards
Happened with a "normal" ESP32 board to me - just to be sure - I got an ESP8266 in an ESP32 packaging. Configuring for the ESP8266 solved the issue of uploading.
In my case I forgot to remove the SD card. Other users recommended removing unnecessary connections to the pins-- and the SD card technically uses some of those :)
This was solved by using other jumpers. It seems one of the jumpers used in the wiring was faulty.
If you're having the same issue and tried everything in this post, try checking your cables!
Another solution here. Just to add, I tried everything on this QA, as well as many other things suggested online. e.g. tested by powering from 3.3V then 5V, various permutations of holding the reset button down and disconnecting IO00 from GND at the point of flashing. Changing various settings in Arduino IDE/
I was unable to flash a single one of the 5 ESP32-CAM boards I bought. Spent a good two hours on it. I even continuity tested every pin on the board to its ESP32 chip pad, and all the hookup wires were tested too. The board seemed fine.
Then I soldered a 100uF capacitor between 5V and GND, and used my USB-UART 5V power... tested and worked straight away. No need to pull out the IO00->GND connection and no need to press RST button on the board during flashing. (Of course, pull out IO00->GND after flashing complete.
So - it was a power problem.
I can only guess that the cheapo regulator they used on the copy of board that I got was not quite efficient enough, but basically that capacitor resolved the issue.
p.s. the ESP on board was marked "ESP32-S". I selected "AI Thinker ESP32-CAM" in Arduino IDE as suggested by most people online, and this worked.
There are 3 pins marked GND on the ESP32-CAM board. Buuuuut (!) the one marked GND/R just by the U0T is NOT connected to other grounds or anywhere else I could had find. Check with a multimeter and use a REAL GND. It just worked for me after days of puzzling.
If you try it with arduino it works but its needed to press reset button on esp32 before you upload your code
Basically I was facing the exact same problem fro quite some time. What worked for me was that as the chip was flashing, shifting the power wire from 5V to 3V3 pin. I do not know why but it workes. When esptool starts flashing at 2%, switching the cable just then, despite having 5V from supply into the 3V3 point made the flashing successful. I do realize this is probably a bad answer to your problem since it involves oversupplying voltage to the chip on the wrong point as it is flashing and could damage the chip. However, if anyone is tired of debugging and are at the point where you are considering throwing the chip away, might as well try my method. For other's who value their chip, don't try this method and if you still do, kniw it is at your own risk. But it worked for me after 3 days of just messing around with connections.

esp8266 on wifi serial board and Arduino Uno board

I bought esp8266 with serial wifi wifi card
I connect RX to TX; TX to RX; VCC to VCC; GRD to GRD;
I cant communicate with the board not if program mode and not in UART mode; the reset do nothing.
the red led on the board is on.
I connected the wifi serial to Arduino uno board.
try to upload sketch i got the following error:
warning: espcomm_sync failed
error: espcomm_open failed
error: espcomm_upload_mem failed
Any help or guides will help me to solve the issue.
Since I have had numorous of problems with my ESP8266 modules, this is what I generally watch for:
Output is 3.3v
Swap over tx and rx. Some boards have them swapped for some reason (searched for days for this!!)
When uploading the code, first the code compiles, then the code uploads. During the compile process, keep the reset button (or pin) pressed. As soon as you see the "uploading" status message, you can release it.
Make sure the GPIO0 is connected to the ground and (depending on which version you have) the GPIO15 as well.
When grounding the GPIO0 and GPIO15, use a resistor for each (between 2K and 10K will do).
I've spent two nights trying to upload firmware so I'll just repeat what helped me since there's not so many solutions:
First in Serial Monitor make sure that your chip responses to AT commands. There's no point in going further without achieving it. If you fail here then it's time to check your commutation, power source, etc.
While uploading: 1. Ground GPIO-0 pin. 2. In Arduino IDE press Upload button. 3. Code starts compiling. 4. As soon as you see that code starts uploading ground RST pin for just a blink. Before I reseted the chip too early so I had sync failed problem as you did. It took me a while to "catch" this moment for resetting the chip. Still I upload new firmware in 4-5 takes.
Before flashing firmware, please hold FLASH button, and press RST button once. When our firmware download tool released, it will flash firmware automatically and needn't press any button
I have this really weird issue where grounding GPIO 0 didn't work for me, but after a lot of trial and error I managed to upload the sketch connecting directly both gpios to ground in the arduino board and it worked. Really strange.
I had the same issue. In my case, I was uploading while in another terminal program I was checking for serial data. After I closed the serial monitor (and let Arduino IDE use the serial port) the problem was resolved partially.
The other half of the problem involves carefully pressing the button GPIO0 and then RESET.
This helped me achieving that.
I had the same issue, but after I set the Programmer to "AVR ISP" in the Arduino IDE/Tools, after that the upload was successful and it worked fine.
Hope it helps.
First you have to make sure that the Arduino IDE has the ESP8266 libraries installed. To do that, go to file>preferences and under Additional Boards Manager URLS, paste this link:
http://arduino.esp8266.com/stable/package_esp8266com_index.json
Then, go to tools>board>boards manager. Scroll until you find the link for ESP, than download it.
Once you select all the info for the board change the programmer to "AVR ISP"
Finally, to download the code, hold down the GPIO0 button and press the reset button once. Finally, hit download!
To use serial monitor, you may need to use the 115200 speed as it is not the default.
Hope this helps!
Please downlode and install these driver as per OS i spent 6 hours today and finally this was the solution.
https://www.silabs.com/products/mcu/Pages/USBtoUARTBridgeVCPDrivers.aspx
Look follow the leads and you will get the proper output as 'OK' in reply to AT command, just search for Arduino15 file in C directory of your computer, it will be in somewhere at C/users/app data and delete it, then set the Arduino to arduino uno board or whatever board you are using and connect the Esp8266 as, UNO --- ESP8266
RX ----- RX
TX ----- TX
GND --- GND
3.3V --- VCC and CH_PD
Once Connected open the Serial Monitor and set "Both NL & CR" and Baud to 9600.
Send "AT" to test. If nothing comes up try different baud rates such as 115200 or 57600 and retest.
If you get "OK" reply then all is working.
I just bought the Wemos D1 and had the same problem: I could not upload my sketches. There were several reasons for this:
1) I did not have the CH340G drivers loaded on my Mac. Both Win and Mac platforms need these drivers. Linux does not. I found my drivers at http://sparks.gogo.co.nz/ch340.html
2) You need to add the board to your Arduino IDE. You can find the steps to do that at http://www.beerandchips.net/2016/01/24/wemos-d1-hands-on-with-the-new-arduino-compatible-esp8266-dev-board/
Once I completed those 2 steps (be sure to select the serial port) everything worked great and I can upload my sketches with no difficulty.
I had (too many/wrong) COM port(s). Find the right one and I't fine.
This worked for me this time in the following way to successfully upload sketch from IDE to esp8266 via arduino:
1) IDE Tools menu: upload speed 115200
2) opt this one in tools menu: Programmer- AVR ISP
3) Keep serial monitor closed. If com port not visible under Tools, disconnect and reconnect USB from laptop
4)Reset Arduino
5)Connect GPIO0 of 8266 to VCC(3.3V) for a blink and remove
6) Connect reset of 8266 to gnd for a blink and remove
7)GPIO0 grounded..keep this one gnded for the upload period
Hope this one works..

Not able to upload code to Arduino

My Arduino Uno was all set up and was working fine.
Project: Arduino controls a 9v motor depending on the command given. As the Arduino only provides 5v, I added a 9v battery to it through a transistor
I decided to add new code into the Arduino but when I tried it failed. I have uploaded code thousands of times before (successfully) all of a sudden the IDE keeps giving the following message
avrdude: ser_open(): can't open device ".\COM3": Access is denied.
I have looked up for a lot of solutions on this forum and elsewhere. Here are the things I have tried so far:
Changing the COM port
Disabling all the other devices CONNECTED to COM
Tightening the CONNECTIONS
Re installing all the drivers and the IDE
Rebooting the system
Using another laptop to upload code
All the above have given me the same output for some reason. The built in LED light and the power LED switch on when the board is connected to a power source (my laptop). Could the board have been damaged by any chance? How can I check if the board is spoilt? Should I buy a new board?
this may help;
remove the mcu from the board and connect the board to your PC.
try to open the com port.
if it opens, short TX pin to RX pin.
send some data and check if you are getting the data back. this way you can make sure your usb-ttl is not damaged.
With my verry limited experience with Arduino I've seen that the IDE sometimes resets the saved arduino on startup. Press extra -> Board -> yourboard and try again.
make sure you have the right ports COM1 and COM1
activate it too in arduino
Once it happened to me that a defective USB cable was the culprit. For one board it gave messages like
avrdude: stk500v2_ReceiveMessage(): timeout
But for another board I also got these messages "can't open device - access denied". It's always worth to try another cable.

Rs232 arduino issue

I have a little confusing about arduino uno. I use Serial.print("hi") code then it "hi" appears on the serial monitor. I also use rs232/ttl converter which are connected pin 1 and 0 on the arduino properly.
Then I realize that when serial.print("hi") working the data first is going through usb cable. But I want the data has to go through tx rx pins which are 1 and 0.
But when I enter some data from serial monitor , rs232/ttl will work and some data will be sended ?
I do not understand the situation?
Why this is happening ? I just want to sent a data from pin 1 and 0 using rs232/ttl converter.
How can I do that ? I do not use usb cable to sent datas.
If you see the data coming from and to your PC by default USB port, then you ARE using pin 0 and 1.
If you correctly connect an extenal converster, you should be able to read exactly the same thing, if not, connection are wrong. Classic error is to switch TX and RX, as they have to be crossed.
Also remeber that RS232 does not support multiple host, but normally give no problem if the "others host" are just reading, as they will simply sniff the connection.

Resources