These are chat archives for esp8266/Arduino

17th
Jan 2016
Me No Dev
@me-no-dev
Jan 17 2016 02:41
@celsworth ArduinoOTA.handle() is currently needed only because the download-firmware part of it is using the regular blocking Client (which needs to run on the loop thread) and because of the progress callbacks. If we do not care about those and have free tcp spot to allocate the necessary client, then we can get rid of it and go async. As for the AIO automation, I pointed some problematic cases here https://github.com/esp8266/Arduino/issues/1452#issuecomment-172283296
Chris Elsworth
@celsworth
Jan 17 2016 02:51
@me-no-dev oh nice. to be honest I agree with Tony (latest reply on that issue).. I don't think its a good idea, I was just looking how it could be done
Tony
@toxuin
Jan 17 2016 02:51
yaay!
Chris Elsworth
@celsworth
Jan 17 2016 02:52
I probably shouldn't have encouraged it at the time ;)
Tony
@toxuin
Jan 17 2016 02:53
Oh come on, that brought us an OTA process that is THAT easy (for end-user I mean).
Chris Elsworth
@celsworth
Jan 17 2016 02:54
no I meant earlier today when this was raised and I looked to see how it could theoretically be done (the automation of it)
Tony
@toxuin
Jan 17 2016 02:54
oh ^_^
Aditya Tannu
@AdySan
Jan 17 2016 02:55
tried to install PlatformIO for the first time today, while installing the platform espressif, it crashed at this
xtensa-lx106-elf-g++ -o .pioenvs/nodemcu/FrameworkArduino/FS.o -c -fno-rtti -fno-exceptions -std=c++11 -Os -mlongcalls -mtext-section-literals -falign-functions=4 -U__STRICT_ANSI__ -ffunction-sections -fdata-sections -MMD -DF_CPU=80000000L -D__ets__ -DICACHE_FLASH -DESP8266 -DARDUINO_ARCH_ESP8266 -DARDUINO_ESP8266_ESP12 -DARDUINO=200 -I/Users/adityatannu/.platformio/packages/framework-arduinoespressif/tools/sdk/include -I.pioenvs/nodemcu/FrameworkArduino -I.pioenvs/nodemcu/FrameworkArduinoVariant .pioenvs/nodemcu/FrameworkArduino/FS.cpp
src/tmp_ino_to.cpp:29:26: fatal error: JsonListener.h: No such file or directory
#include <JsonListener.h>
^
compilation terminated.
scons: *** [.pioenvs/nodemcu/src/tmp_ino_to.o] Error 1
Chris Elsworth
@celsworth
Jan 17 2016 02:55
I think its the start of a slippery slope, where does it end? should we put a webserver hidden away as well just in case a user wants it? ;)
Aditya Tannu
@AdySan
Jan 17 2016 02:55
this is a PlatformIO problem, am I right?
Tony
@toxuin
Jan 17 2016 02:56
I like it how it is now: you need something -> you include a header file and 2-3 calls at the right places. I haven’t encounter a case where I cannot do that because of architectural problems.
Me No Dev
@me-no-dev
Jan 17 2016 02:59
just needs to go async :) now it depends on calling handle() often
Chris Elsworth
@celsworth
Jan 17 2016 03:02
that would be nice.. though I don't get how it would work ;) what would accept a new client and handle data?
Me No Dev
@me-no-dev
Jan 17 2016 03:03
there is no client to accept
the udp server listens for the PC to send request
Chris Elsworth
@celsworth
Jan 17 2016 03:03
oh, espota.py is udp? assumed it was tcp
so it just registers a callback for that socket?
Me No Dev
@me-no-dev
Jan 17 2016 03:03
then the ESP shuts UDP down (and all TCP clients) and opens a connection to the PC
Chris Elsworth
@celsworth
Jan 17 2016 03:03
ahh, got it
Me No Dev
@me-no-dev
Jan 17 2016 03:04
and uses that to download the firmware from the conputer
so instead of opening a regular blocking client, we will open an async one and feed the data when it comes
then reboot
if you do not assign callbacks for progress, you ewill not need to worry about ArduinoOTA.handle()
sticilface
@sticilface
Jan 17 2016 07:49
What is the accepted method for obtaining a pointer of a derived class from a base class?
derived *p1 = static_cast<derived *> (base*); works but when i try to use dynamic_cast<>() i get a compiler error effects.ino:584:72: error: 'dynamic_cast' not permitted with -fno-rtti so is it considered ok to use static_cast if you know the type?
Michael Miller
@Makuna
Jan 17 2016 07:55
Yes it is ok, dynamic cast is useful for runtime checks of the types, as it does extra work, static cast does not do run time checking, so if you make a mistake, it can do some interesting things.
sticilface
@sticilface
Jan 17 2016 08:01
cool thanks. working this out has made my life a lot simpler. I was having to create far to many virtual functions in my base class. can we use dynamic_cast at all, or is it disabled, (i.e. what is the meaning of -fno-rtti?
sticilface
@sticilface
Jan 17 2016 08:06
don't worry, google answered that.
Helio Machado
@crushedice2000
Jan 17 2016 10:26
Good morning/noon!
probonopd
@probonopd
Jan 17 2016 11:53
hello all. does serial upload on linux work in the latest git version using the latest nightly IDE for anyone?
for me it seems to do very strange things, to the point that the /dev/USB0 device just disappears from /dev
I am using a Silabs cp210x
Helio Machado
@crushedice2000
Jan 17 2016 12:13
@probonopd: Could you provide me a link to download? I could test it on my Ubuntu Trusty box.
Helio Machado
@crushedice2000
Jan 17 2016 12:23
This message was deleted
but you can also use the "hourly" download from arduino.cc
Helio Machado
@crushedice2000
Jan 17 2016 12:49
@probonopd: I'll test.
probonopd
@probonopd
Jan 17 2016 12:49
thanks
Helio Machado
@crushedice2000
Jan 17 2016 12:49
7m remaining for download.
probonopd
@probonopd
Jan 17 2016 12:50
AppImages are a little side project of mine: just download, chmod a+x, runs. :-)
Linus seems to like them :-)
Helio Machado
@crushedice2000
Jan 17 2016 12:51

