These are chat archives for esp8266/Arduino

11th
Nov 2015
Ivan Grokhotkov
@igrr
Nov 11 2015 14:39
@projectgus thanks
I was trying to figure out why my nodemcu would sometimes end up in wrong boot mode, when I used system_sdk_restart.
Me No Dev
@me-no-dev
Nov 11 2015 14:56
@igrr did you try the test build from the IDE merge?
Ivan Grokhotkov
@igrr
Nov 11 2015 14:57
I haven't tested their build, but i cloned your branch and built locally
seemed to work well
i think i can run a test on Windows today and report in the pull request
Me No Dev
@me-no-dev
Nov 11 2015 14:59
great
hope they merge and release soon :)
brutzler
@brutzler
Nov 11 2015 22:48
using the DNS_SD_Arduino_OTA sketch I am continously loosing free memory. I took the original sketch, only masked out the part with the //IDE Monitor.
Added these two lines:
Serial.println(ESP.getFreeHeap());
delay(1000);
at the end of loop.
And I see on the serial monitor, that there are 56 bytes less every third second. Where do I loose this?
crosscheck: When I do not mask out the IDE-Monitor-Stuff, then ram stays at the same value. Can somebody explain this to me?
Me No Dev
@me-no-dev
Nov 11 2015 22:53
did you also comment the initialization of the monitor in the beggining of the sketch?
brutzler
@brutzler
Nov 11 2015 22:54
what part of the code do you exactly mean?
Me No Dev
@me-no-dev
Nov 11 2015 22:55
WiFiServer TelnetServer(aport);
WiFiClient Telnet;
then
TelnetServer.begin();
 TelnetServer.setNoDelay(true);
