These are chat archives for SmingHub/Sming

12th
Mar 2016
alon24
@alon24
Mar 12 2016 09:30
ESP8266 simulation now available on 123d ciruits. [BETA]
https://123d.circuits.io/circuits/1385637
Anyone tried this out?
Alexander V. Ribchansky
@avr39-ripe
Mar 12 2016 09:45
@kireevco try to build esp-alt-sdk from develop (gcc 5.3.0) under freebsd - builds, can compile code for esp, but on linkage stage I got error "compiled for a little endian system and target is big endian" so compiled app cannot link..
Georgi Dobrishinov
@dobrishinov
Mar 12 2016 10:04
blob
Hi, i have problem with Basic_WebSkeletonApp
Alexander V. Ribchansky
@avr39-ripe
Mar 12 2016 10:11
@dobrishinov rebuild sming lib
@dobrishinov you have outdated sming lib without new methods on which this example app based
@dobrishinov cd /opt/esp/Sming/Sming && make rebuild spiffy
Georgi Dobrishinov
@dobrishinov
Mar 12 2016 10:22

blob

@avr39-ripe Tnx, i rebuild but i have this error now

Alexander V. Ribchansky
@avr39-ripe
Mar 12 2016 10:42
@dobrishinov add this into configuration.h
// If you want, you can define WiFi settings globally in Eclipse Environment Variables
#ifndef WIFI_SSID
        #define WIFI_SSID "PleaseEnterSSID" // Put you SSID and Password here
        #define WIFI_PWD "PleaseEnterPass"
#endif
@dobrishinov you can also define this variables in your build env for all sming samples..
Georgi Dobrishinov
@dobrishinov
Mar 12 2016 10:47
Thank you! @avr39-ripe
Alexander V. Ribchansky
@avr39-ripe
Mar 12 2016 10:48
@dobrishinov works now?
Georgi Dobrishinov
@dobrishinov
Mar 12 2016 10:48
@avr39-ripe Yes :)
Alexander V. Ribchansky
@avr39-ripe
Mar 12 2016 10:50
@dobrishinov nice to hear it.. for any question - feel free to ask me.. this is basic app to build own on top of it.. Many sming samples is bit outdated and teach newcommers do wrong things :) my app isn't ideal too, but I try to make it as simple as possible staying useful as base app
Georgi Dobrishinov
@dobrishinov
Mar 12 2016 11:01
blob
@avr39-ripe Nice : ) , i have one question, when i open config page, i change name and pass, save but nothing change after restart : ?
Patrick Jahns
@patrickjahns
Mar 12 2016 11:29

@avr39-ripe
Probably one needs to update the examples to reflect change

@hreintke / @alonewolfx2
You asked about improvement to make it easier for people to use - I guess this is one.
And maybe put the link to the documentatoin (sminghub.github.io) more prominent on the front page :-)

