These are chat archives for esp8266/Arduino

16th
Dec 2015
Rocco Musolino
@roccomuso
Dec 16 2015 00:05
@Links2004 any news? :shipit:
Markus
@Links2004
Dec 16 2015 00:05
had to do mods to the code dont have the wifi manager or the i2c MCU.
Rocco Musolino
@roccomuso
Dec 16 2015 00:06
yep. That's true. Thanks for your time..!
Markus
@Links2004
Dec 16 2015 00:10

running fine:

Wifi connected! 
First Calibration done. 
Starting UDP 
Local port: 2390 
Requesting KeepAliveUrl... 
18:fe:34:9f:c0:ae 
[HTTP] POST... done, code: 200 
Printing payload: 
{"server":"www.sapienzaapps.it","ntpserver":"195.46.37.22","script":"","path":""} 
http END 
Requesting KeepAliveUrl... 
18:fe:34:9f:c0:ae 
[HTTP] POST... done, code: 200 
Printing payload: 
{"server":"www.sapienzaapps.it","ntpserver":"195.46.37.22","script":"","path":""} 
http END 
KeepAlive mex sent!

code https://gist.github.com/Links2004/45750deeebd0c706d113

latest git with my memory optimizations.
will push them to git master.
Rocco Musolino
@roccomuso
Dec 16 2015 00:12
uhm but couldn't be the problema related to the other libraries you commented out?
I mean that's my code, but without a lot of lines, do you think that your optimization did the job?
Markus
@Links2004
Dec 16 2015 00:13
possible will test without ram optimizations.
Rocco Musolino
@roccomuso
Dec 16 2015 00:13
are you going to test without ram optimizations?
Markus
@Links2004
Dec 16 2015 00:13
yes thanks to git a few clicks.
still running... you need to test it yourself, since the other libraries needs stack too so it can still be the problem.
Rocco Musolino
@roccomuso
Dec 16 2015 00:16
ok, wouldn't be easier switch to the WiFiClient client; library?
I mean, maybe there's less memory usage
Markus
@Links2004
Dec 16 2015 00:16
then you need to handle the http protocol your self.
with the new code it will be the same.
Rocco Musolino
@roccomuso
Dec 16 2015 00:17
ok, i'm gonna try the new code
are you pushing it to git?
or do i need to make a manual edit?
Markus
@Links2004
Dec 16 2015 00:17
yes #1226
Markus
@Links2004
Dec 16 2015 00:18
but travis needs around 15mins to check
which one?
Rocco Musolino
@roccomuso
Dec 16 2015 00:18
after like 50 calls, it can't send a 'body' anymore
Markus
@Links2004
Dec 16 2015 00:18
what side do you requesting?
Rocco Musolino
@roccomuso
Dec 16 2015 00:19
I'm doing a simple POST
#include <ESP8266WiFi.h>
#include <ESP8266WiFiMulti.h>

#include <ESP8266HTTPClient.h>

#define USE_SERIAL Serial

ESP8266WiFiMulti WiFiMulti;

const char* MAC_char = "00:00:00:00:00:aa";
String lat = "41.892228";
String lon = "12.541938";
double version = 1.0;
int jsonoutput = 1;


void setup() {

    USE_SERIAL.begin(115200);
   // USE_SERIAL.setDebugOutput(true);

    USE_SERIAL.println();
    USE_SERIAL.println();
    USE_SERIAL.println();

    for(uint8_t t = 4; t > 0; t--) {
        USE_SERIAL.printf("[SETUP] WAIT %d...\n", t);
        USE_SERIAL.flush();
        delay(1000);
    }

    WiFiMulti.addAP("FASTWEB-PensioneDiVece", "dodide1333912");

}

