These are chat archives for SmingHub/Sming

11th
Jan 2016
laurentppol
@laurentppol
Jan 11 2016 01:34
for the moment I have limited no of connections to 1, 2nd client receives "Too late..." message and client.close()
it is ok for my application
laurentppol
@laurentppol
Jan 11 2016 03:25
and it works :)
if ANYONE want "4 channels thermometer (DS1820) with USB & WiFi" please let me know
wants
"*
"dedicated to C2H5OH home production"
laurentppol
@laurentppol
Jan 11 2016 06:02
@hreintke @raburton In my app (4x thermometer using DS1820) I find No Nos ESP Sming stable for 10+ hours
now test using WiFi
if anyone wants: "telnet laurentppol.ddns.org 3000" 1 client at a time
alon24
@alon24
Jan 11 2016 06:52
In rtos, what is the replacement for system.onReady: // Run WEB server on system ready
System.onReady(StartServers);
zhivko
@zhivko
Jan 11 2016 07:16
Laurentppol you are doing ethanol home production facility?
@laurentppol very very interesting ;) where are you from?
hreintke
@hreintke
Jan 11 2016 07:43
@alon24 : There is no systemReady callback in the Espressif RTOS SDK.
I have an question about that open at the bbs but no reply yet.
I have been thinking on way to emulate by checking the availability of a specific functionality from within the framework and then firing the callback. Did not find a suitable function for that.
Do you have a suggestion for that or an idea of another solution ?
alon24
@alon24
Jan 11 2016 07:43
I do not have a solution, I just tried to port some of my code, and came across it, so I asked
hreintke
@hreintke
Jan 11 2016 07:46
I understand, but when you have an eureka moment on this please let me know :smile:
alon24
@alon24
Jan 11 2016 07:46
:)
alon24
@alon24
Jan 11 2016 08:12
@hreintke I think that for now i will start my servers when ap is connected (I hope there is an event for that)
hreintke
@hreintke
Jan 11 2016 08:18
@alon24 : In the SDK there is a callback for accesspoint events.
I can extend WfiAccesspoint to be able to set a delegate to receive these callbacks in the application
alon24
@alon24
Jan 11 2016 08:24
yes please, and ap too?
hreintke
@hreintke
Jan 11 2016 08:25
what do you mean with ap ?
alon24
@alon24
Jan 11 2016 08:25
i meant sta
station and accesspoint - 2 network states
alon24
@alon24
Jan 11 2016 09:22
@hreintke is that possible ? add for both interfaces?
hreintke
@hreintke
Jan 11 2016 09:24
@alon24 : wait a moment, busy at another line :smile:
alon24
@alon24
Jan 11 2016 09:27
sure :)
laurentppol
@laurentppol
Jan 11 2016 10:47
@zhivko if You can understand polish, there is nice forum www.bimber.info :)
lot of info how to
alon24
@alon24
Jan 11 2016 11:10
can I use my esp which is in AP mode, from my phone which is NOT on the netwok (not in the AP network), by using mdns or something? I know I can recognize that its there (the AP in mdns mode), but I do not want to connect to it, just send commandfs to it
like ff, back, left, right
either with websockets or tcp or udp
is there a way to do that?
because easyconfig (esp) allows you to send data (to configure the ssid and pass) so how can I mimic that?
my idea is to have my esp-car, using ap mode, and driving it from a phone which is NOT on the same network (that way, the phone will still have WIFI capapbilities, and the car would not need to look for wifi, which mught be my workplace, and secured with certificate - which I cannot add to esp)
hreintke
@hreintke
Jan 11 2016 11:29
@alonewolfx2 : are you in ?
Jakub Sobieraj
@sobiso
Jan 11 2016 12:03
How to use full flash (esp-12e) on Sming2.0 ?
ex. 1MB for app and 3MB for web
hreintke
@hreintke
Jan 11 2016 12:05
@alon24 :
This is the event enumeration :
EVENT_STAMODE_SCAN_DONE ESP8266 station finish scanning AP
EVENT_STAMODE_CONNECTED ESP8266 station connected to AP
EVENT_STAMODE_DISCONNECTED ESP8266 station disconnected to AP
EVENT_STAMODE_AUTHMODE_CHANGE the auth mode of AP connected by ESP8266 station changed
EVENT_STAMODE_GOT_IP ESP8266 station got IP from connected AP
EVENT_STAMODE_DHCP_TIMEOUT ESP8266 station dhcp client got IP timeout
EVENT_SOFTAPMODE_STACONNECTED a station connected to ESP8266 soft-AP
EVENT_SOFTAPMODE_STADISCONNECTED a station disconnected to ESP8266 soft-AP
EVENT_SOFTAPMODE_PROBEREQRECVED Receive probe request packet in soft-AP interface
Jakub Sobieraj
@sobiso
Jan 11 2016 12:17
anyone pls ?
alon24
@alon24
Jan 11 2016 12:20
@hreintke so how to use/
?
hreintke
@hreintke
Jan 11 2016 12:37
This is to show you the options.
I need to finalize some other work on Sming_RTOS before I can add this.
So for now, it is not yet available and you have to use a temporary local solution.
alon24
@alon24
Jan 11 2016 12:41
, thanks
k, thanks
hreintke
@hreintke
Jan 11 2016 12:43
and from my point of view preferable : take a look at the sdk functions, add the code to wifiaccesspoint and submit a PR
hreintke
@hreintke
Jan 11 2016 14:16
@kireevco @raburton :
Is there a way that we can have travis work like :
  • If sming framework fails -> report FAIL
  • If spiffy fails -> report FAIL
  • I example fails ->continue with next example
    Only report OK when all examples compile OK
