These are chat archives for SmingHub/Sming

11th
Mar 2016
alonewolfx2
@alonewolfx2
Mar 11 2016 06:45
@harry-boe can dma mode be enabled in ili9341 library?
Harry Böttcher
@harry-boe
Mar 11 2016 09:26
not shure what you mean by dma mode ..
But what can help is enabling the USE_FAST_PINIO
Other libs use the same concept and there it works.
FAST_PINIO writes directly into the GPIO register instead of using the expensive digitalWrite(PIN, [LOW/HIGH]); methods
To be fair the HSPI implementation in ili9341 is highly optimzed for that ili9341 case. So there are now Register resets (it asumes they settings will never change) and so on. Unlikely hard to beat that implementation with a generic one.
Harry Böttcher
@harry-boe
Mar 11 2016 11:38
@alonewolfx2 i have my ili9340 now connected with new ported ili9341 lib. It works right OOTB.
I agree the script is slow but i need to check what that script actually does. Printing the message etc is fast ist more filling the screen that is slow. But this might be in the sample code.
I will throw my ST3755 Test cases on the port
alonewolfx2
@alonewolfx2
Mar 11 2016 12:18
@harry-boe i think its not sample code because its working fine on hspi.c
how can i try use fastpinio?
Harry Böttcher
@harry-boe
Mar 11 2016 12:19

line 33 in the Lib header file

 #if defined (__AVR__) || defined(TEENSYDUINO) || defined (__arm__) || defined (__ESP8266_EX__)
#define USE_FAST_PINIO
#endif

It speeds up about 5 to 10%

alonewolfx2
@alonewolfx2
Mar 11 2016 12:20
please check this video
Harry Böttcher
@harry-boe
Mar 11 2016 12:21
Ok that’s fast - but these are the same test cases i’m on
To be fair only parts of the processing time is SPI communication
@alonewolfx2 ok my test cases run with about the same speed than the ST3755 display. There i gained 10% speed comapred to the old SPI inplmentation we had (that was mainly due to a inefficient implementation in readData and writeData
So it is not worse than before
alonewolfx2
@alonewolfx2
Mar 11 2016 12:27
%10 better than nothing :)
Harry Böttcher
@harry-boe
Mar 11 2016 12:41
pushed my test cases on my repo
https://github.com/harry-boe/Sming/tree/device/ILI9340
just in case
Harry Böttcher
@harry-boe
Mar 11 2016 12:59
@alonewolfx2 > %10 better than nothing :)
Well the Aduino Due lib is highly optimized.
The Adafruit libs are not really implemented for speed.
The send out avery information as bytes in a own SPI Transaction. So 1 for command, 2 for address (1 hi byte one lo byte) 2 for the pixel value (again lo byte hi byte)
And worse for clear screen they do that in a loop over horizontal than vertical and pixel by pixel
Imagin you can do this with SPI buffers off up to 64 bytes !!
So there is a lot of improovment in the lib (not really in the SPI impl)
alonewolfx2
@alonewolfx2
Mar 11 2016 13:24
ok. i will try to port vnc client lib into the sming.
Harry Böttcher
@harry-boe
Mar 11 2016 15:22
@alonewolfx2 -> that’s sweet:
The vnc client uses a frame buffer. So that can be optimized by heaving a Buffer sync that uses bufferd SPI calls.
Fangorn-SPB
@Fangorn-SPB
Mar 11 2016 15:32
Hi, All!
Can i test my firmware w/o ESP?...)
alon24
@alon24
Mar 11 2016 15:42
To all who wondered, I finally found the cause for the tit stack overflow issue
In my code I used dynamic json for loading data for configuration, from disk, this was copied from the old Mateo example from nonos
Rtos did not like this
I switched to the static json example by @
Avr39 and it works now
Patrick Jahns
@patrickjahns
Mar 11 2016 16:00
@alon24
How large was the size of the json and the jsonbuffer?
alon24
@alon24
Mar 11 2016 16:04
On the phone bow, and I actually do not know, this was the code beforehttps://github.com/alon24/SousVide/blob/rtos/SousVide/app/configuration.cpp
This is nowSousVide/blob/development/SousVide/app/configuration.cpp
Maybe even my old usage was wrong, but it worked in nonos
Now what happens is that the code works ok, and loads and all, but the second I connect to it using websockets, it dies
hreintke
@hreintke
Mar 11 2016 16:12
@alon24 :
I was talking/gitting with @avr39-ripe and he had just the opposite experience.
StaticJson -> issue, DynamicJson -> OK.
I know for sure that DynamicJson is using heap memory.
alon24
@alon24
Mar 11 2016 16:14
I used his example
hreintke
@hreintke
Mar 11 2016 16:39
And "just running the unaltered example" was causing issues ?
alon24
@alon24
Mar 11 2016 16:41
?
What unaltered? SousVide before the change to static? That did not work, when I connected with websocket to it
Harry Böttcher
@harry-boe
Mar 11 2016 17:00
@alonewolfx2 for the vnc port. Check out the ILI9341 lib mentioned on the VNC Youtube comments
https://github.com/Links2004/Adafruit_ILI9341
That lib does exactly what i mentioned before. He copies all the command sequence into a byte buffer (writeCmdDataTmp) and sends that out in one SPI transaction. Maybe that’s what they DMA ?!
alonewolfx2
@alonewolfx2
Mar 11 2016 17:02
mybe
but it didnt work on my module
if i upload working sming code (maybe init sequence is wrong for my module) and than upload vnc code its working but not good some colors not correct
Alexander V. Ribchansky
@avr39-ripe
Mar 11 2016 20:32
@hreintke @alon24 to Dynamic vs StaticJsonBuffer - I in sequence switch from Static to Dynamic Json buffer, app ported from nonos become more usable, then I switch from local char buffer to one global (BAD IDEA!! rtos it multitasking beast! there must be some mutex or semaphore or some synchronization mechanizm, but for tests we can assume thet no concurency, no race will be for this global char buffer used to print content of json to for sending it to web..) so to buffer, when I start to use one global buffer, not many local, declared at function scope - app become even more stable.. but it COMPLETELY GOOD works just about 1000..1200 seconds and then as @hreintke confirm some networking forget to breath (seriously, internal web server stop responding to request) but app itself continue to work properly.. so this is it with buffers, jsons and rtos.. fragile.. very fragile..
alon24
@alon24
Mar 11 2016 20:48
@avr39-ripe I did not understand. I used u'r code with static json, and that works, what r u basically saying, giv
Can u give code sample
Alexander V. Ribchansky
@avr39-ripe
Mar 11 2016 20:50
@alon24 I publish that code before I try to port my real "big" app to rtos.. examle I provide works just fine, but my real app starts working after I change json buffer to Dynamic (may be not related, do not test with StaticJsonBuffer and global char buffer)
alon24
@alon24
Mar 11 2016 20:52
where in this code is the global char buffer
I am not a c++ expert so maybe I am missing it, is it in the example? Basic_WebSkeletonApp
Alexander V. Ribchansky
@avr39-ripe
Mar 11 2016 20:55
@alon24 there is no such buffer in that app.. wait a bit, I give you example
alon24
@alon24
Mar 11 2016 20:55
:)
and could this example also be of what is the best practice here, since I did not understand from the answer before what is best practice
Alexander V. Ribchansky
@avr39-ripe
Mar 11 2016 20:56
NO :( I cant.. seriously.. I do not know bast practice yet..
alon24
@alon24
Mar 11 2016 20:57
:(
Harry Böttcher
@harry-boe
Mar 11 2016 20:57
@alonewolfx2 check out the byte orders for the pixels that are set. Might be the reason for wrong colours ?!
Alexander V. Ribchansky
@avr39-ripe
Mar 11 2016 20:57
alon24
@alon24
Mar 11 2016 20:58
we are talking about saveScheduleCfg method?
or onScheduleCfg
Alexander V. Ribchansky
@avr39-ripe
Mar 11 2016 20:59
no.. better talk for onStateCfg method.. and gbuf is char gbuf[4096];
alon24
@alon24
Mar 11 2016 21:00
so rtos ver works now for u?
works for 1000..1200 seconds.. then webserver (webserver from my app, from sming, from esp module :)) stop responding to requests.. but other app parts is working normally..
so, NOT completely works for me..
As I said many times "ESP RTOS + Sming RTOS + app ported from nonOS Sming" = VERY (!!!) fragile thing.. I think there must be some deeper porting requirements, but have not discovered them yet :(
alon24
@alon24
Mar 11 2016 21:03
understood now
so maybe i just wont send json
I mean the only reason use json now is becuase of save and read the config
but i wont use json for now, any where else until u get a better handle on things
robotiko
@robotiko
Mar 11 2016 21:07
@avr39-ripe so you tested a small rtos POC and then ported the whole app
so it was not done incrementally and cannto isolate where the issue comes from, right?
RTOS SDK 1.3 or 1.4?
Alexander V. Ribchansky
@avr39-ripe
Mar 11 2016 21:08
@alon24 JSON isnt silver bullet.. In this app, even in nonos ver I also use binary config to store some data which eat huge amount or RAM when I try to use json to save them... look at https://github.com/avr39-ripe/OctoTherm/blob/rtos/app/thermo.cpp#L340 this rtos bin cfg.. and this same cfg saved in json.. https://github.com/avr39-ripe/OctoTherm/blob/rtos/app/thermo.cpp#L318
robotiko
@robotiko
Mar 11 2016 21:08
RTOS SDK 1.4 change list mentions
improved system stability;
many other optimizations…
Alexander V. Ribchansky
@avr39-ripe
Mar 11 2016 21:09
@robotiko 1.4.. yes, I had nonos app, then port whole app to rtos.. results - above :)
robotiko
@robotiko
Mar 11 2016 21:09
then it i will be hard to figure out where it comes from
Alexander V. Ribchansky
@avr39-ripe
Mar 11 2016 21:09
my results confirmed by @hreintke so it isnt just my hands :))
@robotiko yes.. indeed.. rtos is very different thing which I think needs verry different GLOBAL point of view of how to vrite Sming-like apps...
robotiko
@robotiko
Mar 11 2016 21:12
@avr39-ripe sure .. the multitasking .. is completely different conception
but it all is done in single task.. should work "almost" as nonos
alon24
@alon24
Mar 11 2016 21:14
is there alt-sdk with rtos 1.4 yet?
Alexander V. Ribchansky
@avr39-ripe
Mar 11 2016 21:14
moreover.. I start thinking that may be we et not biig proffit from rtos on esp8266.. espressif itself do not actively develop rtos sdk for esp8266.. esp32 is MUCH differ from esp8266 in ram amount in dual-corenes.. so may be we are on wrong way by trying get much from rtos on esp8266?? not to offend anybody work! Me personally also wish to see working rtos apps on esp8266.. but for now it very fragile.. :(
robotiko
@robotiko
Mar 11 2016 21:14
and remove the issues with rst when hugging cpu
@avr39-ripe like it or not .. looks like espressif will just keep rtos version and abandon nonos
they will have to poolish
Alexander V. Ribchansky
@avr39-ripe
Mar 11 2016 21:15
@alon24 just build esp-alt-sdk and use it with 1.4 rtos sdk..
alon24
@alon24
Mar 11 2016 21:16
i do nto like building, it adds stuff to do :)
Alexander V. Ribchansky
@avr39-ripe
Mar 11 2016 21:16
@robotiko do not think that they abandone nonos for esp8266 or you have some other official info from espressif??
robotiko
@robotiko
Mar 11 2016 21:16
@avr39-ripe gossip..
Alexander V. Ribchansky
@avr39-ripe
Mar 11 2016 21:16
@alon24 so just download esp-alt-edk and change 1.3 to 1.4 by hand.. no build needed :)
@robotiko sorry, what is gossip? :(
robotiko
@robotiko
Mar 11 2016 21:17
but it makes sense to move to a unified rtos solution for both chips
Alexander V. Ribchansky
@avr39-ripe
Mar 11 2016 21:17
@robotiko make sense, indeed.. if we CAN do this...
tests shows that it is no such easy task..
robotiko
@robotiko
Mar 11 2016 21:17
@avr39-ripe gossip... not official statement
I bet it is a hard thing
alon24
@alon24
Mar 11 2016 21:18
just change in sdk dir in esl-alt?
robotiko
@robotiko
Mar 11 2016 21:18
that is why @hreintke has been asking for more "big examples"
alon24
@alon24
Mar 11 2016 21:18
esp-alt?
robotiko
@robotiko
Mar 11 2016 21:18
to find more issues
still quite impressive job what he has done with rtos
from concept to a workign thing with all included
Alexander V. Ribchansky
@avr39-ripe
Mar 11 2016 21:19
os is not just nonos with multitask.. as @hreintke said app must VERY accurately use stack.. and who knows what else we need have in mind to cook ROTS properly?? :(
alon24
@alon24
Mar 11 2016 21:19
I agree @hreintke is doing a bang up job!!!!
robotiko
@robotiko
Mar 11 2016 21:20
and think of how great it would be if sming could work in rtos mdoe corretly
Alexander V. Ribchansky
@avr39-ripe
Mar 11 2016 21:20
yeh, he is A MAN!!! my critic to RTOS is not to offend him!! his job is amnazing!!
robotiko
@robotiko
Mar 11 2016 21:20
and make esp32 / esp8266 abstraction
@avr39-ripe I get it
the idea behind rtos in sming
is that it is good for some "always there issues" like looks, rst on not event programming etc
but mainly
that new chips will just come in rtos ..
so if rtos is the Hardware Abstraction Level..
and Smign mounts on top of that ..
"ideally".. could run Sming app in both Hw
we will see :D
but nonos and nonos sming took a while to mature and be stable
Alexander V. Ribchansky
@avr39-ripe
Mar 11 2016 21:24
@robotiko idealy - YES.. but reallity can be bit differ.. may be esp8266 is too weak, too ram-less, too cpu-less for rtos with REAL apps..
robotiko
@robotiko
Mar 11 2016 21:25
we would have to define "real apps" first
Alexander V. Ribchansky
@avr39-ripe
Mar 11 2016 21:26
@robotiko ok, real app is some usefull app, not just small test.. my app is kind of useful app.. works great on nonos.. do not work properly on rtos..
@robotiko again I here not to say that I wrote superb great app and only rtos is bad thing around :)) my app is just demonstration of rather complex app..
robotiko
@robotiko
Mar 11 2016 21:28
@avr39-ripe :D not fighting.. you are probably rigth for current status
we will have to see if rtos can be poolished to solve it
or not
too early
look at roadmap from nonos sdk 1.1
esp rtos is very new and sming rtos too
will need to mature..
Alexander V. Ribchansky
@avr39-ripe
Mar 11 2016 21:29
absolutely agree with you!! too early.. yes, I remember the times when I starts use Sming with nonos sdk around 1.0 ..1.1.. hehe... stable??? hehe again.. and now it is good and stable.. but sdk is 1.5.2 : ))
again +1 to you @robotiko
robotiko
@robotiko
Mar 11 2016 21:30
@avr39-ripe .. another +1 for you :D
we need more big apps causing trouble in rtos
:D
Alexander V. Ribchansky
@avr39-ripe
Mar 11 2016 21:31
first one is here.. publically on github :)
robotiko
@robotiko
Mar 11 2016 21:31
thanks
@avr39-ripe what is the route for the rtos version ?
Alexander V. Ribchansky
@avr39-ripe
Mar 11 2016 21:32
obviously - rtos branch :)
robotiko
@robotiko
Mar 11 2016 21:33
ok branch in the project
ok dk
I like your project
alon24
@alon24
Mar 11 2016 21:34
rtos nonos - I just want to make a stake and drive it around in my esp-car :)
Alexander V. Ribchansky
@avr39-ripe
Mar 11 2016 21:35
@robotiko thanks! it is combination of three pices.. TyTherm - remote ds18b20 based thermosensor, TySwitch - remote switch to ON/OFF thingth and OctoTherm - central thermostat logic with web ui for configuring thermostats...
robotiko
@robotiko
Mar 11 2016 21:36
what thermostats are you usign?
I have been using evohome/ evotouch for severla years
and just got teh rf modules to make the wifi bridge
Alexander V. Ribchansky
@avr39-ripe
Mar 11 2016 21:38
@robotiko no thermostats at all.. TyTherm is tempsensor OctoTherm is thermostat logic.. many TyTherm can share the same OctoTherm.. :) that is!! fully software thermostats.. fully remote thermosensors and remote switch..
robotiko
@robotiko
Mar 11 2016 21:39
i see
Alexander V. Ribchansky
@avr39-ripe
Mar 11 2016 21:40
and TyMera is combination of OctoTherm and heating equipment control to control pumps, valves etc... work in progress.. but some parts already in production :))
robotiko
@robotiko
Mar 11 2016 21:41
multiple sensor for a sigle control unit, right?
*single
Alexander V. Ribchansky
@avr39-ripe
Mar 11 2016 21:42
yeah.. indeed..
robotiko
@robotiko
Mar 11 2016 21:42
how many sensors you have deployed?
I guess.. current application is home heating or something like.. with sensors in several rooms and group logi o decidewhan to turn off boiler?
Alexander V. Ribchansky
@avr39-ripe
Mar 11 2016 21:43
@robotiko that part is on testing now... try with just one.. soon will try with many 3..5.. HW is not ready..
robotiko
@robotiko
Mar 11 2016 21:44
do you know evohome?
Alexander V. Ribchansky
@avr39-ripe
Mar 11 2016 21:44
yeah.. the greate goal is something like that... no, do not... about everhome..
robotiko
@robotiko
Mar 11 2016 21:46
have a look is one of the most used smart heating systems
you can get many ideas from it ;)
Alexander V. Ribchansky
@avr39-ripe
Mar 11 2016 21:46
but wireless thermostats that I know is bit pricy and do not allow set them up from one central place.. I know about BIG and $$$ hungry systems which can do muuuch more then my, but I try to make bit cheaper system.. I'm from Ukraine so cost is VERY metter..
robotiko
@robotiko
Mar 11 2016 21:47
I get that
it is pricy .. this one allows to control from central touch screen and also website
Alexander V. Ribchansky
@avr39-ripe
Mar 11 2016 21:47
@robotiko thanks for link, will read it :)
better one
they change all devices to colour .. and new web etc
it is a really cool thing
30% heating saving
Alexander V. Ribchansky
@avr39-ripe
Mar 11 2016 21:50
yeah.. and we need savings for heating.. here in the most democratic of all european country.. our GAZ bills is amnazing :))) if you can pay for heating YOU are a RICH man :(((
robotiko
@robotiko
Mar 11 2016 21:51
yep
:D
Alexander V. Ribchansky
@avr39-ripe
Mar 11 2016 21:51
Ukraine.. what else to say :(
robotiko
@robotiko
Mar 11 2016 21:51
I know I have soem friend over there
there is a low cost thermo valve from conrad electronics
Alexander V. Ribchansky
@avr39-ripe
Mar 11 2016 21:52
in 21th century we use wood for heating... even when we already have gaz... :( stoe age again :(
robotiko
@robotiko
Mar 11 2016 21:53
and horses .. :D
Alexander V. Ribchansky
@avr39-ripe
Mar 11 2016 21:53
@robotiko horses is lesser problem :))