These are chat archives for esp8266/Arduino

28th
Jan 2017
Nikolas Beutler
@biacz
Jan 28 2017 10:56
gentlemen, i would greatly appreciate if someone could tell me how to optimize this code, so the turn ons and offs are being done simultaneously (or at least almost). very appreciated. if you find other big flaws, i'd be grateful to know https://gist.github.com/biacz/5ad2f56b3d055a3fc7ac700c7bc7a294
when i look at it i already have an idea. like buffering the incoming publishs into something temporary and execute it once the for loops are done
bobcroft
@bobcroft
Jan 28 2017 12:04
@brutzler As far as I am aware my Kaspersky software doesn't slow down compiling. EL-Client is the code / library that runs on the Arduino that provides the link to ESP-Link running on the ESP8266.
brutzler
@brutzler
Jan 28 2017 12:13
@bobcroft ESP-Link: Just looked on github, what this is good for. For honest I do not really understand the function of it.
Is it a standalone application to flash another µC (AVR or even ESP) over WiFi? Like a remote serial Port over WiFi?
Hagai Shatz
@hagai-shatz
Jan 28 2017 12:45
Question about the flash memory organisation: what sectors are free to use as EEPROM?
The EEPROM library is using one sector, the one just after the end of SPIFFS.
Are there additional sectors that are free to use?
bobcroft
@bobcroft
Jan 28 2017 12:47
@brutzler Hi the use of EL-Client running on the Arduino effectively gives the Arduino wireless capability. I have a project where I have a 3.5" GLCD on an Arduino MEGA, I also have 4*4 matrix keypad linked to the Mega and the Mega is linked to an ESP-12 module running ESP-Link. The code on the Mega includes EL-Client. I use this set up as a master controller for an automated watering system and greenhouse heating control. I set up the control parameters I need using the keypad and GLCD display and when I press enter the data is sent wirelessly using MQTT to the various remote modules. The EL-Client code sends the data to the ESP module which transmits the data to the remote ESP modules. Each remote module has a I2C port expander to provide 8 relays. In this way the ESP12 has enough pins to meet my needs. In essence the El-Client running on a UNO or Mega can provide considerably more I/O capability than an ESP module alone.
I hope that helps you a little.
Me No Dev
@me-no-dev
Jan 28 2017 12:54
@hagai-shatz well... :D depends on how you use the ESP
if you do not plan on OTA, then the sectors from sketch to 1MB are free
Hagai Shatz
@hagai-shatz
Jan 28 2017 12:57
@me-no-dev it always depends! 😊
Yes, I'm using OTA.
Me No Dev
@me-no-dev
Jan 28 2017 13:00
@hagai-shatz not sure what you can do in this case without customizing core files
Victor Tseng
@Palatis
Jan 28 2017 13:34
don't use the spiffs, and you get all spiffs sectors for free
u have to store more than 4kb eeprom?
Hagai Shatz
@hagai-shatz
Jan 28 2017 13:40
I want to store data and make sure it won't fail if power goes down during writing.
This requires at least 2 sectors.
Martin Sloup
@arcao
Jan 28 2017 13:51
@biacz Do you mean something like this: https://gist.github.com/arcao/12cce928645c6050383206265f1fae6b
Hagai Shatz
@hagai-shatz
Jan 28 2017 15:29
@me-no-dev, I was digging into the code to find where _SPIFFS_end is defined (since EEPROM is using one sector after the end). Looks like this is defined in field under .platformio/packages/framework-arduinoespressif8266/tools/sdk/ld/eagle.flash.4m.ld. I think I can define my own file and have my 2 sectors.
Me No Dev
@me-no-dev
Jan 28 2017 15:30
yup
mega-hz
@mega-hz
Jan 28 2017 15:36
i am trying to get a canvas gauge running, but i can't get the data in correct format...how can i translate <span class="analog">...</span> the value in "analog" into a valid value for the gauge? <canvas id="Anzeige_V1" data-major-ticks="0V 5V 10V 15V 20V 25V 30V" data-type="canv-gauge" data-min-value="0" data-max-value="30" data-onready="setInterval( function() {Gauge.Collection.get('Anzeige_V1').setValue(analog0);}, 200);"> </canvas>
Eternyt
@Eternyt
Jan 28 2017 15:49
Hello everybody! I'm trying to connect an SD card reader to my NodeMCU 1.0 using the Arduino SD library. I try a lot of schematic (using CS pin at GPIO 2 instead of GPIO15, set it to "chipSelect = 2;", reducing by a quart the spi speed) but nothing work. Any suggestion?
mega-hz
@mega-hz
Jan 28 2017 15:55
try it with spiSS as CS!
(gpio15) does this works?
Eternyt
@Eternyt
Jan 28 2017 16:01
What do to mean with "try it with spiSS as CS"?
And no, with gpio15 don't work
mega-hz
@mega-hz
Jan 28 2017 16:02
spiSS is the default cs for spi devices, gpio15, try this first und see if your sd runs
ok, if it doesnt work, see if the sd-library is ok or try a different one
Eternyt
@Eternyt
Jan 28 2017 16:05
Can you tell me another library that work with the NodeMCU?
mega-hz
@mega-hz
Jan 28 2017 16:06
sorry, no, i used the SPIFFS instead of SD-Card, is much better!
Eternyt
@Eternyt
Jan 28 2017 16:11
But I need to store data that i'll read with a computer in future.
mega-hz
@mega-hz
Jan 28 2017 16:12
sorry, i did not try sd on a esp, only arduino
Martin Sloup
@arcao
Jan 28 2017 16:14
@hagai-shatz and http://esp8266.github.io/Arduino/versions/2.3.0/doc/libraries.html#eeprom: ... Size can be anywhere between 4 and 4096 bytes. ... EEPROM library uses one sector of flash located just after the SPIFFS.
Hagai Shatz
@hagai-shatz
Jan 28 2017 16:16
@arcao - I know all this, you are missing the point. The EEPROM lib erase the entire sector before writing the data again. If power go out during this process you lose your data.
@mega-hz - you do it with javascript in the browser.
mega-hz
@mega-hz
Jan 28 2017 16:31
yes i know, but the value of "analog" seems to be in a string, but the gauge needs a int or so
Hagai Shatz
@hagai-shatz
Jan 28 2017 16:35
.setValue(Number.parseInt(analog0));
mega-hz
@mega-hz
Jan 28 2017 16:46
that doesnt work.
if i have this:
<span class="analog">...</span>
i can see instead of those ... the value
Hagai Shatz
@hagai-shatz
Jan 28 2017 16:50
document.getElementsByClassName('analog')[0].innerText
mega-hz
@mega-hz
Jan 28 2017 16:52
it looks like this:
                        var count;
                        // get analog inputs
                        var num_an = this.responseXML.getElementsByTagName('analog').length;
                              for (count = 0; count < num_an; count++) {
                                  document.getElementsByClassName("analog")[count].innerHTML =
                                  this.responseXML.getElementsByTagName('analog')[count].childNodes[0].nodeValue;
                              }
