Post topics, source code that relate to the Arduino Platform

User avatar
By kaoz3000
#16354 Hi Byandrew melvin,
wow your library is exactly what I was looking for. This is so brilliant!
But I can't get this to work on my Mac.
On compiling many libraries from /Applications/Arduino-esp.app/Contents/Java/hardware/tools/esp8266/sdk/include were missing, so I copied them into the Directory of you library. But now I'm sucked with this error now:

Code: Select allIn file included from /Applications/Arduino-esp.app/Contents/Java/hardware/arduino/avr/cores/arduino/Arduino.h:224:0,
                 from /Volumes/kaozData/Users/felix/Documents/Arduino/libraries/Esp_WS2812/Esp_WS2812.h:6,
                 from myws2812test.ino:1:
/Applications/Arduino-esp.app/Contents/Java/hardware/arduino/avr/cores/arduino/USBAPI.h:31:23: error: conflicting declaration 'typedef long unsigned int u32'
 typedef unsigned long u32;
                       ^
In file included from /Volumes/kaozData/Users/felix/Documents/Arduino/libraries/Esp_WS2812/Esp_WS2812.h:1:0,
                 from myws2812test.ino:1:
/Volumes/kaozData/Users/felix/Documents/Arduino/libraries/Esp_WS2812/c_types.h:31:29: error: 'u32' has a previous declaration as 'typedef unsigned int u32'
 typedef unsigned int        u32;
                             ^
Fehler beim Kompilieren.


