These are chat archives for esp8266/Arduino

7th
Nov 2015
brutzler
@brutzler
Nov 07 2015 00:47
Hi, just making first steps with OTA. Flashed a NodeMCU1.0 with "DNS_SD_Arduino_OTA". After this (and restart Arduino-IDE) I see a "esp8266-ota at 192.168.1.21" in the network-ports. The serial output via console shows the same IP. When I change the port to the esp8266-ota, and starting the serial console, there is a (never bevor seen) window, which asks me for a password of the board to call the console??? I searched the sketch, but didn't find any password. Trying the WiFi-Password of my router was not the solution. Trying to call the arduino via browser (192.168.1.21:8266), I see a http-request on the serial console (via com3), but no further action in the browser window. And trying to upload a new scetch to the esp8266 over the network-port, I get a "espcomm_open failed"....Hmmm... how to get on?
brutzler
@brutzler
Nov 07 2015 00:56
And just asking myself a basic, maybe stupid, question. Flashing the ESP with the OTA-sketch, I have a board making a connection to the router with a certain IP. When I sometimes will be able to upload a new sketch OTA with an own and different Wifi-stuff, then expect to run the new sketch at the esp. How will further OTA will work? Or do I have to embedd the "DNS_SD_Arduino_OTA.ino" to my own project?
Harrison Mclean
@h4rm0n1c
Nov 07 2015 01:51
ZOMG the ESP32. Espressif, shut up and take my money!
brutzler
@brutzler
Nov 07 2015 02:13
OTA-issues: OK have seen, that I have to change "upload using" from serial to ota. Now its time to install python :-)
But still wondering about the password for the remote console :worried:
Neil Kolban
@nkolban
Nov 07 2015 02:28

Howdy folks ... I'm working with some of the folks porting Espruino (JavaScript) to the ESP8266. Espruino is written in C. We are finding that C string constants are being copied to RAM ... for example:

char *hello = "Some really, really big string ...";

ends up stealing valuable RAM. My question for y'all ... has anyone heard of a technique or possibility such that the static C Strings end up in flash memory since they are read-only to begin with?

