These are chat archives for esp8266/Arduino

25th
May 2015
Michael Miller
@Makuna
May 25 2015 01:21
Running the latest release, I am getting a compile hang. I have verbose on and this is the statement that I see last.
C:\Users\Michael\AppData\Roaming\Arduino15\packages\esp8266\tools\xtensa-lx106-elf-gcc\1.20.0-26-gb404fb9/bin/xtensa-lx106-elf-gcc -nostdlib -Wl,--no-check-sections -u call_user_start -Wl,-static -LC:\Users\Michael\AppData\Roaming\Arduino15\packages\esp8266\hardware\esp8266\1.6.4-673-g8cd3697/tools/sdk//lib -LC:\Users\Michael\AppData\Roaming\Arduino15\packages\esp8266\hardware\esp8266\1.6.4-673-g8cd3697/tools/sdk//ld -Teagle.flash.4m.ld -o C:\Users\Michael\AppData\Local\Temp\build2948759858614809419.tmp/CompareCountTest.cpp.elf -Wl,--start-group C:\Users\Michael\AppData\Local\Temp\build2948759858614809419.tmp\CompareCountTest.cpp.o C:\Users\Michael\AppData\Local\Temp\build2948759858614809419.tmp/core.a -lm -lgcc -lhal -lphy -lnet80211 -llwip -lwpa -lmain -lpp -lsmartconfig -Wl,--end-group -LC:\Users\Michael\AppData\Local\Temp\build2948759858614809419.tmp
Michael Miller
@Makuna
May 25 2015 02:10
Ok, this is strange, there was a compile error, but it wasn't showing with this sketch. I switch to several others, and most would do the same thing, but one showed that I had compile error. I fixed it, and now they all build. Things seem a little unstable ;-/
Michael Miller
@Makuna
May 25 2015 02:27
@igrr I submitted a pull esp8266/Arduino#326 for exposing another timer with interrupt. The plan is to use this in a Servo library.
alon24
@alon24
May 25 2015 07:25
How do I actually use serial1? i see that people refrence it, but i do not understand, to which pin do I connect it (esp-12) or do you use regular rx,tx? or set any pin as serial1?
Ivan Grokhotkov
@igrr
May 25 2015 07:26
gpio2 is Serial1 TX
we have this in readme :)
Serial1 uses UART1 which is a transmit-only UART. UART1 TX pin is GPIO2. To use Serial1, call Serial1.begin.
alon24
@alon24
May 25 2015 07:39
gr8
ficeto
@ficeto
May 25 2015 07:51
@Makuna awesome job
Ivan Grokhotkov
@igrr
May 25 2015 08:06
@Makuna very cool, thanks
it is auto-disabled when the compare value matches CCOUNT
so this timer acts as a one-shot?
alon24
@alon24
May 25 2015 08:07
is there a cheap usb ftdi or other USB-to-RS232 with rts and dtr exposed? to work with this: http://www.esp8266.com/viewtopic.php?f=9&t=820&hilit=chert
automatic reset from rts and dtr when programming esp?
I figure buying this one programmer would be better than getting breakout boards for esp, since this can be use for many boards, and i think that once you solder an esp to breakout board you cannot take off (my limited experience)
Michael Miller
@Makuna
May 25 2015 08:09
well, sort of. The interrupt will fire when the compare value matches CCOUNT the first time, if you actually set the compare value again with the same value, it will trigger the interrupt when it compares match the next time. But CCOUNT is CPU cycle count and is not changeable.
So using it requires to get the CCOUNT, add your time, set the compare value to get multishot
Ivan Grokhotkov
@igrr
May 25 2015 08:13
ok, got it.
Michael Miller
@Makuna
May 25 2015 08:13
While you can disable the interrupt, you can't disable the timer, so setting the compare value actually auto-enables the interrupt to fire again. Simple and cool.
FYI: The Xtensa docs state there are three of these, but the other two are not "fused" to be on, I suspect they are used to implement the "peripheral" timers we already have.
Ivan Grokhotkov
@igrr
May 25 2015 08:14
what about the other two CCOMPARE registers?
ok
Michael Miller
@Makuna
May 25 2015 08:15
The compiler actually kicks out CCOMPARE1 & CCOMPARE2 are invalid registers (both by name and by reg number)
alon24
@alon24
May 25 2015 08:20
@igrr DTR,RXD,TX,VCC,CTS,GND - no rts
Ivan Grokhotkov
@igrr
May 25 2015 08:20
rts is on the side connector
alon24
@alon24
May 25 2015 08:21
@igrr NICE!
Michael Miller
@Makuna
May 25 2015 08:23
What is the max number of usable IO Pins on any esp8266 boards?
Ivan Grokhotkov
@igrr
May 25 2015 08:24
ESP12E-D exposes GPIOs 0,1,2,3,4,5,12,13,14,15,16, and two more GPIOs (forgot which ones) from the flash interface since it uses DIO flash
so 13 total
Michael Miller
@Makuna
May 25 2015 08:26
Ok, I just picked one of these up (NodemMCU V2), I was wondering if there was some crazy rare one. So, at this point, a servo library really only needs one timer as there just aren't enough pins to really need more.
Is there a map of what pins the board is labeled as and what IO number the pin is in code?
Ivan Grokhotkov
@igrr
May 25 2015 08:29
On normal modules this is one to one mapping, i.e. to set gpio2 you do digitalWrite(2)
but i think nodemcu has a different mapping
i had a link to the schematic somewhere
actually... for the first version of the board we do have mappings in the code
variants/nodemcu/pins_arduino.h
if they changed pin mappings for the second version, we need to make another board variant
Michael Miller
@Makuna
May 25 2015 08:40
a quick glance and the pins seem to match.
(shit, its 1:40 am here, time for sleep)
Markus
@Links2004
May 25 2015 09:40
some one an idea whats go wrong when wifi_station_set_config triggers an wtd_reset
Ivan Grokhotkov
@igrr
May 25 2015 09:42
that's with smartConfig?
or just WiFi.begin()?
Markus
@Links2004
May 25 2015 09:42
no only WiFi.begin()
Ivan Grokhotkov
@igrr
May 25 2015 09:43
any interrupts enabled other than UART?
Markus
@Links2004
May 25 2015 09:44
no only serial in front of the code
Ivan Grokhotkov
@igrr
May 25 2015 09:45
hmm. perhaps the SDK update broke something else
Markus
@Links2004
May 25 2015 09:47
yes, yesterday i use the stored wifi info from eeprom then its working. (no begin call if allready connected).
today i make full erase of the chip for some testings.
so may the bug was there yesterday to.
WiFi.disconnect() shows the same problem
Markus
@Links2004
May 25 2015 10:11
full erase of the user config area with spi function fixed it. may the esptool has an problem by erasing 4MB flash.
will write a function to do this.
Markus
@Links2004
May 25 2015 10:53
SDK 1.1 also killed SPÍ running at 80Mhz...
Ivan Grokhotkov
@igrr
May 25 2015 10:54
Also something got broken with SPI interface sharing
ficeto
@ficeto
May 25 2015 10:54
ok... could this be related to the init.bin?
since it has the setup for the new exposed things
and they are mostly wifi related
try flashing that
what it's the fourth block backwards
Ivan Grokhotkov
@igrr
May 25 2015 10:55
i'm reading a post on the russian esp8266 forum right now, basically looks like Espressif added support for two flash chips on SPI, and broke some other things down the road
Markus
@Links2004
May 25 2015 10:55
"esp_init_data_default.bin" ? to Max size - 0x3000
ficeto
@ficeto
May 25 2015 10:56
-0x4000
Markus
@Links2004
May 25 2015 10:56
k will try
ficeto
@ficeto
May 25 2015 10:56
yeah... setting for those two flashes are also there
Markus
@Links2004
May 25 2015 10:59
oO
 ets Jan  8 2013,rst cause:2, boot mode:(3,1) 

