Compiling debug version of 'BlinkTest' for 'Arduino/Genuino Mega w/ ATmega2560 (Mega 2560)'Program size: 3,048 bytes (used 1% of a 253,952 byte maximum) (1.20 secs)Minimum Memory Usage: 288 bytes (4% of a 8192 byte maximum) Uploading 'BlinkTest' to 'Arduino/Genuino Mega w/ ATmega2560 (Mega 2560)' using 'COM27'Uploader started for board Arduino/Genuino Mega w/ ATmega2560 (Mega 2560)Upload method will be: bootloaderUploading via Bootloader C:\Program Files (x86)\Arduino\hardware\tools\avr\bin\avrdude "-CC:\Program Files (x86)\Arduino\hardware\tools\avr/etc/avrdude.conf" -v -V -patmega2560 -cwiring "-PCOM27" -b115200 -D "-Uflash:w:C:\Users\Frank\AppData\Local\Temp\VMBuilds\BlinkTest\mega_atmega2560\Debug/BlinkTest.ino.hex:i"avrdude: Version 6.3-20171130 Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/ Copyright (c) 2007-2014 Joerg Wunsch System wide configuration file is "C:\Program Files (x86)\Arduino\hardware\tools\avr/etc/avrdude.conf" Using Port : COM27 Using Programmer : wiring Overriding Baud Rate : 115200avrdude: stk500v2_ReceiveMessage(): timeoutavrdude: stk500v2_ReceiveMessage(): timeoutavrdude: stk500v2_ReceiveMessage(): timeoutavrdude: stk500v2_ReceiveMessage(): timeoutavrdude: stk500v2_ReceiveMessage(): timeoutavrdude: stk500v2_ReceiveMessage(): timeoutThe uploader process failedavrdude: stk500v2_getsync(): timeout communicating with programmeravrdude done. Thank you.
You have not tried communicating between a sketch that is actually running on the Arduino, and the serial monitor on the PC.
I just thought of a big hint that (I hope) will help you communicate via BT with a sketch on the ATmega2560. If you did your test through the Mega's onboard USB-to-serial adapter back to the computer, that means you must have had the TX and RX pins swapped so it would do that, instead of in the correct order to communicate to the ATmega2560. Remember, you had it hooked up backwards to make it talk back towards the computer along the USB wire, instead of talking forward to the ATmega2560. :-)
Hmm, now I'm really confused; As I'm sure you know, I have no control over the Rx/Tx wiring between my PC and the USB connector. Between the Arduino and the HC-05, I have Tx1 on the Arduino connected to Rx on the HC-05 and vice versa. Are you saying that the HC-05 to Arduino connection should be Rx - Rx, Tx-Tx? If so, that's a new one on me.
OK for scenario 2 hookup, did you first upload and test a sketch on the Arduino using the USB cable, and communicate back and forth sending and receiving some text between the sketch and serial monitor? And that works? Only after that is known to work, then switch to using BT communication with that previously loaded sketch and using the serial monitor and verify it still works as expected? I suggest do that before trying to do something more complicated, such as sketch uploading.
I truly must be missing something here, as it seems to me that you are describing the normal way in which sketches are uploaded and tested. Upload a sketch with embedded 'Serial.print()' to the Mega and monitor output using the serial monitor. I did this several times just in this one project. This particular Mega board is my 'go to' test board and I've probably uploaded sketches to it 50 or more times since I received it.
So, the bottom line is - yes, I have verified that I can upload an arbitrary sketch to the Mega using the wired USB connector, and I can and monitor serial output using that same connector & cable.
I have also verified that I can communicate TO the Mega using that same USB cable & connector.