These are chat archives for esp8266/Arduino

22nd
Jan 2016
Stavros Korokithakis
@skorokithakis
Jan 22 2016 00:07
@tzapu i'm pretty close to mass production, i'm waiting for my first version to arrive before i test the latest one
but the latest one with the separate vcc/3v3 legs is prettier
after i found out that the regulator can't really regulate much more than 5v down to 3.3, i'm much less excited about that extra leg, but the pcb is better routed in general
gonsays
@gonsays
Jan 22 2016 00:11
@comino I'll thank you!
@comino The problem is that I have Arduino 1.7.7 and the "tutorial" is regarding Arduino 1.6.5, can I downgrade the version of Arduino IDE?
Sven Eliasson
@comino
Jan 22 2016 01:34
Im not using the Arduino IDE at all - so Im surprized hearing it doesnt work with 1.7.
https://www.arduino.cc/en/Main/Software if thats realy the issue download a old version from here
Aditya Tannu
@AdySan
Jan 22 2016 02:06
1.7.7. is probably the Arduino.org IDE, you should use 1.6.7 form Arduino.cc
@gonasys
gonsays
@gonsays
Jan 22 2016 05:07
I'm using 1.6.5 and it is working fine
FTDI+ESP8266
I'm trying to find a way to ping IPs (192.168.1.0-255) from my local area network to know how many hosts are alive, but I'm still struggling to get some example
Helio Machado
@0x2b3bfa0
Jan 22 2016 07:07
@lrmoreno007: Ya somos dos ;)
Maybe you don't have enough current on that output. These bench fonts usually have a knob to adjust the current.
Also try adding a near decoupling capacitor, it will help to get a filtered and stable current. This shouldn't be a problem with a font as yours.
FWeinb
@FWeinb
Jan 22 2016 10:23
The SPI pins on a nodeMCU are CLK SD0 MD SD1 right?
Me No Dev
@me-no-dev
Jan 22 2016 10:24
which SPI?
the one for the flash or the one that you can use?
FWeinb
@FWeinb
Jan 22 2016 10:24
The one I can use.
Me No Dev
@me-no-dev
Jan 22 2016 10:24
GPIOs12-15
12-MISO, 13-MOSI, 14-SCK, 15-SS
marked D5-D8 on nodeMCU
FWeinb
@FWeinb
Jan 22 2016 10:25
Thanks. I was using this pinout.
Me No Dev
@me-no-dev
Jan 22 2016 10:26
great, look on the right
FWeinb
@FWeinb
Jan 22 2016 10:26
I have to use these H* ones.
Me No Dev
@me-no-dev
Jan 22 2016 10:26
that is the SPI
yes. Espressif call it HSPI
FWeinb
@FWeinb
Jan 22 2016 10:26
I was using the unprefixed labels...
Me No Dev
@me-no-dev
Jan 22 2016 10:26
they are for the flash chip. not usable
FWeinb
@FWeinb
Jan 22 2016 10:29
Thanks. But way are they accessible when they can't be used?
I am trying to get a SD card working. I am getting "SD Card initialized" (in the SDWebServer) but "SDCARD Not Detected" when requesting the webroot. The SD Card is a 8Gb SanDisk card. Fat32.
FWeinb
@FWeinb
Jan 22 2016 10:43
Okay. CardInfo is working...
Me No Dev
@me-no-dev
Jan 22 2016 10:43
I do not know why esp12 and nodemcu expose pins that users should not touch instead of making the board smaller either... but that is how life is :D
card might e a it too large ;0
FWeinb
@FWeinb
Jan 22 2016 10:43
But CardInfo is working fine...
Me No Dev
@me-no-dev
Jan 22 2016 10:43
I'm not positive that the lib supports such large file systems
also fat16 might be the only supported
card info reads the hardware
not the file system
FWeinb
@FWeinb
Jan 22 2016 10:45
// Now we will try to open the 'volume'/'partition' - it should be FAT16 or FAT32
  if (!volume.init(card)) {
    Serial.println("Could not find FAT16/FAT32 partition.\nMake sure you've formatted the card");
    return;
  }
