These are chat archives for esp8266/Arduino

26th
Nov 2015
brutzler
@brutzler
Nov 26 2015 00:02
was a long time offline. Still interested in OTA, I updated via boards manager to 2.0.0-rc1. Here I tried the BasicOTA-example. Compiling and flushing via serial to a NodeMCU V1.0 was working as expected. ESP is booting and connecting with a valid IP-address. But if I change to "upload using:OTA" I do not see any IP-Address in the serialport-menu.
Is OTA upload working now different as I expect, or did I forget something?
Me No Dev
@me-no-dev
Nov 26 2015 00:19
yes but not all necessary things have changed yet
we are waiting on Arduino to merge my request with fixes for the IDE
to make it work now, you need to add a blank TCP server running on port 8266
check for new client in the loop and just disconnect it
ports do not show because the IDE is testing the device for TCP connection and OTA uses UDP
after the merge and release of new IDE, you can just use the upload button as usual and no need to select OTA as upload method
brutzler
@brutzler
Nov 26 2015 00:22
hmmm ..... same "prob" as I had with the "DNS_SD_Arduino_OTA" sketch
Me No Dev
@me-no-dev
Nov 26 2015 00:23
yes
brutzler
@brutzler
Nov 26 2015 00:24
Thought I could get rid off the telnet-server :-(
Me No Dev
@me-no-dev
Nov 26 2015 00:24
you can get the prebuild IDE with the changes and start using it now
then you can get rid of the telnet server
we had some folks complain in the merge thread for various unrelated reasons, so I think Arduino team will not hurry to merge
brutzler
@brutzler
Nov 26 2015 00:26
Is this the last hourly build?
Me No Dev
@me-no-dev
Nov 26 2015 00:26
no
this is a specific build
brutzler
@brutzler
Nov 26 2015 00:27
where can I download it?
Do I have other (new) problems with the new IDE-release?
Me No Dev
@me-no-dev
Nov 26 2015 00:27
check the docs
there is a link there
make sure you close your current ide before installing this one
or sh*& will hit the fan
brutzler
@brutzler
Nov 26 2015 00:29
Oh.. I remember. already lost a lot of data with "installing" the portable some weeks ago
Is this special build still the "arduino-PR-4107-BUILD-421"?
äähmmmm any link to the docs? Always searching this stuff desperately. Do not see (imho) any central starting point for searching such stuff
Me No Dev
@me-no-dev
Nov 26 2015 00:35
yes that's the build
brutzler
@brutzler
Nov 26 2015 00:40
thx ... bookmarked. Will test it at weekend. not too much time actually.
Then lets hope for quick integration into Arduino IDE.
And is it still the same? Already having a webserver at port 80 is not enough for recognizing the board, because the IDE is waiting for port 8266?
Me No Dev
@me-no-dev
Nov 26 2015 00:43
yes
we are advertizing port 8266 as OTA port
you can change it to 80, then HTTP will be enough
void setup(){
  ....
  ArduinoOTA.setPort(80);
  ArduinoOTA.begin();
  ....
}
brutzler
@brutzler
Nov 26 2015 00:47
And with this little change I do not need the prebuild?
Me No Dev
@me-no-dev
Nov 26 2015 00:47
i'm 99% positive
brutzler
@brutzler
Nov 26 2015 00:48
not 100% ;-)
Me No Dev
@me-no-dev
Nov 26 2015 00:48
failure is always an option :)
try and youll see
brutzler
@brutzler
Nov 26 2015 00:52
that will be the game. will merge the ota-stuff into my project. and throw away the old ota stuff. but as i told...weekend.
Is the WiFiUdp.h still neccessary for ArduinoOTA?
Me No Dev
@me-no-dev
Nov 26 2015 00:52
no
brutzler
@brutzler
Nov 26 2015 00:55
then it should be removed from the ArduinoOTA example?
Me No Dev
@me-no-dev
Nov 26 2015 00:56
will be, I will add a "compatibility" example as well
brutzler
@brutzler
Nov 26 2015 00:56
??? whats that?
Me No Dev
@me-no-dev
Nov 26 2015 00:57
one with "TelenetServer"
brutzler
@brutzler
Nov 26 2015 00:59
ok. going to bed now ... 2:00 in the "morning"
siedi
@siedi
Nov 26 2015 07:18
@Links2004 great work on your http client, really appreciated. May I make a few comments / questions / suggestions for improvements
  1. The user agent is hardcoded. It doesn't check if the header is maybe added and thus sent twice (some external servers expect a certain user agent for a dumb check)
  1. from my understanding the writeToStream is blocking, means it is waiting (and blocking the main loop) until it received all the data. With a slow webserver or large data this might be a pain for the main loop. For some it is ok to wait for the http request, but if you make a regular request (e.g. I'm pooling open openweathermap) it might be good to have it kind of "asynchron". Suggestion: add it "client.handle" or whatever which can be called within the main loop + possibility to handle a callback function
siedi
@siedi
Nov 26 2015 07:24
  1. Do you plan to integrate a parsing function for the server response headers?
Once again, really appreciate your efforts in the library
(sorry, the 1. 1. 1. should read 1. 2. 3. :-))
Markus
@Links2004
Nov 26 2015 10:43