Piotr Dobrowolski
@Informatic
Jan 11 2016 14:32
Hi all.
I've been playing with some MQTT lately and i noticed major latency between publishing messages from Sming and receiving them back - getting something around 300-500ms (testing code: http://git.io/vzv5P)
Turns out it's caused by send() called in MqttClient::staticSendPacket storing data in a stream and flushing it only when it receives readyToSend event. Simply adding client->pushAsyncPart(); after sending as mentioned above reduces latency to around 10ms. Is there any better way to do it, without modifying SmingCore? In theory send() could check if buffer was empty at the time of last readyToSend event and call pushAsyncPart() immediately in such case...
riban-bw
@riban-bw
Jan 11 2016 14:53
@sobiso You can try to create a SPIFFS of 3MB. I don't know if there is a problem with SPIFFS spanning 1MB boundaries. I don't see why there should be.
ESP8266 maps flash memory to a 1MB (max) location for runtime code but I would guess that SPIFFS accesses the flash as it needs to, effectively paging in the bits it needs - but I am not a SPIFFS expert.
hari2
@hari2
Jan 11 2016 15:33
is there some doc which explains debug via telnet?
hreintke
@hreintke
Jan 11 2016 15:53
@Informatic : can you submit a github issue for that ?
zhivko
@zhivko
Jan 11 2016 16:10
@laurentppol what sensors you plan to use? Hx711 and?
alonewolfx2
@alonewolfx2
Jan 11 2016 16:16
@hreintke i am in now
Dmitry Kireev
@kireevco
Jan 11 2016 16:18
@hreintke yes we can
Richard Antony Burton
@raburton
Jan 11 2016 16:54
@hreintke @kireevco make -k?
Dmitry Kireev
@kireevco
Jan 11 2016 17:17
@raburton @hreintke travis can be configured with allow_failures, so in Makefile example tasks and core tests can be separate. But questions is why do you want to allow some examples to fail? shouldnt they be working for everyone?
and if test fails on a new example, that means "we are not good"?
Richard Antony Burton
@raburton
Jan 11 2016 17:22
i see the logic, overall the build test should fail, but it should try to test all the samples
so if more than one thing is broken, in different tests, you get to see more than one error in the build
rtaher than have to fix one at a time and keep submitting more fixes one at a time
although how often that occurs i don't know, more likely to find the same error in multiple tests
hreintke
@hreintke
Jan 11 2016 17:30

@kireevco : I don't want samples to fail. I would like to see the issues with all examples in one run

If example fails ->continue with next example
Only report OK when all examples compile OK

