These are chat archives for esp8266/Arduino

12th
Jun 2015
Michael Miller
@Makuna
Jun 12 2015 01:44
@igrr I was looking at the dissassbly and I spotted something strange, there is jump to an address that is in the middle of an instruction. see 40202605, it jumps to 40202654, but the instruction starts at 40202653??
402025a8 <_ZN11NeoPixelBus4ShowEv>:
402025a8:    e0c112            addi    a1, a1, -32
402025ab:    61c9          s32i.n    a12, a1, 24
402025ad:    02cd          mov.n    a12, a2
402025af:    2228          l32i.n    a2, a2, 8
402025b1:    7109          s32i.n    a0, a1, 28
402025b3:    51d9          s32i.n    a13, a1, 20
402025b5:    41e9          s32i.n    a14, a1, 16
402025b7:    31f9          s32i.n    a15, a1, 12
402025b9:    0b5216            beqz    a2, 40202672 <_ZN11NeoPixelBus4ShowEv+0xca>
402025bc:    040c22            l8ui    a2, a12, 4
402025bf:    1d3c          movi.n    a13, 49
402025c1:    012280            slli    a2, a2, 24
402025c4:    008296            bltz    a2, 402025d0 <_ZN11NeoPixelBus4ShowEv+0x28>
402025c7:    0029c6            j    40202672 <_ZN11NeoPixelBus4ShowEv+0xca>
402025ca:    00a022            movi    a2, 0
402025cd:    fea9c5            call0    4020106c <delay>
402025d0:    feb2c5            call0    40201100 <micros>
402025d3:    032c32            l32i    a3, a12, 12
402025d6:    c02230            sub    a2, a2, a3
402025d9:    edbd27            bgeu    a13, a2, 402025ca <_ZN11NeoPixelBus4ShowEv+0x22>
402025dc:    006f30            rsil    a3, 15
402025df:    fff121            l32r    a2, 402025a4 <_ZN11NeoPixelBus5BeginEv+0x34>
402025e2:    011c82            l16ui    a8, a12, 2
402025e5:    0239          s32i.n    a3, a2, 0
402025e7:    2c38          l32i.n    a3, a12, 8
402025e9:    050c22            l8ui    a2, a12, 5
402025ec:    160c          movi.n    a6, 1
402025ee:    838a          add.n    a8, a3, a8
402025f0:    401200            ssl    a2
402025f3:    a16600            sll    a6, a6
402025f6:    002020            esync
402025f9:    03ea20            rsr.ccount    a2
402025fc:    c91c          movi.n    a9, 28
402025fe:    1cc222            addi    a2, a2, 28
40202601:    ca3c          movi.n    a10, 60
40202603:    fb5c          movi.n    a11, 95
40202605:    0012c6            j    40202654 <_ZN11NeoPixelBus4ShowEv+0xac>
40202608:    0003d2            l8ui    a13, a3, 0
4020260b:    027d          mov.n    a7, a2
4020260d:    850c          movi.n    a5, 8
4020260f:    80a042            movi    a4, 128
40202612:    10e4d0            and    a14, a4, a13
40202615:    0a2d          mov.n    a2, a10
40202617:    8329e0            moveqz    a2, a9, a14
4020261a:    02ed          mov.n    a14, a2
4020261c:    002020            esync
4020261f:    03ea20            rsr.ccount    a2
40202622:    c0f270            sub    a15, a2, a7
40202625:    f3bbf7            bgeu    a11, a15, 4020261c <_ZN11NeoPixelBus4ShowEv+0x74>
40202628:    fbbb71            l32r    a7, 40201514 <__pinMode+0x384>
4020262b:    0020c0            memw
4020262e:    0769          s32i.n    a6, a7, 0
40202630:    002020            esync
40202633:    03ea70            rsr.ccount    a7
40202636:    c07720            sub    a7, a7, a2
40202639:    f337e7            bltu    a7, a14, 40202630 <_ZN11NeoPixelBus4ShowEv+0x88>
4020263c:    fbb771            l32r    a7, 40201518 <__pinMode+0x388>
4020263f:    550b          addi.n    a5, a5, -1
40202641:    0020c0            memw
40202644:    0769          s32i.n    a6, a7, 0
40202646:    414140            srli    a4, a4, 1
40202649:    458c          beqz.n    a5, 40202651 <_ZN11NeoPixelBus4ShowEv+0xa9>
4020264b:    027d          mov.n    a7, a2
4020264d:    fff046            j    40202612 <_ZN11NeoPixelBus4ShowEv+0x6a>
40202650:    c33200            excw
40202653:    338701            l32r    a0, 401cf470 <_etext+0xc8214>
40202656:    d321b0            excw
40202659:    ff              .byte 0xff
4020265a:    002222            l32i    a2, a2, 0
4020265d:    13e620            wsr.ps    a2
40202660:    002000            isync
40202663:    040c22            l8ui    a2, a12, 4
40202666:    642020            extui    a2, a2, 0, 7
40202669:    044c22            s8i    a2, a12, 4
4020266c:    fea905            call0    40201100 <micros>
4020266f:    036c22            s32i    a2, a12, 12
40202672:    7108          l32i.n    a0, a1, 28
40202674:    61c8          l32i.n    a12, a1, 24
40202676:    51d8          l32i.n    a13, a1, 20
40202678:    41e8          l32i.n    a14, a1, 16
4020267a:    31f8          l32i.n    a15, a1, 12
4020267c:    20c112            addi    a1, a1, 32
4020267f:    f00d          ret.n
40202681:    000000            ill
Me No Dev
@me-no-dev
Jun 12 2015 02:59
GPIO clock is clocked as some sort of divisoin of the CPU clock
timing shanges with CPU freq as opposed to SPI and other peripherals
are we actually talkig to the MCU by adressing 0x60000000+ ?
that !
is awesome
seems easy to modify, so it can ask to the server instead of listen
Michael Miller
@Makuna
Jun 12 2015 06:46
@me-no-dev We are writing to a peripheral register when we write to 0x60000000, the chip is a PSOC, they burn in "features" and expose them in the peripheral registers. The GPIO is exposed this way (and normal timers, and, and). So setting and clearing a pin is a request to a peripheral, and who knows (espresif/extensa) knows what happens in there.
Michael Miller
@Makuna
Jun 12 2015 07:05
I am convinced now that there is a problem in this peripheral. There is "clear" register, a "set" register, and there is a R/W "out" register. This last can be thought of as the AVR Port. If I use the R/W register to get the whole port, set/clear the pin bit, then set the whole port back, the timing gets even stranger, where not only the first bit is messed up, but also about the eigth bit gets a similar effect. Without precise documentation on this peripheral, I can only conclude from the experiment that it "caches" requests and "reacts" when it can (at the lower cycle rate), and it has bugs.
Michael Miller
@Makuna
Jun 12 2015 07:14