:(
User avatar
By paulwb
#16961 I've been following this post since Sunday to see if the author came back to lend a hand. No dice, so I downloaded the lirary, installed it, and tried to compile myws2812test (Arduino 8266, OS X). Got this:

Code: Select allUsing library Esp_WS2812 in folder: /Users/durandal/Documents/Arduino/libraries/Esp_WS2812 (legacy)

/Users/durandal/Documents/Arduino/esp8266/Arduino8266.app/Contents/Java/hardware/tools/esp8266/xtensa-lx106-elf/bin/xtensa-lx106-elf-g++ -D__ets__ -DICACHE_FLASH -I/Users/durandal/Documents/Arduino/esp8266/Arduino8266.app/Contents/Java/hardware/tools/esp8266/sdk//include -c -Os -mlongcalls -mtext-section-literals -fno-exceptions -fno-rtti -std=c++11 -MMD -DF_CPU=80000000L -DARDUINO=10601 -DARDUINO_ESP8266_ESP01 -DARDUINO_ARCH_ESP8266_OLD -I/Users/durandal/Documents/Arduino/esp8266/Arduino8266.app/Contents/Java/hardware/esp8266com/esp8266_old/cores/esp8266 -I/Users/durandal/Documents/Arduino/esp8266/Arduino8266.app/Contents/Java/hardware/esp8266com/esp8266_old/variants/esp01 -I/Users/durandal/Documents/Arduino/libraries/Esp_WS2812 /var/folders/51/mn17tsd91k7fqww2x3sdfrlw0000gn/T/build7693316613586356223.tmp/myws2812test.cpp -o /var/folders/51/mn17tsd91k7fqww2x3sdfrlw0000gn/T/build7693316613586356223.tmp/myws2812test.cpp.o
Using previously compiled file: /var/folders/51/mn17tsd91k7fqww2x3sdfrlw0000gn/T/build7693316613586356223.tmp/Esp_WS2812/Esp_WS2812.cpp.o
/Users/durandal/Documents/Arduino/esp8266/Arduino8266.app/Contents/Java/hardware/tools/esp8266/xtensa-lx106-elf/bin/xtensa-lx106-elf-as -o /var/folders/51/mn17tsd91k7fqww2x3sdfrlw0000gn/T/build7693316613586356223.tmp/cont.S.o /Users/durandal/Documents/Arduino/esp8266/Arduino8266.app/Contents/Java/hardware/esp8266com/esp8266_old/cores/esp8266/cont.S
Using previously compiled file: /var/folders/51/mn17tsd91k7fqww2x3sdfrlw0000gn/T/build7693316613586356223.tmp/cont_util.c.o
Using previously compiled file: /var/folders/51/mn17tsd91k7fqww2x3sdfrlw0000gn/T/build7693316613586356223.tmp/core_esp8266_noniso.c.o
Using previously compiled file: /var/folders/51/mn17tsd91k7fqww2x3sdfrlw0000gn/T/build7693316613586356223.tmp/core_esp8266_wiring.c.o
Using previously compiled file: /var/folders/51/mn17tsd91k7fqww2x3sdfrlw0000gn/T/build7693316613586356223.tmp/core_esp8266_wiring_analog.c.o
Using previously compiled file: /var/folders/51/mn17tsd91k7fqww2x3sdfrlw0000gn/T/build7693316613586356223.tmp/core_esp8266_wiring_digital.c.o
Using previously compiled file: /var/folders/51/mn17tsd91k7fqww2x3sdfrlw0000gn/T/build7693316613586356223.tmp/core_esp8266_wiring_pulse.c.o
Using previously compiled file: /var/folders/51/mn17tsd91k7fqww2x3sdfrlw0000gn/T/build7693316613586356223.tmp/core_esp8266_wiring_shift.c.o
Using previously compiled file: /var/folders/51/mn17tsd91k7fqww2x3sdfrlw0000gn/T/build7693316613586356223.tmp/abi.cpp.o
Using previously compiled file: /var/folders/51/mn17tsd91k7fqww2x3sdfrlw0000gn/T/build7693316613586356223.tmp/core_esp8266_main.cpp.o
Using previously compiled file: /var/folders/51/mn17tsd91k7fqww2x3sdfrlw0000gn/T/build7693316613586356223.tmp/HardwareSerial.cpp.o
Using previously compiled file: /var/folders/51/mn17tsd91k7fqww2x3sdfrlw0000gn/T/build7693316613586356223.tmp/i2c.cpp.o
Using previously compiled file: /var/folders/51/mn17tsd91k7fqww2x3sdfrlw0000gn/T/build7693316613586356223.tmp/IPAddress.cpp.o
Using previously compiled file: /var/folders/51/mn17tsd91k7fqww2x3sdfrlw0000gn/T/build7693316613586356223.tmp/Print.cpp.o
Using previously compiled file: /var/folders/51/mn17tsd91k7fqww2x3sdfrlw0000gn/T/build7693316613586356223.tmp/Stream.cpp.o
Using previously compiled file: /var/folders/51/mn17tsd91k7fqww2x3sdfrlw0000gn/T/build7693316613586356223.tmp/Tone.cpp.o
Using previously compiled file: /var/folders/51/mn17tsd91k7fqww2x3sdfrlw0000gn/T/build7693316613586356223.tmp/WMath.cpp.o
Using previously compiled file: /var/folders/51/mn17tsd91k7fqww2x3sdfrlw0000gn/T/build7693316613586356223.tmp/WString.cpp.o
/Users/durandal/Documents/Arduino/esp8266/Arduino8266.app/Contents/Java/hardware/tools/esp8266/xtensa-lx106-elf/bin/xtensa-lx106-elf-ar cru /var/folders/51/mn17tsd91k7fqww2x3sdfrlw0000gn/T/build7693316613586356223.tmp/core.a /var/folders/51/mn17tsd91k7fqww2x3sdfrlw0000gn/T/build7693316613586356223.tmp/cont.S.o
/Users/durandal/Documents/Arduino/esp8266/Arduino8266.app/Contents/Java/hardware/tools/esp8266/xtensa-lx106-elf/bin/xtensa-lx106-elf-ar cru /var/folders/51/mn17tsd91k7fqww2x3sdfrlw0000gn/T/build7693316613586356223.tmp/core.a /var/folders/51/mn17tsd91k7fqww2x3sdfrlw0000gn/T/build7693316613586356223.tmp/cont_util.c.o
/Users/durandal/Documents/Arduino/esp8266/Arduino8266.app/Contents/Java/hardware/tools/esp8266/xtensa-lx106-elf/bin/xtensa-lx106-elf-ar cru /var/folders/51/mn17tsd91k7fqww2x3sdfrlw0000gn/T/build7693316613586356223.tmp/core.a /var/folders/51/mn17tsd91k7fqww2x3sdfrlw0000gn/T/build7693316613586356223.tmp/core_esp8266_noniso.c.o
/Users/durandal/Documents/Arduino/esp8266/Arduino8266.app/Contents/Java/hardware/tools/esp8266/xtensa-lx106-elf/bin/xtensa-lx106-elf-ar cru /var/folders/51/mn17tsd91k7fqww2x3sdfrlw0000gn/T/build7693316613586356223.tmp/core.a /var/folders/51/mn17tsd91k7fqww2x3sdfrlw0000gn/T/build7693316613586356223.tmp/core_esp8266_wiring.c.o
/Users/durandal/Documents/Arduino/esp8266/Arduino8266.app/Contents/Java/hardware/tools/esp8266/xtensa-lx106-elf/bin/xtensa-lx106-elf-ar cru /var/folders/51/mn17tsd91k7fqww2x3sdfrlw0000gn/T/build7693316613586356223.tmp/core.a /var/folders/51/mn17tsd91k7fqww2x3sdfrlw0000gn/T/build7693316613586356223.tmp/core_esp8266_wiring_analog.c.o
/Users/durandal/Documents/Arduino/esp8266/Arduino8266.app/Contents/Java/hardware/tools/esp8266/xtensa-lx106-elf/bin/xtensa-lx106-elf-ar cru /var/folders/51/mn17tsd91k7fqww2x3sdfrlw0000gn/T/build7693316613586356223.tmp/core.a /var/folders/51/mn17tsd91k7fqww2x3sdfrlw0000gn/T/build7693316613586356223.tmp/core_esp8266_wiring_digital.c.o
/Users/durandal/Documents/Arduino/esp8266/Arduino8266.app/Contents/Java/hardware/tools/esp8266/xtensa-lx106-elf/bin/xtensa-lx106-elf-ar cru /var/folders/51/mn17tsd91k7fqww2x3sdfrlw0000gn/T/build7693316613586356223.tmp/core.a /var/folders/51/mn17tsd91k7fqww2x3sdfrlw0000gn/T/build7693316613586356223.tmp/core_esp8266_wiring_pulse.c.o
/Users/durandal/Documents/Arduino/esp8266/Arduino8266.app/Contents/Java/hardware/tools/esp8266/xtensa-lx106-elf/bin/xtensa-lx106-elf-ar cru /var/folders/51/mn17tsd91k7fqww2x3sdfrlw0000gn/T/build7693316613586356223.tmp/core.a /var/folders/51/mn17tsd91k7fqww2x3sdfrlw0000gn/T/build7693316613586356223.tmp/core_esp8266_wiring_shift.c.o
/Users/durandal/Documents/Arduino/esp8266/Arduino8266.app/Contents/Java/hardware/tools/esp8266/xtensa-lx106-elf/bin/xtensa-lx106-elf-ar cru /var/folders/51/mn17tsd91k7fqww2x3sdfrlw0000gn/T/build7693316613586356223.tmp/core.a /var/folders/51/mn17tsd91k7fqww2x3sdfrlw0000gn/T/build7693316613586356223.tmp/abi.cpp.o
/Users/durandal/Documents/Arduino/esp8266/Arduino8266.app/Contents/Java/hardware/tools/esp8266/xtensa-lx106-elf/bin/xtensa-lx106-elf-ar cru /var/folders/51/mn17tsd91k7fqww2x3sdfrlw0000gn/T/build7693316613586356223.tmp/core.a /var/folders/51/mn17tsd91k7fqww2x3sdfrlw0000gn/T/build7693316613586356223.tmp/core_esp8266_main.cpp.o
/Users/durandal/Documents/Arduino/esp8266/Arduino8266.app/Contents/Java/hardware/tools/esp8266/xtensa-lx106-elf/bin/xtensa-lx106-elf-ar cru /var/folders/51/mn17tsd91k7fqww2x3sdfrlw0000gn/T/build7693316613586356223.tmp/core.a /var/folders/51/mn17tsd91k7fqww2x3sdfrlw0000gn/T/build7693316613586356223.tmp/HardwareSerial.cpp.o
/Users/durandal/Documents/Arduino/esp8266/Arduino8266.app/Contents/Java/hardware/tools/esp8266/xtensa-lx106-elf/bin/xtensa-lx106-elf-ar cru /var/folders/51/mn17tsd91k7fqww2x3sdfrlw0000gn/T/build7693316613586356223.tmp/core.a /var/folders/51/mn17tsd91k7fqww2x3sdfrlw0000gn/T/build7693316613586356223.tmp/i2c.cpp.o
/Users/durandal/Documents/Arduino/esp8266/Arduino8266.app/Contents/Java/hardware/tools/esp8266/xtensa-lx106-elf/bin/xtensa-lx106-elf-ar cru /var/folders/51/mn17tsd91k7fqww2x3sdfrlw0000gn/T/build7693316613586356223.tmp/core.a /var/folders/51/mn17tsd91k7fqww2x3sdfrlw0000gn/T/build7693316613586356223.tmp/IPAddress.cpp.o
/Users/durandal/Documents/Arduino/esp8266/Arduino8266.app/Contents/Java/hardware/tools/esp8266/xtensa-lx106-elf/bin/xtensa-lx106-elf-ar cru /var/folders/51/mn17tsd91k7fqww2x3sdfrlw0000gn/T/build7693316613586356223.tmp/core.a /var/folders/51/mn17tsd91k7fqww2x3sdfrlw0000gn/T/build7693316613586356223.tmp/Print.cpp.o
/Users/durandal/Documents/Arduino/esp8266/Arduino8266.app/Contents/Java/hardware/tools/esp8266/xtensa-lx106-elf/bin/xtensa-lx106-elf-ar cru /var/folders/51/mn17tsd91k7fqww2x3sdfrlw0000gn/T/build7693316613586356223.tmp/core.a /var/folders/51/mn17tsd91k7fqww2x3sdfrlw0000gn/T/build7693316613586356223.tmp/Stream.cpp.o
/Users/durandal/Documents/Arduino/esp8266/Arduino8266.app/Contents/Java/hardware/tools/esp8266/xtensa-lx106-elf/bin/xtensa-lx106-elf-ar cru /var/folders/51/mn17tsd91k7fqww2x3sdfrlw0000gn/T/build7693316613586356223.tmp/core.a /var/folders/51/mn17tsd91k7fqww2x3sdfrlw0000gn/T/build7693316613586356223.tmp/Tone.cpp.o
/Users/durandal/Documents/Arduino/esp8266/Arduino8266.app/Contents/Java/hardware/tools/esp8266/xtensa-lx106-elf/bin/xtensa-lx106-elf-ar cru /var/folders/51/mn17tsd91k7fqww2x3sdfrlw0000gn/T/build7693316613586356223.tmp/core.a /var/folders/51/mn17tsd91k7fqww2x3sdfrlw0000gn/T/build7693316613586356223.tmp/WMath.cpp.o
/Users/durandal/Documents/Arduino/esp8266/Arduino8266.app/Contents/Java/hardware/tools/esp8266/xtensa-lx106-elf/bin/xtensa-lx106-elf-ar cru /var/folders/51/mn17tsd91k7fqww2x3sdfrlw0000gn/T/build7693316613586356223.tmp/core.a /var/folders/51/mn17tsd91k7fqww2x3sdfrlw0000gn/T/build7693316613586356223.tmp/WString.cpp.o
/Users/durandal/Documents/Arduino/esp8266/Arduino8266.app/Contents/Java/hardware/tools/esp8266/xtensa-lx106-elf/bin/xtensa-lx106-elf-gcc -nostdlib -Wl,--no-check-sections -u call_user_start -Wl,-static -L/Users/durandal/Documents/Arduino/esp8266/Arduino8266.app/Contents/Java/hardware/tools/esp8266/sdk//lib -L/Users/durandal/Documents/Arduino/esp8266/Arduino8266.app/Contents/Java/hardware/tools/esp8266/sdk//ld -Teagle.app.v6.ld -o /var/folders/51/mn17tsd91k7fqww2x3sdfrlw0000gn/T/build7693316613586356223.tmp/myws2812test.cpp.elf -Wl,--start-group /var/folders/51/mn17tsd91k7fqww2x3sdfrlw0000gn/T/build7693316613586356223.tmp/myws2812test.cpp.o /var/folders/51/mn17tsd91k7fqww2x3sdfrlw0000gn/T/build7693316613586356223.tmp/Esp_WS2812/Esp_WS2812.cpp.o /var/folders/51/mn17tsd91k7fqww2x3sdfrlw0000gn/T/build7693316613586356223.tmp/core.a -lc -lgcc -lhal -lphy -lnet80211 -llwip -lwpa -lmain -lpp -Wl,--end-group -L/var/folders/51/mn17tsd91k7fqww2x3sdfrlw0000gn/T/build7693316613586356223.tmp
/Users/durandal/Documents/Arduino/esp8266/Arduino8266.app/Contents/Java/hardware/tools/esp8266/xtensa-lx106-elf/bin/../lib/gcc/xtensa-lx106-elf/4.8.2/../../../../xtensa-lx106-elf/lib/libc.a(lib_a-mallocr.o):(.literal+0x1c): undefined reference to `_sbrk_r'
/Users/durandal/Documents/Arduino/esp8266/Arduino8266.app/Contents/Java/hardware/tools/esp8266/xtensa-lx106-elf/bin/../lib/gcc/xtensa-lx106-elf/4.8.2/../../../../xtensa-lx106-elf/lib/libc.a(lib_a-mallocr.o): In function `malloc_extend_top':
mallocr.c:(.text+0x5e): undefined reference to `_sbrk_r'
mallocr.c:(.text+0x127): undefined reference to `_sbrk_r'
/Users/durandal/Documents/Arduino/esp8266/Arduino8266.app/Contents/Java/hardware/tools/esp8266/xtensa-lx106-elf/bin/../lib/gcc/xtensa-lx106-elf/4.8.2/../../../../xtensa-lx106-elf/lib/libc.a(lib_a-freer.o): In function `_malloc_trim_r':
mallocr.c:(.text+0x366): undefined reference to `_sbrk_r'
mallocr.c:(.text+0x38f): undefined reference to `_sbrk_r'
/Users/durandal/Documents/Arduino/esp8266/Arduino8266.app/Contents/Java/hardware/tools/esp8266/xtensa-lx106-elf/bin/../lib/gcc/xtensa-lx106-elf/4.8.2/../../../../xtensa-lx106-elf/lib/libc.a(lib_a-freer.o):mallocr.c:(.text+0x3a0): more undefined references to `_sbrk_r' follow
collect2: error: ld returned 1 exit status
Error compiling.


I've googled around for the "`_sbrk_r'"error, no luck. Just some references to replacing C++ memory management functions with C ones. This is a bit beyond my abilities so I will wait for input from a kind, learned soul. :)
User avatar
By glynnsimon
#17058
paulwb wrote:I've been following this post since Sunday to see if the author came back to lend a hand. No dice, so I downloaded the lirary, installed it, and tried to compile myws2812test (Arduino 8266, OS X). Got this:


Hi paulwb, Not to indicate that this is the appropriate solution to your problem, but I'll let you know what worked for me.

I was having a similar (not sure if exactly the same but definitely included the _sbrk_r part) issue when compiling the examples using the IDE package for OS X.

I have ended up getting mine to work by:
1. getting the source for the IDE from github
2. Installing the JDK 8u45 (1.8) from Oracle - because it won't build with the JDK 1.6 on my version of OS X (Mavericks)
3. building the IDE
4. building the sample from the WS2812 - no _sbrk_r_ error.

Compiled, uploaded and ran fine for me after doing that. A long road to get there though ... :)
Regards
User avatar
By andrew melvin
#17068 Hi,

Sorry i'd neglected to check back here in a while. Unfortunately i can't really help you. My experience with C, and Arduino is in the timeframe of 2 months. It looks like there are some things missed if you can't compile the demo. My advice would be to clone and build a more recent version of the arduino IDE. If you are using the first 1.6.1 release from git-hub, a huge amount has changed since that was first put up. A huge amount.

Also there is another lib, https://github.com/Makuna/NeoPixelBus.git

This lib, uses a different method of bit banging, namely cpu cycle counts, and it is also able to stop timer 14 interrupts, which makes it less flickery as the wifi stack can't interrupt things. I can't comment on it too much, as i've yet to attach it to any length of string. But I am working with it.

The downsides, are that it is not quite comparable with the arduino lib. Markus has removed the dim feature, and created an rgb object that handles the color. this means the demo functions from arduino don't quite work. i'm struggling round trying to adjust them and learn about it.

If you check the issues, he also showed me how to create the ws2812 object dynamically, which means that you can adjust the number of pixels after you have compiled. That advice will probably work with the adafruit lib too actually. This is great as now you can just deploy a set up and adjust the string length in a web page for example.

let me know how you get on.