load 0x40100000, len 31072, room 16  
tail 0 
chksum 0x31 
load 0x3ffe8000, len 1564, room 8  
tail 4 
chksum 0x6c 
load 0x3ffe8620, len 8664, room 4  
tail 4 
chksum 0x5e 
csum 0x5e 
system param error 
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
ficeto
@ficeto
May 25 2015 11:00
used the latest init from the same SDK right?
Markus
@Links2004
May 25 2015 11:00
yes
ficeto
@ficeto
May 25 2015 11:00
any success after that?
or same fail?
Markus
@Links2004
May 25 2015 11:01
4MB chip @ 0x3FC000
wifi killed again...
ficeto
@ficeto
May 25 2015 11:01
you flashed at the correct spot :)
that's why you got the error
alright
try this to run first
Ivan Grokhotkov
@igrr
May 25 2015 11:02
why all the zeroes? esp_init_default_data.bin doesn't look like all zeroes
ficeto
@ficeto
May 25 2015 11:03
00 is whote it wrote it because of the error
void _wifiInit(){
  struct station_config conf;
  *conf.ssid = 0;
  *conf.password = 0;

  struct softap_config apconf;
  *apconf.ssid = 0;
  *apconf.password = 0;
  apconf.channel = 0;
  apconf.authmode = AUTH_OPEN;
  apconf.ssid_len = 0;
  apconf.ssid_hidden = 0;
  apconf.max_connection = 4;
  apconf.beacon_interval = 100;

  ETS_UART_INTR_DISABLE();
  wifi_station_dhcpc_stop();
  wifi_station_disconnect();
  wifi_station_set_config(&conf);
  wifi_softap_dhcps_stop();
  wifi_softap_set_config(&apconf);
  wifi_set_opmode(NULL_MODE);
  ETS_UART_INTR_ENABLE();
}
run this before anything
to clear things up
Markus
@Links2004
May 25 2015 11:04
k will try
k found the problem... SPI @80Mhz broke also the SPI flash access, the the wifi cant store the config --> wtd reset.
ficeto
@ficeto
May 25 2015 11:08
the new sdk seems like too much hassle to get rssi :D
Markus
@Links2004
May 25 2015 11:09
yes to buggy for the moment, i think we shut wait for the next release.
may copy the asm for rssi ^^
ficeto
@ficeto
May 25 2015 11:10
that would e awesome!
Markus
@Links2004
May 25 2015 11:11
40225264 <wifi_station_get_rssi>:
40225264:    f0c112            addi    a1, a1, -16
40225267:    0109          s32i.n    a0, a1, 0
40225269:    ff4e05            call0    4022474c <wifi_get_opmode>
4022526c:    0b1226            beqi    a2, 1, 4022527b <wifi_station_get_rssi+0x17>
4022526f:    083226            beqi    a2, 3, 4022527b <wifi_station_get_rssi+0x17>
40225272:    f21c          movi.n    a2, 31
40225274:    0108          l32i.n    a0, a1, 0
40225276:    10c112            addi    a1, a1, 16
40225279:    f00d          ret.n
4022527b:    f95e01            l32r    a0, 402237f4 <eagle_lwip_if_free+0x5c>
4022527e:    042002            l32i    a0, a0, 16
40225281:    018016            beqz    a0, 4022529d <wifi_station_get_rssi+0x39>
40225284:    1e2032            l32i    a3, a0, 120
40225287:    1fa022            movi    a2, 31
4022528a:    c38c          beqz.n    a3, 4022529a <wifi_station_get_rssi+0x36>
4022528c:    020c          movi.n    a2, 0
4022528e:    0172c5            call0    402269bc <ic_get_rssi>
40225291:    012280            slli    a2, a2, 24
40225294:    312820            srai    a2, a2, 24
40225297:    fff646            j    40225274 <wifi_station_get_rssi+0x10>
4022529a:    fff586            j    40225274 <wifi_station_get_rssi+0x10>
4022529d:    f21c          movi.n    a2, 31
4022529f:    fff446            j    40225274 <wifi_station_get_rssi+0x10>
402252a2:    b80000            excw
402252a5:    002a          add.n    a0, a0, a2
402252a7:    c11240            mul16u    a1, a2, a4