That looks like CardInfo is reading the file system?
Me No Dev
@me-no-dev
Jan 22 2016 10:45
it's like having a bad SPIFFS image onyour ESP :) you can read the flash ut not the files
but again ... how big is your partition?
FWeinb
@FWeinb
Jan 22 2016 10:45
It is reporting 3478 MBytes
Me No Dev
@me-no-dev
Jan 22 2016 10:46
make a 3GB partiotion and you will be fine
FWeinb
@FWeinb
Jan 22 2016 11:08
Working fine. Thanks.
Stefan Gordon
@stefangordon
Jan 22 2016 15:59
I'm looking at preparing a PR for floating point PrintF support today - if anyone has existing work or strong feelings on it let me know! This is to better support IOT applications sending messages with floats and specifically to support the Azure IOT Hub SDK.
Looks like NodeMCU has some things we can borrow here, so planning to start there.
Chris Elsworth
@celsworth
Jan 22 2016 16:17
look forward to it. messing about with dtostr() is always a pain.
Stefan Gordon
@stefangordon
Jan 22 2016 17:39
Is it understood that os_printf is just wildly unreliable? Or is it just me :)
Depending on scenario it may do nothing, or may hard crash, or may work.
ets_vsnprintf does seem reliable, so all the Print::printf works well, but printf (from libc_replacements) is quite bad.
For example, this sketch crashes void setup() { Serial.begin(115200); printf("printf"); }
Martin Ayotte
@martinayotte
Jan 22 2016 17:55
It is probably because stdout isn't initialize to point to serial or any other stream
Stefan Gordon
@stefangordon
Jan 22 2016 17:59
Is there a standard way to do this? Presumably a call to os_install_putc1 of some sort.
Markus
@Links2004
Jan 22 2016 18:00
the os_install_putc1 stuff is for os_printf

for printf and other steam functions you normally implement:

int _write (int fd, const void *buf, size_t count);
int _read (int fd, const void *buf, size_t count);

but what the SDK does how knows.

Me No Dev
@me-no-dev
Jan 22 2016 18:04
extern "C" void system_set_os_print(uint8 onoff);
extern "C" void ets_install_putc1(void* routine);

static void _u0_putc(char c){
  while(((U0S >> USTXC) & 0x7F) == 0x7F);
  U0F = c;
}

void setup(){
  Serial.begin(115200);
  ets_install_putc1((void *) &_u0_putc);
  system_set_os_print(1);
}
this is the most reliable way to use os_printf
as it does not trigger any interrupts
and uses the build-in buffer
interrupt safe ;)
Stefan Gordon
@stefangordon
Jan 22 2016 18:06
Ah exactly what I was looking for! Will experiment with this, thank you.
Markus
@Links2004
Jan 22 2016 18:06
it do trigger the interrupts when the Serial interface is used the interrupts are enabled.
but its interrupt safe yes.
Me No Dev
@me-no-dev
Jan 22 2016 18:07
@Links2004 yeah, true! hope we will get rid of those soon
Stefan Gordon
@stefangordon
Jan 22 2016 18:11
Hmm, not immediate success but will work on it.
Fatal exception 2(InstructionRetchErrorCause):
epc1=0x3ffe83b8, epc2=0x00000000, epc3=0x00000000, excvaddr=0x3ffe83b8, depc=0x00000000

Exception (2):
epc1=0x3ffe83b8 epc2=0x00000000 epc3=0x00000000 excvaddr=0x3ffe83b8 depc=0x00000000

ctx: cont 
sp: 3ffef640 end: 3ffef8e0 offset: 01a0
Me No Dev
@me-no-dev
Jan 22 2016 18:11
I run those exact lines
Stefan Gordon
@stefangordon
Jan 22 2016 18:12
Trying this on sparkfun Thing
extern "C" void system_set_os_print(uint8 onoff);
extern "C" void ets_install_putc1(void* routine);

static void _u0_putc(char c){
  while(((U0S >> USTXC) & 0x7F) == 0x7F);
  U0F = c;
}

void setup(){
  Serial.begin(115200);
  ets_install_putc1((void *) &_u0_putc);
  system_set_os_print(1);
  printf("\ntest");
}