void loop() {
    // wait for WiFi connection
    if((WiFiMulti.run() == WL_CONNECTED)) {


        String mac_addr = String(MAC_char);
        mac_addr.replace(":", "%3A");
        String body = "deviceid="+mac_addr+
            "&model=esp8266&"+"lat="+lat+"&lon="+lon+
            "&version="+version+"&jsonoutput="+jsonoutput;

        HTTPClient http;

        USE_SERIAL.print("[HTTP] begin...\n");
        // configure traged server and url

        http.begin("192.168.1.113", 8080, "/seismocloud/alive.php"); //HTTP
        http.addHeader("Connection", "close");
        http.addHeader("Content-Type", "application/x-www-form-urlencoded");

        USE_SERIAL.print("[HTTP] POST...\n");
        // start connection and send HTTP header
        int httpCode = http.POST(body);
        if(httpCode) {
            // HTTP header has been send and Server response header has been handled
            USE_SERIAL.printf("[HTTP] POST... code: %d\n", httpCode);

            // file found at server
            if(httpCode == 200) {
                String payload = http.getString();
                USE_SERIAL.println(payload);
            }
        } else {
            USE_SERIAL.print("[HTTP] POST... failed, no connection or no HTTP server\n");
        }
    }

    delay(10000);
}
Markus
@Links2004
Dec 16 2015 00:20
will try
Rocco Musolino
@roccomuso
Dec 16 2015 00:20
this is a very simple POST code
but after 50/70 calls you'll notice an httpCode: -3
-3 means: HTTPC_ERROR_SEND_PAYLOAD_FAILED (-3)
Markus
@Links2004
Dec 16 2015 00:21
normal this error means the tcp connection has a problem
Rocco Musolino
@roccomuso
Dec 16 2015 00:23
this happens after like 50 calls
Markus
@Links2004
Dec 16 2015 00:24
ram is not going done so far.
Rocco Musolino
@roccomuso
Dec 16 2015 00:24
I'm trying to reset the board and see if the error persists
the error persists, even after reset..
BOOH
Markus
@Links2004
Dec 16 2015 00:26
133 requests still running, free heap stable at 35816
Rocco Musolino
@roccomuso
Dec 16 2015 00:26
hmm really weird, why mine can't send the payload
Markus
@Links2004
Dec 16 2015 00:26
895...
Rocco Musolino
@roccomuso
Dec 16 2015 00:27
I gotta switch to the git version :')
Markus
@Links2004
Dec 16 2015 00:28
yes better try this. https://github.com/esp8266/Arduino#using-git-version-
but delete the board manager version before
Rocco Musolino
@roccomuso
Dec 16 2015 00:30
how to delete the board manager version?
Markus
@Links2004
Dec 16 2015 00:32
good question i never used it.
normally is shut be here some where C:\Users[username]\AppData\Roaming\Arduino.....
Rocco Musolino
@roccomuso
Dec 16 2015 00:33
on another computer i found something in C:\Users[username]\AppData\Roaming\Arduino15\packages\esp8266\hardware\esp8266\ <-- here there 2 directories
there are*
Markus
@Links2004
Dec 16 2015 00:34
simply delete C:\Users[username]\AppData\Roaming\Arduino15\packages\esp8266\
and then follow: https://github.com/esp8266/Arduino#using-git-version-
Rocco Musolino
@roccomuso
Dec 16 2015 00:35
ok
Markus
@Links2004
Dec 16 2015 00:35
changes are now on git master.
Rocco Musolino
@roccomuso
Dec 16 2015 00:38
ok
Rocco Musolino
@roccomuso
Dec 16 2015 00:44
Quite done with the procedure..
but now on my arduino ide i don't have the esp8266 choices on the menù...
Markus
@Links2004
Dec 16 2015 00:48
you have cloned it to the C:\Arduino\hardware\esp8266com ??
Rocco Musolino
@roccomuso
Dec 16 2015 00:48
yes
but on that computer i have the arduino portable
but i think it is using anyway that path under AppData\Roaming etc..
Markus
@Links2004
Dec 16 2015 00:49
have you a dir called "portable" in the Arduino root path?
Rocco Musolino
@roccomuso
Dec 16 2015 00:50
what is the arduino root path?
i have a dir on desktop called arduino-1.6.5-r2
Markus
@Links2004
Dec 16 2015 00:50
where the "arduino.exe" is
Rocco Musolino
@roccomuso
Dec 16 2015 00:50
in this directory arduino-1.6.5-r2 on my Desktop
Markus
@Links2004
Dec 16 2015 00:51
yes is in there a directory called portable?
Rocco Musolino
@roccomuso
Dec 16 2015 00:51
no
Markus
@Links2004
Dec 16 2015 00:51
then its using the "AppData\Roaming"
create the directory and all stuff will be stored in there.
Rocco Musolino
@roccomuso
Dec 16 2015 00:52
what i gotta do?
I did the procedure in AppData\Roaming..
restarted arduino ide
but i can't see all the esp8266 boards in the menù
Markus
@Links2004
Dec 16 2015 00:53
will not work this way.
Rocco Musolino
@roccomuso
Dec 16 2015 00:54
hmm this works only on arduino 1.6.5 or even 1.6.6?
Markus
@Links2004
Dec 16 2015 00:54

you need to place it inside the directory arduino-1.6.5-r2 on the desktop
shut look like this:

arduino-1.6.5-r2\hardware\esp8266com\esp8266

and create a directory