402269bc <ic_get_rssi>:
402269bc:    f0c112            addi    a1, a1, -16
402269bf:    006102            s32i    a0, a1, 0
402269c2:    02d105            call0    402296d4 <rc_get_trc>
402269c5:    002102            l32i    a0, a1, 0
402269c8:    004256            bnez    a2, 402269d0 <ic_get_rssi+0x14>
402269cb:    f21c          movi.n    a2, 31
402269cd:    0002c6            j    402269dc <ic_get_rssi+0x20>
402269d0:    030222            l8ui    a2, a2, 3
402269d3:    a0c222            addi    a2, a2, -96
402269d6:    012280            slli    a2, a2, 24
402269d9:    312820            srai    a2, a2, 24
402269dc:    10c112            addi    a1, a1, 16
402269df:    f00d          ret.n
402269e1:    000000            ill
402269e4:    fecb60            excw
402269e7:    3f              .byte 0x3f
;)
will give i a try
chad cormier roussel
@chadouming
May 25 2015 11:53
hmm, i've added this line : randomSeed((unsigned int)os_random()); to user init and i don't have any problems connecting to mysql server anymore
thought, to be fair, i updated to SDK 1.1.0 so i don't really know if I fixed the problem or it fixed itself
ficeto
@ficeto
May 25 2015 11:54
if your adc is floting...
:)
you can take a dump and see the ports
chad cormier roussel
@chadouming
May 25 2015 11:55
exactly what i'm doing
hmm, even if ADC is not floating, chances are it will not take exactly twice the very same measure in a short lapse of time, making it pseudo random, no ?
ficeto
@ficeto
May 25 2015 11:58
well if you have a sensor there like me
my temp sensor does not really fluctuate
chad cormier roussel
@chadouming
May 25 2015 11:58
hmm, seems like the problem fixed itself, i think it's always running on the 4097 port
ficeto
@ficeto
May 25 2015 11:58
so it's really possible to end up in the same situation
have you restarted the server?
chad cormier roussel
@chadouming
May 25 2015 11:59
nope
ficeto
@ficeto
May 25 2015 11:59
it can come up again
in situation that they will not negotiate the disconnect
chad cormier roussel
@chadouming
May 25 2015 12:01
hmm, seems like you are right
i just forced it to stop before the disconnect (removed power just after it connected). On the next run, it failed once
so, still not getting a random port :worried:
ficeto
@ficeto
May 25 2015 12:02
did you pull igrr's fix?
chad cormier roussel
@chadouming
May 25 2015 12:02
yup
ficeto
@ficeto
May 25 2015 12:02
then why is the port not changing...
oh i know why
you have to call the new method
you need a random number from 0 to 16 and that to be the highest 4 bits
actually random 1-15
chad cormier roussel
@chadouming
May 25 2015 12:11
so, i tried that : uint16_t WiFiClient::_localPort = 4096 | (1+random(14) << 12);
which should have changed the port, even if not random, right ?
but it's still 4097
ficeto
@ficeto
May 25 2015 12:13
randomSeed((unsigned int)os_random());
WiFiClient.setLocalPortStart((random(1,15) & 0xF) << 12);
that in begining of setup
chad cormier roussel
@chadouming
May 25 2015 12:20
hmm, even when i include osapi.h it still tell me it's not defined
ficeto
@ficeto
May 25 2015 12:20
use analogRead(A0)
:)
chad cormier roussel
@chadouming
May 25 2015 12:23
BBQTemp2.ino: In function 'void setup()':
BBQTemp2.ino:73:13: error: expected unqualified-id before '.' token
expected unqualified-id before '.' token
Markus
@Links2004
May 25 2015 12:24
@ficeto my asm skills a to bad to get it working :(
ficeto
@ficeto
May 25 2015 12:24
include "WiFiClient.h"
chad cormier roussel
@chadouming
May 25 2015 12:24
already there
ficeto
@ficeto
May 25 2015 12:25
i see it in the commit to be defined as static function
can you check your header
maybe ::
randomSeed(analogRead(A0)));
WiFiClient::setLocalPortStart((random(1,15) & 0xF) << 12);
chad cormier roussel
@chadouming
May 25 2015 12:27
nope, not working
ficeto
@ficeto
May 25 2015 12:27
@igrr clues?
@Links2004 how can I obtain the ASM dump?
Ivan Grokhotkov
@igrr
May 25 2015 12:28
xtensa-elf-lx106-objdump -S sketch.elf > dump.S
ficeto
@ficeto
May 25 2015 12:28
i'm on old sdk though
Ivan Grokhotkov
@igrr
May 25 2015 12:29
#include <ESP8266WiFi.h>
#include <WiFiClient.h>