Simple by doing the following before I start sending bits...

GPIO_REG_WRITE(GPIO_OUT_ADDRESS, GPIO_REG_READ(GPIO_OUT_ADDRESS));

will cause the first bit "high" to be 1/3 the width it should be and the eighth bit "down" cycle to be five times too long.

Michael Miller
@Makuna
Jun 12 2015 07:59
the code that demonstrates this is at Makuna/NeoPixelBus/NeoPixelBus.cpp, specifically the send_pixels_800() method.
Me No Dev
@me-no-dev
Jun 12 2015 10:48
wow! quite the difference...
are the neopixels working?
Russ Mathis
@RussMathis
Jun 12 2015 12:58
@Anyone, looking for example settings for AdHoc network?
Me No Dev
@me-no-dev
Jun 12 2015 14:32
AdHoc? like have only one client being able to connect to the ESP?
Russ Mathis
@RussMathis
Jun 12 2015 14:34
@me-no-dev , like... each ESP using a hardcoded IP with no DNS.
Me No Dev
@me-no-dev
Jun 12 2015 14:34
so you want the ESPs to connect to an AP with static IP?
Russ Mathis
@RussMathis
Jun 12 2015 14:35
yes
Me No Dev
@me-no-dev
Jun 12 2015 14:35
that is not AdHoc ;)
Russ Mathis
@RussMathis
Jun 12 2015 14:36
So how to not use AP with static IP?
Just each ESP module being able to communication with any other ESP on the same network.
Me No Dev
@me-no-dev
Jun 12 2015 14:36
WiFi.config(ip, gateway, subnet);
Russ Mathis
@RussMathis
Jun 12 2015 14:37
Does that have to come after or befer .begin?
Line 1: WiFi.config, Line 2: WiFi.begin
]OR[
Line 1: WiFi.begin, Line 2: WiFi.config
Me No Dev
@me-no-dev
Jun 12 2015 14:40
config first
but... why do you not read the header files? The cpp files? it's all written there... it's exactly whaty I just did. Opened the header and saw the config method
after your second question i opened the cpp file and looked what is being done
Russ Mathis
@RussMathis
Jun 12 2015 14:43
I'm finding the header files confusing very little documentation. Then when I have issues I read online sources and they seemed to say the config needs to be called after the begin. So next I ask here to make sure I'm not on a wild goose hunt. :)
Me No Dev
@me-no-dev
Jun 12 2015 14:43
you are so far off on this... :D
open the header and look
Russ Mathis
@RussMathis
Jun 12 2015 14:43
K thxs!
Me No Dev
@me-no-dev
Jun 12 2015 14:44
  /* Change Ip configuration settings disabling the dhcp client
        *
        * param local_ip:     Static ip configuration
        * param gateway:     Static gateway configuration
        * param subnet:        Static Subnet mask
        */
    void config(IPAddress local_ip, IPAddress gateway, IPAddress subnet);
