Sming - Open Source framework for high efficiency native ESP8266 development

User avatar
By prutser
#14820 for anakod : some feedback and some virtual beers!
I've installed sming on Debian, and I followed the instructions (I use a command line interface )

The only thing I had to add was a symbolic link :
/opt/esp-open-sdk/xtensa-lx106-elf/bin
xt-nm -> xtensa-lx106-elf-nm
(and modify the Paths in the Makefiles)

I'm testing the MQTT client, and the publishing works great at the defined interval!
But when I want to receive something, it only gets true at the time it publishes something.
(I got the latest release)

When does onMessageReceived() gets executed?

Kind Regards!




-just for information in case you use an esp-12 board with multiple GPIO pins -
-I cannot use GPIO0 and GPIO2 because they are attached to the GPIO of a raspberry pi, this way I can remotely install and reboot the esp board-

I have an esp-12 board, and attached the BMP180 sensor to gpio 4 and 5
In order to get it working I modified Wire.h
#define I2C_DEFAULT_SCL_PIN 4
#define I2C_DEFAULT_SDA_PIN 5

in case you want to blink GPIO12, 13 ... I've a solution too;)
---------------------------------------------------------
User avatar
By sh4d0w
#14897 Hey guys,

I am having trouble getting interrupts to work using the sming framework. I was able to get them working under the standard sdk but liked some of the ease and flexibility of Sming. So I have the following code

Code: Select all#include <user_config.h>
#include <SmingCore/SmingCore.h>

#define IR_PIN 12 // GPIO12

void inter_call()
{
   //interruptMode(IR_PIN, 99); // Disable interupts
   float v=0.5;
}

void init()
{
   Serial.begin(SERIAL_BAUD_RATE); // 115200 by default
   Serial.println("Setting up...");
   attachInterrupt(IR_PIN, inter_call, RISING);
   interrupts();
   Serial.println("Ready...");
}


Simple enough, but when I run it and trigger the infrared the esp8266 just resets itself. The idea is to have the interupt trigger on the first rising edge of the IR signal and then disable the interupts and read the code. I managed to get this working fine under the standard C environment, but no luck with Sming. I had a look at the Interrupts.cpp code and I could definitely modify the interruptHandler but wanted to check if there was something I was missing. Any help would be great.

Cheers!
User avatar
By anakod
#15048 UDP example was added
UdpServer_Echo Example
Now we have full featured UDP classes.

ttabbal wrote:I'm curious, does this work with the FreeRTOS SDK? It seems like it should, as it's mostly a library, but I don't want to spend time trying if it's known to be incompatible.

It isn't tested yet, but I have a plan to use multi task environment for Sming framework (or make it selectable). If you check it, please, notify us about results. Very big thanks!

for anakod : some feedback and some virtual beers!

Thank you very much for feedback! If someone want to make beer more real, I have added donation button in the first post :D

But when I want to receive something, it only gets true at the time it publishes something.

Did you try to publish messages from external client to Sming listen channel?

I have an esp-12 board, and attached the BMP180 sensor to gpio 4 and 5

Yes, it's right way. Lso you can use pins(...) call.

Simple enough, but when I run it and trigger the infrared the esp8266 just resets itself.

Code saved to ROM have limitation: it can't be called from interrupt, because flash cahe can be disabled in that time. Sming, by default, store all user code to ROM, so you should add attribute IRAM_ATTR to your handler method.
If you will build small example of interrupt usage, it will be really great to make pull-request of that!