These are chat archives for esp8266/Arduino

16th
Apr 2016
sticilface
@sticilface
Apr 16 2016 08:18
That's very cryptic...
Me No Dev
@me-no-dev
Apr 16 2016 08:22
when you introduce C++ to the RTOS SDK, the sketch runs for a few seconds then hang and reset
I test with a simple class, which instantiates and destructs just fine
but for a few seconds at a time :)
Ivan Grokhotkov
@igrr
Apr 16 2016 08:24
That's a very vague case to draw conclusion that "C++ doesn't work"
Me No Dev
@me-no-dev
Apr 16 2016 08:24
I tried like everything
known toolchain
different linker magic
Ivan Grokhotkov
@igrr
Apr 16 2016 08:25
Well it certainly worked for me in esp-open-rtos, last time i checked.
Me No Dev
@me-no-dev
Apr 16 2016 08:26
class MyTestClass {
  public:
    MyTestClass(){
      os_printf("MyTestClass Created\n");
    }
    ~MyTestClass(){
      os_printf("MyTestClass Destructed\n");
    }
    void method(){
      os_printf("MyTestClass Method Called\n");
    }
};

MyTestClass gtest;

void setup() {
  MyTestClass test;
  test.method();
}

void loop() {}


extern void setup();
extern void loop();

void __loop_task(void *pvParameters){
  setup();
  for(;;){
    loop();
  }
}

extern "C" void user_init(void) {
#if defined(F_CPU) && (F_CPU == 160000000L)
  system_update_cpu_freq(160);
#endif
  xTaskCreate(__loop_task, (const signed char *)"loop_task", 4096, NULL, 0, NULL);
}
this is all of the code
if I do not instantiate the class, the sketch runs fine
Ivan Grokhotkov
@igrr
Apr 16 2016 08:27
Did you try gdb-ing?
Me No Dev
@me-no-dev
Apr 16 2016 08:27
no
the funny thing is that the sdk supports c++ otherwice
you do not need to do_global_ctors();
Ivan Grokhotkov
@igrr
Apr 16 2016 08:29
yes, that got added to libmain.
Me No Dev
@me-no-dev
Apr 16 2016 08:30
and the obeject is created fine and all methods are run fine
like it's all working, then bam...
it's not an exception, because I do not get a trace (when I wrap the handler)
another thing was that I needed to remove some duplicate implementations from one of the libs
and did not have libhal inside, so I copied taht from the nonos
bidyutper
@bidyutper
Apr 16 2016 14:13
@tzapu hi !!!!!! I m tryin first time OTA update..... how to upload sketch via OTA...... side by side with wifi-manager current IDE is 1.6.5 in which under port menu not showing any esp ip..only showing serial ....
tzapu
@tzapu
Apr 16 2016 15:09
@bidyutper i ve got a sketch with basic ota and wifimanager working together, no conflicts. getting the port to appear is magic thought, most often than not, on os x, i need to restart arduino ide and wait a bit for it to show. also make sure you are running the recommended arduino ide version
hi :)
seems i m running 1.6.7 bt
w
VĂ­tor Barbosa
@Vitorbnc
Apr 16 2016 15:32
Hi everybody! ;)
What options of network scanning or device discovery do we have? I was looking for something simple that could show alive hosts(IPs) and perhaps ports currently used in the network, like Fing (the app for Android), so I could add it to my espSuite sketch.
bidyutper
@bidyutper
Apr 16 2016 15:41
@tzapu hmm....let me try with 1.6.7
Stefan Gordon
@stefangordon
Apr 16 2016 17:22
@Vitorbnc there are a variety of techniques that can be used, Fing uses several to get the most information possible. You could start with implementing support for basic UDP broadcast discovery - Just launch a network monitor and you'll get a feel for some of the broadcast packets you can watch for in regards to DHCP and UPNP https://en.wikipedia.org/wiki/Simple_Service_Discovery_Protocol
From there you can do port scans if you are looking for common services on the IP's you find. You can also just brute force a port scan on the entire subnet (pretty fast) if you want.
CHAE-PIL LIM
@chaeplin
Apr 16 2016 19:19
http://bbs.espressif.com/viewtopic.php?f=46&t=2041 [SDK Release] ESP8266_NONOS_SDK_V1.5.3_16_04_16
sticilface
@sticilface
Apr 16 2016 21:39
Bit of a basic question here. If I attach an inturrupt and that fixation gets triggered, if the pin changes again during execution of that already running interrupt calls Callback function. What happens? I'm looking to use inturrupts for the pjon lib, so a change would indicated the start of a transmission but I obviously want the inturrupt not to fire whilst collecting it. Does that make sense?
bernamorillo
@bernamorillo
Apr 16 2016 21:58
Here you have an example of esp8266 with a relay and temp&humidity
Me No Dev
@me-no-dev
Apr 16 2016 22:23
@sticilface that makes lots of sense
you have one of two options and I do not know the exact outcome of the second one
first is to disable/unmask the interrupt while in the routine
second is to disable interrupts while in the ISR
I personally take the first option and unmask the interrupt
the sequence that the ISR is executing is the following: first the interrupt get's acked/cleared, then the action assigned is called
so if an interrupt comes after the interrupt clear, then you should get another ISR called after you end the current one
Me No Dev
@me-no-dev
Apr 16 2016 22:37
@bernamorillo 40 pounds for ESP, relay and a standart plastic box?
bernamorillo
@bernamorillo
Apr 16 2016 23:26
yea!, is totally perfect
And also it is small