void setup() {
  // put your setup code here, to run once:
WiFiClient::setLocalPortStart((random(1,15) & 0xF) << 12);
}

void loop() {
  // put your main code here, to run repeatedly:

}
compiles here
chad cormier roussel
@chadouming
May 25 2015 12:29
BBQTemp2.ino:73:3: error: 'setLocalPortStart' is not a member of 'WiFiClient'
'setLocalPortStart' is not a member of 'WiFiClient'
Ivan Grokhotkov
@igrr
May 25 2015 12:30
did you take the update from git?
chad cormier roussel
@chadouming
May 25 2015 12:30
yup, it's even there in the files
Ivan Grokhotkov
@igrr
May 25 2015 12:30
do you have the board manager package installed also?
it will override local files
chad cormier roussel
@chadouming
May 25 2015 12:31
ah
lol, feel stupid now
Ivan Grokhotkov
@igrr
May 25 2015 12:34
no problem, happened to me couple of times as well
chad cormier roussel
@chadouming
May 25 2015 12:36
this seems to make the port "pseudo" random
uint16_t WiFiClient::_localPort = (random(1,15) & 0xF) << 12;
at least, i've had only twice the same port
ficeto
@ficeto
May 25 2015 12:38
will be so if init the random seed
else it should give the same result
chad cormier roussel
@chadouming
May 25 2015 12:38
hmm, well, only the first 4 bytes are random i think. Always give me a multiple of 4096
ficeto
@ficeto
May 25 2015 12:39
that is ok
it was the point
chad cormier roussel
@chadouming
May 25 2015 12:39
wasn't the point to have a random port ? xD
ficeto
@ficeto
May 25 2015 12:39
that is as random as it needs to be
while still giving you at least 4096 ports to work with
where the random gives 15
in other case, the least difference between the ports will be 4096
which is still a good difference to not have the issue
the fact that the wholr 16 bits are not random, do not make the port not random :)
chad cormier roussel
@chadouming
May 25 2015 12:41
well, if i have a derped disconnection, that's 1 chance out of 14 of of getting a broken port
ficeto
@ficeto
May 25 2015 12:42
you can go 6 bits
and have 1024 step
but not lower
as you need the lower ports for services
that will give you 63 possibilities
chad cormier roussel
@chadouming
May 25 2015 12:43
nice
i just change the 12 to 6 ? i'm not really good with bitwise opperator things
ficeto
@ficeto
May 25 2015 12:44
from 12 to 10
and random(1,63)
chad cormier roussel
@chadouming
May 25 2015 12:44
make sense
ficeto
@ficeto
May 25 2015 12:44
& 0x3F
to get 6 bits
chad cormier roussel
@chadouming
May 25 2015 12:47
acually, i think it takes less time than using the PHP api with get command
cause right now it's working perfectly :D
ficeto
@ficeto
May 25 2015 12:48
it does the same thing
so that is how it shoudl be
plus you add parsing/php when going through http
chad cormier roussel
@chadouming
May 25 2015 12:49
well, i don't have any security with the php api, now it should be secure
and i'm pretty sure it takes ~ 1 second less
on a total of ~4 secs, that's a lot xD
ficeto
@ficeto
May 25 2015 12:50
what takes 4 seconds?
chad cormier roussel
@chadouming
May 25 2015 12:50
total wake up to sleep
ficeto
@ficeto
May 25 2015 12:50
one conect/query/disconnect?
chad cormier roussel
@chadouming
May 25 2015 12:51
wake up, connect to wifi, connect to DB, query, then sleep
ficeto
@ficeto
May 25 2015 12:51
time lost in computation and parsing is important
chad cormier roussel
@chadouming
May 25 2015 12:51
oh, and reading a DHT22 in that
ficeto
@ficeto
May 25 2015 12:51
and you have lots less now
you do not parse http headers in responses
chad cormier roussel
@chadouming
May 25 2015 12:52
i've added a few delay here and there to make sure no data gets lost
true
ficeto
@ficeto
May 25 2015 12:52
you do not send them either
chad cormier roussel
@chadouming
May 25 2015 12:52
any fast like that way to process an ntp server and get time %
?*
that way i could set it at every 5 minutes
ficeto
@ficeto
May 25 2015 12:54
I have this:
WiFi.begin(ssid, pass);
  if(WiFi.waitForConnectResult() == WL_CONNECTED){
    udp.begin(localPort);
    sendNTPpacket(timeServer);
    int cb = udp.parsePacket();
    while(!cb){
      sendNTPpacket(timeServer);
      cb = udp.parsePacket();
      yield();
    }
    udp.read(packetBuffer, NTP_PACKET_SIZE);
    //rtc_set((word(packetBuffer[40], packetBuffer[41]) << 16 | word(packetBuffer[42], packetBuffer[43])) - 2208988800UL + 10800);
  }