@probonopd: My workflow is a bit different:

strings YourAppImage | less
./YourAppImage

:smiling_imp:

probonopd
@probonopd
Jan 17 2016 12:51
in the AppImage above, I bundled the latest IDE with the latest esp8266/Arduino from git
good :-)
you can also loop-mount the AppImage as an ISO file and inspect its innards
Helio Machado
@crushedice2000
Jan 17 2016 12:52
@probonopd: Your project is very cool and awesome!
probonopd
@probonopd
Jan 17 2016 12:52
thanks @crushedice2000
these AppImages get built in the cloud on travis-ci in an entirely automated process
there is also a "delta updater" that can download just the blocks that have changed from the last version
Helio Machado
@crushedice2000
Jan 17 2016 12:55
@probonopd: This looks promising. Maybe @ivankravets is interested on that to bundle the latest platformio.
probonopd
@probonopd
Jan 17 2016 12:56
well i'm definitely interested in platformio but the tab system in atom just drives me nuts.
make me feel like a 3 year old who is in front of a computer for the first time.
Helio Machado
@crushedice2000
Jan 17 2016 12:57
@probonopd: What would you prefer?
probonopd
@probonopd
Jan 17 2016 12:57
tabs that work like in the browser? not tabs with some strange notion of split windows?!
(we're getting OT ;-))
bundling it should be no problem
Helio Machado
@crushedice2000
Jan 17 2016 12:59

@probonopd: Not so strange for me, however that is so personal. Maybe you prefer vi and PIO command-line tool?

Off-topic is good sometimes.

probonopd
@probonopd
Jan 17 2016 13:00
no i'd like a GTK or QT app with good code completion dropdowns etc.
probably i'd go for the netbeans c thing
if it was open source
Helio Machado
@crushedice2000
Jan 17 2016 13:02

@probonopd: Impressive! Arduino opens faster than the normal installation.

Netbeans, mono, anjuta, codeblocks and eclipse give me urticaria. I'm a UX maniac

probonopd
@probonopd
Jan 17 2016 13:02
they have a free version for python and it really makes me productive :) but I guess that's a matter of personal preference
@crushedice2000 that's because it's compressed
less to do for the HD
Helio Machado
@crushedice2000
Jan 17 2016 13:04
@probonopd:
processing.app.debug.RunnerException
    at cc.arduino.packages.uploaders.SerialUploader.uploadUsingPreferences(SerialUploader.java:179)
    at cc.arduino.UploaderUtils.upload(UploaderUtils.java:78)
    at processing.app.Sketch.upload(Sketch.java:1178)
    at processing.app.Sketch.exportApplet(Sketch.java:1152)
    at processing.app.Sketch.exportApplet(Sketch.java:1124)
    at processing.app.Editor$DefaultExportHandler.run(Editor.java:2417)
    at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.NullPointerException
    at java.lang.String.replace(String.java:2240)
    at processing.app.helpers.StringReplacer.replaceFromMapping(StringReplacer.java:97)
    at processing.app.helpers.StringReplacer.replaceFromMapping(StringReplacer.java:89)
    at processing.app.helpers.StringReplacer.formatAndSplit(StringReplacer.java:37)
    at cc.arduino.packages.uploaders.SerialUploader.uploadUsingPreferences(SerialUploader.java:174)
    ... 6 more