hreintke
@hreintke
Jan 11 2016 17:35
@alonewolfx2 : still in ?
Dmitry Kireev
@kireevco
Jan 11 2016 17:37
@hreintke ah, so if one fails others don't even start. is that what you mean?
hreintke
@hreintke
Jan 11 2016 17:37
yes, that is the current situation. If we can see all failed examples in one run would ease fixing
Dmitry Kireev
@kireevco
Jan 11 2016 17:37
got it
hm....
Dmitry Kireev
@kireevco
Jan 11 2016 17:49
@hreintke Well, that's why if you have a separate samples repo you can run a matrix on all samples
Richard Antony Burton
@raburton
Jan 11 2016 17:51
not tested, but i think this would probably do the job:
make
make -k recurse-samples
main make needs to suceed, else no point testing the samples
Dmitry Kireev
@kireevco
Jan 11 2016 17:51
@raburton I think it will, but then you will have to look into the log file to see the resiults?
Richard Antony Burton
@raburton
Jan 11 2016 17:52
i think -k still reports failure if any step failed, just tries to do as much as possible
unlike -i which just ignores errors
yep, tested it
broke a couple of builds by deleting spiffy
Dmitry Kireev
@kireevco
Jan 11 2016 17:54

I'll see what can be done

env:
  - TESTFOLDER=integration/user
  - TESTFOLDER=integration/shopping_cart
  - TESTFOLDER=integration/payments
  - TESTFOLDER=units
script: "make -C $TESTFOLDER"

something like that

Richard Antony Burton
@raburton
Jan 11 2016 17:54
still ran through and tried to build them all, but returned an error message at the end and return code 2
Dmitry Kireev
@kireevco
Jan 11 2016 17:54
that should creaet multiple parallels tasks
Richard Antony Burton
@raburton
Jan 11 2016 17:55
will that make a very messy log?
hreintke
@hreintke
Jan 11 2016 17:57
@kireevco @raburton : I doubt whether we really need parallel tasks. all finishes quickly now and there will not be 100's of examples
Dmitry Kireev
@kireevco
Jan 11 2016 17:57
not 100% sure, but I think it will create multiple tasks
so you will see which one failed explicitly
Richard Antony Burton
@raburton
Jan 11 2016 17:57
that's ok then
@hreintke not a bad point, currentl build only takes about 40 seconds
we spend longer waiting for a osx build box than actually building
Dmitry Kireev
@kireevco
Jan 11 2016 17:59
all I'm saying, it would be nice to see failed tasks as separate items without looking into a build log
Richard Antony Burton
@raburton
Jan 11 2016 18:00
yeah, if we are building all of them, wasn't a problem when we stopped at point of the failure, the error would simply be at the bottom of the log
sounds like a plan
hreintke
@hreintke
Jan 11 2016 18:04
yes, nice options. Will give a good impression to people who initiate PR's and need to react on results.
I am out for dinner now. Talk later.
Richard Antony Burton
@raburton
Jan 11 2016 18:26
ditto, followed by pub quiz ;-)
Dmitry Kireev
@kireevco
Jan 11 2016 18:41
Platform IO is listening. they are working on windows-friendly UI (based on Atom editor)
How everyone is familiar with Cmake?
and scons
robotiko
@robotiko
Jan 11 2016 18:44
cmake is clion friendly
Dmitry Kireev
@kireevco
Jan 11 2016 18:48
@robotiko yep. I'm using it with platformio
for arduino, arduino-esp
code completeion and stuff...
alonewolfx2
@alonewolfx2
Jan 11 2016 18:55
@kireevco i donw know both :D
Piotr Dobrowolski
@Informatic
Jan 11 2016 18:57
@hreintke yes, i'll submit an issue later (and i have probably working but not much tested yet patch for that in TcpClient itself)
I'll submit a PR too after some testing.
alonewolfx2
@alonewolfx2
Jan 11 2016 19:14
@hreintke did you tried to port interrupts on rtos
Dmitry Kireev
@kireevco
Jan 11 2016 19:21
@alon24 is this usign sming?
hreintke
@hreintke
Jan 11 2016 20:10

@alonewolfx2 There is an the Interrupts.cpp. That one is in.
I did not convert to rtos interrupt handling. My goal is to have the working framework, based on rtos sdk.
adaption to the rtos equivalents is second step.

That is also true for the handling of tasks. And there there is the added complexity of callbacks.
callbacks need special handling to be able to get them running on specific tasks.
So please be not that firm in stating that sming functions will run in dedicated tasks without effort.

@Informatic : Great, good to know that you not only report a problem but also try to solve.
Issue submitting now is preferred as it gives the possibility to understand the direction on how you expect to solve.
Curtis Pope
@piperpilot
Jan 11 2016 20:15
hey guys, anyone there and have time for a quick question about Classes and callbacks
I have a class where I need to download a file to the SPIFFS to work with later...I want to have a callback when the download is done. I define downloadFile like this:

