These are chat archives for esp8266/Arduino

18th
Jul 2016
Clemens Kirchgatterer
@everslick
Jul 18 2016 10:45
if i want to count (TCP) network traffic, I would have to wrap tcp_write() and tcp_recved(), right?
Me No Dev
@me-no-dev
Jul 18 2016 10:46
but that would mean that you need to edit platform.txt as well wouldn't it?
Ivan Grokhotkov
@igrr
Jul 18 2016 10:47
i think @everslick uses his own very custom makefile so that's not an issue
Clemens Kirchgatterer
@everslick
Jul 18 2016 10:47
yes, indeed
Me No Dev
@me-no-dev
Jul 18 2016 10:48
then that is the best case
Clemens Kirchgatterer
@everslick
Jul 18 2016 10:48
for UDP it would be udp_recv() and udp_sendto()
Me No Dev
@me-no-dev
Jul 18 2016 10:48
@igrr why don't we just add such stats to the interfaces?\
Clemens Kirchgatterer
@everslick
Jul 18 2016 10:49
feature creep? ;-)
Ivan Grokhotkov
@igrr
Jul 18 2016 10:49
#1932 feel free to
Me No Dev
@me-no-dev
Jul 18 2016 10:52
that is more general stats though
Clemens Kirchgatterer
@everslick
Jul 18 2016 10:52
i'm happy with bytes sent and received. no need to distinguish protocols, just like ifconfig
Me No Dev
@me-no-dev
Jul 18 2016 10:52
I was more of iface->bytes_sent/received thing
Clemens Kirchgatterer
@everslick
Jul 18 2016 10:53
me too
Me No Dev
@me-no-dev
Jul 18 2016 10:53
snmp does not count those, so they will not be extra
@everslick there should be better place to hook into btw
Clemens Kirchgatterer
@everslick
Jul 18 2016 10:53
that's what i found digging through WIFIClient
Ivan Grokhotkov
@igrr
Jul 18 2016 10:54
i'd go for ip_input/ip_output
Me No Dev
@me-no-dev
Jul 18 2016 10:54
exactly
ip_output_if
Ivan Grokhotkov
@igrr
Jul 18 2016 10:54
would be nice to make this strictly optional though
Me No Dev
@me-no-dev
Jul 18 2016 10:55
sure thing
Ivan Grokhotkov
@igrr
Jul 18 2016 10:55
i.e. if you reference some stats query function in your sketch, then stats hooks are added. if not, then extra data or code.
probably possible with some good use of linker
Clemens Kirchgatterer
@everslick
Jul 18 2016 10:55
i already set -DLWIP_OPEN_SRC -DMEMP_NUM_TCP_PCB_TIME_WAIT=2, i don't mind extra defines
Ivan Grokhotkov
@igrr
Jul 18 2016 10:56
Arduino users won't be able to use stuff if it is driven by defines
don't get me wrong @everslick, you get highest cred for the code you write, but you aren't exactly the target audience of this project.
Clemens Kirchgatterer
@everslick
Jul 18 2016 10:57
yeah, i fully understand that
Me No Dev
@me-no-dev
Jul 18 2016 10:57
ok, we have 2 interfaces with 2 32bit fields each to store sent/received
code addition will be really short
do you really think that we need this to be optional?
Ivan Grokhotkov
@igrr
Jul 18 2016 10:58
ok, extra four words we can ignore.
i was thinking about the full LwIP stats API
Me No Dev
@me-no-dev
Jul 18 2016 10:58
it has that in form of the stats and snmp
Ivan Grokhotkov
@igrr
Jul 18 2016 10:58
if it's just bytes sent/received, then okay it can be non-optional
Shelby Merrick
@forkineye
Jul 18 2016 12:10
What's the best practice for bit-banging on the ESP now? Just wrap it with noInterrupts() and interrupts()? Any thresholds I need to be aware of?
Ivan Grokhotkov
@igrr
Jul 18 2016 12:16
20us between noInterrupts and interrupts at most
if you can use I2S or UART to bitbang, then you don't need noInterrupts.
(Depending on how busy WiFi around the ESP is, you may be able to get away with more than 20us. But it's not guaranteed.)
Shelby Merrick
@forkineye
Jul 18 2016 12:19
ouch. that's my problem then. this packet can takes 790us to generate
Ivan Grokhotkov
@igrr
Jul 18 2016 12:19
in that case I2S is your friend.
Shelby Merrick
@forkineye
Jul 18 2016 12:20
I'll have to look into it. I came up with a way to use the uart for ws2811 last year, but wasn't able to come up with a method for these GECE lights
ack. i'm on an ESP-01 :/
Shelby Merrick
@forkineye
Jul 18 2016 13:26

Question:

#define UART_STOP_BIT_NUM 0x00000003
/*
Two bits are occupied by the length of Stop Bit. The length of Stop Bit can be configured by setting
the two bits, for example: 1: 1bit; 2: 1.5bit; 3 : 2bit
*/

What what happens if you set it to 0? Will it generate no stop bits?

trying to figure out how to fudge this packet into the uart
Me No Dev
@me-no-dev
Jul 18 2016 13:35
yes, should be 0
still you should look into i2s as it has DMA
Shelby Merrick
@forkineye
Jul 18 2016 13:36
i'm on an ESP-01 :/
think i can fudge it into the uart similar to how i did my ws2811 code
Anirudh Varanasi
@anirudh838
Jul 18 2016 13:43
@holgerlembke somehow got it connected. My readings are 7-digit numbers.
CHAE-PIL LIM
@chaeplin
Jul 18 2016 13:49

[SDK Release] ESP8266_NONOS_SDK_MBEDTLS_20160718

http://bbs.espressif.com/viewtopic.php?f=46&t=2443

Shelby Merrick
@forkineye
Jul 18 2016 15:59
wavedrom.png
Thinking this should work as 8N0 with a lookup table
it's a 27 bit packet so should fit just right with 9 bytes
Me No Dev
@me-no-dev
Jul 18 2016 16:13
@forkineye nice! it took me a sec to realize that every 10th bit (next start bit) happens to be 1 :D
and those 9 bytes fit in the hardware FIFO, so sending will happen in the background
Clemens Kirchgatterer
@everslick
Jul 18 2016 18:24
wrapping ip_output_if_opt() is not that easy (me thinks). i would have to extract the packet length from struct pbuf * ... better i'll wait for @me-no-dev ;-)
Clemens Kirchgatterer
@everslick
Jul 18 2016 19:38
wrapping tcp_write() and tcp_recved() worked quite well though. of course it would be nicer if there was a generic API to the eth interface, but this solution is ok for the time being. so no hurry, @me-no-dev .
PyB
@PyBerger
Jul 18 2016 21:59
hi there
PyB
@PyBerger
Jul 18 2016 22:05

I'm struggling with some exception and really hard time to debug in an advanced way (using GDB Stub).
I have 2 issues /:
1/ sometime I have a random crash (exception (4)) the exception doesn't give much and a gdbstub use points me to something like ```ESP8266WiFiGenericClass::_eventCallback (arg=0x3fff1c34)
at /home/pierre-yves/.arduino15/packages/esp8266/hardware/esp8266/2.3.0/libraries/ESP8266WiFi/src/ESP8266WiFiGeneric.cpp:214
214 if (handler->canExpire() && handler.unique()) {
(gdb) bt

#0 ESP8266WiFiGenericClass::_eventCallback (arg=0x3fff1c34)

at /home/pierre-yves/.arduino15/packages/esp8266/hardware/esp8266/2.3.0/libraries/ESP8266WiFi/src/ESP8266WiFiGeneric.cpp:214

#1 0x40203467 in ESP8266WiFiGenericClass::_eventCallback (arg=0x3fff1c34)

at /home/pierre-yves/.arduino15/packages/esp8266/hardware/esp8266/2.3.0/libraries/ESP8266WiFi/src/ESP8266WiFiGeneric.cpp:205

#2 0x40203467 in ESP8266WiFiGenericClass::_eventCallback (arg=0x3fff1c34)

....
Any clue what could be the cause of this - anyone seen that....

2/ My second issue is when doing some viterbi decoding, the function seems to go forever (never leaves), I commented the code and just added some prints, when I do so I have Exception (28) and gdbsut only gives me ``` Reading symbols from /tmp/build673d8af0e2ecf4bf28e7040a9169578a.tmp/PyRC_Timing_v3.ino.elf...done.
Remote debugging using :9980
0x4020462a in Print::write (this=0x3ffef600 <Serial>, str=0x3ffe847c "DEC TIME:") at /home/pierre-yves/.arduino15/packages/esp8266/hardware/esp8266/2.3.0/cores/esp8266/Print.h:59
59 return write((const uint8_t *) str, strlen(str));
(gdb) bt

#0 0x4020462a in Print::write (this=0x3ffef600 <Serial>, str=0x3ffe847c "DEC TIME:")

at /home/pierre-yves/.arduino15/packages/esp8266/hardware/esp8266/2.3.0/cores/esp8266/Print.h:59

#1 0x40204644 in Print::print (this=<optimized out>, str=<optimized out>) at /home/pierre-yves/.arduino15/packages/esp8266/hardware/esp8266/2.3.0/cores/esp8266/Print.cpp:83

#2 0x40201f17 in transponderId (type=<optimized out>, data=<optimized out>) at /tmp/build673d8af0e2ecf4bf28e7040a9169578a.tmp/sketch/pyrc_decode.h:334

#3 0x40202a04 in manageTransponderHits (timeStamp=1073671212) at /home/pierre-yves/SVN/PyRC_Timing/Embedded/Decoder/v3/esp8266/PyRC_Timing_v3/PyRC_Timing_v3.ino:191

#4 0x40204624 in Print::write (this=0x0, str=<optimized out>) at /home/pierre-yves/.arduino15/packages/esp8266/hardware/esp8266/2.3.0/cores/esp8266/Print.h:59

#5 0x401008c4 in cont_run () at /home/pierre-yves/.arduino15/packages/esp8266/hardware/esp8266/2.3.0/cores/esp8266/cont.S:105

#6 0x40204624 in Print::write (this=0x0, str=<optimized out>) at /home/pierre-yves/.arduino15/packages/esp8266/hardware/esp8266/2.3.0/cores/esp8266/Print.h:59

Would any of you have any clue.... That would help.
My sketch is pretty complex, I can give it away in MP (mixes recoded SPI, recoded ITs, ...)

Shelby Merrick
@forkineye
Jul 18 2016 22:53
@me-no-dev that ended up not working. it configured at 8N0 and I'm not seeing stop bits, however it's still going low 10us between bytes on the UART (running inverted logic). will try at 7N1