Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

enable reset control for generic esp8266 boards #22

Closed
nerdralph opened this issue Mar 31, 2015 · 40 comments
Closed

enable reset control for generic esp8266 boards #22

nerdralph opened this issue Mar 31, 2015 · 40 comments

Comments

@nerdralph
Copy link

change
esp01.upload.resetmethod=none
in esp8266/boards.txt to:
esp01.upload.resetmethod=ck

@rogerclarkmelbourne
Copy link

What does this change achieve ?

@nerdralph
Copy link
Author

It is documented in esptool-ck; connect RTS to reset and DTR to GPIO0, then
upload automatically resets the ESP and triggers the bootloader.
https://github.com/igrr/esptool-ck
On Mar 31, 2015 7:45 PM, "Roger Clark" notifications@github.com wrote:

What does this change achieve ?

Reply to this email directly or view it on GitHub
#22 (comment).

@rogerclarkmelbourne
Copy link

I guess there is no harm to change boards.txt, but this form of resetting is very dependent on the type of USB to serial board you have.

@nerdralph
Copy link
Author

I tried it with a cheapie pl2303hx under Windows 7, and it works fine.
On Mar 31, 2015 8:09 PM, "Roger Clark" notifications@github.com wrote:

I guess there is no harm to change boards.txt, but this form of resetting
is very dependent on the type of USB to serial board you have.

Reply to this email directly or view it on GitHub
#22 (comment).

@rogerclarkmelbourne
Copy link

OK. I have one of those, so I'll test, and I can generate a pull request if its easier for Ivan than for him to do the change himself

@igrr
Copy link
Member

igrr commented Apr 1, 2015

The reason I didn't set this as default is that when you open Serial Monitor in Arduino IDE, it pulls both RTS and DTR low, which puts the chip into bootloader mode. In fact some other terminals (screen?) also do that by default.
I can probably make this change but some people may get confused by this behaviour.

@igrr igrr changed the title enable reset control for generic esp8266 boards - enhancement enable reset control for generic esp8266 boards Apr 1, 2015
@rogerclarkmelbourne
Copy link

Ivan

I think this can be dependent on what USB to Serial adapter you have. There are loads of postings on various embedded forums where people have tried to make these adapters to both reset and also to enable the bootloader, but the consensus is that its not reliable and only works for some people.

There was a big and heated discussion on Arduino STM32 forum, and in the end I decided not to try to implement it.

@igrr
Copy link
Member

igrr commented Apr 1, 2015

For one esp8266 board I used the following solution:
esptool_wifio
This is supported in my fork of esptool using resetmethod=wifio. Seems to be very reliable and works with all the terminals I have. But for most people having to find a PNP and a capacitor may be an issue.

@nerdralph
Copy link
Author

It makes no sense to disable it for everyone because it might not work
for some. We're talking a one-line change here that won't affect anyone
that is using manual reset.
On Apr 1, 2015 3:42 AM, "Roger Clark" notifications@github.com wrote:

Ivan

I think this can be dependent on what USB to Serial adapter you have.
There are loads of postings on various embedded forums where people have
tried to make these adapters to both reset and also to enable the
bootloader, but the consensus is that its not reliable and only works for
some people.

There was a big and heated discussion on Arduino STM32 forum, and in the
end I decided not to try to implement it.

Reply to this email directly or view it on GitHub
#22 (comment).

@igrr
Copy link
Member

igrr commented Apr 1, 2015

We're talking a one-line change here that won't affect anyone
that is using manual reset.

Okay, makes sense. Will fix.

@nerdralph
Copy link
Author

"when you open Serial Monitor in Arduino IDE, it pulls both RTS and DTR low, which puts the chip into bootloader mode."
That is a minor nuisance if you want to do serial logging to have to unplug the RTS (and maybe DTR) line. It allows you to get started programming an ESP-01 with only a USB-TTL module and some dupont cables. I've been using mine that since it arrived in the mail a week ago.

@igrr igrr closed this as completed in 8b081eb Apr 1, 2015
@igrr
Copy link
Member

igrr commented Apr 1, 2015

Option to disable DTR and RTS manipulation in serial monitor has also been added, so no issues with that now!

@JeroenBeemster
Copy link

iggr, seems THE solution to build an easy way to upload. "Where can I find the option to disable DTR and RTS in serial monitor. (I currently use version 1.6.3 of arduino).

@rogerclarkmelbourne
Copy link

Jeroem

From what I recall the change was in board.txt