brutzler
@brutzler
Nov 11 2015 22:56
No, because without this I won't see the board in the network ports, or? You an igrr told me this a few days ago
Me No Dev
@me-no-dev
Nov 11 2015 22:56
if not, then the reason is that Arduino IDE is probably testing the connection to your board and you have unhandled packets
so you need to then not omment everything about IDE Monitor
and check for data and just read it and discard it
because the way that the IDE checks if your board is alive currently is to open the advertised TCP port
TCP packet header is 56 bytes
hopefully soon you will not need to do that
brutzler
@brutzler
Nov 11 2015 22:59
OK, is there a short way to discard the unreceived package? In the example sketch, there are ~20 line of code
Me No Dev
@me-no-dev
Nov 11 2015 23:00
if (TelnetServer.hasClient()) TelnetServer.available().stop();
there :) 1 line
brutzler
@brutzler
Nov 11 2015 23:01
trying right now..... brb
brutzler
@brutzler
Nov 11 2015 23:07
OK. working :smile: And its really the Arduino IDE. Because closing the IDE doesnt decrease memory any more.
Shouldn't be cleared this automatically? Is this normal, or a "bug"?
Me No Dev
@me-no-dev
Nov 11 2015 23:10
it's normal, not a bug
we do have a push request to fix that in the IDE
and updated OTA+MDNS to control it
brutzler
@brutzler
Nov 11 2015 23:11
Now I will implementate this new line into my real project-sketch. because here I have seen that i have very often a reboot, because of less memory
Me No Dev
@me-no-dev
Nov 11 2015 23:12
even after Arduino updates the IDE and you update your IDE and core, that line will not break the functionality
but keep in mind that having that "TelnetServer" wastes memory and a usable connection
brutzler
@brutzler
Nov 11 2015 23:16
Yes, but as you told me, there is no other possibility to see the network port for OTA to tell it the IDE.
I asked igrr if it is possible to give the IDE manually the IP of a board with static IP. But there is no way for this.
Me No Dev
@me-no-dev
Nov 11 2015 23:16
that is true for now
brutzler
@brutzler
Nov 11 2015 23:17
Or is there any other way for OTA in the IDE?
Me No Dev
@me-no-dev
Nov 11 2015 23:17
there is a way you can test it
but that means to reinstall ArduinoIDE
brutzler
@brutzler
Nov 11 2015 23:17
Do I need the telnet server, if I have a webserver already running on the ESP?
Me No Dev
@me-no-dev
Nov 11 2015 23:18
for now yes
brutzler
@brutzler
Nov 11 2015 23:18
Perhaps change the webserver port from 80 to 8266?
Me No Dev
@me-no-dev
Nov 11 2015 23:18
if OTA was running at port 80, then no
that can work
but web on 8266...
brutzler
@brutzler
Nov 11 2015 23:19
OTA running on port 80? Thought it needs 8266?
Me No Dev
@me-no-dev
Nov 11 2015 23:19
it's running on 8266
IF it was on 80 then yo will not need the TelnetServer
brutzler
@brutzler
Nov 11 2015 23:21
No, i copied the stuff out of the DNSSD_Arduino_OTA-sketch, and here it is
const uint16_t aport = 8266;
Me No Dev
@me-no-dev
Nov 11 2015 23:22
:D as I said
OTA runs on 8266
TelenetServer also
both run on the same port
if you move the web server to 8266, then you will not need TelenetServer
but you have to access the web at that port
brutzler
@brutzler
Nov 11 2015 23:23
Understood.
Arduino-IDE is looking at 8266 for a responding "TCP-server". This can be a telnet- or webserver right?
Me No Dev
@me-no-dev
Nov 11 2015 23:25
yes
any TCP server will do
OTA, DNS, MDNS, DHCP are all UDP
brutzler
@brutzler
Nov 11 2015 23:27
And what about to tell arduino-ide to search the esp on port 80? Then I could cancel the telnet-stuff.
Me No Dev
@me-no-dev
Nov 11 2015 23:27
you are probably usin the OTA upload method and that is locked to 8266 for now
soon none of that will be needed, but for now those are the limitations
brutzler
@brutzler
Nov 11 2015 23:28
but udp-port 8266
Me No Dev
@me-no-dev
Nov 11 2015 23:28
you are actually correct
BUT
port 80 is manually forwarded to port 22 because of old Yun firmware
that is hardcoded inside the IDE
brutzler
@brutzler
Nov 11 2015 23:29
ok then waiting for "soon" :smile:
Me No Dev
@me-no-dev
Nov 11 2015 23:30
you can have it now, but you have to be comfortable with reinstalling Arduino and using GIT to pull the latest esp core
then OTA is 3 lines
also you current sketch will not work once you get the updated core
brutzler
@brutzler
Nov 11 2015 23:34
what do I have to change in my sketch for working after update?
Me No Dev
@me-no-dev
Nov 11 2015 23:35
no way to do that :)
there are some changes in the protocol
and all OTA is handled by ArduinoOTA
brutzler
@brutzler
Nov 11 2015 23:36
ArduinoOTA is a lib?
Me No Dev
@me-no-dev
Nov 11 2015 23:36
yes
but that has also changed much from what you have
brutzler
@brutzler
Nov 11 2015 23:41
one last thought from me regarding to the actual WiFiUPD OTA.
we are using a pyton script for making the ota-upload. actually i am working always on the same esp. with a static ip. What about changing the code not to use the input-paramater <ESP_IP_address>, but writing the static ip manually into the script. Then I do not need the telnet stuff any more, because i do not have to search for the board to tell arduino-ide its IP-address.
def serve(remoteAddr, remotePort, filename, command = FLASH): is the code I think at
changing the 'remoteAddr' to e.g.192.168.1.66 ?????
only guessing. never did anything with python
brutzler
@brutzler
Nov 11 2015 23:51
Hmmm. not the right way
Me No Dev
@me-no-dev
Nov 11 2015 23:55
you are mixing upload with the ide availability check :)
you can run the python manually and use the IP you want
enable build and upload debug in arduino's preferences
run just a build, no upload
note the path to the .bin file
python [path-to]/espota.py -i [IP] -p [port] -f [bin-file]