it's pretty fast
chad cormier roussel
@chadouming
May 25 2015 12:55
based on NTP example ?
ficeto
@ficeto
May 25 2015 12:55
yup
chad cormier roussel
@chadouming
May 25 2015 13:10
using :
unsigned long highWord = word(packetBuffer[40], packetBuffer[41]);
unsigned long lowWord = word(packetBuffer[42], packetBuffer[43]);
unsigned long secsSince1900 = highWord << 16 | lowWord;
give me : 3641548158
which is in 2085 xD
ficeto
@ficeto
May 25 2015 13:11
  • 70 years?
this is not unix time
this starts from 1900
chad cormier roussel
@chadouming
May 25 2015 13:11
aw
ficeto
@ficeto
May 25 2015 13:11
unix starts from 1970
  • 2208988800UL
10800 is my local offset
chad cormier roussel
@chadouming
May 25 2015 13:27
hmm, i'm trying to modify to mysql connector to have the server in either IPAddress or const char* format, but that doesnt seems to go well
i've added the 2nd protoype in the header and declared the function using new argument, am i supposed to do something else ?
ficeto
@ficeto
May 25 2015 13:30
what is the error?
chad cormier roussel
@chadouming
May 25 2015 13:30
C:\Users\chad\Documents\Arduino\libraries\mysql-connector-master\src\MySQL.cpp:105:6: error: prototype for 'bool Connector::mysql_connect(IPAddress, int, char, char)' does not match any in class 'Connector'
bool Connector::mysql_connect(IPAddress server, const int port, char user, char password)
^
C:\Users\chad\Documents\Arduino\libraries\mysql-connector-master\src\MySQL.cpp:75:6: error: candidate is: bool Connector::mysql_connect(const char, int, char, char)
bool Connector::mysql_connect(const char
server, const int port, char user, char password)
ficeto
@ficeto
May 25 2015 15:49
and you have both defined surely
Michael Miller
@Makuna
May 25 2015 17:07
I am running into a weird problem this morning. My board keeps reseting; while the same sketch (pretty simple) worked fine last night.
 ets Jan  8 2013,rst cause:4, boot mode:(3,6)