Hagai Shatz
@hagai-shatz
Jan 28 2017 16:54
Then why not set the gauge value at the same time?
mega-hz
@mega-hz
Jan 28 2017 16:55
how do you mean?
Hagai Shatz
@hagai-shatz
Jan 28 2017 17:00
  var count;
  // get analog inputs
  var num_an = this.responseXML.getElementsByTagName('analog').length;
  for (count = 0; count < num_an; count++) {
    var value = Number.parseInt(this.responseXML.getElementsByTagName('analog')[count].childNodes[0].nodeValue);
    document.getElementsByClassName("analog")[count].innerHTML = value.toFixed(2);
    Gauge.Collection[count].setValue(value);
  }
And no need for script in gouge data-onready.
Not sure about the Gauge API, what are you using?
mega-hz
@mega-hz
Jan 28 2017 17:00
@hagai-shatz
    <canvas id="Anzeige_V1" data-major-ticks="0V 5V 10V 15V 20V 25V 30V"
            data-type="canv-gauge" data-min-value="0" data-max-value="30"
            data-onready="setInterval( function() {Gauge.Collection.get('Anzeige_V1').setValue(nodeValue);}, 200);">
    </canvas>
Hagai Shatz
@hagai-shatz
Jan 28 2017 17:02
mega-hz
@mega-hz
Jan 28 2017 18:45
if i remove this
    <h0><span class="analog">...</span></h0>
    <h0><span class="analog">...</span></h0>
    <h0><span class="analog">...</span></h0>
    <h0><span class="analog">...</span></h0>
the gauges dont work anymore, do i have to change something more?
Rinaldi Segecin
@rsegecin
Jan 28 2017 19:01
hi
does anyone knows what ESP sdk the Arduino core for ESP8266 is based upon?
Rinaldi Segecin
@rsegecin
Jan 28 2017 19:15
found it, it's based upon ESP8266 NONOS SDK V1.5.3
brutzler
@brutzler
Jan 28 2017 19:28
Is there any possibility for a debug over WiFi?
I mean instead of serial Interface?