brutzler
@brutzler
Nov 07 2015 03:20
After installing python (release 3.5/64Bit for Windows), adding the directory to path, the messages "python.exe not found" are gone. But upload is not starting. I use Arduino 1.6.5 with staging "1.6.5-1160-gef26c5f" and the DNS-SD_Arduino_OTA-Sketch on a NodeMCU 1.0.
I switched the IDE to more infos during upload and only see this line:
python.exe C:\Users\brutzler\AppData\Roaming\Arduino15\packages\esp8266\hardware\esp8266\1.6.5-1160-gef26c5f/tools/espota.py -i 192.168.1.21 -p 8266 -f C:\Users\brutzler\AppData\Local\Temp\build4645835155126156286.tmp/DNS_SD_Arduino_OTA.cpp.bin
and here we stay for ever
Jeff Eberl
@jeffeb3
Nov 07 2015 03:35
@nkolban Not a developer here, but have you seen this: https://github.com/esp8266/Arduino/blob/master/doc/reference.md#progmem
Neil Kolban
@nkolban
Nov 07 2015 03:36
@jeffeb3 Oooh ... that looks useful ... however ... the code base that I am compiling for the ESP8266 is not just for the ESP8266 and can't modify the base just for ESP ... :-(
Harrison Mclean
@h4rm0n1c
Nov 07 2015 03:37
@nkolban I can remember a lot of discussion around a macro for this. FPSTR?
I was dead on, but too late, haha.
brutzler
@brutzler
Nov 07 2015 03:40
aha....using python 2.7.2 its working now. Somewhere I read, that apple bonjour is neccessary for the OTA-Upload on Windows? Did no active install for this, bt maybe its already installed later on. Does anybody know, if really neccesarry?
And still no idea about the password for the console...HELP
Ivan Grokhotkov
@igrr
Nov 07 2015 07:30
@brutzler When you select network port, Arduino IDE thinks that you are working with Arduino Yun. So when you open serial console, it actually tries to connect to "Yun" over ssh, hence the password request. It will not be able to connect no matter what password you type, because we don't have ssh on the esp8266.
Bonjour is not necessary for OTA, because Arduino comes with its own mDNS discovery library. However if you want to use mDNS in other apps (i.e. if you want to type http://esp8266-ota.local in your browser), you need to install bonjour.
@nkolban If you can not mark string with some special attributes (like ICACHE_DATA_ATTR) because the code is shared with other platform, the only remaining option is to use unaligned read exception handler, which is used now in the esp-open-sdk and nodemcu.
brutzler
@brutzler
Nov 07 2015 08:36
@igrr Thanks for explanation. With this background, I can understand this better.
BTW: What do you think about this? http://www.esp8266.com/viewtopic.php?f=32&t=6428&sid=ebb9bd4228846e6d57a2f911b9a74a19
Me No Dev
@me-no-dev
Nov 07 2015 16:57
@igrr, I'm about done with the IDE mods to enable network ota
it's device abstracted and depends on txt data from mDNS
authentication for upload as well
Me No Dev
@me-no-dev
Nov 07 2015 18:10
@igrr me-no-dev/Arduino-1@2b75aec this is the IDE part. See if you have any comments. @Links2004 & @Makuna would love your input too
as this needs to be accepted upstream
Ivan Grokhotkov
@igrr
Nov 07 2015 21:20
@me-no-dev IDE changes look good to me
Changes in #980 are a good starting point
some things left to do:
  • call enableArduino from classes/libraries/examples which use OTA
  • do not transmit plain password over UDP. there was a discussion of a way to do secure handshake using HMACs as signatures
brutzler
@brutzler
Nov 07 2015 21:35
Looking at the DNS_SD_Arduino_OTA Example: Is there any correlation between the telnet-stuff and the appearance of the ethernet-port in the Arduino-IDE/network-ports?
Me No Dev
@me-no-dev
Nov 07 2015 21:39
@brutzler yes
Ivan Grokhotkov
@igrr
Nov 07 2015 21:39
recent versions of the IDE attempt to connect to the port advertised by the board, over TCP. if the connection fails, the board is not listed
Me No Dev
@me-no-dev
Nov 07 2015 21:40
@igrr I have the feeling we should look into upload binary or integrate OTA into esptool itself
about 60% of the updates fail for no apparent reason
Ivan Grokhotkov
@igrr
Nov 07 2015 21:41
i was just going to propose to use HTTP for OTA since it appears to work quite well
Me No Dev
@me-no-dev
Nov 07 2015 21:41
I have only STA + only OTA, nothing else, no errors
Ivan Grokhotkov
@igrr
Nov 07 2015 21:42
do you think this is some issue in python script?
Me No Dev
@me-no-dev
Nov 07 2015 21:43
I do not think it's the script itself, but rather some library along the way
there is no way HTTP will work and syncronous TCP will not
it's the same basic thing
seems like the python is missing a response from the ESP
Ivan Grokhotkov
@igrr
Nov 07 2015 21:44
that's true
Me No Dev
@me-no-dev
Nov 07 2015 21:44
will try to debug some more
Ivan Grokhotkov
@igrr
Nov 07 2015 21:44
ok, that would be cool. perhaps it's some sort of a timeout issue
Me No Dev
@me-no-dev
Nov 07 2015 21:45
well, the python is not getting the response so it timeouts but the timeout is 1 minute
i mean 10 seconds
so more than plenty
a block erase could not take that long right?
Ivan Grokhotkov
@igrr
Nov 07 2015 21:46
10 seconds is usually enough to erase 2-3Mb
brutzler
@brutzler
Nov 07 2015 21:46
Then I need both, the "WiFiServer TelnetServer(aport)" and the "WiFiClient Telnet" to see the board in the network ports? When I use this two connections, a web-server, a ntp-client... Isn't there any limitation of connections?
Ivan Grokhotkov
@igrr
Nov 07 2015 21:47
@me-no-dev did you check with wireshark if the response from ESP is actually sent?
Me No Dev
@me-no-dev
Nov 07 2015 21:47
will do fulldebug on all ends now
Ivan Grokhotkov
@igrr
Nov 07 2015 21:47
@brutzler WiFiClient Telnet gets initialised only when a client connects, so most of the time it's only TelnetServer which is using one TCP pcb
this is less than ideal, but currently that's the way...
brutzler
@brutzler
Nov 07 2015 21:52
When I first upload the complete sketch, and second upload the sketch without the telnet-stuff, then I am still able to upload a third time. Even if I do not see the board in the network ports. It is stored in the IDE. Only if I change from ota to serial and back I loose the IP-address. If I could input the IP manually (because the ESP has a static one, and I know it) then i wouldn't need the Telnet-Stuff. Any possibility for this?
Me No Dev
@me-no-dev
Nov 07 2015 21:52
@igrr ACK is sent, but not received by python
tcpdump shows that it reaches thecomputer
Ivan Grokhotkov
@igrr
Nov 07 2015 21:54
@brutzler no possibility for this in the IDE but you can always run espota.py manually if you happen to know IP address
@me-no-dev ok, that's a relief. i was prepared to face another weird network issue on the 8266 side.
Me No Dev
@me-no-dev
Nov 07 2015 21:55
oh
you know what...
ACK is sent, but it does not send the response that it had written thebytes to the flash
so it is the ESP
Ivan Grokhotkov
@igrr
Nov 07 2015 21:57
enable DEBUG_UPDATER and check return code from ESP.flashWrite?
sorry have to go now. getting up early tomorrow.
brutzler
@brutzler
Nov 07 2015 22:03
Is the recognizing of the board only possible if the ESP is using DHCP?
I tried to add:
IPAddress ip(192,168,1,66);
IPAddress gateway(192,168,1,1);
IPAddress subnet(255,255,255,0);
and
WiFi.config(ip,gateway,subnet);
The result was, that the IDE didn't find the board any more....
Me No Dev
@me-no-dev
Nov 07 2015 22:12
@igrr here is what I observe, and you will not like it :)
at random point, the ESP as I said, sends ACK but no response data
and funny enough, as soon as the computer sends FIN because of the timeout, the ESP responds with the needed packet
tried altering the timeout and it always responded exactly there
so the ESP for some reason hangs and waits for another packet from the other end
brutzler
@brutzler
Nov 07 2015 22:22
OK, I have seen, that a change of the IP-address needs a restart of the Arduino IDE, to see the board with its new IP under network-ports. Helpful to know this....
Me No Dev
@me-no-dev
Nov 07 2015 22:41
no need to restart if you do not notice for 10 minutes, then it should generally refresh the mDNS
brutzler
@brutzler
Nov 07 2015 22:45
Ok, thx for info..... but...10min... a lot of time for a impatient programmer ;-)
Me No Dev
@me-no-dev
Nov 07 2015 22:51
@igrr I think I fixed it ;) small change to the updater. yield is not enough :D