void loop() {}
Me No Dev
@me-no-dev
Jan 22 2016 18:12
try os_printf
Stefan Gordon
@stefangordon
Jan 22 2016 18:12
yeah, just realized, trying now.
Assumed that was mapped in libc_replacements, but maybe was wrong
Me No Dev
@me-no-dev
Jan 22 2016 18:13
i assume the same btw
Stefan Gordon
@stefangordon
Jan 22 2016 18:13
Ah, it works with os_printf
I can figure out whats happening from here I'm sure. Thanks for you help.
Me No Dev
@me-no-dev
Jan 22 2016 18:13
no probs :)
Stefan Gordon
@stefangordon
Jan 22 2016 18:14
Unrelated question, maybe someone can point me to the right venue to discuss - How is release schedule coordinated in terms of getting a release available for stable or staging?
Chris Elsworth
@celsworth
Jan 22 2016 18:18
@igrr decides when he likes I think ;)
Stefan Gordon
@stefangordon
Jan 22 2016 18:18
I figured :)
We are planning to have several samples and docs showing folks how to use esp8266/arduino on the Azure IoT Hub site in a few weeks, so if we can help get a new staging out we'd be happy to do so.
Chris Elsworth
@celsworth
Jan 22 2016 18:20
there is an rc circulating atm so probably any major commits wouldn't get into 2.1.0 now
but having said that, all commits are still going onto master, there's no 2.1.0 branch or anything. so who knows. I think release schedule and release engineering are quite loose terms around here ;)
Stefan Gordon
@stefangordon
Jan 22 2016 18:22
Yeah, less worried about new commits and just eager for it to be easier for people to use Arduino 1.6.7 ide.
Which works great with master.
Me No Dev
@me-no-dev
Jan 22 2016 18:23
the new version of the ide tool also uplaods spiffs OTA (default port and no pass)
Markus
@Links2004
Jan 22 2016 18:24
rc2 is planed for the next days ( when igrr has time ), since rc1 is still running the buggy SDK 1.5.0
Stefan Gordon
@stefangordon
Jan 22 2016 18:24
Ah great. I suppose probably this requires flash of at least 1024 (ota)
Me No Dev
@me-no-dev
Jan 22 2016 18:24
yes, why have less anyway? :D
Chris Elsworth
@celsworth
Jan 22 2016 18:24
@Links2004 excellent, I've been avoiding rc1 becasue of sdk 1.5.0
will be nice to have one to test with
Stefan Gordon
@stefangordon
Jan 22 2016 18:24
Yeah we are working with sparkfun to ensure it all works on their thing board, which is unfortunately still 512 :(
no problem though. thanks for the info.
misterdanb
@misterdanb
Jan 22 2016 19:11
hi there
may i ask a short question concerning the wifi connection?
(i'm not sure if this is the right place, but though)
Markus
@Links2004
Jan 22 2016 19:13
whats your question?
misterdanb
@misterdanb
Jan 22 2016 19:16
i'm wondering, why my esp is continuously loosing the wifi connection, i have built something to reconnect in this case, but since what i'm doing is time critical, this is a problem. adding a delay(2); solves the issue for whatever reason, but i really don't like this solution
Markus
@Links2004
Jan 22 2016 19:17
does the ESP crashe or do it loos the connection?
misterdanb
@misterdanb
Jan 22 2016 19:17
it looses the connection
as WiFi.status() reports
Markus
@Links2004
Jan 22 2016 19:19

how long is your "time critical" part?

try enable the debug functions for Core + WiFi this may gives a hint why.
https://github.com/esp8266/Arduino/blob/master/doc/Troubleshooting/debugging.md

misterdanb
@misterdanb
Jan 22 2016 19:20
here's the code, if this helps: https://github.com/cytrill/frmwr
time critical part is receiving and sending some udp packets plus debouncing 8 buttons
if you habe no delay in the loop is running very fast and then you try send many many udp packages
try sending the KeepAlive based on the millis()
misterdanb
@misterdanb
Jan 22 2016 19:24
i'll try commenting some things to see what happens, give me a moment
misterdanb
@misterdanb
Jan 22 2016 19:28
okay, it's not the keepalive part (will though reimplement that, making it based on millis() is prettier and more controlled i think), it's the Cytrill.loop(), which is essentially the debouncing code
does reading the ADC consume much time?
Markus
@Links2004
Jan 22 2016 19:30
I never measure it,
ate first look i not see a part that need much time in the Cytrill.loop
misterdanb
@misterdanb
Jan 22 2016 19:30
(i'm still wondering, why this is effecting the wifi, i thought the framework would take care of it by scheduling stuff)
Markus
@Links2004
Jan 22 2016 19:31
its cooperative multitasking :)
if the SDK has no time to do its stuff the WiFi drops
misterdanb
@misterdanb
Jan 22 2016 19:32
:D, what do you mean by that exactly?
ah, okayx
so by adding delays in my code, the sdk takes over the control and does its wifi magic?
misterdanb
@misterdanb
Jan 22 2016 19:37
and in that case, can i tell the sdk to do the wifi householding more explicitly and not by adding delays?
Markus
@Links2004
Jan 22 2016 19:49
at the end of the loop the SDK will be triggert automatically.
if you need to do it inside you code use delay(0);
misterdanb
@misterdanb
Jan 22 2016 19:51
ah okay, so i should not need to do it, hm
Markus
@Links2004
Jan 22 2016 19:52
only when your code takes to long ;)
misterdanb
@misterdanb
Jan 22 2016 19:52
wifi evt: 3
bcn_timout,ap_probe_send_start
ap_probe_send over, rest wifi status to disassoc
state: 5 -> 0 (1)
rm 0
f r0, wifi evt: 1
STA disconnect: 200
Connecting to HaSi-Kein-Internet-Legacy
sta config unchanged....scandone
state: 0 -> 2 (b0)
state: 2 -> 3 (0)
state: 3 -> 5 (10)
add 0
aid 5
cnt
that's what wifi debug output gives (for some reason i cannot compile it with additional core debug)
misterdanb
@misterdanb
Jan 22 2016 19:58
oh, sorry, it's the other way around, cannot compile with wifi, but core is fine
misterdanb
@misterdanb
Jan 22 2016 20:04
so, i tried to put delay(0) in nearly every line of the remaining code and it still timouts :(
Markus
@Links2004
Jan 22 2016 20:18
measure how long you Cytrill.loop loop take,
there must be some function that needs to many time.
the wifi debug problem is fixed in latest git.
misterdanb
@misterdanb
Jan 22 2016 20:26
okay, i'll do that
it takes exactly 117 μs
(at 80 MHz)
Markus
@Links2004
Jan 22 2016 20:41
strange that is fast, have you tried to disable the adc?
misterdanb
@misterdanb
Jan 22 2016 20:42
how do i disable it?
or shell i just comment the analogRead line?
wow, just disabling that line leads to 13 μs (!) and no more disconnects
misterdanb
@misterdanb
Jan 22 2016 20:48
(problem is, i need the adc :/)
Martin Ayotte
@martinayotte
Jan 22 2016 20:51
You can add an MCP3421, and you will even get higher resolution. :-)
Or the MCP3021 if you wish to stay at 10bits to keep cost low
misterdanb
@misterdanb
Jan 22 2016 20:55
well, since the board on which the esp is soldered on is given, that's not an option (maybe for the next version)
Markus
@Links2004
Jan 22 2016 20:57
may not read every loop, how often do you need a new value?
how much voltage the acd gets, it only can handle up to ~1V
misterdanb
@misterdanb
Jan 22 2016 20:58
as frequent as possible, it's going to be sort of a game controller
it's frmo 0v to 1v
the input signal
Markus
@Links2004
Jan 22 2016 20:59
a game runs typical with ~60fps so every 16ms a new value is good and more then the most people can input :)
misterdanb
@misterdanb
Jan 22 2016 20:59
but the latency!
:D
but still, why does a delay(2) help out? and not just putting delay(0) nearly EVERYWHERE?
Markus
@Links2004
Jan 22 2016 21:01
its not a task problem, the WiFi use the adc too inside the stack.
may this make problems
espressif does strange thinks some time
misterdanb
@misterdanb
Jan 22 2016 21:02
whaaat? for what purpose do they use the adc?
Helio Machado
@0x2b3bfa0
Jan 22 2016 21:06
Arrived from a long travel. Tired now. Good night!
Markus
@Links2004
Jan 22 2016 21:19
@misterdanb they adjust the WiFi output power based on the input voltage
misterdanb
@misterdanb
Jan 22 2016 21:24
okay, i see
didn't expect something like that, but okay, 2ms are okay actually (as you already mentionedr
misterdanb
@misterdanb
Jan 22 2016 21:38
thanks for your help btw.!
:)