wdt reset
load 0x40100000, len 28780, room 16 
tail 12
chksum 0x7f
ho 0 tail 12 room 4
load 0x3ffe8000, len 1332, room 12 
tail 8
chksum 0x50
load 0x3ffe8540, len 1584, room 0 
tail 0
chksum 0x93
csum 0x93
rl
chad cormier roussel
@chadouming
May 25 2015 17:30
Yes
ficeto
@ficeto
May 25 2015 17:55
@Makuna are you running at 80MHz FlashSpeed (not CPU)?
@chadouming you mind pasting that part of the header where you have them defined?
chad cormier roussel
@chadouming
May 25 2015 18:01
class Connector
{
public:
Connector();
bool mysql_connect(const char server, int port, char user, char password);
bool mysql_connect(IPAddress server, int port, char
user, char *password);
that's the header
the cpp
ficeto
@ficeto
May 25 2015 18:05
int port != const int port
should be uint16_t btw
chad cormier roussel
@chadouming
May 25 2015 18:13
changed it to uint16_t, but i'm just plain stupid
or tired
ficeto
@ficeto
May 25 2015 18:16
so it was the const?
chad cormier roussel
@chadouming
May 25 2015 18:16
no, I was working with the header of my git folder and the cpp of my arduino library folder
ficeto
@ficeto
May 25 2015 18:18
:D
it happens
chad cormier roussel
@chadouming
May 25 2015 18:46
and it works perfectly :D
take ~3 seconds now
Michael Miller
@Makuna
May 25 2015 18:58
@ficeto found my problem, uninitialized interrupt handler pointer being called before I thought it would.
ficeto
@ficeto
May 25 2015 18:58
@Links2004 had the same problem last night with same address and it was 80MHz flash speed
so i thought might be the same
Markus
@Links2004
May 25 2015 19:00
the SDK v1.1.0 has more then one bug.
for the moment i keep 1.0.1 until they are all fixed.
ficeto
@ficeto
May 25 2015 19:42
can someone help?
undefined reference to `vtable for TestClass'
TestClass is abstract
Ivan Grokhotkov
@igrr
May 25 2015 20:47
can you post the code snippet?
usually this means that some members are not declared as abstract and are not defined
ficeto
@ficeto
May 25 2015 20:58
well I kinda understood what is the problem
bu kinda have no clue how to attack it
i have a pure abstract class (thats when they have =0 right?)
then i have implementations of it
and they return instances of this abstract class
and this is the result
the linker can not find it
Ivan Grokhotkov
@igrr
May 25 2015 21:00
you can't return an instance of an abstract class
you can only return a pointer or a reference
ficeto
@ficeto
May 25 2015 21:01
so how to do lets say Serial.getStream()
to return an instance of Stream
sorta...
Ivan Grokhotkov
@igrr
May 25 2015 21:01
but serial is derived from Stream, right?
ficeto
@ficeto
May 25 2015 21:01
yes
maybe it's a poor question on my part
Ivan Grokhotkov
@igrr
May 25 2015 21:02
Stream& HardwareSerial::getStream() { return *this; }