arduino-1.6.5-r2\portable
no OTA on 1.6.6
Rocco Musolino
@roccomuso
Dec 16 2015 00:55
so are you saying i gotta clone the repository inside a new portable directory?
Markus
@Links2004
Dec 16 2015 00:55
no
Rocco Musolino
@roccomuso
Dec 16 2015 00:55
why do i need to create the portable dir?
Markus
@Links2004
Dec 16 2015 00:55
it shut be here:
arduino-1.6.5-r2\hardware\esp8266com\esp8266
that the IDE not use the AppData stuff
to avoid conflicts.
Rocco Musolino
@roccomuso
Dec 16 2015 00:57
done
now i can see the boards finally
;)
ok let me try now to upload the code
Sven Eliasson
@comino
Dec 16 2015 01:03
ESP.getChipId() is not realy a unique ID (true?)
ESP.getFlashChipId() is more a model number. Is there any real unique ID accessable?
Me No Dev
@me-no-dev
Dec 16 2015 01:04
@comino ESP.getChipId() is unique
Markus
@Links2004
Dec 16 2015 01:04
getFlashChipId is the flash type.
"CHIP_ID can not be used to uniquely indicate of ESP8266EX, because the chip_id of chips for the same batch is same." :/
I thought maybe someone managed to get the flash´s UID afaik it should have one
Dmitry Kireev
@kireevco
Dec 16 2015 01:09
@comino mac would sound sufficient
Sven Eliasson
@comino
Dec 16 2015 01:10
it can be changes manually :/
changed*
Me No Dev
@me-no-dev
Dec 16 2015 01:12
wow.... and we thought chip id is unique
Dmitry Kireev
@kireevco
Dec 16 2015 01:12
@comino manually by whom?
Sven Eliasson
@comino
Dec 16 2015 01:12
I mean its possible to change it - I would like to have a unique ID which can not be changed
Dmitry Kireev
@kireevco
Dec 16 2015 01:12
on a pc - sure, can't rely. but SOC, how would you change this without reflashing?
Me No Dev
@me-no-dev
Dec 16 2015 01:13
there is a function in the SDK
Dmitry Kireev
@kireevco
Dec 16 2015 01:13
@comino sure, would be nice.
Sven Eliasson
@comino
Dec 16 2015 01:13
Since I want to use it for crypto stuff
wifi_set_macaddr()
Dmitry Kireev
@kireevco
Dec 16 2015 01:53
@comino here's the question, where will that function be executed?
aren't you the person who flashes the software?
if you give me that device, how woud I spoof your software without having the code?
maybe by editing a binary with a hex editor... tha'ts the only option I have
disassemble it and call this method.
in that case I could replace getChipID() with a simple string)
beikeland
@beikeland
Dec 16 2015 02:12
shouldn't the "hardcoded" MAC still be accessible even if you override it? Does it not reset?
Martin Ayotte
@martinayotte
Dec 16 2015 02:28
About FlashUniqueId vs EspUniqueId, where is what I've post few days ago : http://www.esp8266.com/viewtopic.php?f=32&t=7087#p36230
Since SDK don't provide some getFlashUniqueId() function, I don't know if on our ArduinoESP side we can talk to Flash thru SPI directly without side effect, but I'm able to do getFlashUniqueId() using LowPowerLab SPIFlash library under STM32. It is an 8 bytes UID.
Martin Ayotte
@martinayotte
Dec 16 2015 02:47
That make me ask that "can we talk to Flash thru SPI directly without side effect with SDK Flash caching" to experts @IGRR, @Links2004 and @me-no-dev ?
Chris Elsworth
@celsworth
Dec 16 2015 03:41
does it make any difference if I use ceramic or electrolytic caps for smoothing an ESPs supply?
I'm thinking it doesn't
Harrison Mclean
@h4rm0n1c
Dec 16 2015 04:57
I use both, ceramic's value can change with voltage.
Rohit Yermalkar
@romuye123
Dec 16 2015 05:54
Is there any alternative to Esp.deepsleep() where in we can listen to GPIO pin state changes ?
Harrison Mclean
@h4rm0n1c
Dec 16 2015 06:08
isn't that what gpio 16 is for?
Rohit Yermalkar
@romuye123
Dec 16 2015 06:10
yes correct
but i want to understand the reset is because normal reboot or by GPIO button press
Foo JH
@jhfoo
Dec 16 2015 06:38
hi folks. looking for some1 to comment on websocks in nodemcu...
websockets i mean...
Dmitry Kireev
@kireevco
Dec 16 2015 07:50
I used a message broker and mqtt
@jhfoo... mqtt seems more stable to me overall. less stress on the SOC. imho
Me No Dev
@me-no-dev
Dec 16 2015 10:03
@martinayotte it is possible and I even had an idea at some point to write such code, but I guess I got lost in all other interesting things that can be done :D
To everyone that uses Arduino IDE: PR4107 is Merged! Yeah!
Stavros Korokithakis
@skorokithakis
Dec 16 2015 10:16
@romuye123 i'm having the same problem
@romuye123 you can use a capacitor to hold the input high for a while, but RST is low
by the way, the ota example has this code: https://www.pastery.net/wctehc/ won't this only run once?
Me No Dev
@me-no-dev
Dec 16 2015 10:20
yes. that "while" is a leftover
Markus
@Links2004
Dec 16 2015 10:51
@jhfoo websockets are possible, https://github.com/Links2004/arduinoWebSockets/
Chris Elsworth
@celsworth
Dec 16 2015 11:08
@Links2004 oh interesting, you remember the SoftwareSerial and interrupts problem I had a few days ago, well I just spotted #1020 which looks the same. They're just disabling interrupts to work around it but thats not an acceptable solution for me, missing data :(
anyway I gave up on SoftwareSerial and used the real hardware RX, all good.
Me No Dev
@me-no-dev
Dec 16 2015 11:13
@celsworth do you need the soft serial for RX or TX?
Stavros Korokithakis
@skorokithakis
Dec 16 2015 11:28
@me-no-dev am I ok to send requests after WiFi.begin(), or should i wait for some time?
Me No Dev
@me-no-dev
Dec 16 2015 11:28
@skorokithakis you should be able to send requests as soon as WiFi is connected
Stavros Korokithakis
@skorokithakis
Dec 16 2015 11:29
@me-no-dev i mean, will WiFi.begin() block until it connects?
Me No Dev
@me-no-dev
Dec 16 2015 11:29
no, that is why there is that check that you asked about earlier
intead of while, there should be just "if"
Stavros Korokithakis
@skorokithakis
Dec 16 2015 11:29
but that check is only for checking whether we are connected
basically, i have this: https://www.pastery.net/kmmhxa/
should i change it so it waits for a few seconds first?
Me No Dev
@me-no-dev
Dec 16 2015 11:30
WiFi.waitForConnectResult() blocks untill WiFi is connected of connection failed
Stavros Korokithakis
@skorokithakis
Dec 16 2015 11:30
ah, great, thank you
that's ideal
Me No Dev
@me-no-dev
Dec 16 2015 11:31
what you have is what you need :)
Stavros Korokithakis
@skorokithakis
Dec 16 2015 12:06
hmm, is there a way to save on resistors for the bare 12E by connecting many of the GPIOs to one pullup resistor?
micropet
@micropet
Dec 16 2015 12:57

