Special developer offer: ESP32 (WIFI +BLE) wireless board

I already have the Arduino plugin installed. Just not familiar with using it. As a new Arduino user I am still learning how they work and all tutorials out there talk about how to make it work with the standard Arduino IDE thus why I haven’t tried to use VS.

Have you found a fully functional ESP32 sketch? Realistically for the M2 I can imagine we only need it to serve as a host for WiFi and as a Serial port for BT so a bunch of the commands would be unnecessary but as long as those basic services are provided for they should work.

But still would like to find a way to upload the binaries to the ESP32 from ESP-IDF.

As to the AT commands. You shouldn’t allow AT commands to be received by the ESP32 from the wifi or bt.
When AT commands are received from the ESP32 normally they are not echoed but if echoing is turned on then what I would suggest is that we add a custom command to ignore the next AT command then put a bogus AT command after the data… This would allow the ESP32 unit to ignore the AT command within the data but if there is no AT command the bogus AT command would be run allowing the ESP to take further information. This is assuming when running a program you don’t blindly send AT commands without getting a response and checking it. Otherwise you have to parse the string before it is sent to the ESP and bracket it with the “ignore next AT command” whenever there is an AT command. I would assume the Arduino would have enough processor speed to be able to do this parsing and adding of commands if necessary.

I MAY try tinkering with the sketch posted here later today. I BELIEVE the ESP-IDF expects the GPIO0 line to be held high the whole process so I will try changing the sketch so when the first button is pressed it will hold the GPIO line high, wait a short period then press the reset for a short period but leave the GPIO0 line high until the button is pressed again or the reset button is pressed.

Rodney

Has anyone gotten the ESP-IDF working with these units? Otherwise is there a way to take the Binary for the ESP32 once created with the ESP-IDF and upload it via Arduino IDE? I have to believe there is a way since you are compiling then uploading but not sure how to “shortcut” the process.

Rodney

Yes, I use the esp-idf over Arduino most of my development. I’m not sure Arduino has a functionality to select and upload a hex. But luckily, esp-idf comes with the tools to flash the device.

esptool is located in $IDF_PATH/components/esptool_py/esptool/esptool.py
If for some reason this doesn’t exist, try the following.

cd $IDF_PATH
git submodule init
git submodule update

This will checkout all of the submodules, including esptool. From there the flash command line will look something like…

esptool.py --chip esp32 --port $PORT --baud 213400 --before no_reset --after hard_reset write_flash --flash_freq {build.flash_freq} --flash_size detect 0xe000 $IDF_PATH/tools/partitions/boot_app0.bin 0x1000 boot.bin 0x10000 app.bin 0x8000 app.partitions.bin

oh wait. just as replying it’s occurred to me… if you’re using make with esp-idf you can just make flash. You will still need to configure the --before/--after options using make menuconfig in the following menus.

Serial flasher config --->
  Before flashing (No reset)
  After flashing (No reset)

(Also, sorry it’s taken so long to jump back into this conversation work was crazy then holiday blahs)

Its all good. Probably your last message is what I need. The flash tool is timing out at the connection. I have the M2 in the “Downloading” mode and it doesn’t talk.

Looks like it is using the same flash tool for ESP-IDF as for Arduino IDE which is what was frustrating to me. When I get home I will try that route and see if it works.

In the back of my mind I figured it had something to do with something like this since we had to change them for the Arduino IDE but wasn’t sure.

Assuming this works I will likely still pursue the ESP-AT library as it appears to be complete.

Rodney

Ok so looking at the hello world program mine is a little different. I would assume this is the correct setting based on what you said. On the second option the other selection was “Reboot after flash”.

image

I am not home but have my laptop with me so I was able to atleast go through some of the steps. Hopefully this was my issue since it was set to reboot before and after.

Both should be “No reset”. The pass-through bootloader handles the reset after no data has been sent for (I think) 3 seconds.

On the example given the two choices were Stay in Bootloader and Reset after flash. So I will try this setting when I get home and hope it works.

