These are chat archives for esp8266/Arduino

5th
May 2017
Tejas H
@CodingCreate101
May 05 2017 02:24
@rodrigocirilo I am using EEPROM. It's good enough for my purposes. What's your purpose?
Steve Nelson
@zenmanenergy
May 05 2017 03:12
if I do the following I can make a method with a callback function:
class Callbackexample{
  public:
    void callThisFunction(void (*callback)());
};

void Callbackexample::callThisFunction(void (*callback)()){
  Serial.println("calling the function passed in");
  (*callback)();
}
but I can't seem to pass in an object and a method.
So I can do:
Callbackexample example;
  example.callThisFunction(helloWorld);
but I can't seem to do this:
SomeObject obj;
Callbackexample example;
  example.callThisFunction(obj.helloWorld);
Is that possible?
4D Systems
@4dsystems
May 05 2017 03:21
Hello. We have a new board using ESP8266 which we want to get into the ESP8266 Arduino Repo. I submitted a Pull request to change the boards.txt file with our new board. Otherwise no files are changing, as it uses the Generic type. Is there anything else I need to change to action this pull request?
It had been mentioned that the JSON and Documentation needed updating. I am unsure where to find these to update to add to the Pull Request though
4D Systems
@4dsystems
May 05 2017 03:33
Hi Ivan
Thank you. So I add/edit those files and add to the pull request?
Sorry, this is the first time we have ever had to do anything like this, the process is all very new
Ivan Grokhotkov
@igrr
May 05 2017 03:34
Yes, please do update these files with information about the newly added board/boards.
4D Systems
@4dsystems
May 05 2017 03:34
Ok, is there a way to add these to the existing pull request?
Ivan Grokhotkov
@igrr
May 05 2017 03:35
You can add more commits to the same branch you have used when creating the PR. Alternatively, you may amend an existing commit and force-push to the said branch.
Also please rebase the changes on the latest master branch, there are some merge conflicts right now.
4D Systems
@4dsystems
May 05 2017 03:36
ok. ill try to figure out how to do that. Thanks
4D Systems
@4dsystems
May 05 2017 03:55
Ivan, in the documentation file, adding to the table of contents, how do you get the link to jump to the bottom, or will this functionality work once its merged?
I have copied the existing formatting from other areas
4D Systems
@4dsystems
May 05 2017 04:18
Gee this really is a whole new world. I now have 3 pull requests :(
@igrr Please assist if you are able
Ivan Grokhotkov
@igrr
May 05 2017 05:29
Here's a quick guide about making a fork and committing changes to a feature branch:
https://help.github.com/articles/committing-changes-to-a-pull-request-branch-created-from-a-fork/
Once you have done that, the other guide explains how to create a PR from a fork:
https://help.github.com/articles/creating-a-pull-request-from-a-fork/
This is another guide from Github which covers the same topics: https://guides.github.com/activities/forking/
They also have some good video tutorials, if that's your thing:
https://www.youtube.com/playlist?list=PLg7s6cbtAD15G8lNyoaYDuKZSKyJrgwB-
4D Systems
@4dsystems
May 05 2017 05:32
Thanks Ivan, I will read. I did originally fork the repo and change the boards.txt file, and then did a pull request, but it just sat there for days even after saying all tests passed, and I didnt know what else to do. Then it said there was a conflict, as someone else maybe did another change. So I edited the file and submitted it again, all tests passed again, but still nothing is happening. Then I ask you here, and tried to do what you said, but it made 3 new forks, and all 3 have failed the tests. So confusing what I did wrong.
4D Systems
@4dsystems
May 05 2017 06:04
Done. PM'ed you Ivan.
Why would Travic CI be failing
File "/usr/lib/python2.7/socket.py", line 553, in create_connection
for res in getaddrinfo(host, port, 0, SOCK_STREAM):
IOError: [Errno socket error] [Errno -2] Name or service not known
Ivan Grokhotkov
@igrr
May 05 2017 06:16
It is failing because of esp8266/Arduino#3198
Michael Miller
@Makuna
May 05 2017 07:02
@zenmanenergy C++ does not handle passing member methods with the "captured" this pointer easy. There are ways to do it by using lamba wrapper.
https://github.com/Makuna/NeoPixelBus/blob/master/examples/animations/NeoPixelAnimation/NeoPixelAnimation.ino
Has an example in it storing and then passing a lambda (verbose example as often they are written inline when passed).
Ivan Grokhotkov
@igrr
May 05 2017 07:04
Alternatively std::bind can be used for the same purpose
Michael Miller
@Makuna
May 05 2017 07:09
Is std::bind part of the build? What ever you do, it won't be compatible with AVR Arduino as they just don't have stl available, and even the libraries that try fail to include enough of it.
Ivan Grokhotkov
@igrr
May 05 2017 07:43
Ha, you're right. As of Arduino 1.5.8 i believe AVR has C++11 enabled, so i thought that std::bind should be supported as well. However it still doesn't ship with STL headers, even though they were generated when building the compiler.
So lambdas (as a language feature) do work, while std::bind doesn't.
Which is probably of little value since you can't use STL types to pass lambda around and store it as a class member... have to write custom container to replace the std::function.
Tejas H
@CodingCreate101
May 05 2017 10:01
Hi guys, a quick question: how much programming differes for monochrome oled and two color(yellow and blue) oled?
Ivan Grokhotkov
@igrr
May 05 2017 10:05
@CodingCreate101 sorry, how is this related to Arduino core for ESP8266? Please keep this on topic.
Tejas H
@CodingCreate101
May 05 2017 11:04
Uh alright. I was using it with esp. But yeah, you are right.
giesberge
@giesberge
May 05 2017 12:36
Hi, are there any mirrors for arduino.esp8266.com ? I'm trying to install the win32-xtensa-lx106-elf-gb404fb9-2.tar.gz file
Ivan Grokhotkov
@igrr
May 05 2017 12:38
download.igrr.me points to the same server.
giesberge
@giesberge
May 05 2017 12:40
Thanks, updated my json file, seems to be happy, also just found the ip
gregstewart90
@gregstewart90
May 05 2017 14:50
I changed my ide flash size to 4M to match my hardware, but after uploading a script, it no longer connects to wifi. I found an article that said I needed to erase the entire flash and then upload. How do I erase the entire flash?
brutzler
@brutzler
May 05 2017 15:13

Hi,
opening Arduino IDE, I got today this message:

Error downloading http://arduino.esp8266.com/stable/package_esp8266com_index.json

anybody similiar problems?

brutzler
@brutzler
May 05 2017 15:19
Hmmmm... perhaps regarding to this? esp8266/Arduino#3198
Fu...! Can not compile any more, cause of missing ESP-Boards :worried:
brutzler
@brutzler
May 05 2017 15:27
Hmmm... working again...without any change on my system....
Ivan Grokhotkov
@igrr
May 05 2017 15:50
Yep this was recently fixed on the DNS side of things.
Should we move the package json to some more reliable host though?
Except for the toolchain packages everything else is already served from Github releases.
So maybe it's just a matter of moving toolchain packages there as well.
Steve Nelson
@zenmanenergy
May 05 2017 16:12
@Makuna Thanks, I'll take a look. I did a bit more research and found that if I include the 'static' keyword on the methods I was to pass in as callbacks, then it seems to work. Although, I don't know the downsides to doing such a thing.
Michael Miller
@Makuna
May 05 2017 16:30
@zenmanenergy Static will work, but within the static you wont have access to any of the members. An old technique (before STL::bind) was to always have callbacks with a PVOID arg, then the object instance can be passed to the static method, the static method then just casts it to a pointer to itself and then you can call members all you want.
Steve Nelson
@zenmanenergy
May 05 2017 16:31
oh. That's a pretty major downside!
Michael Miller
@Makuna
May 05 2017 16:37
You can use the lambda to glue the callback to call a member of the class. The compiler will capture the instance for you. It just means an extra call in the redirection.
riataman
@riataman
May 05 2017 16:37
has anyone measured the call overhead in the esp8266?
I was wondering the other day when I was looking at a softspi implementation
also branching
Ivan Grokhotkov
@igrr
May 05 2017 16:44
Branch is 2 extra cycles
riataman
@riataman
May 05 2017 16:47
I see, not very expensive
Ivan Grokhotkov
@igrr
May 05 2017 16:48
Call mostly depends on registers being saved and arguments passed. The call itself is essentially a branch. But function prologue will have a bunch of instructions to save callee-saved registers.
riataman
@riataman
May 05 2017 16:49
@igrr: I pun in the overlap hspi changes you requested. In reality I don't really know if that is going to be worth merging.
Ivan Grokhotkov
@igrr
May 05 2017 16:49
With windowed ABI (ESP32) this is done in HW, but with call0 ABI the program must save registers itself.
riataman
@riataman
May 05 2017 16:49
as its kind of hard to use and mostly won't work out of the box with arduino libraries that use spi.
Ivan Grokhotkov
@igrr
May 05 2017 16:50
TBH, i'd rather have this merged, maybe with some explanation in the header file.
riataman
@riataman
May 05 2017 16:51
I guess if its merged we could potencially have people fixing stuff to actually work there.
Ivan Grokhotkov
@igrr
May 05 2017 16:51
Yes. Or filing issues. It works both ways :)
riataman
@riataman
May 05 2017 16:52
I hope the SD card would work
that would free me a lot of pins.
and would actually be fast. software spi is slow
as implemented right now
Ivan Grokhotkov
@igrr
May 05 2017 16:53
I am pretty sure it can be made to work. If anything, I'm going to try that myself, have a board which has SD slot attached to SPI0
riataman
@riataman
May 05 2017 16:54
that would be awesome. I made some progress but couldn't move past initialization.
I found that if I leave the card plugged in during boot it'll never respond to anything.
but if I put it in after boot it'll give some responses
the GPIO0 pulsing at boot might be confusing it. not sure if that's a nodemcu thing or a esp8266 thing.
brutzler
@brutzler
May 05 2017 17:38
@igrr
is some more trouble to be expected on the "old" hoster? Had only once the problem. And if i know the reason its not the problem to look for a solution.
But if you want, you can move the toolchain to github too. Perhaps with a little time of parallel usage. But then you have to update two places....
Is there a "newsletter" place to get such informations? Would have prevent me to post my "problem"
!!!
I am only astonished, that compiling failed. Thought the package was downloaded for offline usage???
Jannis Hermanns
@jayniz
May 05 2017 20:25
hey @igrr is there any mirror for osx-xtensa-lx106-elf-gb404fb9-2.tar.gz? http://arduino.esp8266.com is down again (see https://github.com/esp8266/Arduino/issues/3198#issue-226204749)
Have a look there, a few things were put up there
Me No Dev
@me-no-dev
May 05 2017 23:49
@riataman I have some ideas about those SD issues :)
thing is that the card is it's own thing, so when you initialize it in certain mode, even though you might restart the ESP (flash or whatever) the card will stay in it's mode and might not behave exactly as you wish when SD is starting.
this is really visible on ESP32 if you swap between SDMMC and SD on the same pins, without power restart
I have implemented some measures to coop with most and I do thing thaht in future (in case that nobody else wants to do it sooner) fatfs and SD should be merged from ESP32 to ESP8266
Me No Dev
@me-no-dev
May 05 2017 23:55
I know you are not swapping between SD and MMC mode on ESP8266, but since you say that you need to replug the card to get it going, I have the strong feeling that your problem is connected