Good day everybody.
I just compiled the new 1.6.7.
Now I always get the message that my function is not declared:

esp_60_mqtt_only_06:116: error: 'serialEvent' was not declared in this scope

         serialEvent();
                     ^

esp_60_mqtt_only_06:118: error: 'publishIP' was not declared in this scope

         publishIP();                  // IP-Adresse und MAC einmal senden 

Is there a way out?

Peter
Stavros Korokithakis
@skorokithakis
Dec 16 2015 13:00
wow, these 18650 batteries claim 3.7V but they put out 4.1V, is that dangerous for the ESP?
Chris Elsworth
@celsworth
Dec 16 2015 13:16
@me-no-dev ideally yes, so I can keep real rx/tx free for other things (flashing, mainly, I guess, if ota fails)
@skorokithakis yes. in a word :)
Stavros Korokithakis
@skorokithakis
Dec 16 2015 13:16
aw
what's the "okay" range?
Chris Elsworth
@celsworth
Dec 16 2015 13:16
2.5 - 3.6
Stavros Korokithakis
@skorokithakis
Dec 16 2015 13:17
oh huh, it goes as low as 2.5? interesting
Chris Elsworth
@celsworth
Dec 16 2015 13:17
3 - 3.6 officially, but people have seen it run as low as 2.5, yeah
Stavros Korokithakis
@skorokithakis
Dec 16 2015 13:17
i did hook it up to the 4.1 battery yesterday and it seemed to work fine, but i won't be trying that again
Chris Elsworth
@celsworth
Dec 16 2015 13:17
got away with that one then :)
Stavros Korokithakis
@skorokithakis
Dec 16 2015 13:18
haha, seems so
this is odd, i'm connecting a CR2032 that i'm measuring at 3V to the circuit, measure the voltage again and it's at 1.5. i take it out, 2,7V
is it somehow killing the battery in half a second?
Chris Elsworth
@celsworth
Dec 16 2015 13:24
could just be the load is too high, they're only weedy little things
even 100mA load on a 200mAh battery is pretty demanding
Stavros Korokithakis
@skorokithakis
Dec 16 2015 13:24
i guess that's true
which means i'm out of ways to power this
Chris Elsworth
@celsworth
Dec 16 2015 13:25
a few CR2032 in parallel maybe
Stavros Korokithakis
@skorokithakis
Dec 16 2015 13:25
i'm space-constrained, it has to fit in a doorbell :/
Chris Elsworth
@celsworth
Dec 16 2015 13:26
hm I see, very tight
Stavros Korokithakis
@skorokithakis
Dec 16 2015 13:26
yeah :/ i have a small battery, but it outputs 4v
Chris Elsworth
@celsworth
Dec 16 2015 13:27
perhaps use a diode to create a voltage drop, but I'm unsure how much power that would waste
more than a few uA and its a nogo
Stavros Korokithakis
@skorokithakis
Dec 16 2015 13:27
yeah, that's another problem :/
Stavros Korokithakis
@skorokithakis
Dec 16 2015 14:15
do floating pins show up as high or as low?
Chris Elsworth
@celsworth
Dec 16 2015 14:15
depends on phase of the moon..
Stavros Korokithakis
@skorokithakis
Dec 16 2015 14:15
ah hm
Chris Elsworth
@celsworth
Dec 16 2015 14:16
they're floating, by their nature you can't rely on it, unless you've set an internal pull :)
Stavros Korokithakis
@skorokithakis
Dec 16 2015 14:16
so if i want to set a pin as a failsafe, so it's always high or low, i need to pull it up or pull it down
Chris Elsworth
@celsworth
Dec 16 2015 14:17
can use INPUT_PULLUP on most of them (16 has a PULLDOWN_16, special)
Rocco Musolino
@roccomuso
Dec 16 2015 14:18
Where will be released the new Arduno/esp8266 ? I mean from GIT to stable version..
when*
Me No Dev
@me-no-dev
Dec 16 2015 14:19
@celsworth what is the speed of the serial in question and how many bytes do you expect in a transmission?
Sven Eliasson
@comino
Dec 16 2015 14:19
rocco - whats wrong with using the git version ;) ?
Chris Elsworth
@celsworth
Dec 16 2015 14:20
@me-no-dev low speed, 9600. and it will be attached to a linux server serial console, so quite low throughput. the problem is I was getting "mac 674" crashes even on just a few hundred bytes (so lets say the output of an ls), because the SoftwareSerial disabled interrupts while it processed incoming bits for too long, I think
however it only crashes if I'm trying to send the data over wifi, if there's no wifi activity, its fine
Me No Dev
@me-no-dev
Dec 16 2015 14:21
@celsworth you can use a timer to read the bits
Chris Elsworth
@celsworth
Dec 16 2015 14:21
basically exactly what is in that ticket #1020
Me No Dev
@me-no-dev
Dec 16 2015 14:21
and start the timer based on pin interrupt on start bit
Chris Elsworth
@celsworth
Dec 16 2015 14:21
hm, that's an interesting idea actually, I may try that
Me No Dev
@me-no-dev
Dec 16 2015 14:22
I have done such serials for AVR andthey work fine
Chris Elsworth
@celsworth
Dec 16 2015 14:22
I was using someone elses SoftwareSerial (linked in ticket) and it simply waits for a time between each bit
Stavros Korokithakis
@skorokithakis
Dec 16 2015 14:22
@celsworth INPUT_PULLUP is interesting, do you know where i can find some sample code? can they all be pulled up by default?
Chris Elsworth
@celsworth
Dec 16 2015 14:22
@skorokithakis hm I'm not sure there is an example, but yes they acn all be pulled up except GPIO16
Stavros Korokithakis
@skorokithakis
Dec 16 2015 14:22
that neatly solves my problem, i'll look, thanks
@me-no-dev I'm going to have a play with that idea, thanks for the tip :) didn't think of it
Stavros Korokithakis
@skorokithakis
Dec 16 2015 14:23
oh, i just configure it as INPUT_PULLUP rather than input, sounds great
thank you
Chris Elsworth
@celsworth
Dec 16 2015 14:23
if I can get it working well I'll release it
Me No Dev
@me-no-dev
Dec 16 2015 14:25
@celsworth the other SoftSerial implementations all use delays to read/write the bits
Chris Elsworth
@celsworth
Dec 16 2015 14:25
okay, maybe I just picked a bad one to try :D
Me No Dev
@me-no-dev
Dec 16 2015 14:25
on slow speeds that is too much for the ESPs network
Chris Elsworth
@celsworth
Dec 16 2015 14:25
may need os_timer_arm_us though
I forget what the delay is between bits at 9600.. like 0.1ms or something?
Me No Dev
@me-no-dev
Dec 16 2015 14:26
@celsworth timer1 not os_timer
you need hardware interrupt at the exact time in order to read the bit correctly
Chris Elsworth
@celsworth
Dec 16 2015 14:27
looking in the docs for this
Me No Dev
@me-no-dev
Dec 16 2015 14:27
ok, maybe I'll stop on the Async stuff and give it a go
Venkatesh
@itsjustvenky
Dec 16 2015 14:27
@skorokithakis Yes it works fine. Update your platformio to 2.6.0. usage : https://github.com/esp8266/Arduino/blob/master/doc/platformio.md
Me No Dev
@me-no-dev
Dec 16 2015 14:27
yes
Chris Elsworth
@celsworth
Dec 16 2015 14:28
I can't find this in the docs though, may need some updating
just a mention of Timer1 for servos
Stavros Korokithakis
@skorokithakis
Dec 16 2015 14:28
@itsjustvenky hmm, what do you mean? update for what?
Rocco Musolino
@roccomuso
Dec 16 2015 14:28
@comino nothing wrong, but the 'installation' process is tricky... for my students i'd like to have an easier process :)
Venkatesh
@itsjustvenky
Dec 16 2015 14:29
@skorokithakis what is your platformio ?
Stavros Korokithakis
@skorokithakis
Dec 16 2015 14:29
2.6.0
@itsjustvenky are you talking about INPUT_PULLUP?
Venkatesh
@itsjustvenky
Dec 16 2015 14:30
then its fine.. go through the link which I have given.. it explain's option on to upload to ESP (ota)
Stavros Korokithakis
@skorokithakis
Dec 16 2015 14:30
@itsjustvenky oh, yeah, i got it working with 2.6.0, thanks
works great
although apparently serial broke
Venkatesh
@itsjustvenky
Dec 16 2015 14:30
@skorokithakis May be I missed your earlier messages. :+1:
Stavros Korokithakis
@skorokithakis
Dec 16 2015 14:31
i'm getting "error: espcomm_open failed" now, over serial
Venkatesh
@itsjustvenky
Dec 16 2015 14:32
@skorokithakis what commands are you using ?
Stavros Korokithakis
@skorokithakis
Dec 16 2015 14:33
just platformio run -t upload with https://www.pastery.net/ywjauk/
it's a nodemcu 0.9
beikeland
@beikeland
Dec 16 2015 14:34
Received my wemos d1-mini today. Propper sealed esd bags, nice clean boards. works with resetmethod nodemcu and confirmed 4MiB flash. Gonne get a few extra
Stavros Korokithakis
@skorokithakis
Dec 16 2015 14:34
@beikeland oh very nice, i'm thinking of getting some as well
from aliexpress?
Venkatesh
@itsjustvenky
Dec 16 2015 14:35
@skorokithakis HTTPS won't work
Stavros Korokithakis
@skorokithakis
Dec 16 2015 14:35
won't work where?
oh, i just pasted my config
Stavros Korokithakis
@skorokithakis
Dec 16 2015 14:36
i'm not using OTA
i'm doing serial
or are you saying you can't access the page?
Rocco Musolino
@roccomuso
Dec 16 2015 14:36
Guys a really quick question, does anyone have ever used NTP? How do you mantain time clock inside the nodemcu after having received through the NTP the time?
Venkatesh
@itsjustvenky
Dec 16 2015 14:37
@skorokithakis my bad.. I thought the url is upload_port
Stavros Korokithakis
@skorokithakis
Dec 16 2015 14:37
oh, no
i'm just doing it over USB to the NodeMCU, but it doesn't want to work
let me reset flash
Venkatesh
@itsjustvenky
Dec 16 2015 14:37
can you check whether the ports listed
Stavros Korokithakis
@skorokithakis
Dec 16 2015 14:40
yeah, /dev/ttyUSB0 seems to be fine
Venkatesh
@itsjustvenky
Dec 16 2015 14:40
you can use this option --upload_port=COM3 or for linux //dev/ttyUSB0
Stavros Korokithakis
@skorokithakis
Dec 16 2015 14:40
but i get I/O error after a while
Steve Nelson
@zenmanenergy
Dec 16 2015 14:41
Is anyone awake who is good with git?
Stavros Korokithakis
@skorokithakis
Dec 16 2015 14:41
@zenmanenergy, what's up?
@itsjustvenky it's detecting the port, it's just failing mid-upload
maybe it's my NodeMCU that's problematic
Steve Nelson
@zenmanenergy
Dec 16 2015 14:41
I’m trying to switch over to github desktop for my mac and i’m trying to figure out which folder to point the clone to.
Venkatesh
@itsjustvenky
Dec 16 2015 14:42
@skorokithakis yeah may be
Stavros Korokithakis
@skorokithakis
Dec 16 2015 14:42
@zenmanenergy i've never used the github client, but probably the folder that has the .git repo in it
@itsjustvenky hm nah, different nodemcu, same problem... i'll try anothe rcable
Steve Nelson
@zenmanenergy
Dec 16 2015 14:44
does it go into a different folder when you clone the repository than when you use the board manager?
Stavros Korokithakis
@skorokithakis
Dec 16 2015 14:46
i'm not sure what you're referring to
Steve Nelson
@zenmanenergy
Dec 16 2015 14:47
Sorry, i’m still waking up… here are the instructions on the main page: Install Arduino 1.6.5
Go to Arduino directory
Clone this repository into hardware/esp8266com/esp8266 directory (or clone it elsewhere and create a symlink)
Stavros Korokithakis
@skorokithakis
Dec 16 2015 14:47
oh, right
Steve Nelson
@zenmanenergy
Dec 16 2015 14:47
I’ve done all that but now I have multiple esp8266 folders in there and I’m not sure if it’s working right.
Stavros Korokithakis
@skorokithakis
Dec 16 2015 14:47
hm
maybe you want to delete them and move the one you cloned in there
Steve Nelson
@zenmanenergy
Dec 16 2015 14:48
also github desktop put everything into a folder called Arduino is that correct?
Venkatesh
@itsjustvenky
Dec 16 2015 14:48
@skorokithakis cable or may be USB port itself
Stavros Korokithakis
@skorokithakis
Dec 16 2015 14:49
i changed them all :/
@zenmanenergy i don't know, i don't use github desktop
but probably yes
Steve Nelson
@zenmanenergy
Dec 16 2015 14:49
ok. i’ll keep futzing with it
Stavros Korokithakis
@skorokithakis
Dec 16 2015 14:50
@itsjustvenky that's what i get from esptool: https://www.pastery.net/qajbwa/
seems weird
Venkatesh
@itsjustvenky
Dec 16 2015 14:51
@skorokithakis I had similar USB cable problem with raspberry pi.. cheap couldn't power it properly.. I had to test the cable using android app
Stavros Korokithakis
@skorokithakis
Dec 16 2015 14:51
here it is with the command as well: https://www.pastery.net/fevwwz/
oh, how do you test cables?
Venkatesh
@itsjustvenky
Dec 16 2015 14:52
no.. just plugged usb cable to phone and used amphere app to measure charging
Stavros Korokithakis
@skorokithakis
Dec 16 2015 14:52
oh right
Venkatesh
@itsjustvenky
Dec 16 2015 14:52
cheap cables will give less amp..
Stavros Korokithakis
@skorokithakis
Dec 16 2015 14:52
nah, three cables, same thing
Venkatesh
@itsjustvenky
Dec 16 2015 14:52
even if you provide 1A to cable
Stavros Korokithakis
@skorokithakis
Dec 16 2015 14:52
plus it used to work fine with the other nodemcu
oh
yeah, works fine with nodemcu 1.0, doesn't work with 0.9
Venkatesh
@itsjustvenky
Dec 16 2015 14:54
just hit reset button before upload
Stavros Korokithakis
@skorokithakis
Dec 16 2015 14:54
oh
i power-cycled it before upload and it worked, thanks. there's no reset button on it
Sven Eliasson
@comino
Dec 16 2015 14:57
@ roccomuso : You may write a script cloning the git into the correct doler and starting "get.py".
Venkatesh
@itsjustvenky
Dec 16 2015 14:58
oh ok
Steve Nelson
@zenmanenergy
Dec 16 2015 14:59
oh there we go, i figured it out. for anyone interested in the github desktop, I used the command line instructions first, then added the local repository in the desktop app instead of cloning it again.
Stavros Korokithakis
@skorokithakis
Dec 16 2015 15:01
oh nice
i have a pin configured as INPUT_PULLUP, can i just connect it to GND to pull it down, or do i need a 10k resistor inbetween?
Chris Elsworth
@celsworth
Dec 16 2015 15:02
direct
Stavros Korokithakis
@skorokithakis
Dec 16 2015 15:02
awesome, thanks
it won't increase my power consumption, will it?
Chris Elsworth
@celsworth
Dec 16 2015 15:03
nah
Stavros Korokithakis
@skorokithakis
Dec 16 2015 15:03
fantastic
thank you
hopefully it'll be simple enough for me
i may make a pcb out of this button
Rocco Musolino
@roccomuso
Dec 16 2015 15:09
Guys a really quick question, does anyone have ever used NTP? How do you mantain time clock inside the nodemcu after having received through the NTP the time?
Stavros Korokithakis
@skorokithakis
Dec 16 2015 15:09
@roccomuso doesn't it just maintain it by itself?
Rocco Musolino
@roccomuso
Dec 16 2015 15:09
hmm the example script doesn't not
doesn't*
Stavros Korokithakis
@skorokithakis
Dec 16 2015 15:10
what's the example?
can you guys give me another hint? const char* x = "hello world"; can be modified?
why the 'const' keyword?
Stavros Korokithakis
@skorokithakis
Dec 16 2015 15:12
@roccomuso can you not store the time you got and the millis() you got it at and just add millis() + originalTime - originalMillis?
@roccomuso the pointer is immutable, but the thing it points to can be modified
Rocco Musolino
@roccomuso
Dec 16 2015 15:12
@skorokithakis i don't know, just asking :')
Stavros Korokithakis
@skorokithakis
Dec 16 2015 15:12
i think you can
Rocco Musolino
@roccomuso
Dec 16 2015 15:13
and how to copy a new value in x?