Russ Mathis
@RussMathis
Jun 12 2015 15:10
Can't find strtoul() during build?
Tried to include stdio.h
sic stdlib.h
I see it in the .h :unsigned long _EXFUN(strtoul,(const char __n, char *end_PTR, int base));
What would stop the compiler from seeing it?
Michael Miller
@Makuna
Jun 12 2015 15:59
@me-no-dev Yes the NeoPixels do work well, and this problem can come and go by just moving where the include for the header is placed in relation to other libraries.
@RussMathis Did you try ::strtoul or std::strtoul and see if they work? Seems there is a little name mangling going on with this one.
fmgomes
@fmgomes
Jun 12 2015 16:25
I've tried to compile the example above for OTA, and got a lot of warnings, is it necessary to do any special configuration? Some of the warnings below:
In file included from C:\Users\9132\AppData\Roaming\Arduino15\packages\esp8266\hardware\esp8266\1.6.4-816-g1f0673f\cores\esp8266\core_esp8266_eboot_command.c:24:0:
C:\Users\9132\AppData\Roaming\Arduino15\packages\esp8266\hardware\esp8266\1.6.4-816-g1f0673f\cores\esp8266\eboot_command.h:14:23: warning: ISO C restricts enumerator values to range of 'int' [-Wpedantic]
ACTION_LOAD_APP = 0xffffffff
^
C:\Users\9132\AppData\Roaming\Arduino15\packages\esp8266\hardware\esp8266\1.6.4-816-g1f0673f\cores\esp8266\core_esp8266_wiring_digital.c:105:16: warning: redefinition of typedef 'voidFuncPtr' [-Wpedantic]
typedef void (voidFuncPtr)(void);
^
In file included from C:\Users\9132\AppData\Roaming\Arduino15\packages\esp8266\hardware\esp8266\1.6.4-816-g1f0673f\cores\esp8266\core_esp8266_wiring_digital.c:22:0:
C:\Users\9132\AppData\Roaming\Arduino15\packages\esp8266\hardware\esp8266\1.6.4-816-g1f0673f\cores\esp8266\wiring_private.h:37:16: note: previous declaration of 'voidFuncPtr' was here
typedef void (
voidFuncPtr)(void);
^
In file included from C:\Users\9132\AppData\Roaming\Arduino15\packages\esp8266\hardware\esp8266\1.6.4-816-g1f0673f\cores\esp8266\spiffs\spiffs_cache.c:9:0:
C:\Users\9132\AppData\Roaming\Arduino15\packages\esp8266\hardware\esp8266\1.6.4-816-g1f0673f\cores\esp8266\spiffs\spiffs_nucleus.h:348:6: warning: ISO C99 doesn't support unnamed structs/unions [-Wpedantic]
};
^
C:\Users\9132\AppData\Roaming\Arduino15\packages\esp8266\hardware\esp8266\1.6.4-816-g1f0673f\cores\esp8266\spiffs\spiffs_nucleus.h:358:6: warning: ISO C99 doesn't support unnamed structs/unions [-Wpedantic]
};
^
C:\Users\9132\AppData\Roaming\Arduino15\packages\esp8266\hardware\esp8266\1.6.4-816-g1f0673f\cores\esp8266\spiffs\spiffs_nucleus.h:343:3: warning: union has no named members [-Wpedantic]
union {
^
C:\Users\9132\AppData\Roaming\Arduino15\packages\esp8266\hardware\esp8266\1.6.4-816-g1f0673f\cores\esp8266\spiffs\spiffs_nucleus.h:360:4: warning: ISO C99 doesn't support unnamed structs/unions [-Wpedantic]
};
It has no errors, only warnings, but I wanto your opinion before trying in a real node :D
chad cormier roussel
@chadouming
Jun 12 2015 16:31
It's ok, it's because of the pedantic flag. Nothing to worry.
:D
Me No Dev
@me-no-dev
Jun 12 2015 17:52
does anyone here have a 3D printer?
chad cormier roussel
@chadouming
Jun 12 2015 18:44
i'm looking to buy one
at least a diy kit
Kiril Zyapkov
@kzyapkov
Jun 12 2015 20:34
I have access to a MakerBot 2
bad things happen when #include "user_interface.h", conflicts with ip_addr.h from lwip I believe
Is there a quick fix?