What is the difference between "ESP8266WiFi.h" and AT Commands? - arduino

I am confused that some people use ESP8266WiFi.h library and some people use AT commands for connecting a WiFi module to Arduino.
Do they work the same or not?
Is there is any problem with the library, or is the library for some different purpose and AT commands for other purpose?

That's a great question. It's definitely not obvious from much of the code and many of the questions people post.
When the ESP8266 first came out, it was only used to connect other processors to Wifi. It shipped running software that provided TCP/IP and Wifi support. You'd wire it up to an Arduino or other processor and control it with AT commands. But you would not change the software that ran on the ESP8266 itself.
Many people still use it this way, but it turns out that the ESP8266 is as capable as (or more capable than) some of the processors that used it to connected to Wifi. So developers put together toolchains for building software to run on the ESP8266 itself. They even ported the Arduino SDK so that you could run "Arduino" programs on it (even though it's not an Arduino).
ESP8266Wifi.h is a header file intended for software that's built to run on the ESP8266, as opposed to software built to run on an Arduino or other processor that uses the ESP8266 to connect to Wifi. When you build software to run directly on the ESP8266, it replaces the software that implements the AT commands - though you can reinstall that later if you want.
So when you see a project using ESP8266.h, it's meant to build for and run directly on the ESP8266. When you see a project using AT commands, it's meant to run on a second processor (most likely an Arduino) that uses the ESP8266 for communications.
There are also libraries like https://github.com/itead/ITEADLIB_Arduino_WeeESP8266 which help an Arduino talk to an ESP8266 - they hide the AT commands and provide a simple set of function calls to do what the AT commands do. This runs on the Arduino, the AT commands are still used but the programmer doesn't have to worry about them.
There are also other languages like LUA and Python that run on the ESP8266 itself. Again, these replace the AT software that it first came with.

Related

Can we use arduino libraries(e.g motor shield library) with the STM32?

I want to know if it is possible to use arduino libraries (e.g motor shield library) with the STM32 series? Has anybody tried it before?
Thank you.
Generally yes, but.
Arduino the software defines just an API. As long as your board has an implementation of that API, a library basing on it should work.
That being said, libraries that weren't tested specifically on STM32 might break for various reasons. If you use PlatformIO, you can look for libraries that use Arduino framework and support STM32 MCUs.
If you're using an Arduino IDE, it's also possible to program the STM controllers directly from it. You just need an appropriate core/board definition installed, and make sure that you pick an appropriate programming option (I personally use ST-link whenever I can instead of bootloaders+serial).

How to replace default code in arduino bootloader

I need to make bootloader with my code.
I discovered a github with bootloaders, but i don't know what to do with it.
My experience in use of arduino is limited by burning the default bootloader for ATmega328p
So, is there any simple way just to replace default arduino bootloader code (blinking diod) to anything else?
Certainly there is. Embedded engineers replace and/or overwrite the bootloaders all the time. Here's an article on the subject but I'll outline the basics.
Select a progamming device. There are numerous devices on the market, from very inexpensive to quite expensive, depending on what else they can do besides program a chip. You can even use another Arduino as a programmer, probably least expensive of all and readily available.
Connect the programmer to the proper programming pins. For your purposes you'll want the ISP/ICSP headers (2x3 header(s)) on the board, or 2x3 connector to an non-Arduino programmer.
Upload your code using the Arduino IDE, a utility such as AVRdude, or even Atmel Studio if you're very ambitious and want complete control.
It's not that hard if you use another Arduino as your programmer and 6 female-female jumper wires as outlined in the article.

Arduino Uno debugging

I'm absolutely new to microcontroller development and currently want to:
Understand a typical process of the development
Set I/O and tune all tools for the development.
Currently I'm using Arduino Uno (ATmega328 based)
I found PlatformIO. It looks useful for me to work with microcontrollers on different platforms
Qt Creator is a favorite IDE, and I'd prefer to continue using this for AVR programming (PlatformIO can also generate Qt Creator's project template)
I've tried to build and run first sketch there, it works. So the only question is still there is a debugging.
Correct me if I'm wrong, two primary ways to do this is a JTAG and debugWire, and both ones are "hardware" debug, correct? And, of course, require additional devices.
In other hand, Qt Creator has a "bare metal" plugin which can work (debug) with a devices who can "behaves" as gdbserver.
I also found this article where the author suggests own implementation for a library for an Arduino project, which emulates gdbserver for a PC GDB client via the usual serial connection. Of course, I'll try this way as a preferable in my case.
So the question is - please confirm that all assumptions are correct.
And probably someone uses this way (maybe without this IDE).

Program external F5529 with Energia via LaunchPad

I have a LaunchPad (Rev 1.6 MSP-EXP430F5529LP) that I am using as a programmer for an external MSP430F5529 chip. The programming is done via Spy-By-Wire(see picture below for setup).
The programming works fine via CCS, there are no issues coding or debugging.
I tried to program the external chip via Energia. The programming seems to complete successfully, however, none of the code seems to be running.
Any insight as to what I may be doing wrong, or any additional setup steps? Or..is what I'm trying to do not possible?

Is it possible to write an Arduino program without the Arduino itself?

Hi I am curious to know is it possible to write an Arduino program without the Arduino breadboard itself? Can you emulate this some how instead of the hardware?
Found another post on here which was very helpful
There are a whole slew of Arduino simulators out there, many free, and
some paid products as well.
The CodeBlocks Arduino development environment includes a free Arduino simulator, still under development but functional.
Simuino simulates the Arduino Uno and Mega pins - not a pretty-looking realistic simulator, but it works.
The Python based Arduino Simulator is another option, that plays well with the official IDE
Virtronics Simulator for Arduino looks promising, but I don't see why I would pay $14.99 for it, when I could buy one or more actual
Arduino clones for that price
Many other Arduino simulators are out there if you search, and new
ones are being announced, even crowdfunded, all the time.

Resources