probonopd
@probonopd
Jan 17 2016 13:04
yes...
Helio Machado
@crushedice2000
Jan 17 2016 13:05
@probonopd: USB0 remains on /dev
probonopd
@probonopd
Jan 17 2016 13:05
can you make it more verbose?
Helio Machado
@crushedice2000
Jan 17 2016 13:05
Trying to show the full error.
probonopd
@probonopd
Jan 17 2016 13:05
yes
Helio Machado
@crushedice2000
Jan 17 2016 13:10
@probonopd: I don't see a easy way of expanding that. Maybe someone here understand Java? I only Python ans Bash ;) C/++ badly.
@probonopd: I'm sorry, I can't help you. However maybe someone of @/all these people here can help you. :worried:
probonopd
@probonopd
Jan 17 2016 13:20
go to preferences -> check both checkmarks for verbosity during compile and upload
@crushedice2000
Helio Machado
@crushedice2000
Jan 17 2016 13:20
@probonopd: The same output.
probonopd
@probonopd
Jan 17 2016 13:21
that's not much :) but the same I'm getting
just to verify, could you do the same without the AppImage?
Helio Machado
@crushedice2000
Jan 17 2016 13:21
@probonopd: What do you mean?
probonopd
@probonopd
Jan 17 2016 13:22
download the IDE from arduino.cc and install the ESP stuff from GIT
rather than using my bundled version
because at least for me the error seems to be there as well
Helio Machado
@crushedice2000
Jan 17 2016 13:23
@probonopd: Ok, I'll do it after lunch.
This message was deleted
probonopd
@probonopd
Jan 17 2016 13:23
cool. thanks @crushedice2000
Sven Eliasson
@comino
Jan 17 2016 13:36
as you were talking about the jetbrains ide - is anyone using sublime codecodecompletion plugin or visual studio ?
tzapu
@tzapu
Jan 17 2016 13:36
hey guys, is there any reason why IPAddress does not have all the features of the arduino variant ? https://github.com/arduino/Arduino/blob/master/hardware/arduino/avr/cores/arduino/IPAddress.cpp
probonopd
@probonopd
Jan 17 2016 13:44
@comino I am going to try visual studio code now
Sven Eliasson
@comino
Jan 17 2016 14:03
A good working code completion would make me so much more productive. Visual Studio code completion seems not to work like I expect :/
ystrem
@ystrem
Jan 17 2016 14:10
@comino What about Eclipse + CDT ?
probonopd
@probonopd
Jan 17 2016 14:12
why is it so hard to add code completion to the Arduino IDE?
and dependency checking + automatic library downloading from github :)
anyway, need to reboot
Chris Elsworth
@celsworth
Jan 17 2016 14:15
@probonopd personally I feel the term IDE is done a dis-service by Arduino IDE even using it, its terrible :)
Sven Eliasson
@comino
Jan 17 2016 14:22
I dont like ecplise :/
trying clion
Martin Ayotte
@martinayotte
Jan 17 2016 14:32
@tzapu , simply that the commit from arduino/Arduino@e3909b4 has been added well after the ESP version. Maybe we can add those fromString() to ESP.
ystrem
@ystrem
Jan 17 2016 14:33
I think that the will be new IDE based on Brackets
and new Uno with integrated ESP :D
Chris Elsworth
@celsworth
Jan 17 2016 14:38
but with an esp you don't need an arduino :)
Me No Dev
@me-no-dev
Jan 17 2016 14:42
exactly :D
Martin Ayotte
@martinayotte
Jan 17 2016 14:46
@tzapu , I've merged the IPAddress change and sent a PR.
ystrem
@ystrem
Jan 17 2016 14:48
don't tell me :D
probonopd
@probonopd
Jan 17 2016 14:51
uno with esp sounds like overkill to me
probably overpriced anyway. i like the esp23e 3 usd modules :-)
Sven Eliasson
@comino
Jan 17 2016 14:52
sounds useless to me
probonopd
@probonopd
Jan 17 2016 14:52
12e actually
yes
and as for musto, oh well. i guess i've started a flamewar in their github issues ;-)
arduino-org/Arduino#2
tzapu
@tzapu
Jan 17 2016 14:55
@martinayotte wow, thanks
this community is f ing awesome
probonopd
@probonopd
Jan 17 2016 14:56
anyone around who is using platformio?
Chris Elsworth
@celsworth
Jan 17 2016 14:56
yup.
probonopd
@probonopd
Jan 17 2016 14:56
how do i make it use esp8266/Arduino git head?
Chris Elsworth
@celsworth
Jan 17 2016 14:57
you need to clone the tree and put it in .platformio/packages/framework-arduinoespressif
probonopd
@probonopd
Jan 17 2016 14:57
thanks @celsworth
Chris Elsworth
@celsworth
Jan 17 2016 14:58
then there's some minor fix-up to be done (make a dummy version.txt, from what I remember)
probonopd
@probonopd
Jan 17 2016 15:01
echo "2.0.0" > .platformio/packages/framework-arduinoespressif/version.txt
seems to do the trick
but compilation fails with
.platformio/packages/framework-arduinoespressif/tools/sdk/lib/libcrypto.a(aes-internal.o):(.irom0.text+0x0): undefined reference to `rcons'
collect2: error: ld returned 1 exit status
scons: * [.pioenvs/esp12e/firmware.elf] Error 1
may need to do the ldscripts bit
probonopd
@probonopd
Jan 17 2016 15:03
(trying to compile ArduinoOTA)
awesome!
compiling
probonopd
@probonopd
Jan 17 2016 15:08
is it just me or does this compile much faster than the IDE?
ystrem
@ystrem
Jan 17 2016 15:09
yep in Eclipse much faster
Chris Elsworth
@celsworth
Jan 17 2016 15:09
@probonopd it only compiles what changed, I think the IDE blats and starts over every time
probonopd
@probonopd
Jan 17 2016 15:12
wow.
i start to like it :)
Helio Machado
@crushedice2000
Jan 17 2016 15:25

I'll be busy now, then available again at 19:00 or so.

@probonopd: Later I'll try that 4u
@tzapu: Could you explain me how to use IPAddress::fromString?

Martin Ayotte
@martinayotte
Jan 17 2016 15:33
@crushedice2000 , until today, I didn't notice that fromString() was added for AVR, but it can be usefull for web form where there is a field for static IP and don't want to parse it, IPAddress class will parse it for you.
Please, note that I didn't try it out, simply merged from AVR to ESP
tzapu
@tzapu
Jan 17 2016 16:16
@crushedice2000 will try in a bit, but i assume you make a new ipaddress and use fromString on it
tzapu
@tzapu
Jan 17 2016 16:30
@crushedice2000 this seems to work for me, not sure if there s a better way
 IPAddress ip;
  ip.fromString("10.1.2.3");
  Serial.println(ip);
probonopd
@probonopd
Jan 17 2016 16:31
is anyone using atom platformio with working code completion?
i think i have done everything but it does not do code completion
OTA works though
ystrem
@ystrem
Jan 17 2016 16:32
@probonopd Are you on windows ?
probonopd
@probonopd
Jan 17 2016 16:32
linux
have installed clang
do i need to edit some configs?
ystrem
@ystrem
Jan 17 2016 16:32
sry don't know I'm on windows and don't use it
probonopd
@probonopd
Jan 17 2016 16:34
aaah i need to manually install the clang-autocomplete package
tzapu
@tzapu
Jan 17 2016 16:49
maybe one of you more knowleadgeable people can help me
i m using ArduinoJson, i have a const char *static_ip = "10.0.1.56"; declared
then later one i am assigning static_ip a value from the json
static_ip = json["ip"];
and even later i am trying to use it, and it seems to contain some other location of memory, one that s used by a string in a library somehow
so i assume i need to copy the json value string over, but not sure how...
probonopd
@probonopd
Jan 17 2016 16:53
...and need to rename the .ino to .cpp :-(
for autocompletion to towk
to work
Me No Dev
@me-no-dev
Jan 17 2016 16:56
char *ip_address;
const char*default_ip = "10.0.1.56";

void setup(){
  ip_address = new char[16];
  sprintf(ip_address, "%s", default_ip);
  //or
  strcat(ip_address, default_ip);
  //or
  memcpy(ip_address, default_ip, strlen(default_ip));
  ip_address[strlen(default_ip)] = 0; //terminate
}
same for the one from json
tzapu
@tzapu
Jan 17 2016 16:58
i ve used this strcpy((char *)static_ip, json["ip"]); and seems to do the trick
but not sure it s ok really
i nver understood const char and char
so that typecast that makes it work... in my example, something gives me a feeling it s not right..
@mozgy they seem to be using an array and iterator as it s shown in 'avoiding pitfalls' of arduinojson, thanks
@me-no-dev is const char* something you should never write to?
tzapu
@tzapu
Jan 17 2016 17:05
without const as your example shows, these both work, thanks
            strcpy(static_ip, json["ip"]);
            strcat(static_ip, json["ip"]);
is there one that s better than the other?
Chris Elsworth
@celsworth
Jan 17 2016 17:05
strcpy always copies to start of string, strcat appends to it
if static_ip is empty, they're equivalent
tzapu
@tzapu
Jan 17 2016 17:05
which in my case it isn't just noticed, cheers
Chris Elsworth
@celsworth
Jan 17 2016 17:06
be careful that static_ip has enough space to copy the contents of json["ip"] or you'll get overflows that cause very hard to track-down bugs :)
this is especially the case if the json is coming from some untrusted source (ie anything you didn't generate)
Helio Machado
@crushedice2000
Jan 17 2016 17:08
I'm here again! @probonopd: Downloading nightly ide...
tzapu
@tzapu
Jan 17 2016 17:08
i generate it, but of course, anything could happen to it
how can i check static_ip has enough space?
does it init it to the size of the original?
Chris Elsworth
@celsworth
Jan 17 2016 17:09
well, if you're doing new char[16] then it has 16 bytes
so before copying I would check that strlen(json["ip"]) is 16 or lower :)
Helio Machado
@crushedice2000
Jan 17 2016 17:10
@tzapu: Thanks for the IP example!
tzapu
@tzapu
Jan 17 2016 17:11
ok... hard to assign legths for custom variables in my case, but i ll see how to make it
thank you very much, it helps a lot
@crushedice2000 no probs
Chris Elsworth
@celsworth
Jan 17 2016 17:11
if you don't know the size then do strlen first, then new char[size] where size is the result of the strlen
tzapu
@tzapu
Jan 17 2016 17:12
that would be a way, i was just resizing the variables containing the default values
Chris Elsworth
@celsworth
Jan 17 2016 17:12
then you know it has enough space. but again, it would be wise to check that size isn't huge.. or you'll run out of memory. checks and safeguards like these are the cornerstone of any C/C++ programming :)
Mario Mikočević
@mozgy
Jan 17 2016 17:12
size + 1 for \00 if you're doing any String.xx
Chris Elsworth
@celsworth
Jan 17 2016 17:12
right right :)
tzapu
@tzapu
Jan 17 2016 17:12
yeah...i probably left the c++ world 15 years ago , because of all this :))
malloc and all that crap
Mario Mikočević
@mozgy
Jan 17 2016 17:13
json is not always string+\00
tzapu
@tzapu
Jan 17 2016 17:16
can you define a size when declaring like this
char *static_ip = "10.0.1.5";
?
Mario Mikočević
@mozgy
Jan 17 2016 17:17
yes, thats defined size
tzapu
@tzapu
Jan 17 2016 17:17
i meant a bigger size than the actual legth of the string delcared
declared*
Mario Mikočević
@mozgy
Jan 17 2016 17:18
char statip_ip[1024] = "short_len_str";
tzapu
@tzapu
Jan 17 2016 17:18
thanks
ha! worked! amazing. thanks guys, much appreciated
Helio Machado
@crushedice2000
Jan 17 2016 17:24
@allthejsonusers: Should I close the SPIFFS file once written data? Strange things are happening!
tzapu
@tzapu
Jan 17 2016 17:24
yes
:)
it doesn t write it if the destructor is not called i think
Helio Machado
@crushedice2000
Jan 17 2016 17:25
@tzapu: Why then ConfigFile.ino doesn't?
tzapu
@tzapu
Jan 17 2016 17:25
hold one, i know i worked it out last time
lemme look
i think that when loadConfig exits it triggers the close
for me, in setup, the only way to make it actually write was to close the file
would not do what it should of any other way
Helio Machado
@crushedice2000
Jan 17 2016 17:28

@tzapu: My spiffs breaks once I reset the device.

bool config_write() {
  DynamicJsonBuffer jsonBuffer;
  File configFile = SPIFFS.open("/config.json", "w");
  if(!configFile) Serial.println("No confile on write. Hwat?"); return false;
  JsonObject& root = jsonBuffer.createObject();
                  root["brightness"] = brightness;
                  Serial.print("json write:");
                  Serial.println(brightness);
  root.printTo(configFile);
  return true;
}

Is that good? Now index.html point to config.json and config.json seems empty.

Should I flush before close?
tzapu
@tzapu
Jan 17 2016 17:28
try it with a close before return
son.printTo(configFile);
configFile.close();
that s from mone
Helio Machado
@crushedice2000
Jan 17 2016 17:29
@tzapu: Flashing...
tzapu
@tzapu
Jan 17 2016 17:29
i also do a json.printTo(Serial); to see the json is what it should
before the printTo(configFile)
Helio Machado
@crushedice2000
Jan 17 2016 17:30
@tzapu: This happens:
Calling write
Write done
Calling write
Write done
Calling write
No confile on write. Hwat?
Write done
Calling write
No confile on write. Hwat?
Write done
Calling write
No confile on write. Hwat?
Write done
Calling write
No confile on write. Hwat?
Write done
Calling write
No confile on write. Hwat?
Write done
Mario Mikočević
@mozgy
Jan 17 2016 17:30
json.prettyPrintTo( Serial ); is better :p :)
tzapu
@tzapu
Jan 17 2016 17:30
ah! didn t know that existed
Helio Machado
@crushedice2000
Jan 17 2016 17:31
@mozgy @tzapu: :small_red_triangle: Trying!
tzapu
@tzapu
Jan 17 2016 17:32
i also had some issues until i swapped spiff sizes and format
but that s just grasping for straws i guess
it would not open the file like yours seems to...
Helio Machado
@crushedice2000
Jan 17 2016 17:33
@tzapu: Why?
tzapu
@tzapu
Jan 17 2016 17:33
well, first time i tried spiffs, i couldn t get it to do anything, it would error on open file for read or write
so i think i just changed spiff from 1 m to 3m and did a SPIFFS.format(); before begin and after that i didn t have any more problems
but i don t know if things just happened, or it actually helped with anything
Helio Machado
@crushedice2000
Jan 17 2016 17:35
@tzapu: I can't format it because contains html&js&css that shouldn't be removed. However I'll grow the spiffs.
tzapu
@tzapu
Jan 17 2016 17:35
you are not even getting to the writing part
only on the first two tries
Helio Machado
@crushedice2000
Jan 17 2016 17:42

@tzapu: My fault:

if(!configFile) Serial.println("No confile on write. Hwat?"); return false;

means IF NOT configFile THEN PRINT "ERROR"; RETURN 0 and not IF NOT configFile THEN PRINT "ERROR" ALSO RETURN 0

So the return is executed also if the cofigFile exists

FWeinb
@FWeinb
Jan 17 2016 17:43
Does someone know a tiny templating language for embedded devices?
Helio Machado
@crushedice2000
Jan 17 2016 17:43
@FWeinb: What is templating?
tzapu
@tzapu
Jan 17 2016 17:43
curly brackets strike again
i assume stuff like <html>{var}</html>
FWeinb
@FWeinb
Jan 17 2016 17:44
Something like: http://handlebarsjs.com/
tzapu
@tzapu
Jan 17 2016 17:44
and it replaces values for you
FWeinb
@FWeinb
Jan 17 2016 17:44
Yeah.
tzapu
@tzapu
Jan 17 2016 17:44
i looked for one at some point, for some lightweight version, but didn t find any
Helio Machado
@crushedice2000
Jan 17 2016 17:44
@FWeinb: I don't know. Maybe plain c++?
FWeinb
@FWeinb
Jan 17 2016 17:44
I would really like something that compiles to c or something.
tzapu
@tzapu
Jan 17 2016 17:46
if you do find something, let us know :P
FWeinb
@FWeinb
Jan 17 2016 17:47
This looks interesting: https://github.com/vmg/crustache
probonopd
@probonopd
Jan 17 2016 17:48
@crushedice2000 how did it go?
Helio Machado
@crushedice2000
Jan 17 2016 17:49
@probonopd: Downloadig, damn slow.
tzapu
@tzapu
Jan 17 2016 18:00
good night everyone
Helio Machado
@crushedice2000
Jan 17 2016 18:00
@tzapu: Good night! What TZ?
tzapu
@tzapu
Jan 17 2016 18:04
gmt +2, just retreating from active life :P
Helio Machado
@crushedice2000
Jan 17 2016 18:05
@tzapu: Ok, simple and unhealthy curiosity. :worried:
tzapu
@tzapu
Jan 17 2016 18:06
:)))))
Helio Machado
@crushedice2000
Jan 17 2016 18:07


    Malawi
    Burundi
    Egypt
    Botswana
    Zimbabwe
    South Africa
    Rwanda
    Zambia

    Mozambique
    Lesotho
    Swaziland
    Libya
    Namibia
    Jordan
    Lebanon
    Syria

    Palestine
    Israel
    Cyprus
    Greece
    Romania
    Moldova
    Finland
    Turkey

    Ukraine
    Aaland Islands
    Latvia
    Bulgaria
    Estonia
    Lithuania
probonopd
@probonopd
Jan 17 2016 18:15
@crushedice2000 please comment on esp8266/Arduino#1453 - it helps if this can be verified by more persons than just me
thanks!
FWeinb
@FWeinb
Jan 17 2016 18:24
There must be someone that wrote a simple templating language for embedded devices...
probonopd
@probonopd
Jan 17 2016 18:34
thanks @crushedice2000
Helio Machado
@crushedice2000
Jan 17 2016 18:41
@probonopd: u r welcome!
Martin Ayotte
@martinayotte
Jan 17 2016 18:52
@tzapu , the changes for IPAddress has been merged ... BTW, for your example you've provide, the fromString() was not needed, although useful as I said for WebPage IP field :
IPAddress ip(10, 1, 2, 3);
Serial.println(ip.toString());
Helio Machado
@crushedice2000
Jan 17 2016 19:11
Only a question: How could I get a unique identifier for my ESP?
Chris Elsworth
@celsworth
Jan 17 2016 19:13
getChipId is about as good as it gets
Helio Machado
@crushedice2000
Jan 17 2016 19:13
@celsworth: Thanks!
Helio Machado
@crushedice2000
Jan 17 2016 20:29
Is there any better webserver than ESP8266WebServer? (fully async and multi-client)
FWeinb
@FWeinb
Jan 17 2016 20:36
There is this one https://github.com/bjpirt/esphttpd but not arduino compatible.
Helio Machado
@crushedice2000
Jan 17 2016 20:38
@FWeinb: Thanks! This looks good, however is out-of-scope for me (as this project seems a entire firmware instead of library) :smile_cat: Also not Arduino
Only a question: The int size on the ESP is 16 or 32?
Markus
@Links2004
Jan 17 2016 20:39
32bit
Helio Machado
@crushedice2000
Jan 17 2016 20:39
@Links2004: Thanks!
Helio Machado
@crushedice2000
Jan 17 2016 20:42
@Links2004: Thanks again! :smile:
FWeinb
@FWeinb
Jan 17 2016 20:42
Will this be integrated into the core?
Markus
@Links2004
Jan 17 2016 20:43
when @me-no-dev say its stable and start a pull request yes :)
FWeinb
@FWeinb
Jan 17 2016 20:43
That sound great.
Helio Machado
@crushedice2000
Jan 17 2016 20:44
@Links2004 @me-no-dev: Great!
Helio Machado
@crushedice2000
Jan 17 2016 20:51
Look at my essid generator! that's weird! (but works)
unsigned int uuid = ESP.getChipId() ^ 0x2BEC6;
String ssid = String(uuid);
The xor value is crafted to reveal my ESP ssid as 0x000001
:smiling_imp:
Me No Dev
@me-no-dev
Jan 17 2016 20:59
@crushedice2000 @FWeinb @Links2004 the server seems really stable :) maybe needs a shorter name :D
Helio Machado
@crushedice2000
Jan 17 2016 21:00
@me-no-dev: I propose 8266WebServer
Me No Dev
@me-no-dev
Jan 17 2016 21:01
well it runs on ESP32 as well :P
Helio Machado
@crushedice2000
Jan 17 2016 21:01
@me-no-dev: Then ESPwebServer
FWeinb
@FWeinb
Jan 17 2016 21:02
Yeah. ESPWebServer sounds good
Chris Elsworth
@celsworth
Jan 17 2016 21:02
thats too similar to the existing one.
ESP8266WebServer or ESPWebServer, confusing
Me No Dev
@me-no-dev
Jan 17 2016 21:03
maybe AWebServer :D
Helio Machado
@crushedice2000
Jan 17 2016 21:03
Maybe we could do a brainstorming. Your web server seems (light-years) more capable than the existing one. What about replacing?
FWeinb
@FWeinb
Jan 17 2016 21:03
I thougt it will be merged?
Me No Dev
@me-no-dev
Jan 17 2016 21:03
I was brainstorming over making it use 100% the same API
Chris Elsworth
@celsworth
Jan 17 2016 21:03
replacing = breaking everyones existing code :(
that would be good
Me No Dev
@me-no-dev
Jan 17 2016 21:03
then it should not break the existing code
Helio Machado
@crushedice2000
Jan 17 2016 21:03
@celsworth: :smile:
Chris Elsworth
@celsworth
Jan 17 2016 21:03
drop-in replacement
FWeinb
@FWeinb
Jan 17 2016 21:04
But it is a breaking update. So breaking things is okay?
Chris Elsworth
@celsworth
Jan 17 2016 21:04
uhh..
Helio Machado
@crushedice2000
Jan 17 2016 21:04
@me-no-dev: Would be factible to do dummy functions for a compatibility layer?
Me No Dev
@me-no-dev
Jan 17 2016 21:04
have to see if it can be done though and to what extend
Chris Elsworth
@celsworth
Jan 17 2016 21:05
when is breaking things ever okay? :D
Me No Dev
@me-no-dev
Jan 17 2016 21:05
for most part it's doable, there are some edge cases to check
Markus
@Links2004
Jan 17 2016 21:05
if its in the core we can remove the old one, on a stable release.
FWeinb
@FWeinb
Jan 17 2016 21:05
Isnt the next release a major version bump?
Chris Elsworth
@celsworth
Jan 17 2016 21:05
next is 2.1.0
removing things should basically be a 3.0.0
FWeinb
@FWeinb
Jan 17 2016 21:06
Oh. Than breaking is out of question.
Me No Dev
@me-no-dev
Jan 17 2016 21:06
maybe we need to branch a prep for 3.0.0 and see how much we can get it to be the same
I'm positive we can do all network and services to be async
FWeinb
@FWeinb
Jan 17 2016 21:07
yeah a general cleanup would be great.
Markus
@Links2004
Jan 17 2016 21:07
some times updates, are incompatible but I think the benefit of Aaync are big, and most people will use it when its there.
until 3.0 we can keep both in the git.
and the user can select what he like.
Chris Elsworth
@celsworth
Jan 17 2016 21:08
+1. I'm all for improving, but people don't expect to have to majorly change their sketch for a .1 update
just a bad user experience.
FWeinb
@FWeinb
Jan 17 2016 21:08
yeah for the minor update there shoukd not be any breaking changes.
Me No Dev
@me-no-dev
Jan 17 2016 21:08
I would love you to pitch in a WebSocket plugin :) @Links2004
Chris Elsworth
@celsworth
Jan 17 2016 21:08
I don't know if this project sticks to semantic versioning or not, but what works in 2.0.0 should work in 2.x.x
Me No Dev
@me-no-dev
Jan 17 2016 21:09
maybe getting it into the core will get that :P
Markus
@Links2004
Jan 17 2016 21:10
@celsworth yes until 3.0 release we shut keep both inside the core (first the great async work from me-no-dev need to be there;) .
if we reach 3.0 it be well tested, and many user will know it, so the step will be less tragic.
FWeinb
@FWeinb
Jan 17 2016 21:12
I like that!
Markus
@Links2004
Jan 17 2016 21:12
may we can add a "wrapper" for old code at this point.
@me-no-dev will add one, but currently working on my LED light control server / managment
including support for kodi/xbmc screen capture ;)
Me No Dev
@me-no-dev
Jan 17 2016 21:16
I can do it too, but I think you are the WebSocket master :) plus you'll get to know the server architecture a bit more and maybe give ideas for improvements :P
Helio Machado
@crushedice2000
Jan 17 2016 21:21
How can I do this sprintf(ap_essid, "%06x", ESP.getChipId()); when ap_essid is a char* variable?
Markus
@Links2004
Jan 17 2016 21:22
type case? i think sprintf needs (const char *)
Helio Machado
@crushedice2000
Jan 17 2016 21:23
@Links2004: Maybe, trying...
@Links2004: error: initializing argument 1 of 'int sprintf(char*, const char*, ...)' [-fpermissive]
Chris Elsworth
@celsworth
Jan 17 2016 21:24
no, it should not be const, its writing into it :)
you just need to malloc (or new char[]) the space at ap_essid
and it should work as you had it.
Helio Machado
@crushedice2000
Jan 17 2016 21:25
@celsworth: Thanks! lmgtfying and trying...
Markus
@Links2004
Jan 17 2016 21:25
char ap_essid[7];
Helio Machado
@crushedice2000
Jan 17 2016 21:27
@Links2004 Finally used:
char* ap_essid;
ap_essid = new char[7];
  sprintf(ap_essid, "%06x", ESP.getChipId());
Thanks to @Links2004 and @celsworth!
Chris Elsworth
@celsworth
Jan 17 2016 21:28
Links's way is simpler, then you don't have to remember to free it later
Markus
@Links2004
Jan 17 2016 21:28
if you do it like this, dont forget to delete it (free)
Chris Elsworth
@celsworth
Jan 17 2016 21:28
if you need to keep the pointer to use outside that function, then you have it right
Helio Machado
@crushedice2000
Jan 17 2016 21:29
But, the essid could be longer, I'll run this only in emergency mode. @celsworth @Links2004
Martin Ayotte
@martinayotte
Jan 17 2016 21:30
About WebServer names, maybe the old one should be rename ESPLiteWebServer and new one from @me-no-dev can then be named ESPWebServer ?
Helio Machado
@crushedice2000
Jan 17 2016 21:33
@martinayotte: Good idea!
Now @crushedice2000 is tired. Good night!
Chris Elsworth
@celsworth
Jan 17 2016 21:33
night!
Martin Ayotte
@martinayotte
Jan 17 2016 21:41
Ciao
Me No Dev
@me-no-dev
Jan 17 2016 21:41
@martinayotte the current one is called ESP8266WebServer, so maybe we can just rename the async one and stay compatible with older sketches and examples.
also I was thinking that since the server is fully compatible with the new ESP32, maybe it can stay on a side and be pulled into the repo just like the tools
Martin Ayotte
@martinayotte
Jan 17 2016 21:42
@me-no-dev , then, it is up to you to decide the name yours ... ;-)
ESPBestWebServer :-)
(I didn't try it out, but I will)
Me No Dev
@me-no-dev
Jan 17 2016 21:43
the more people that do , the more bugs that we will find :)
@martinayotte are you on windows?
Sven Eliasson
@comino
Jan 17 2016 21:55
Who needs a synchron server if you can have a async one :D
Martin Ayotte
@martinayotte
Jan 17 2016 22:11
@me-no-dev , no ! I'm a Linux guy, the only Windows I have are VM only for Office.
According to what I saw on ESP32 forum, you have problem with toolchain under Windows, right ?
Is it only related to the dtostrf() function you have mentioned there ?
Me No Dev
@me-no-dev
Jan 17 2016 22:20
yes I think so... and I guess I'm really not understanding windows at all
I was able to build a toolchain now, but it whines about cygwin
the other one whines about mingw
Juppit
@Juppit
Jan 17 2016 22:21
@me-no-dev for Cygwin I have a batch file to build the environment. And for crosstool a shell script to build under Cygwin.
Me No Dev
@me-no-dev
Jan 17 2016 22:21
I want it to not want anything else... :(
Martin Ayotte
@martinayotte
Jan 17 2016 22:22
I've used Cygwin/Mingw many many years ago ... :-0
Me No Dev
@me-no-dev
Jan 17 2016 22:22
@Juppit really? can you share?
at least a part to see how to set it properly for build
Juppit
@Juppit
Jan 17 2016 22:22
I have to upload it.
Me No Dev
@me-no-dev
Jan 17 2016 22:23
for windows tere is only one guy providing a toolchain for esp32 and it's failing (strangely enough only on Arduino IDE as far as I know)
@Juppit will the result require cygwin/mingw to be installed by the user?
Juppit
@Juppit
Jan 17 2016 22:28
Sorry, not for esp32
Me No Dev
@me-no-dev
Jan 17 2016 22:28
I imagine it would not matter generally
Juppit
@Juppit
Jan 17 2016 22:28
But to install cygwin you can see some ideas in:
https://gist.github.com/Juppit/39a41f00ede127013cc1
Me No Dev
@me-no-dev
Jan 17 2016 22:34
@Juppit huge thanks!
crosstool-NG.patch << where does this come from?
the rest seems like the same thing I did as compilation steps
and I use the same repo, just another branch
Juppit
@Juppit
Jan 17 2016 22:40
@me-no-dev the patch is for 'LDFLAGS += -lintl' and
'- ESCDELAY = 1;
  • set_escdelay(1);
    '
    I guess you know it
Me No Dev
@me-no-dev
Jan 17 2016 22:40
yup :)
xtensa-esp108-elf-g++: error: spawn: No such file or directory
this is my issue
Juppit
@Juppit
Jan 17 2016 22:41
I was working on https://github.com/kireevco/esp-alt-sdk with a good Makefile
error spawn, thats wy my branch is better :smile:
Me No Dev
@me-no-dev
Jan 17 2016 22:44
this is what is referenced by espressif as toolchain source and what I have working just fine on my mac and I'm sure on linux as well
but i'm all lost in this M$
Juppit
@Juppit
Jan 17 2016 22:44
@me-no-dev at the moment I run a build from Pfalcon but today it is sloooooow. Needs one more hour. But to late for my TZ
@me-no-dev https://github.com/kireevco/esp-alt-sdk is running on cygwin, have a look at the develop branch and mybe my last PR there
Me No Dev
@me-no-dev
Jan 17 2016 22:47
maybe newlib is the problem?
Juppit
@Juppit
Jan 17 2016 22:49
newlib is ok on esp-alt-sdk
Me No Dev
@me-no-dev
Jan 17 2016 22:49
I also see mingw there
isn't that the same as cygwin almost?
Juppit
@Juppit
Jan 17 2016 22:51
Yea, Dimitry builded on Ubuntu mac an mingw, and I had a look at cygwin. Now it is also ok.
It is almost the same.
And I thought mac is even a unix :smile:
Me No Dev
@me-no-dev
Jan 17 2016 22:56
it is unix :) it is not linux
some BSD heritage
this Makefile is gold
Martin Ayotte
@martinayotte
Jan 17 2016 22:58
Many things in Mac OS comes from things that Steve Job bring back from Next