@siedi user agent can be made changeable.
writeToStream and getString are blocking yes they for easy usage if you want full control over the data flow use getStreamPtr and handle the data like you want.
https://github.com/esp8266/Arduino/blob/master/libraries/ESP8266httpClient/examples/StreamHttpClient/StreamHttpClient.ino#L66

the header from the server is parsed allready see:
https://github.com/esp8266/Arduino/blob/master/libraries/ESP8266httpClient/src/ESP8266httpClient.cpp#L521

siedi
@siedi
Nov 26 2015 11:20
@Links2004 perfect! seems like I have overlooked parts of the code....many thanks
onkelfunny
@onkelfunny
Nov 26 2015 20:16
hi @all. what is the best solution to set a unique id to a esp but the code is still the same. Is the eprom the correct solution to handle it?
maybe i can set the id with the serial to the eprom
Markus
@Links2004
Nov 26 2015 20:42
each chip has a unique id, you can access it with ESP.getChipId();
or use the mac address
onkelfunny
@onkelfunny
Nov 26 2015 21:00
i need a id like this: de_de_0990 -> load de_de config file or de_ch_1890 -> load de_ch file
the number is not important
it is not a id... it is a config identifier. 5 modules loads de_de and 5 modules load de_ch. the firmware is the same
Markus
@Links2004
Nov 26 2015 21:03
then use the filesystem or the eeprom to store the information
onkelfunny
@onkelfunny
Nov 26 2015 21:04
the filesystem is also the same... i have to json config files. i try to use the eeprom
the eprom will not overwrite if i flash a new firmware, correct?
Markus
@Links2004
Nov 26 2015 21:05
yes
onkelfunny
@onkelfunny
Nov 26 2015 21:05
ok thx!!
brutzler
@brutzler
Nov 26 2015 22:23
@me-no-dev : coming back to your 99%
the trick with ArduinoOTA.setPort(80); is not working without IDE-changes.
I had to edit the platform.txt:
tools.espota.upload.pattern="{cmd}" "{path}/espota.py" -i "{serial.port}" -p 80 -f "{build.path}/{build.project_name}.bin"
otherwise there is a "no answer"
But after this changes I was always succesfull on uploading. Only with a http-server on port 80. This was enough to recognize the board in the Arduino IDE.
I tried to change the IP of my ESP between the uploads. The IDE was always loosing the port. And I had to restart it, that there was a rescan.
Thought there is a rescan durin open IDE every x minutes, but I din't see this.
brutzler
@brutzler
Nov 26 2015 22:28
EDIT:
To be honest, I was not always succesfull on uploading:
Only the very first time, the ESP stucks:
Progress: 99%
Progress: 100%
End
 ets Jan  8 2013,rst cause:2, boot mode:(1,6)
 ets Jan  8 2013,rst cause:4, boot mode:(1,6)
wdt reset
Me No Dev
@me-no-dev
Nov 26 2015 23:14
@brutzler that first digit inthe boot mode is looking not OK
having some hardware pulling down on your GPIOs?
brutzler
@brutzler
Nov 26 2015 23:35
Yep, there is a I2C-levelshifter on D5 and D7. Added just today.
Normally the booting looks like this:
Progress: 99%
Progress: 100%
End
 ets Jan  8 2013,rst cause:4, boot mode:(3,6)
wdt reset
load 0x4010f000, len 1264, room 16
tail 0
chksum 0x42
@cp:0
ld
But as I told. This was only the very first time, After this I made about 20 flash cycles. And always working fine.
Markus
@Links2004
Nov 26 2015 23:40
may same as here #1017
brutzler
@brutzler
Nov 26 2015 23:41
@me-no-dev : You once told me there is a rescan of the IP devices from the IDE every 10 minutes. Can not see this right now. (IDE 1.6.5 + 2.0.0-rc1)
Only get a rescan on restarting the IDE
Me No Dev
@me-no-dev
Nov 26 2015 23:57
there is a bug with the IDE itself
loses devices after certain time
untill they merge my current request I'm not about to make a new one