robotiko
@robotiko
Mar 12 2016 11:32
@patrickjahns .. Totally agree on both statements. Could you please open two issues so it is Not lost?
Patrick Jahns
@patrickjahns
Mar 12 2016 11:34
2 issues? :confused: - wouldn`t know what to name two - but I can open one with the label "improve documentation"
robotiko
@robotiko
Mar 12 2016 11:35
And another about update basic examples to current sming style
I can create that one layer today when I'm at the computer
@avr39-ripe. Do you have identified examples that new an update?
We have a lot there
Patrick Jahns
@patrickjahns
Mar 12 2016 11:47
@robotiko done #650 and #649
Patrick Jahns
@patrickjahns
Mar 12 2016 11:53
@avr39-ripe
some days ago you mentioned errors with the request body/ header fix of mine - can you please document them in the PRs so I can have a look at it
Alexander V. Ribchansky
@avr39-ripe
Mar 12 2016 11:54
@patrickjahns its simple - i get no query parameters with you branch..
robotiko
@robotiko
Mar 12 2016 11:57
@patrickjahns thanks
if not reported.. it get lost -> doesn't exists
Alexander V. Ribchansky
@avr39-ripe
Mar 12 2016 11:58
@dobrishinov do you update WHOLE sming or just take separate pr? empty {} in your log sows that there is no post request body from web ui.. just tested with hour ago updated sming banch develop - all works..
@robotiko About examples, all examples with wifi connection needs change.. do not think that IMMEDIATLY, more people should test WifiEvents and comment on such mechanizm, then, if no serious bugs found - update all examples to use WifiEvents.. next is update MeteoControl example, and My WebSkeleton NOT TO SAVE wifi config in separate file.. there is no need for this.. sdk stores it internally.. bit later I update my app to reflect this change..
Alexander V. Ribchansky
@avr39-ripe
Mar 12 2016 12:04
@patrickjahns query parameters is like GET http://some.url/data.json?id=10 so "id" is query parameter and "10" is value... with changes from you branch I can't get them.. request.getQueryParameter("id") return empty string while id=10 present in request..
Georgi Dobrishinov
@dobrishinov
Mar 12 2016 12:12
@avr39-ripe I download sming, go in Sming/Sming, 1- make clean, 2- make, 3 -make spiffy, 4 - go in sample, 5 - make clean, 6 - make flash, 7- uploaded and dont work properly
Alexander V. Ribchansky
@avr39-ripe
Mar 12 2016 12:16
@dobrishinov download sming mean what? cd Sming && git checkout develop && git pull or what? try the same procedure several minutes ago and it work.. so i try to narrow up problem source..
Georgi Dobrishinov
@dobrishinov
Mar 12 2016 12:26
@avr39-ripe 1 - delete old sming folder, 2 - git clone https://github.com/SmingHub/Sming.git, 3 - build sming, spiffy and project
teicors
@teicors
Mar 12 2016 12:26
Hi all, I would share my partial porting of the lib of rfid-rc522 from arduino in order to check any error and end the porting. Do I have to follow any direction ? The soft seems able to read and write the card...
Alexander V. Ribchansky
@avr39-ripe
Mar 12 2016 12:29
@dobrishinov good procedure.. nothing wrong here.. do the same thing, move my own sming fork, git clone https://github.com/SmingHub/Sming.git && gmake rebuild spiffy then in app folder gmake rebuild flash and app works.. gmake because I'm on freebsd.. here we have own bsd make and gnu one called gmake..
@dobrishinov can you try to write some ssid and password in on /config page and put checkbox on enable wifi client and show console log from esp??
@teicors fork Sming repo, put your library port into Sming/Sming/Libraries/YOUR_LIB_NAME if you can provide some example app as Sming/samples/Example_APP commit your changes in separate branch ex. feature/rc522_lib push to you Sming fork, then create push request to sming repo..
Georgi Dobrishinov
@dobrishinov
Mar 12 2016 12:33
blob @avr39-ripe i put name and pass, i click save several times, click chekbox but nothing, in console log - {} is empty
Alexander V. Ribchansky
@avr39-ripe
Mar 12 2016 12:34
@dobrishinov strange.. will try to rebuild this app in max clean env.. wait a bit..
Alexander V. Ribchansky
@avr39-ripe
Mar 12 2016 12:41
@dobrishinov reflash my esp with make flashinit (clear all wifi settings to default) unset WIFI_SSID & WIFI_PWD to make "EMPTY APP", make clean && make flash in app folder, restart esp, attach miniterm,py console, connect to esp AP from android 5.1 phone, open in chrome 192.168.4.1/config do not change anything, just press "Save network" and get request body in json in console log as LOG 3fff1fe0 already freed { "StaSSID": "PleaseEnterSSID", "StaPassword": "PleaseEnterPass", "StaEnable": 1 }mode : sta(5c:cf:7f:01:f6:02) + softAP(5e:cf:7f:01:f6:02) add if0 station: fc:64:ba:a4:91:ff leave, AID = 1 rm 1 bcn 0 del if1 mode : sta(5c:cf:7f:01:f6:02) f r0, 3fff1fe0 already freed scandone no PleaseEnterSSID found, reconnect after 1s
alonewolfx2
@alonewolfx2
Mar 12 2016 12:43
@teicors i can test your port. if your port clean more than mine you can make pr. if mine clean i will make pr
Alexander V. Ribchansky
@avr39-ripe
Mar 12 2016 12:45
@dobrishinov what do you use as device and browser to connect to esp AP?? phone/computer?? which browser do you use?

@all can anybody find a minute to checkout Basic_WebSkeletonApp ? you either need to deffine WIFI_SSID and WIFI_PWD in your build env or add fix to include/configuration.h ``` C++
// If you want, you can define WiFi settings globally in Eclipse Environment Variables

