These are chat archives for SmingHub/Sming

20th
Mar 2016
alonewolfx2
@alonewolfx2
Mar 20 2016 10:39
@hreintke are you arround?
hreintke
@hreintke
Mar 20 2016 10:39
@avr39-ripe :
I just merged a PR called add tcp_accepted. Please test you application with this.
@alonewolfx2 : Yes I am but need to leave in 5 mins
alonewolfx2
@alonewolfx2
Mar 20 2016 10:40
what is last pr?
hreintke
@hreintke
Mar 20 2016 10:41
Adding another lwip call when having a new connection
alonewolfx2
@alonewolfx2
Mar 20 2016 10:51
still here ?
hreintke
@hreintke
Mar 20 2016 10:59
yes
alonewolfx2
@alonewolfx2
Mar 20 2016 11:01
are there chip id and serial swap function on rtos?
if no, ,will add it
hreintke
@hreintke
Mar 20 2016 11:05
Suppose you mean within SmingRTOS -> no they are not in.
alonewolfx2
@alonewolfx2
Mar 20 2016 11:08
ok i will add it
hreintke
@hreintke
Mar 20 2016 11:08
OK, Now I am really out :smile:
alonewolfx2
@alonewolfx2
Mar 20 2016 13:00
anyone here?
Patrick Jahns
@patrickjahns
Mar 20 2016 13:05
for short yes
y?
alonewolfx2
@alonewolfx2
Mar 20 2016 13:11
did you tried webskeleton example on smingrtos?
robotiko
@robotiko
Mar 20 2016 13:11
@alonewolfx2 I did
that is why we opened issues about it
:D
alonewolfx2
@alonewolfx2
Mar 20 2016 13:13
haha i didnt saw issue on rtos sming :)
robotiko
@robotiko
Mar 20 2016 13:14
#88 and #90
robotiko
@robotiko
Mar 20 2016 13:18
in rtos, right?
alonewolfx2
@alonewolfx2
Mar 20 2016 13:18
yes
robotiko
@robotiko
Mar 20 2016 13:19
blob
gitter is gettign default project to associate the issues links
:D
alonewolfx2
@alonewolfx2
Mar 20 2016 13:20
yep :)
Patrick Jahns
@patrickjahns
Mar 20 2016 13:35
Nope sorry - I still haven`t setup a seperate dev environment for RTOS
robotiko
@robotiko
Mar 20 2016 14:18
@patrickjahns if you are interested
the setup is really simple
basically get teh smingrtos repo..
get the sdk (if you are using udk or similar is already there )
and set a few IDE environment vars
Patrick Jahns
@patrickjahns
Mar 20 2016 15:23
@robotiko
Do you switch frequently between rtos and nonos?
robotiko
@robotiko
Mar 20 2016 15:24
yes
everytime I play with sming
Patrick Jahns
@patrickjahns
Mar 20 2016 15:24
for certain reasons (i.e. fragile stack in rtos) I develop towards nonos for my applications for them to run smooth
How do you switch>
?
robotiko
@robotiko
Mar 20 2016 15:25
I just keep two workspaces in eclipse
one for rtos and another for nonos
it just needs to have the SDK patsh etc in the env vars and will give you all the flexibility
Patrick Jahns
@patrickjahns
Mar 20 2016 16:15
instead of global path variables? How can you overwrite global path vars?
robotiko
@robotiko
Mar 20 2016 17:11
just remove the global paths and set the values in the eclipse build environment vas
vars
this is set at worskpace level so you simply set the vars to Nonos and the RTOS in each workspace
alon24
@alon24
Mar 20 2016 18:28
I am getting my websocket closed all the time - do not know why
TCP connection send: 52 
TCP connection send: 2 
TCP connection send: 2 
TCP connection send: 104 
WebSocket Commandprocessor started, RequestParam = command, reqName = 
TCP connection send: 2 
TCP connection send: 41 
TCP connection send: 2 
TCP connection send: 0 
Default server handler for: '/index.html'
found index.html
attached file: index.html (9021 bytes)
response sendHeader
Switched to WebSocket Protocol
timeout updating: 90 -> 65535
Static OnSent buf = 2920
TCP sent: 280
onReadyToSendData: 2
Static OnReceive buf = 2920
WS remove connection item
WS Close
TCP connection closing
TCP received new: 35 bytes
~TCP connection
Static OnReceive buf = 2920
-TCP connection
Fatal exception (20): 
epc1=0x0000000c
epc2=0x00000000
epc3=0x4010181b
epcvaddr=0x0000000c
depc=0x00000000
rtn_add=0x40248cdc
�
 ets Jan  8 2013,rst cause:2, boot mode:(3,6)


                                         0xb6 (size before relaxing)
                0x0000000040248b68                TcpConnection::closeTcpConnection(tcp_pcb*)
 *fill*         0x0000000040248bca        0x2 
 .text._ZN13TcpConnection15staticOnReceiveEPvP7tcp_pcbP4pbufa
                0x0000000040248bcc       0xde /Users/iklein/docker/sming-docker/workspace/SmingRTOS/sming/compiler/lib//libsming.a(TcpConnection.o)
                                        0x126 (size before relaxing)
                0x0000000040248bd4                TcpConnection::staticOnReceive(void*, tcp_pcb*, pbuf*, signed char)
 *fill*         0x0000000040248caa        0x2 
 .text._ZN13TcpConnection12staticOnPollEPvP7tcp_pcb
                0x0000000040248cac       0x45 /Users/iklein/docker/sming-docker/workspace/SmingRTOS/sming/compiler/lib//libsming.a(TcpConnection.o)
                                         0x4d (size before relaxing)
                0x0000000040248cac                TcpConnection::staticOnPoll(void*, tcp_pcb*)
 *fill*         0x0000000040248cf1        0x3
alon24
@alon24
Mar 20 2016 19:31
so I believe I localized the isses, its with dynamicjsonbuffer or in that area
robotiko
@robotiko
Mar 20 2016 19:31
nonos?
alon24
@alon24
Mar 20 2016 19:31
rtos
robotiko
@robotiko
Mar 20 2016 19:31
:D
back on rtos?
alon24
@alon24
Mar 20 2016 19:31
the eror happens when I try to save and load int values
SousvideConfig loadConfig()
{
    DynamicJsonBuffer jsonBuffer;
    SousvideConfig cfg;
    if (fileExist(SOUSVIDE_CONFIG_FILE))
    {
        int size = fileGetSize(SOUSVIDE_CONFIG_FILE);
//        char* jsonString = new char[size + 1];
        String jsonString = fileGetContent(SOUSVIDE_CONFIG_FILE);

        debugf("loaded file = %s",jsonString.c_str() );

        JsonObject& root = jsonBuffer.parseObject(jsonString);

        JsonObject& network = root["network"];
        cfg.NetworkSSID = String((const char*)network["StaSSID"]);
        cfg.NetworkPassword = String((const char*)network["StaPassword"]);

        JsonObject& sousvide = root["Sousvide"];
        cfg.Needed_temp = sousvide["T"];
        cfg.Kp = sousvide["kp"];
        cfg.Ki = sousvide["ki"];
        cfg.Kd = sousvide["kd"];

        JsonObject& operations = root["operations"];
        cfg.operationMode = operations["type"] == "0" ? Manual : Sousvide;
        cfg.highlow = operations["highlow"] == "0" ? false : true;
    }
    else
    {
        //Factory defaults if no config file present
        cfg.NetworkSSID = WIFI_SSID;
        cfg.NetworkPassword = WIFI_PWD;
        cfg.Needed_temp =54;
//        cfg.Kp =9;
//        cfg.Ki =9;
//        cfg.Kd =9;
//        cfg.highlow = 0;
//        cfg.operationMode = Manual;
    }
    return cfg;
}

void saveConfig(SousvideConfig& cfg)
{
    DynamicJsonBuffer jsonBuffer;
    JsonObject& root = jsonBuffer.createObject();

    JsonObject& network = jsonBuffer.createObject();
    root["network"] = network;
//    network["ssid"] = cfg.NetworkSSID.c_str();
//    network["StaPassword"] = cfg.NetworkPassword.c_str();

    JsonObject& sousvide = jsonBuffer.createObject();
    root["Sousvide"] = sousvide;
    sousvide["T"] = cfg.Needed_temp;
    sousvide["kp"] = cfg.Kp;
    sousvide["ki"] = cfg.Ki;
    sousvide["kd"] = cfg.Kd;
//    sousvide["enabled"] = cfg.enabled;

    JsonObject& operations = jsonBuffer.createObject();
    root["operations"] = operations;
    operations["type"] = cfg.operationMode == Manual ? "0" : "1";
    operations["highLow"] = String(cfg.highlow);

    String st = "";
    root.prettyPrintTo(st);
//    char buf[ConfigFileBufferSize];
//    root.prettyPrintTo(buf, sizeof(buf));
    debugf("saved file = %s",st.c_str() );
    fileSetContent(SOUSVIDE_CONFIG_FILE, st);
}
if I change the value of "highlow" to be int and not String, then when loading it, sming goes KABOOM
robotiko
@robotiko
Mar 20 2016 19:33
tried forcing type in json conversion?
alon24
@alon24
Mar 20 2016 19:33
how
(show me exactly becuse I tried a number of stuff )
robotiko
@robotiko
Mar 20 2016 19:34
hold on
looking
I assume you dumped the values and are real ints
alon24
@alon24
Mar 20 2016 19:36
yes i write them 0 an d1
robotiko
@robotiko
Mar 20 2016 19:37
Casting values
long time = root["time"].as<long>();
I guess int would work the same is a template
alon24
@alon24
Mar 20 2016 19:37
int day = root["data"]["time"]["day"];
robotiko
@robotiko
Mar 20 2016 19:38
..
what is teh json structure?
alon24
@alon24
Mar 20 2016 19:40
loaded file = {
  "network": {},
  "Sousvide": {
    "T": 54.00,
    "kp": 1.00,
    "ki": 1.00,
    "kd": 1.00
  },
  "operations": {
    "type": "0",
    "highLow": "0"
  }
}
This message was deleted
This message was deleted
I confirmed it, it does not like as<int>()
robotiko
@robotiko
Mar 20 2016 19:45
json crash?
laurentppol
@laurentppol
Mar 20 2016 22:38
where is (how to download) DEV version od Sming? (not RTOS), as in "regular" 2.1.1 I don't see HWTimer
laurentppol
@laurentppol
Mar 20 2016 22:50
ok, got tarball, unpacking