Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
Develo
@devyte
@AlfonsMittelmeyer welcome to our public channel
Earle F. Philhower, III
@earlephilhower
@Makuna have him open an issue on the Arduino-8266 tracker with a stack decode. Class static variables sit in BSS, which is always in RAM. There is also a .MAP file generated on ARduino compile where you can find the absolute address of this variable (post-C++-name-mangling) to verify its location. Only symbols starting with _ZTV (a prefix that GCC adds only to vtable names) should be moved.
Michael Miller
@Makuna
Thanks @earlephilhower , I have been trying to create a minimum sketch that demonstrates it. I am seeing some interesting behavior when the class object is destroyed, the static variable values (I added some debug static variables to track some stuff) are being changed to the same non-zero value even though nothing in the destructor is doing anything.
Earle F. Philhower, III
@earlephilhower
If you were able to set anything to the static variable, it's not in flash for sure (you'd fault writing anything to it). There is no data copied automatically from flash to ram after BSS is initialized at system startup. Very odd thing you're seeing!
Sam Kendrick
@adnauseum
Hi all, I finished my first IoT project ever! It's a bathroom door monitor for my workplace. It is really simple; just hits a lambda function to modify a piece of state in a DB. I integrated it with Slack, so the status can be queried. I'm know my code is pretty poor, but I was making this during my brief lunch breaks :-D https://github.com/adnauseum/esp8266-door-monitor/blob/master/arduino_code/door-monitor.ino
Bert Melis
@bertmelis
how do you printf a uint64_t? I tried snprintf(str, sizeof(str), "%" PRIu64, value); but it prints "lu"
Bert Melis
@bertmelis
Anyone? Is my code wrong of is there a bug of is this feature just missing?
Myles Eftos
@madpilot
The formatted should be “%lu”
Wait. Sorry. Ignore
david gauchard
@d-a-v
%llu ?
or %Lu ?
Bert Melis
@bertmelis
%llu prints "lu"
%Lu does the trick. I thought uint64_t is a long long unsigned int, but it is a long double when I follow printf's logic
Redferne Bellini
@Redferne
Haha. Was really upset about this last week. Thanks, %Lu to printf a uint64_t. Why in gaawks name is PRIu64 defined as %lu?
Bert Melis
@bertmelis
so it is a bug, or intended? And it's SDK code, not Arduino.
Me No Dev
@me-no-dev
unsigned int on 32 bit system is uint32_t. unsigned long int is uint64_t
Bert Melis
@bertmelis
now I'm completely lost
millis() returns uint32_t which is defined as unsigned long. In this logic, uint64_t is unsigned long long.
Bert Melis
@bertmelis
however, to printf uint64_t I have to use Lu which implicates this is a long double.
Me No Dev
@me-no-dev
uint32_t is unsigned int
int is int32_t (32 bit system)
millis returns unsigned long for compatibility probably
Bert Melis
@bertmelis
I take this from c_types.h:
typedef unsigned int        uint32;
typedef unsigned long long  uint64;
Me No Dev
@me-no-dev
hmmm.. that seems odd
Bert Melis
@bertmelis
same definitions in stdint.h. So it is very odd printf assumes uint64_t is a long double (which is something comepletely different off course)
maybe I'm looking in the wrong place. I looked into the headers at Arduino/tools/sdk/...
david gauchard
@d-a-v
This is not odd to me. On 32 bits archs, int/long are 32 and long long is 64. I just tested it again on the esp. It has to be noted that printf(%) deal with int(%d %i) long(%ld %li) or long long (%lld %lli %Ld %Li) (man printf is not clear, speaking of double for L but also saying it's a synonym of ll which applies to integers). It does not known int_t types. This is why these PRI* macro were introduced, and yes at least PRIu64 prints "lu" too here.
david gauchard
@d-a-v
on 32 and 64 bits archs, we can always cast to (unsigned) int and use %u/id for 32 bits, or cast to (unsigned) long long and use %Lu/id for 64 bits. At least until these PRI* macro are worked-out.
David Albert
@dalbert2

I am working on a wireless bridge device (like Zigbee to WiFi) and believe I need to turn off the WiFi in order to transmit in Zigbee for FCC compliance reasons.

I am disconnecting using the sequence WiFi.disconnect(true); WiFi.mode(WIFI_OFF); WiFi.forceSleepBegin();. I re-enable using WiFi.forceSleepWake(); WiFi.persistent(false); WiFi.mode(WIFI_STA); WiFi.begin(mySsid, myPsk);

This works, but as soon as I re-enabled WiFi, the onSTAGotIP() callback is invoked with a null IP address and it is not invoked again when the IP address is actually received via DHCP. Is this expected behavior or should I file a problem ticket?

Bert Melis
@bertmelis
silly question maybe, but what is the c++ (standard) version of the compiler? Or where can I find out?
Clemens Kirchgatterer
@everslick
somewhere in the tools directory is the toolchain. the compiler takes the command line parameter --version and will happily report its version if asked nicely.
../../Arduino-ESP8266/tools/xtensa-lx106-elf/bin/xtensa-lx106-elf-g++ --version
xtensa-lx106-elf-g++ (crosstool-NG 1.20.0) 4.8.2
Copyright (C) 2013 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Develo
@devyte
C++11. Be aware that stdlibc++ support is incomplete.
Bert Melis
@bertmelis
thanks, where did you find this info?
Clemens Kirchgatterer
@everslick
sankarsurya
@sankarsurya
if anyone knows the esp32 arduino spi master receive code
Me No Dev
@me-no-dev
@sankarsurya there is no point to ask this again here
do some googling, read some examples... it's pretty straight-forward peripheral
Bert Melis
@bertmelis
Do I understand correctly that os_strcpy or ets_strcpy optimized versions of the standard C function strcpy? (for example, complete list in osapi.h)
Is there any reason to use the non API versions?
Develo
@devyte
@bertmelis I'm not sure about this, but I think they all map to the same underlying function
Ash
@ashthespy
Hi,
Off late, I don't seem to be able to have success with OTA. It starts of fine, but then seems to reset somewhere down the line. This happens at seemingly random percentages 3 -- 58 even with the simple OTA sketch

                 Start

Progress: 0%
Progress: 0%
Progress: 0%
Progress: 0%
Progress: 1%
Progress: 1%
Progress: 1%
Progress: 2%
Progress: 2%
Progress: 2%
Progress: 3%
Progress: 3%
Progress: 3%

Soft WDT reset

ctx: cont
sp: 3fff05e0 end: 3fff08d0 offset: 01b0


>>>stack>>>
3fff0790:  00000000 4000444e 00000001 40100690

3fff07a0:  00000000 4000420c 60000200 3fff2b8c

3fff07b0:  00000100 40004ac0 00000100 002b5000

3fff07c0:  00000100 3fff2b4c 3fffc718 002b5000

3fff07d0:  00001000 00e8a101 40105734 00001000

3fff07e0:  3fff2b4c 3fff2b4c 00003000 3fff2b4c

3fff07f0:  3fffc718 3fff2b4c 40209c48 3ffef8b0

3fff0800:  002b5000 40208712 002b5000 00001000

3fff0810:  00000000 3ffef7c4 3ffef808 40209111

3fff0820:  00000000 3ffef808 3ffef72c 402081e8

3fff0830:  40106f70 00000000 00001388 3ffef8b0

3fff0840:  00000000 3fff28ac 00000000 40107028

3fff0850:  6001a8c0 6001a8c0 3ffef678 40206bff

3fff0860:  3ffef7b0 00000000 00000001 40202aec

3fff0870:  888e8888 88ee88e8 8e8e8e88 3ffef8a4

3fff0880:  3fffdad0 00000000 3ffef72c 4020832a

3fff0890:  4b000000 00000000 3ffef89d 402027a2

3fff08a0:  00000000 00000000 00000001 40209c69

3fff08b0:  3fffdad0 00000000 3ffef89d 40209c94

3fff08c0:  feefeffe feefeffe 3ffef8b0 40100700

<<<stack<<<


 ets Jan  8 2013,rst cause:2, boot mode:(3,6)
Arun Khanchandani
@arunk140
Download the EspException Decoder. That should give you what the stack means.
Holger Lembke
@holgerlembke
  HTTPClient http;

  http.begin("http://localhost/");
  int result = http.POST("hallo");
  String answer = " "+http.getString();  

  Serial.println("result: "+String(result));
  Serial.println("answer: "+answer);

  http.end();
all I get is result=-1
Me No Dev
@me-no-dev
hahahahaha
Holger Lembke
@holgerlembke
Oh. I see.
holgerlembke @holgerlembke stupid
Holger Lembke
@holgerlembke
searching for an hour and when I post it I instantly see the error.....
Me No Dev
@me-no-dev
sorry I could not resist to laugh at it :D