Ah! sorry, I didn’t completely understand the previous post. That ends up translating to no_reset which is the actual esptool option.

Well I look forward to getting the ESP32 fully engaged. The hints from their site make it sound like it would have been nice if the Macchina group could have had some sort of connection on the device so it could be used as an extension if possible of the M2. That chip is capable of doing far more than just be a BT/WiFi adapter.

Ok so I have the programming working with ESP-IDF now. So next question now that I have this running is for the ESP32-AT.

Here are the options I have for the port.

image

I set the 0 for the uart number and trying to figure out what pins to select.

I did find this information:
https://www.dfrobot.com/product-1559.html

Based on this information my selections are now:

Ahh not working… It throws a code for UART issue. I left the console as UART0 as well for now just figured both would write to the same area. I CAN turn off the console but want to confirm that I have the pins setup correct first.

Thanks again!

Rodney

Hmm, I’m struggling to see anything wrong here, can you be more specific about this “thrown code for UART”?

Sure, I also posted an issue with the ESP-AT group… I believe something is wrong in the setup of the uart.

Here is a picture of the screen I get (With console on which is also set to send to uart0):
Note that turning off the console just gives me a shortened console. Not worth much.
Still reboots.

This doesn’t look like an issue with the UART, the function call that is causing the exception is initialise_wifi.

Is the code you’re compiling available? Or at least the basis for it. I cannot seem to find either esp-at-core or at_core anywhere.

Can you also post your entire sdkconfig ?

(also found you github thread)

It is built from ESP-IDF.

So if it is not in the ESP32-AT code it would have to be in the ESP-IDF code somewhere.

Or in their tool chain.

I followed the ESP-IDF instructions, downloaded the tool chain, then cloned ESP-IDF and then cloned ESP32-AT.

So as far as I can tell I have done everything I was supposed to with this?

I am in the last two weeks of my semester then I will be on Christmas break so I hope I can get this sorted out shortly. I will be somewhat busy finishing up some group projects but don’t really have any exams which is odd. Once the semester is over I hope to hit the ground running and get some significant progress with this. So hoping I can sort out the issues getting this software loaded on the ESP32 before then.

Edited:
The answer seems to be that I am using too new of an ESP-IDF and to use the one packaged with it. Not enough time to try it now so will try later today and will report back. While there are other libraries available personally I think we should be using the manufacturers library. IMHO

Edited Again:
Tried it when I got home and set the path for IDF to the one within the ESP32-AT package. Was able to flash this image and now It appears to be working. I get a “ready” prompt.

Now to find some tutorials on the ESP32-AT package and see what I can do with it.

Hmm a couple of interesting projects that could make the WiFi and potentially Cellular modems work with a PC the same as if it were directly connected to the M2.

For windows (May work as is, just needing to be compiled):

For Linux (Not sure if this will work but here it is anyhow. May be able to incorporate into the program.):

I do have the module fully working at this time. I MAY go ahead and start coding a new library for this module so we have a full Arduino library for it. Not sure. I MAY just hard code some stuff for testing purposes to get M2RET working with it and go back to this later.

In the process of building a library to allow easily adding modules such as ESP32 or the Cellular module to the M2. Hope to have the library “finished” this week and will start integrating into M2RET. Does anyone have the ESP32 fully working so I can test with that module? Since someone else has been working with the module I haven’t started but may do so if no one has by the time I have M2RET converted over. hard to test it if I don’t have a library to test with… :slight_smile:

Currently I have 2 ESP32 modules. An older “Beta” one and what I am assuming is the production version. I have the ESP32-AT library installed on the Beta version and I can communicate with it.

What I am curious about is if there is an Arduino Library already built to support it or not? I can write one but looking through the documentation of the ESP32-AT library, that could take a while even if I just include the functions I expect to use. I could just write all of the “AT” commands to the serial port manually but seems so wrong to do and hard to debug where as having a simplified library would make things much simpler.

(Ie calling a function to get a list of possible hosts and have it return a list is programmatically easier to debug than to manually write out the AT command and handle it in the program manually.)