downloadFile(DEV_PICFW_URL, bootload);

and boatload is defined as:

void picBootload::bootload() {

when I compile, I get:
app/picbootload.cpp:156:39: error: invalid use of non-static member function
what am I doing wrong? How can I set a callback inside of the class for the download finished callback
alon24
@alon24
Jan 11 2016 20:22
@hreintke no, I must tell u, sming does not gave a lot if traction
hreintke
@hreintke
Jan 11 2016 20:37
@piperpilot : You cannot use a "pointer to a class function".
The calling method the compiler uses for non-class/static function is different from class functions.
In sming we use Delegates for functionality you need. A delegate can both be a static or class function.
@alon24 : I don't understand what you are trying to tell me :smile:
alon24
@alon24
Jan 11 2016 20:43
Rephrase... Sming does not seem to have a lot of traction in the world of esp8266 (sadly)
Tomáš Procházka
@tprochazka
Jan 11 2016 20:43
Does anybody have experience with sending file over HTTP as POST request in Sming please?
Curtis Pope
@piperpilot
Jan 11 2016 20:44
@hreintke would it be best then to just check the status in a timer? Not sure how I can define a delegate
hreintke
@hreintke
Jan 11 2016 20:51
something like : typedef Delegate<void()> bootLoadDelegate;
definition : downLoadFile(..., bootLoadDelegate bld).
The you can call with downLoadFile(.., bootLoadDelegate(picBootLoad::bootload,this)
Delegate look difficult, but takes less than an hour to grasp if you now about callbacks.
In sming every callback is implemented as a delegate
makes code clear and understandable, full support of classes/objects
Curtis Pope
@piperpilot
Jan 11 2016 20:55
I'll give it a try...I was trying to follow HttpFirmwareUpdate as an example...but that doesn't seem to download to SPIFFS
OK...I get the typedef...but not sure about the definition...as downloadFile is defined in HttpClient
hreintke
@hreintke
Jan 11 2016 21:03
Ah.. Sorry I did not realize that dowwloadFile was from http client. Then it even easier.
hreintke
@hreintke
Jan 11 2016 21:08
@piperpilot : this is the definition : downloadFile(String url, HttpClientCompletedDelegate onCompleted = NULL);
So you can call with downloadFile("nice url",HttpClientCompletedDelegate(&picBootload::bootload, this));
Curtis Pope
@piperpilot
Jan 11 2016 21:08
hmmm, I think I tried that...but I'll try again
@hreintke Yes...here is what I get when I try that:
app/picbootload.cpp:157:87: error: no matching function for call to 'Delegate<void(HttpClient&, bool)>::Delegate(void (picBootload::)(), picBootload)'
downloadFile(DEV_PICFW_URL, HttpClientCompletedDelegate(&picBootload::bootload, this));
hreintke
@hreintke
Jan 11 2016 21:10
the typedef is : typedef Delegate<void(HttpClient& client, bool successful)> HttpClientCompletedDelegate;
Curtis Pope
@piperpilot
Jan 11 2016 21:11
so I have to put that typedef in my header file?
hreintke
@hreintke
Jan 11 2016 21:11
no wait, I have to type
your have void picBootload::bootload(), but delegatefunction should be :
void picBootload::bootload(HttpClient*,bool succesful);
the <void(HttpClient& client, bool successful)> from the typedef
Curtis Pope
@piperpilot
Jan 11 2016 21:14
ahhh...OK...I see
hreintke
@hreintke
Jan 11 2016 21:20
@alon24 : I agree, that is why there are talks about platformio and others. That would provide more visibility.
And maybe.. sming_rtos on esp32
robotiko
@robotiko
Jan 11 2016 21:21
And maybe.. sming_rtos on esp32
:D
don't mention the devil
:D
hreintke
@hreintke
Jan 11 2016 21:22
well rumours are that esp32 is rather beta so we have some time :smile:
Curtis Pope
@piperpilot
Jan 11 2016 21:26
@hreintke thanks for the help!!!
hreintke
@hreintke
Jan 11 2016 21:29
@piperpilot : glad to help. You see how nice delegate are.
You also can call downloadFile with a static function,
void myfunction(httpclient* , bool s);
call : downloadFile("url", myfunction).