These are chat archives for SmingHub/Sming

11th
Sep 2016
Piotr Dobrowolski
@Informatic
Sep 11 2016 00:08
Has anyone managed to use captures in lambda/closures in place of delegates? Right now only things like http.addPath("/", *[](HttpRequest &req, HttpResponse &resp) { /* code */ }); work, but proper captures sound usable. Sadly I'm not really into C++, so maybe I'm just missing something. / inb4 i should feel bad for using closures at all
hreintke
@hreintke
Sep 11 2016 07:14

@Informatic @zhivko : There are two options for SPIFFS

  • automatic -> spiffs fs is flashed starting at the first available segment after the program code, that is the line @Informatic showed.
    I needed to update that when I converted Sming to RTOS and for sure it works there correctly. There might be bounder cases within NONOS which fail.
    Within the application you can use spiffs_mount()

  • manual -> need to flash yourself to the segment you want to have spiffs fs.
    Within application you need spiffs_mount_manual(...) and provide the correct location of spiffs.
    The basic_rboot example uses this method.

@Informatic :
I did try/use lamda/closures within smingRTOS. They worked, also for delegates but I noticed some specifics when using it. Don't remember now what/when.
hreintke
@hreintke
Sep 11 2016 07:23
@Informatic : There is PR Sming#596 with the ssl code. Not finished that is why is it not merged. Due to the current status of sming_nonos I will not merge either. Would be great if you can port and finish that for SmingRTOS.
hreintke
@hreintke
Sep 11 2016 07:33
@Informatic :
I now have a Wemos D1 mini powered bu usb, have no idea how I can see whether is has a CP2102. But after reset I see clear text on my putty configured for 74880.
Piotr Dobrowolski
@Informatic
Sep 11 2016 08:18
Actually, I'm not even using SPIFFS in my case, it was just segments stored in 0x00000 being too big.
PR - Yeah, I was using that branch. ; Wemos - well, CH340 is more rectangular-ish than CP2102, and it should be on the bottom side of Wemos D1. Maybe something is wrong with linux drivers for ch340 then.
I'll look into porting my code to RTOS soon, but just wanted to somehow get it working on nonos, to just have at least some reference.
Piotr Dobrowolski
@Informatic
Sep 11 2016 08:32
https://github.com/Informatic/mqtt-playground/blob/master/spejsiot/SpejsNode.cpp + https://github.com/Informatic/mqtt-playground/blob/master/switch/app/application.cpp ; And this is what I'm mostly working on recently. Generic NIH MQTT (+HTTP soon) appliance framework with built-in OTA and stuff... ,_,
Not even a framework. Boilerplate, I shall say.
hreintke
@hreintke
Sep 11 2016 11:55
@/all :
Fixed Timer initialization, please retest rboot/basic_rboot using current master
crosofg
@crosofg
Sep 11 2016 17:49
why does this occur?```
open errno -10004

write errno -10010
This message was deleted
#define SPIFFS_ERR_BAD_DESCRIPTOR       -10010
#define SPIFFS_ERR_DELETED              -10004
What does it mean?
hreintke
@hreintke
Sep 11 2016 18:37
errors in the spiffs fs
crosofg
@crosofg
Sep 11 2016 19:03

rBoot v1.4.0 - richardaburton@gmail.com
Flash Size:   32 Mbit
Flash Mode:   QIO
Flash Speed:  40 MHz
rBoot Option: Big flash

Rom 0 is bad.
Rom 1 is bad.
No good rom available.
user code done
any idea why this is happening?
hreintke
@hreintke
Sep 11 2016 19:48
@crosofg
rboot is checking checksum of the rom's -> both invalid.
If it is the same esp as above you might have flash issues
crosofg
@crosofg
Sep 11 2016 20:03
@hreintke this is occuring only if I use
AppSettings.save();
AppSettings.load();

    pinMode(LED_PIN, OUTPUT);
    if (AppSettings.exist()) {
        Serial.println("Settings Exits");
        if (AppSettings.state) {
            Serial.println("State it on");
            turnPlugOn();
        } else {
            AppSettings.state = false;
            AppSettings.save();
            procTimer.initializeMs(2000, turnPlugOff).startOnce();
        }
        WifiStation.config(AppSettings.ssid, AppSettings.password);
        Serial.println("Wifi SSID"+AppSettings.ssid);
        WifiStation.enable(true, true);
        WifiAccessPoint.enable(false, false);
        WifiStation.waitConnection(connectOk, 20, connectFail);
    } else {
        AppSettings.state=false;
        AppSettings.ssid="";
        AppSettings.password="";

//        AppSettings.save();
        Serial.println("Settings Dont Exits");
        connectFail();
    }
If I comment the Appsettings.save() then rboot error is gone. but file read write error keeps coming.