ifndef WIFI_SSID

    #define WIFI_SSID "PleaseEnterSSID" // Put you SSID and Password here
    #define WIFI_PWD "PleaseEnterPass"

endif

```

Georgi Dobrishinov
@dobrishinov
Mar 12 2016 12:49
@avr39-ripe i will try again now, i use chrome browser on ubuntu 14.04
Alexander V. Ribchansky
@avr39-ripe
Mar 12 2016 12:50
@dobrishinov really cant reproduce your problem :((( I really try.. very odd
Georgi Dobrishinov
@dobrishinov
Mar 12 2016 12:52
@avr39-ripe what sdk you use :? i use 1.5.2
Alexander V. Ribchansky
@avr39-ripe
Mar 12 2016 12:53
@dobrishinov same here.. 1.5.2 esp-alt-sdk from @kireevco with gcc 5.1.0
Georgi Dobrishinov
@dobrishinov
Mar 12 2016 12:54
@avr39-ripe i use esp-open-sdk https://github.com/pfalcon/esp-open-sdk
Alexander V. Ribchansky
@avr39-ripe
Mar 12 2016 12:56
@dobrishinov really don't think that this is compiler problem... it is either my javascript code wrong (but cant figure out why it work for me) or some browser issue from your side...
here is js code attached to Save Network button
function post_netcfg(event) {
    event.preventDefault();
    var formData = {
            'StaSSID'                    :    document.getElementById('StaSSID').value,
            'StaPassword'                :    document.getElementById('StaPassword').value,
            'StaEnable'                    :    (document.getElementById('StaEnable').checked ? 1 : 0)
            };
    $.ajax({
        type        : 'POST',
        url         : '/config',
        contentType    : 'application/json; charset=utf-8',
        data        : JSON.stringify(formData),
        dataType    : 'json'
    })
}
Georgi Dobrishinov
@dobrishinov
Mar 12 2016 12:57
@avr39-ripe i test from my android 5.1.1, with stock browser but problem still - empty {}, maybe i wrong somewhere i dont know : ?
Alexander V. Ribchansky
@avr39-ripe
Mar 12 2016 12:59
@dobrishinov can you test it from chrome with developer console open, you can peek on actually network requests and responses.. try to look for post request body for /config url..
@all can anybody comment js code?? I know that it have NOTHING to sming but if someone can it will be great.... :( it works for me as a charm.. just POST form data in json..
Georgi Dobrishinov
@dobrishinov
Mar 12 2016 13:04
Screenshot from 2016-03-12 15:01:33.png
Screenshot from 2016-03-12 15:01:45.png
Screenshot from 2016-03-12 15:01:55.png
@avr39-ripe i click save but in response and preview is empty, but on cancel button show this
Screenshot from 2016-03-12 15:03:29.png
Screenshot from 2016-03-12 15:03:38.png
Alexander V. Ribchansky
@avr39-ripe
Mar 12 2016 13:06
on first screenshot you can see post payload with correct json... so we must search why we get empty json on sming side after we parse it...

@dobrishinov please try to add this

Serial.printf("Request RAW body: %s\n", request.getBody());

just into webserver.cpp into onConfiguration

--- a/samples/Basic_WebSkeletonApp/app/webserver.cpp
+++ b/samples/Basic_WebSkeletonApp/app/webserver.cpp
@@ -24,6 +24,7 @@ void onConfiguration(HttpRequest &request, HttpResponse &response)
                }
                else
                {
+                       Serial.printf("Request RAW body: %s\n", request.getBody());
                        StaticJsonBuffer<ConfigJsonBufferSize> jsonBuffer;
                        JsonObject& root = jsonBuffer.parseObject(request.getBody());
                        root.prettyPrintTo(Serial); //Uncomment it for debuging
Alexander V. Ribchansky
@avr39-ripe
Mar 12 2016 13:13
with this change we will see actual raw post body.. oh!! may be this is what @patrickjahns said about packet split and so on??? hmmm!!! but if I connect DIRECTLY to esp with my phone, and you do the SAME what is the difference in our networking env???
and for me code from sming/develop in context of request.getBody() works at least on 3 different wifi access points and directly connected to esp..
Georgi Dobrishinov
@dobrishinov
Mar 12 2016 13:19
blob
In console now show this output, if i change ssid and pass, in console is change
Alexander V. Ribchansky
@avr39-ripe
Mar 12 2016 13:32
@dobrishinov good, so we get correct post body but can't parse it.. and please change StaticJsonBuffer<ConfigJsonBufferSize> jsonBuffer; to DynamicJsonBuffer jsonBuffer; and try again..
Georgi Dobrishinov
@dobrishinov
Mar 12 2016 13:42
@avr39-ripe i change but still dont work
in console -
dhcp server start:(ip:192.168.4.1,mask:255.255.255.0,gw:192.168.4.1)
bcn 100
add 1
aid 1
station: 24:fd:52:64:44:4b join, AID = 1
Request RAW body: {"StaSSID":"azzz","StaPassword":"12345678","StaEnable"
{}3fff2170 already freed
Alexander V. Ribchansky
@avr39-ripe
Mar 12 2016 13:45
@dobrishinov so there is definitively problem with json parsing... may be you clone sming repo in between new arduinojson lib merge?? no other idea :(( there is something BAD with json parsing ;( what is your last commit in sming log??
Patrick Jahns
@patrickjahns
Mar 12 2016 13:46
@avr39-ripe
you lazy :monkey: - whenever you find an issue please post it in github or the PR to keep track of it :tongue: - otherwise things will always be lost in this chat :worried:
Alexander V. Ribchansky
@avr39-ripe
Mar 12 2016 13:47
@patrickjahns agree.. but I post an issue about httpClient... also try you http rawBody fix and tell you about the problem..
@patrickjahns problem with @dobrishinov is fresh one.. cant describe issue yet..
@patrickjahns and as logs from @dobrishinov said ther isn't problem with getting rawBody but with parsing it as json.. new json lib was imported to develop today... which issue i forgot to post? ;)
Patrick Jahns
@patrickjahns
Mar 12 2016 13:49
You are helping a lot - and I find it great :sparkles: - but for example with the rawbody issue I nearly forgot about it :worried: - since there was no record on PR
Alexander V. Ribchansky
@avr39-ripe
Mar 12 2016 13:50
@patrickjahns ok.. agree.. will post an issue in future.. I get you position and it is good one.. talks and chats are good, but "paper" in form of ISSUE is better.. no doubt..
Patrick Jahns
@patrickjahns
Mar 12 2016 13:51
@avr39-ripe
hope I wasnt to rude and I hope it was the correct way of using lazy monkey - wasnt meant as an insult
Alexander V. Ribchansky
@avr39-ripe
Mar 12 2016 13:52
@patrickjahns no offence :)))
Patrick Jahns
@patrickjahns
Mar 12 2016 13:53
@avr39-ripe do you mind tracking your findings in regards to bad/wrong examples here #650
Whenever you have time
@dobrishinov
when looking at your console - is the line truncated with the body or not?
It looks to me as if the body is missing some params which would indeed replicate the behaviour I experienced
Georgi Dobrishinov
@dobrishinov
Mar 12 2016 13:58
@patrickjahns i dont understand : ?
Patrick Jahns
@patrickjahns
Mar 12 2016 13:59
@dobrishinov
see for example {"StaSSID":"azzz","StaPassword":"12345678","StaEnable" - it is not the full request - there are some parts missing. So is it just truncated in your console/terminal window or is it truncated on the ESP
Georgi Dobrishinov
@dobrishinov
Mar 12 2016 13:59
blob
Alexander V. Ribchansky
@avr39-ripe
Mar 12 2016 13:59
@patrickjahns ok, will try to inspect examples.. but I need some feedback about WifiEvents and NEW way Wifi.enable ( = Station | AccessPoint) works.. there is a SECOND optional parameter which if TRUE will tell to write to flash wifi settings.. otherwise they will be just runtime, till next reboot.. if this two things are good, we need to correct examples... and I need to implement getting wifi config for access point..
Patrick Jahns
@patrickjahns
Mar 12 2016 14:00
@avr39-ripe
it`s also okay if you only document what you already know in that issue - no need for creating extra work
Alexander V. Ribchansky
@avr39-ripe
Mar 12 2016 14:00
@patrickjahns good catch! about truncation...
Patrick Jahns
@patrickjahns
Mar 12 2016 14:00
This is what I experienced also - that is why I implemented the buffer variant
I don`t know if that is actually an issue with packets split or lwip buffer implementaiton - but either way, we have to deal with it on SMING side i.e. use a buffer etc
Georgi Dobrishinov
@dobrishinov
Mar 12 2016 14:01
@patrickjahns some parts missing but i think is it truncated on the ESP, not on console
Alexander V. Ribchansky
@avr39-ripe
Mar 12 2016 14:01
@patrickjahns but how can my env be differ than @dobrishinov when both of us try to connect to esp DIRECTLY from phone???
I can imagine difference with wifi access points/routers etc.. but if there is only esp < - > phone and there is softAP on esp... odd..:(
Patrick Jahns
@patrickjahns
Mar 12 2016 14:03
@dobrishinov
can you try this branch https://github.com/patrickjahns/Sming/tree/buffer-fixrawbodypost - it`s a fix I used
Alexander V. Ribchansky
@avr39-ripe
Mar 12 2016 14:03
@patrickjahns and if you said thet you found issue with request parameters may be you can share your new way of fixing request.rawBody ?
i absolutely need request parameters to work... ;(
Patrick Jahns
@patrickjahns
Mar 12 2016 14:05
@avr39-ripe - there are many factor involved - this goes down to the network layer. Either way it can be a slow network, so packets might be split into smaller pieces for better transfer rates. It might be that packets are delayed and thus lwip buffer already stops before another part arrives and hands the current buffer over
@avr39-ripe
I will check the next days - I don`t have an esp for debugging here -
@avr39-ripe
Did you check if only request parameters are wrong, or also if normal http post (urlencoded) are wrong?
Alexander V. Ribchansky
@avr39-ripe
Mar 12 2016 14:07
@patrickjahns ok will wait for your info.. if my knowledge allows me, I try to look into your fix.. may be I can find some hints why request parameters are missing...
@patrickjahns don't even test urlencoded.. just rawBody - WORKS and requestParameters - DON'T WORKS...
@patrickjahns do not like urlencoded as exchange media between form (web ui) and esp.. json via raw body is much more flexible
Patrick Jahns
@patrickjahns
Mar 12 2016 14:10
The problem occured in pr #622 - I am asking since the request parameter function might have a glitch - the basic parsing method for request params and post params is the same. Just wondering if the glitch is there or soemwhere else
Alexander V. Ribchansky
@avr39-ripe
Mar 12 2016 14:11
@patrickjahns no-problem.. can test urlencoded with your fix for rawBody..
Alexander V. Ribchansky
@avr39-ripe
Mar 12 2016 14:41
@patrickjahns so back to your fix.. nither queryParameter nor urlencoded form data DO NOT work ;(( switching to regular sming/develop solve the problem.. and introduce new one with packet hassle :(( hope this helped and you will find solution..
teicors
@teicors
Mar 12 2016 15:00
@avr39-ripe I'm rookie in git :O ... I created my repo on git hub (https://github.com/teicors) and I placed two projects: rfid (the library) and ReadWrite_RFID (a project ported from Arduino).
teicors
@teicors
Mar 12 2016 15:05
Into rfid I placed two files for patching WString.cpp and WString.h in order to allow the lib working. Only one thing is to be fixed: // Serial.println(mfrc522.PICC_GetTypeName(piccType));. I commented out (only info) in order to compile the source.
hreintke
@hreintke
Mar 12 2016 15:26
@teicors : What did you update in Wstring class and what should it solve ?
teicors
@teicors
Mar 12 2016 15:31
@hreintke I added some classes releated to FlashStringHelper (comparing the WString in Arduino)
ex. String & String::copy(const
FlashStringHelper *pstr, unsigned int length)
If I did something wrong, don't hexitate to tell it to me !!!
hreintke
@hreintke
Mar 12 2016 15:44
@teicors :
No nothing wrong. But getting in a library which requires framework updates needs always some extra attention.
Especially in the base classes like WString. What would be the situation when not adding ?
Should at least be a separate PR so that the update is not "hidden" in the lib PR.
teicors
@teicors
Mar 12 2016 17:03
@hreintke w/o the patches I gt always this error:
C+ Libraries/rfid/MFRC522.cpp
In file included from Libraries/rfid/MFRC522.cpp:8:0:
Libraries/rfid/MFRC522.h:384:15: error: 'FlashStringHelper' does not name a type
static const
FlashStringHelper *GetStatusCodeName(StatusCode code);
^
as example .. but if it's wrong, don't care my port :smile:
alon24
@alon24
Mar 12 2016 17:08
@hreintke if I want to add changes to the infoscreen, do I just do it in the same local branch From when I checked code in at the beginning?
robotiko
@robotiko
Mar 12 2016 20:54
@avr39-ripe checking Basic_WebSkeletonApp in rtos .. causing some troubles
looks like it is not working at all
I just saw earlier comments
but here i'm not even abel to display index properly
Alexander V. Ribchansky
@avr39-ripe
Mar 12 2016 20:55
@robotiko known issue :( download bootstrap and jquery from nonos sample
robotiko
@robotiko
Mar 12 2016 20:55
all styles
oook
what is teh iss?
the issue
is it reported?
Alexander V. Ribchansky
@avr39-ripe
Mar 12 2016 20:55
my fault.. somehove dont include two files into rtos ver..
robotiko
@robotiko
Mar 12 2016 20:56
is just that?
Alexander V. Ribchansky
@avr39-ripe
Mar 12 2016 20:56
yes.. just that.. Im planning get rid off jquery..
robotiko
@robotiko
Mar 12 2016 20:57
so issue reported?
I also see a veeery weird thing
everytime I restart the esp
I see
Alexander V. Ribchansky
@avr39-ripe
Mar 12 2016 20:58
yes by @alon24 here.. no issue in right place... Me ENO_TIME to make pr :(
what do you see?
robotiko
@robotiko
Mar 12 2016 20:58
dhcp client start...
ip:192.168.1.59,mask:255.255.255.0,gw:192.168.1.1
the ip changes
Alexander V. Ribchansky
@avr39-ripe
Mar 12 2016 20:59
this isnt ths app issue.. I hope.. for me 3 different modules gets the same ip in 2 different wifi nets...
robotiko
@robotiko
Mar 12 2016 20:59
I started with ip:192.168.1.40
same for me
but this is the first time I see this
In months
Alexander V. Ribchansky
@avr39-ripe
Mar 12 2016 20:59
do not change a bit in dhcp or ip address logic
robotiko
@robotiko
Mar 12 2016 21:00
ok
Alexander V. Ribchansky
@avr39-ripe
Mar 12 2016 21:01
do please test whether you ccan actually get post request pfrom web ui processed in esp.. we spand whole afternoon with @dobrishinov & @patrickjahns to catch issue with cuted post body..
robotiko
@robotiko
Mar 12 2016 21:02
ok so first add the resources
and the try
Alexander V. Ribchansky
@avr39-ripe
Mar 12 2016 21:02
try to add missing files, build app flash.. and try to write some ssid and password and see whethe esp get them.. in console log you must see somesing differ then {}
yes..
robotiko
@robotiko
Mar 12 2016 21:03
@avr39-ripe one thing
I just flashed the DNS captive
reseted the esp 5 times
and always got the same ip
I will check again with this example.. to see it ip roll
robotiko
@robotiko
Mar 12 2016 21:11
another question
DNS Captive Portal works on rtos?
Alexander V. Ribchansky
@avr39-ripe
Mar 12 2016 21:15
@robotiko don't know about captiv portal at all... not yet test it.. but it is good feature :)
robotiko
@robotiko
Mar 12 2016 21:16
shouldn't it capture any http request and resent to default page that displays default page?
Alexander V. Ribchansky
@avr39-ripe
Mar 12 2016 21:19
@robotiko i think it should..
robotiko
@robotiko
Mar 12 2016 21:20
doesnt look like
@patrickjahns .. here?
robotiko
@robotiko
Mar 12 2016 21:26
@avr39-ripe ok testing the web skeleton
Alexander V. Ribchansky
@avr39-ripe
Mar 12 2016 21:26
@robotiko works for you? you can see json in console when you "Save network" ?
robotiko
@robotiko
Mar 12 2016 21:27
I see that it save teh network data
I will test that
Alexander V. Ribchansky
@avr39-ripe
Mar 12 2016 21:27
heh! glad to hear this...
if you whant take a look how data is going to and from web ui.. no sming templates no post with formUrlEncoded.. just json to both sides... and also take look at WifiEvents in real work :)
this app starts own softAP when there is no connection with predefined wifi.. then as soon as connection to wifi restored it shuts down own ap.. you also can disable connection to wifi and just run own AP on esp..
robotiko
@robotiko
Mar 12 2016 21:34
@avr39-ripe
I see things:
Alexander V. Ribchansky
@avr39-ripe
Mar 12 2016 21:35
warning: known limitation is when esp try yo connect to some wifi access point in sta mode it is REAL difficult to connect to own esp softAP! connection drops, authorization requests pop.. cant get ip for a long time.. but with little patience you CAN connect to own esp softAP and change settings..
this is nod bug of app but limitation of esp itself..
robotiko
@robotiko
Mar 12 2016 21:35
1) tested in Internet explorer and returns errors ..
XMLHttpRequest: Network error 0x2eff, could not complete due to error 00002eff.
Alexander V. Ribchansky
@avr39-ripe
Mar 12 2016 21:36
IE isnt supported by jquery 1.9, not 1.9 but 2.1.4..
robotiko
@robotiko
Mar 12 2016 21:36
in firefox
I just tested in latest nightbuild and looks like console is screwed .. but I see in the esp serial
that json dat ais received
Alexander V. Ribchansky
@avr39-ripe
Mar 12 2016 21:37
try to enter real wifi ssid and password.. it should connect to it..
robotiko
@robotiko
Mar 12 2016 21:38
not really
mode : softAP(5e:cf:7f:06:02:a8)
dhcp server start:(ip:192.168.4.1,mask:255.255.255.0,gw:192.168.4.1)
add if1
bcn 100
add 1
aid 1
station: 00:25:d3:e0:87:68 join, AID = 1
{
  "StaSSID": "STL",
  "StaPassword": "realpass",
  "StaEnable": 1
}mode : sta(5c:cf:7f:06:02:a8) + softAP(5e:cf:7f:06:02:a8)
add if0
station: 00:25:d3:e0:87:68 leave, AID = 1
rm 1
bcn 0
del if1
mode : sta(5c:cf:7f:06:02:a8)
f r0, "tiT"(stack_size = 116,task handle = 3fff1990) overflow the heap_size.
Fatal exception (20): 
epc1=0x000080b8
epc2=0x00000000
epc3=0x4020b916
epcvaddr=0x000080b8
depc=0x00000000
rtn_add=0x000080b8
ú
 ets Jan  8 2013,rst cause:2, boot mode:(3,7)

load 0x40100000, len 28012, room 16 
tail 12
chksum 0x7d
ho 0 tail 12 room 4
load 0x3ffe8000, len 944, room 12 
tail 4
chksum 0x29
load 0x3ffe83b0, len 7924, room 4 
tail 0
chksum 0x4a
csum 0x4a
~r[12]ì[12]b[00]ŒžâŒb[0C]lŒbŽb[0C]bp’llìŽ|€lbìònî€[12]nnâ[10][02][0C][02]llàŒ[02][0C]l[0C]Œ[0C]lŒŽlìŽ[1E]ŒlŽ[1E]‚ìŽ[0E]ldon't use rtc mem data
€[02]nü[00]ŒžâŒb[0C]쎎[1C]p[0C][0C][02][02]ŒžâŒb[0C]l[0C]ŒbŽ[0E]lrln[0C]’`€[02]ìònnnâ[0E]‚[12]nnn[0E]l[12]nî[12]ònò[02]lž‚[12]‚[12]nnœ[1E][00]ìŽ[0C]lb[0C]ŒŽr’ìlŽ[0E]lŽ’bâ’b[02][0C]žìr’ònò[02]lž‚[12]‚[12]nnœ[1E][00][0C]Ž[0C]lb[0C]l[0C]l`[02]`[12]b‚ò[12]b’r’œ|b[12]‚nlžàŒ‚[02][0C][0C]bì’b[12]nàp[12]’žâ’’[02]ìb’[12]‚[12]nnnìnr[00]l`[02]`[12]b‚ò[12]b’r’œ|b[12]‚nlžàŒ‚[02][0C][0C]bì’b[12]nàp‚’rrnìb’[12]‚[12]nnnìnr[00]l`[02]Ž’nì|ò[02]Œ[12]’ll[00][0C][12]|~ònœìnœìònnp[12]‚ͱ••Ádisable
mode : softAP(5e:cf:7f:06:02:a8)
dhcp server start:(ip:192.168.4.1,mask:255.255.255.0,gw:192.168.4.1)
add if1
bcn 100
add 1
aid 1
station: 00:25:d3:e0:87:68 join, AID = 1
{
  "StaSSID": "STL",
  "StaPassword": "realpass",
  "StaEnable": 1
}mode : sta(5c:cf:7f:06:02:a8) + softAP(5e:cf:7f:06:02:a8)
add if0
station: 00:25:d3:e0:87:68 leave, AID = 1
rm 1
bcn 0
del if1
mode : sta(5c:cf:7f:06:02:a8)
f r0, "tiT"(stack_size = 116,task handle = 3fff1990) overflow the heap_size.
Fatal exception (20): 
epc1=0x000080b8
epc2=0x00000000
epc3=0x4020b908
epcvaddr=0x000080b8
depc=0x00000000
rtn_add=0x000080b8
ú
 ets Jan  8 2013,rst cause:2, boot mode:(3,7)
it crashes
rtos 1.4
Alexander V. Ribchansky
@avr39-ripe
Mar 12 2016 21:40
@robotiko again rtos limitation.. to be honest I just port app as part as WifiEvents port to rtos, but dont think I really test it... again app from nonos needs some care in rtos.. :(((
try to change StaticJsonBuffer to DynamicJsonBuffer in webserver.cpp
Patrick Jahns
@patrickjahns
Mar 12 2016 21:49
@robotiko
what is your issue with captive portal?
robotiko
@robotiko
Mar 12 2016 21:54
hi @patrickjahns
what shoudl be the expected behaviour?
If i connect to the captive portal I was expeting that any http request get catched and shows the default page
but it simply shows not available connection
unless I enter the ESP Ip as url
tested on rtos
Patrick Jahns
@patrickjahns
Mar 12 2016 21:57
did you use my example?
robotiko
@robotiko
Mar 12 2016 21:57
yes
just that
nothing changed
Patrick Jahns
@patrickjahns
Mar 12 2016 21:57
please enable debugging and provide a log
robotiko
@robotiko
Mar 12 2016 21:58
ok
was is tested on rtos?
Patrick Jahns
@patrickjahns
Mar 12 2016 21:58
I did not - @alonewolfx2 confirmed it is working
robotiko
@robotiko
Mar 12 2016 21:58
ok
Patrick Jahns
@patrickjahns
Mar 12 2016 22:00
and be sure to clear your dns resolver cache of the os
robotiko
@robotiko
Mar 12 2016 22:01
ok
I will test that way and enable debug
keep you updated
thanks
Patrick Jahns
@patrickjahns
Mar 12 2016 22:06
For me in nonos it is working in a project of mine perfectly
@robotiko
once you are done with the test - please describe your actions so I can test it accordingly
hreintke
@hreintke
Mar 12 2016 22:40

@avr39-ripe :
Setting

const uint16_t ConfigFileBufferSize = 2048;

And using it in

void saveConfig(ThermConfig& cfg)
{
    StaticJsonBuffer<ConfigJsonBufferSize> jsonBuffer;
    JsonObject& root = jsonBuffer.createObject();

    JsonObject& network = jsonBuffer.createObject();
    root["network"] = network;
    network["StaSSID"] = cfg.StaSSID.c_str();
    network["StaPassword"] = cfg.StaPassword.c_str();
    network["StaEnable"] = cfg.StaEnable;

    char buf[ConfigFileBufferSize];
    root.prettyPrintTo(buf, sizeof(buf));
    fileSetContent(THERM_CONFIG_FILE, buf);
}

You can expect stack issues in lots of systems
Think that just by changing to String buf will solve this issue.

PS : Why prettyPrint for just saving to a file ?
Patrick Jahns
@patrickjahns
Mar 12 2016 22:46

@avr39-ripe
I tested http request/post param parsing and I think I found the 2 problems that introduced themselves when cleaning up code
Please test:
https://github.com/patrickjahns/Sming/tree/http-buffer-test

If there is any error - provide me with a full debug log so I can replicate it more easily