What I think may be a better solution for everyone is to have a menu defined in boards.txt that allows you to switch whether you want to enable the reset or not.

@JeroenBeemster
Copy link

Hi Roger,
I found it in board.txt:
generic.serial.disableDTR=true
generic.serial.disableRTS=true
It is not in yours and in mine fork from you.
Any idea when this will be get in sync.
I am pretty new with github and I am loosing track now.
Anyway good work. I will test it asap and trying to update arduino esp8266 for beginners at http://www.arduinesp.com/

@JeroenBeemster
Copy link

I tested the
generic.serial.disableDTR=true
generic.serial.disableRTS=true
on Arduino 1.6.3 (downloaded from arduino.cc) and it is not working.
I assume this is a change also in the arduino java code. Will this change also be available in the "Original" build of arduino. Or should we use the build from igrr?
Again, I can't wait for this change. :)

@ozayturay
Copy link

Does current Windows release from igrr's repository (arduino-1.6.1-p1-windows.zip) have this
generic.serial.disableDTR=true
generic.serial.disableRTS=true
options enabled. They are in the esp8266/boards.txt but I cannot use Serial Monitor when DTR and RTS are connected.

@igrr
Copy link
Member

igrr commented Apr 7, 2015

@ozayturay no this was added in 0dabb25. You need to clone the repository and build the modified Java source to get this feature at the moment, sorry about that.

@ozayturay
Copy link

Is there a simple tutorial for compiling the source for windows?

@igrr
Copy link
Member

igrr commented Apr 7, 2015

@ozayturay For windows builds you need MinGW, JDK, ant, and some mingw utilities (untar i think).
Once you've cloned the repository, do the following in the MinGW prompt:

cd "your arduino git directory"/build
ant dist < NUL

If you find that something extra needs to be installed, please post an update here so I can add that knowledge into the readme. Thanks.

@ozayturay
Copy link

Answering my own question; build/howto.txt takes me to https://code.google.com/p/arduino/wiki/BuildingArduino page and it looks simple enough.
I'll try tonight. :)

Edit: I'll let you know if something else is required.

@ozayturay
Copy link

ozayturay commented Apr 8, 2015

Here are simple instructions for building Windows version:

Compiling Arduino IDE with DTR/RTS Patch for using Serial Monitor with ESP8266

Download jdk-8u101-windows-i586.exe from http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html and install with default settings.

Download https://cygwin.com/setup-x86.exe and install adding wget to the default packages.

Enter Cygwin enviroment using the icon from desktop and use the following commands to download necessary tools.

wget http://rawgit.com/transcode-open/apt-cyg/master/apt-cyg
install apt-cyg /bin
rm apt-cyg

apt-cyg update
apt-cyg install git make mingw64-i686-gcc-core mingw64-i686-gcc-g++ perl zip unzip patch nano

wget https://www.apache.org/dist/ant/binaries/apache-ant-1.9.7-bin.zip
unzip apache-ant-1.9.7-bin.zip

nano .bash_profile

add the following lines at the end of the file (the first two lines is not mandatory)

LANG=en_US.UTF-8
alias dir="ls -al --color"

export JAVA_HOME="/cygdrive/c/Program Files (x86)/Java/jdk1.8.0_101"
export ANT_HOME=~/apache-ant-1.9.7
export PATH=~/apache-ant-1.9.7/bin:$PATH

At this step you must exit and re-enter Cygwin enviroment for the changes to take effect, or you can manually execute the export lines if you don't want to do so.

Continue with the following commands to download/patch/build the Arduino source.

wget https://github.com/arduino/Arduino/archive/1.6.11.zip
mv 1.6.11.zip Arduino-1.6.11.zip
unzip Arduino-1.6.11.zip
cd Arduino-1.6.11

wget https://github.com/arduino/Arduino/pull/4102.patch
mv 4102.patch SerialMonitor.patch
patch -b -p1 < SerialMonitor.patch

cd build
ant dist

Press enter when you are asked for a version number to choose the default value and after a long downloading and building process you can find your freshly build arduino-1.6.11-windows.zip file in the following folder:

C:\cygwin\home\yourwindowsusername\Arduino-1.6.11\build\windows

I hope it helps someone. ;)

Edit 1: Don't forget to copy libiconv-2.dll from hardware\tools\avr\libexec\gcc\avr\4.8.1 to the root (side by side with arduino.exe) of your freshly installed arduino-1.6.1 installation. :) NOT NEEDED ANYMORE

