These are chat archives for SmingHub/Sming

26th
Feb 2016
slaff
@slaff
Feb 26 2016 08:57
accessing memory address 0x402393fa
@patrickjahns That means that the breakpoint is pointing to a code that is not in RAM
Make sure the the fucntion where the breakpoint resides has the GDB_IRAM_ATTR attribute and recompile the app with make ENABLE_GDB=1
alon24
@alon24
Feb 26 2016 09:21
@hreintke here?
slaff
@slaff
Feb 26 2016 09:53

Unrecognised function prologue. Stack trace cannot be resolved. This message will not be repeated in this session.

@patrickjahns Most probably you are using older version of the debugger. Take a look at the bottom comments: SmingHub/Sming#350

Alexander V. Ribchansky
@avr39-ripe
Feb 26 2016 10:53
Hello @all! can anybody Point me how setup onSomething(Delegate...) where Delegate should be class INSTANCE member function.. if it is simple function I know, if It is class-member function - know too.. and if it is class INSTANCE - do not.. help please :)
hreintke
@hreintke
Feb 26 2016 11:11
@avr39-ripe :
If you want to delegate not to object itself but to another object you can change the "this" in f.e. the
CommandProcessDelegate(&DebugClass::processDebugCommands,this)) to : The pointer to the object that should handle the delegation.
Is that what you are looking for ?
Alexander V. Ribchansky
@avr39-ripe
Feb 26 2016 11:12
I think yes... will try.. THANKS A LOT @hreintke !!
so if I have someClass classInstance, I need to firm something like CommandProcessDelegate(&DebugClass::processDebugCommands, classInstance.handler_method)) ??
Alexander V. Ribchansky
@avr39-ripe
Feb 26 2016 11:19
@hreintke Hmm.. I'm bit confused.. If I have Instance of for example DebugClass, C++ DebugClass myDebug; what shoul I write to attach instance `C++ myDebug.processDebugCommands method for delegate? should I write C++ CommandProcessDelegate(&DebugClass::processDebugCommands, myDebug); or what??
sorry for dumb questions.. I'v never fully understand delegates magic... :(
hreintke
@hreintke
Feb 26 2016 11:23
I think it is "*myDebug" instead of "myDebug"
Alexander V. Ribchansky
@avr39-ripe
Feb 26 2016 11:24
@hreintke do not complie as *myDebug
hreintke
@hreintke
Feb 26 2016 11:26
Can you try myDebug* ?
Alexander V. Ribchansky
@avr39-ripe
Feb 26 2016 11:26
if I write something like this C++ onStateChange(onStateChangeDelegate(SwitchHttp::setState, &officeSwitch)); it say invalid usage of non-static member function...
either if I write C++ onStateChange(officeSwitch.setState);
if there is simple non-class-member function I can simple write onStateChange(onStateChangeDelegate(onOfficeStateChange); and it works.. ( onOfficeStateChange - simple non-class-member function)
@hreintke analog to myDebug* do not complie.. invalid-use of non static member function
hreintke
@hreintke
Feb 26 2016 11:33
Then I have to check. I am out of ideas at the moment.
I know I did it a long time ago so it is possible.
Jose Barros
@PTDreamer
Feb 26 2016 11:38
Hi yall
Is the Sming thread at esp8266 forum moderated? I mean does the first post need approval?
hreintke
@hreintke
Feb 26 2016 12:12
@avr39-ripe :
I discussed this with @robotiko, maybe he can help here too ?
alon24
@alon24
Feb 26 2016 12:27
So my kid said, dad the car is nice can u make me a remote, and I told him that it was all for the phone, he was upset
So I need to investigate the i2c protocol on the nunchuk
Someone made this to work? I do not have a nunchuk
Alexander V. Ribchansky
@avr39-ripe
Feb 26 2016 12:55
@hreintke ok, will asl @robotiko too when he online here :) Also if you find new solution to my problem - do please let me know..
hreintke
@hreintke
Feb 26 2016 13:05
@avr39-ripe : Sure I will. I referred to him as he will be triggered by the "mention"here.
Alexander V. Ribchansky
@avr39-ripe
Feb 26 2016 13:09
@hreintke At first it seems to me as a simple task... just use some class-instance member-function as delegate.. :(
hreintke
@hreintke
Feb 26 2016 13:12
Some time ago in the talk with @robotico, the solution was found quick.
So either you doing something different or my memory retrieve capability is getting worse.
hreintke
@hreintke
Feb 26 2016 13:47
This message was deleted
@avr39-ripe :
What are you different as in the example below ? That one compiles with me.
#include <user_config.h>
#include <SmingCore.h>

class LedBlinker
{

public :
    LedBlinker(int reqPin) : ledPin(reqPin) {
        pinMode(ledPin, OUTPUT);
    };
    bool setTimer(int reqInterval) {
        if (reqInterval <= 0) return false;
        ledInterval = reqInterval;
        return true;
    }
    void blink(bool reqRun) {
        if (reqRun) {
            ledTimer.initializeMs(ledInterval, TimerDelegate(&LedBlinker::ledBlink,this)).start();
        }
        else {
            ledTimer.stop();
        }
    }
    void ledBlink () { ledState = !ledState ; digitalWrite(ledPin, ledState);}

private :
    int ledPin = 2;
    Timer ledTimer;
    int ledInterval = 1000;
    bool ledState = true;
};

#define LEDPIN_1  2 // GPIO2
#define LEDPIN_2  4 // GPIO4

LedBlinker myLed1 = LedBlinker(LEDPIN_1);
LedBlinker myLed2 = LedBlinker(LEDPIN_2);

Timer tempTimer;

void init()
{
    myLed1.setTimer(1000);
    myLed1.blink(true);
    myLed2.setTimer(500);
    myLed2.blink(true);
    tempTimer.initializeMs(1000, TimerDelegate(&LedBlinker::ledBlink,&myLed1)).start();
}
Alexander V. Ribchansky
@avr39-ripe
Feb 26 2016 14:05
@hreintke hmm yes, I want to make the same but with my delegate.. :(
hreintke
@hreintke
Feb 26 2016 14:09
What is your delegate typedef
Alexander V. Ribchansky
@avr39-ripe
Feb 26 2016 14:18
@hreintke typedef Delegate<void(bool state)> onStateChangeDelegate;
hreintke
@hreintke
Feb 26 2016 14:23
Just noticed something. Is this your use, look careful with all & * etc
onStateChange(onStateChangeDelegate(SwitchHttp::setState, &officeSwitch)
Alexander V. Ribchansky
@avr39-ripe
Feb 26 2016 14:29
@hreintke in your example there in & before LedBlinker::ledBlink in TimerDelegate(&LedBlinker::ledBlink,&myLed1) so do I need & or not??
hreintke
@hreintke
Feb 26 2016 14:30
Yep, that is the issue. The & makes it a class function. If no & it is static -> illegal use of static
Alexander V. Ribchansky
@avr39-ripe
Feb 26 2016 14:50
@hreintke THANK a LOT!! it is C, baby.. it like VERY static types.. problem was that SwitchHttp::setState accepts uint8_t argument, and I declare delegate to accept bool argument.. and compiller cannot cast uint8_t to bool in this context...
Harry Böttcher
@harry-boe
Feb 26 2016 17:28

Question to ALL of you.

I did some deep dive into the ESP HW SPI. Please check out issue #618 for my findings. it’s all documented there. I think heaving a reliable HW SPI imlpementation is critical for all kind of sensor projects. I like to get you opinions on what direction to go before i put more effort into preparing a PR for a new implementation

THX for your comments

alon24
@alon24
Feb 26 2016 17:58
@harry-boe does the arduino cam work now with sming?
Harry Böttcher
@harry-boe
Feb 26 2016 18:26
Almost there is still a minor problem with the captured data. Requires more debugging but I'm getting there
robotiko
@robotiko
Feb 26 2016 23:40
@avr39-ripe @hreintke , sorry guys I was out the whole day. Fast following the conversation looks like you found the way. If not I can check tomorrow my code where this was solved