const char x = "hello world";
const char
y = "hello world 2";

may i do x = y ? or should i use some function?

Stavros Korokithakis
@skorokithakis
Dec 16 2015 15:14
no, const char can't be modified afaik
but i don't really know much C :(
Rocco Musolino
@roccomuso
Dec 16 2015 15:19
hmm
Rocco Musolino
@roccomuso
Dec 16 2015 15:53
solved using strdup( l... )
strdup () *
Markus
@Links2004
Dec 16 2015 15:55
@roccomuso you cant change the content of a const char*, how your code look like now?
Rocco Musolino
@roccomuso
Dec 16 2015 15:57
@Links2004 look: https://www.pastery.net/rsfzhw/ line 129
Markus
@Links2004
Dec 16 2015 15:58
you moving the pointer, will work but with every use of strdup you will have less ram.
Rocco Musolino
@roccomuso
Dec 16 2015 15:58
I should optimize the code
Markus
@Links2004
Dec 16 2015 15:59
may simple use the String class.
String host = "192.168.1.113";

             if (host  ! = root["server"]) {
               host = root["server"];
             }
make it much simpler and you do not need to handle the memory stuff.
Rocco Musolino
@roccomuso
Dec 16 2015 16:02
but i need a const char* type :/
Markus
@Links2004
Dec 16 2015 16:03
you can get one as long you not modify the data with it.
host.c_str();
looks like host is used only for http.begin, and there a String is ok.
Rocco Musolino
@roccomuso
Dec 16 2015 16:11
i'll update the code ;) to optimize it
but now i have a deadline :/
@Links2004 have you ever play with NTP? after having received the unix epoch time, how do you keep track of the time clock on board without making constant call to the ntp server?
Martin Ayotte
@martinayotte
Dec 16 2015 16:16
Simply use the Time library, set it time and then use now() function to get the time. To keep it in sync, do an NTP call again ounce every 6 hours or something like.
Rocco Musolino
@roccomuso
Dec 16 2015 16:17
thanks :)
Venkatesh
@itsjustvenky
Dec 16 2015 16:20
@martinayotte :+1:
Martin Ayotte
@martinayotte
Dec 16 2015 16:27
Welcome !
Steve Nelson
@zenmanenergy
Dec 16 2015 16:28
whoa, my Serial monitor just started spitting out: "E:M 8304” over and and over again. Anyone know what may have caused that? It’s certainly not in my code.
Martin Ayotte
@martinayotte
Dec 16 2015 16:29
BTW, I'm using the Time library from Paul Stoffregen ...
Rocco Musolino
@roccomuso
Dec 16 2015 16:31
link
is it on github right?
Venkatesh
@itsjustvenky
Dec 16 2015 16:31
yes
marksev1
@marksev1
Dec 16 2015 16:51
compiling problem, esp8266, using new liquidcrystal library, and esp ofc, i get this http://pastebin.com/VJCXLbFc
and I'm just compiling the library example for i2c lcd
so should i trash that library
Venkatesh
@itsjustvenky
Dec 16 2015 16:56
looks like it is made only for AVR
marksev1
@marksev1
Dec 16 2015 16:56
dang
Venkatesh
@itsjustvenky
Dec 16 2015 16:56
there is other library liquidcrystal_i2c.. something smilar which works on ESP
marksev1
@marksev1
Dec 16 2015 16:56
yep i found it
Venkatesh
@itsjustvenky
Dec 16 2015 16:57
:+1:
marksev1
@marksev1
Dec 16 2015 16:57
thanks
itjustvenky, i had similair issues with newping library
but by replacing all uint8 with uint32 in the library the sketch compiled :)
hope it also works in real-life (but i dont have hardware to test yet)
Venkatesh
@itsjustvenky
Dec 16 2015 16:58
go ahead and just compile and see if that works ;-)
marksev1
@marksev1
Dec 16 2015 16:59
well yeah for newping it compiled fine
maybe I'd need to try and do the same for this library
heeh
Venkatesh
@itsjustvenky
Dec 16 2015 17:00
or you can create a "issue" so that a author can fix it for you
marksev1
@marksev1
Dec 16 2015 17:02
yeah
first i'm gonna try this one https://github.com/agnunez/ESP8266-I2C-LCD1602
ok this one works :)
Venkatesh
@itsjustvenky
Dec 16 2015 18:25
:+1:
M0ebiu5
@M0ebiu5
Dec 16 2015 19:01
@skorokithakis it's funny that the doorbell sign says "Emergency" - good joke :)
Endre Karlson
@ekarlso
Dec 16 2015 19:02
any of you used Desfire with a RFID reade rbeore ?
Mario Mikočević
@mozgy
Dec 16 2015 20:29
that OTA-first-flash bug starts to annoy me :fire:
beikeland
@beikeland
Dec 16 2015 23:32
Not sure I'm 100% pleased with the end result, but decided to try and mount the d1 mini underneath a breadboard, and solder the pins to the the first few rows. Works. But, I don't know, only did the one. Its good for having to quickly test small simple stuff though. Maybe it'll give you guys ideas: https://www.dropbox.com/s/m47kn2wocr5x8sy/2015-12-17%2000.26.53_.jpg?dl=0
Gonna print a strip with the pin names and glue on the center of the board over the esp
Tony
@toxuin
Dec 16 2015 23:45
Is it possible to interface esp with CAN bus in the car?..
beikeland
@beikeland
Dec 16 2015 23:48
i hope so. I've bought an canbur arduino shield, and a simpler module for this very reason. esp->spi->can
this is the smaller can bus module thing i got: http://www.aliexpress.com/item/MCP2515-CAN-Bus-Module-Board-TJA1050-Receiver-SPI-For-51-MCU-ARM-Controller-NEW/32522595390.html
The arduino shield use the same mcp2515, but a differetn transciever, but it shouldn't matter much
Tony
@toxuin
Dec 16 2015 23:56
Thanks! I'll take a look ^_^
beikeland
@beikeland
Dec 16 2015 23:58
https://github.com/Seeed-Studio/CAN_BUS_Shield arduino code for the mcp chip