Edit 2: Serial Monitor is working with DTR and RTS connected. Thanks Ivan. :)

Edit 3: I updated the compile instructions. It works for 1.6.6 or above. ;)

@JeroenBeemster
Copy link

ozayturay, Could you share your executable. I am dying for this solution.
Currently waiting for ivan that he update the zip. But I assume he working something great now.
I am working on some simple examples and this makes it much more easy to use.

@ozayturay
Copy link

Here it is: https://dl.dropboxusercontent.com/u/18575245/ESP8266/Arduino-1.6.1_ESP8266.zip

Copy the included files over your current ESP8266 Arduino folder (probably extracted from arduino-1.6.1-p1-windows.zip) and have fun. ;)

@igrr
Copy link
Member

igrr commented Apr 11, 2015

@JeroenBeemster The next release is currently blocked by availability of a proper windows toolchain, as discussed in #23 and elsewhere.
But there is really no need to wait for the release if you need the latest changes. You can always grab the latest build from the CI server:
https://ci.appveyor.com/project/igrr/Arduino/build/artifacts
As mentioned above,

Don't forget to copy libiconv-2.dll from hardware\tools\avr\libexec\gcc\avr\4.8.1 to the root (side by side with arduino.exe)

@ozayturay
Copy link

Wow that CI sever is really cool. Is the build process automatic or manually activated by you when required?

@igrr
Copy link
Member

igrr commented Apr 11, 2015

@ozayturay It's configured to build whenever there is a new commit, but it's also possible to run the build manually.

@JeroenBeemster
Copy link

@ivan Thanks. Its working
@ozayturay Thanks for your quick reply

@Toshik
Copy link
Contributor

Toshik commented Apr 26, 2015

@igrr
Your schematics to autoflash is interesting, but it will strictly limit GPIO0 usage.
For example, now I use ESP-01 as I2C device on ports GPIO0 and GPIO2, in case I would attach your schematics, I will kill I2C when ESP uses UART

Проще говоря, при обмене через UART будет постоянно дрыгаться GPIO0, что прибьет I2C передачи

igrr pushed a commit that referenced this issue May 18, 2015
pull SPI speed fix and uart overflow
@probonopd
Copy link
Contributor

Now that we are using the Boards Manager, #22 (comment) becomes more relevant. I think the change to Arduino/arduino-core/src/processing/app/Serial.java from 0dabb25 needs to be made in https://github.com/arduino/Arduino in order to become effective.

If you agree, please create a pull request to https://github.com/arduino/Arduino containing the change.

@JeroenBeemster
Copy link

2 NPN transistors did the trick See #533
I have made an example over here http://www.arduinesp.com/blink

@d-a-v
Copy link
Collaborator

d-a-v commented Nov 7, 2015

Hi,
I really like this, I can now dev from home on the chip at work.
I updated the patch above and submitted to arduino.
arduino/Arduino#4102
Credit goes not to me, but I want this included. Maybe some of you could +1 right there, or comment better than I did.

@tablatronix
Copy link
Contributor

Looks like
arduino/Arduino#4102
is in limbo ?

@d-a-v
Copy link
Collaborator

d-a-v commented Jan 14, 2016

It is now getting somewhere else. I don't know about politics, people in charge, global orientations, ...
What about a specific arduino fork for esp for making it easier to people to get things working fast ?
Would it be too much of work for maintaining ?
Has it been tried before ?

@ab3nd
Copy link

ab3nd commented Jun 9, 2016

Is the version of the development environment that had configurable DTR/RTS lines available anymore? I notice that the option is in the ESP8266 for arduino package's boards.text, but it doesn't have any effect on the IDE.

Edit: I've been reminded that I can just use screen or minicom or whatever instead of the Arduino IDE serial monitor.

@ozayturay
Copy link

Compilation instuctions in the comment #22 (comment) above updated, 1.6.11 compiled without problems and works as expected.

@d-a-v
Copy link
Collaborator

d-a-v commented Jul 18, 2017

one of the patches submitted to original arduino has just been merged (#22 (comment))
2 years later :)

@tablatronix
Copy link
Contributor

w00t!

@probonopd
Copy link
Contributor

Since there is no resetmethod=none anymore in boards.txt it looks like this will start to work in the Arduino IDE nightly builds...

@beicnet
Copy link

beicnet commented Jul 18, 2017

@d-a-v Don't worry, it's all up to date with 108 poll request! ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests