And i get this error when trying to upload: A fatal esptool.py error occurred: Failed to connect to ESP8266: Invalid head of packet (0x0C). The parts im using are Arduino UNO, and ESP826Use code tags to format code for the forum6 for wifi.
Im not sure if this is helpful, but my goal for this project is to be able to wirelessly flip a light switch from my phone.
Also, Thank you for the information about the IO-Pins. I have seen multiple configurations with the Esp8226 with arduinos, im not sure which would be the best.
I also saw some people said to remove the ATMEGA on the Arduino for similiar projects. I removed it but im wondering whether this is necessary.
I should probably note, that this is my first Arduino project, so im not knowledgeable about a lot of things.
You are using two microcontrollers.
And because of this fact that you are using two microcontrollers you should make very clear to which microcontroller you are uploading code.
There is a mish-mash mushup.
In post #8 you are using a code that starts with
This is code that is dedicated to run on an ESP8266.
For uploading code to an ESP8266-01 you need to connect the ESP8266-01 to a serial to USB-comport-adapter.
Like this
or this
If you tried to upload the code of post #8 to the arduino-uno with IDE adjusted for board arduino-uno it will fail with a different error: no such file or directory
If you had the IDE adjusted to ESP8266 but your USB-cable is connected to the arduino uno this will fail because the ESP_py-tool expects to communicate directly with an ESP8266.
Easiest way to write code for this project to flip a switch wireless from your smartphone would be to use a ESP32-nodeMCU-board like this
Or if $10 are too much using a WeMos D1 mini
which are available for $5
With the ESP32-nodeMCU or ESP8266 D1 mini you can eliminate the arduino-uno completely
the ESP is connectd directly to the computer through the onboard USB-to-serial adapter
and you just write the code to control the servo on the ESP-board
I recommend the ESP32 as it has more flash / more RAM
best regards Stefan
Iuploaded the code of post #8 to a NodeMCU ESP8266 device without problems
I set Tools>Board to 'Generic ESP8266 module"
what have got the Tools>Board set too?
have you selected the correct COM port?
to upload the code from post # 8 into the ESP8266-01 would my current setup work?
Then the answer is
"I can't say because you have not posted code that does serial communication between the ESP8266 and the Arduino-Uno
The posted code for the ESP8266 does no serial communication
You haven't posted any code for the Arduino-Uno yet.
You may think "oh man this is pedantic!"
Well if you like to fiddle around for weeks without success or even destroying components you
can go on writing "if I do this with that code...."
You are a beginner and as a beginner it is even more important to be very precise and to avoid assumptions and you should not tinkering around without knowing.
Example connecting your ESP8266 to 5V will destroy the ESP8266 because it is a 3.3V-device
uups !
I uploaded the code of post #8 to a ESP-01S device without problems using a ESP-01 Helper V3 (ESP8266/ESP32 programmer/development board)
which enables one to program and run code without having to switch programming/run modes etc
I modified the code to my SSID and password and the serial monitor displays
Connecting to WiFi...
Connecting to WiFi...
Connecting to WiFi...
Connected to WiFi!
I appreciate you bringing the importance of being precise to my attention. I didn't really think about the importance of it, before you brought it up. Multiple times through this project i have made mistakes of not being precise. Going forward, I will try to be as precise and straightforward as I can with this project, and my questions.
With keeping precise in mind, I think that i didn't explain my project as precisely as I could have, so I think I should explain more precisely what i am trying to do. So, what i am trying to do is be able to turn my room lights on and off from my phone, and I watched a video of a YouTuber making a "Arduino Bluetooth Light Switch with Servos" (link: Arduino Bluetooth Light Switch with Servos - YouTube) looked like what i had in mind for this project. I got the same materials that this person had in there video, and assembled everything like they had it. But the problem arose when I couldn't find the app they were using to connect to the Bluetooth module(CC2540 CC2541 AT-09). So i didn't really know what to do after that, so i did research on a bunch of apps for things like this. Multiple apps I tried and none of them worked.
Now your probably wondering how i ended up having an esp8266-01. Well, I tried to connect the Bluetooth module (CC2540 CC2541 AT-09) to blynk, but the only options for adding a device were "Connect to Wi-Fi, scan QR-code, Quickstart device. And i did research (which i probably didn't get the best information) and it seemed that most people using blynk did so by using an WiFi module such as the ESP's. So i got the ESP8266-01, and i have been trying many different things. But I have very little knowledge about this stuff, and now I'm kinda lost. I'm open to any input anyone has about what i should do next.
Thanks again for trying to help.
(Im sorry its long)
You are welcome. Your posting is very good. And not too long. It describes what you have done so far and it was interesting to read.
OK. There are a lot of options to realise what you want to do.
And I have some additional questions: would it be sufficient to switch on / off your lights if you are inside that room?