These are chat archives for SmingHub/Sming

2nd
Feb 2016
laurentppol
@laurentppol
Feb 02 2016 00:41
@robotiko with carefully designed HW & SW... it may work even on "resources limited platform" like ESP
offloading all encryption to a (external) hardware, looks nice
and secure
but, do "we" need security beyond SSL/ssh?
laurentppol
@laurentppol
Feb 02 2016 00:53
with ssh only PUBLIC keys are stored on device...
laurentppol
@laurentppol
Feb 02 2016 01:38
to allow "device" to verify private key of a client
w/o compromising security
sle118
@sle118
Feb 02 2016 07:28
@robotiko > @sle118 how is the jpg lib going?
I was unable to find the source of crash just yet. jpg are working but png causes reboots (wdt)
So I'm seeing up gdb to do a deep dive in execution logic and pointer allocation
@robotiko i have a jpg library working in my repo if you want to check
sle118
@sle118
Feb 02 2016 07:34
I am putting a more complete lib with jpg, gif, png, etc support but it's more complex
hreintke
@hreintke
Feb 02 2016 07:49
@sle118 :
If jpg is working good, I would PR the lib with only that functionality enabled.
When merged into develop more people are going to use so you have a lot more testing done :smile:
@sle118 @harry-boe : Not sure when I an reading both of your chats but.. Are you both working on a bmp/jpg to screen converter/displayer ?
alonewolfx2
@alonewolfx2
Feb 02 2016 08:34
@sle118 is your jpg library one color or full color ?
@hreintke seems yes. @sle118 has monocolor jpeg library (as i know) @harry-boe has full color bmp library.
Harry Böttcher
@harry-boe
Feb 02 2016 09:36
for the image library the sub_lib is a very good starting point. I’m right now playing with that as a side task. Main problem with jpag is that you need to load the whole file to get the compression/decompression codes someher ni the file. So ether you have it stored on spiffs or SD card and seek inside the file or you are limited to pictures that fit into the memory. Her is the link to the lib to https://github.com/nothings/stb (it’s one file an compile without issues in sming)
Ricardo Martínez
@mtzfactory
Feb 02 2016 10:22

Hi, my exp8266 resets itself because of wdt reset but I have disabled previously the watchdog with WDT.enable(false)... What I'm doing wrong? Heeeelp...
That is what I get:

"ets Jan 8 2013,rst cause:4, boot mode:(3,7)

wdt reset
load 0x40100000, len 23728, room 16
tail 0
chksum 0xcd
load 0x3ffe8000, len 884, room 8
tail 12
chksum 0x4c
ho 0 tail 12 room 4
load 0x3ffe8378, len 3948, room 12
tail 0
chksum 0x64
csum 0x64"

alonewolfx2
@alonewolfx2
Feb 02 2016 10:31
@mtzfactory you cant disable wdt more than 6 second due to espressif sdk
zhivko
@zhivko
Feb 02 2016 13:15
HI @alonewolfx2 ! I want to interface a sensor with rs232 - I remember there are two serial on esp12 - is that right?
What library should I use for classical rs232 communication? I want to leave standar serial intact - so I could still interact to esp over serial and see debug messages...

I see from:
https://github.com/SmingHub/Sming/blob/9171e91243f95da22a7827d50537337cba36b25b/Sming/SmingCore/HardwareSerial.h
There are 2 serials:

#define UART_ID_0   0
#define UART_ID_1   1

So how can I use one or another? What pins do they connect to - on esp12?

zhivko
@zhivko
Feb 02 2016 13:21
I see HardwareSerial.cpp references only UART_ID_0. So if I wanna use UART_ID_1 can I just copy implementation and replace UART_ID_0 with UART_ID_1 ?
Ricardo Martínez
@mtzfactory
Feb 02 2016 13:50
@alonewolfx2 So... I have to do WDT.Alive() from time to time? It is not used at all in the sming's samples, in any example...
Is there a best practice to do that? Some one has a snippet as an example?
zhivko
@zhivko
Feb 02 2016 14:13
@mtzfactory I think you dont need to do that - just make sure you dont have long running loops in your code.
They must be as short as possible
You need to leave esp to cool down and do its stuff on its own. :)
Ricardo Martínez
@mtzfactory
Feb 02 2016 14:18
@zhivko thank you very much!!

I do have another question, I want to try the deep sleep functionality in my esp (NodeMCU v0.9), so I tried this code:

"while (1) {
WDT.alive();
Serial.print(".");
System.deepSleep(30000); // 30000 = 30 seconds.
// system_deep_sleep(10000000); //sleep time in usecs. 10000000 = 10 secs.
}"

But the code is printing dots all the time, it seems it never goes to sleep :-/
Any suggestion?

hreintke
@hreintke
Feb 02 2016 14:44
@zhivko
Although from the source it looks like there is hardwareserial possible on uart1, that is not implemented.
And just copying will not work as interrupts between uart0 and uart1 are shared. And (from my memory) there is dependency on a espressif supplied ringbuffer.
I think there is a function like uart_tx_one_char(Uartno, oneChar);
At least that is the function I use in SmingRTOS where I prepared (not finished) HardwareSerial for use of both uarts.
robotiko
@robotiko
Feb 02 2016 14:53
humm
why not
it i possible
is an analog tv
sle118
@sle118
Feb 02 2016 14:54
I have a full color bmp jpg gif png etc library ported. Jpg works, treated on monochrome but should work fine on color too. > @hreintke seems yes. @sle118 has monocolor jpeg library (as i know) @harry-boe has full color bmp library.
robotiko
@robotiko
Feb 02 2016 14:54
@sle118 so now you support all format in color too?
sle118
@sle118
Feb 02 2016 14:55
The library allows a 2 steps approach. 1 load picture, 2 display. If pictures are small (like status icons), them you can keep them in mermoiry to draw quicker as decide takes a little time
I always said i support full color on multiple formats with the new library, but i only have amono displkay hooked up
I have 2 libraries
One is already on my git account, the other is undergoing test
I can do a PR today if someone else is willing to help troubleshoot the deciding of png
*decoding
I am just not used checking in code that is not rock solid
Decoding routines can be selected before compiling Sming, by means of #define
This helps reduce code footprint
sle118
@sle118
Feb 02 2016 15:01
It also contains ziv-lemp compression routines (which are used for png) that are users accessible for other compression tasks
@robotiko @hreintke here is the library i ported: https://github.com/nothings/stb
Check stb_image
All of the other libraries are really interesting
As well
They are fully contained libraries with very little dependencies, so they are extremely portable
hreintke
@hreintke
Feb 02 2016 15:08
@sle118 @harry-boe :
This is the text from @harry-boe
Her is the link to the lib to https://github.com/nothings/stb (it’s one file an compile without issues in sming)
Looks like you are duplicating effort.
sle118
@sle118
Feb 02 2016 15:21
It would seem so
Let me do the pr
So effort can be shared
I guess one month was too slow, but real life called me :smile:
Not sure how much changes harry-boe has done, but i where
But i went deep in retrofit
Took off all the biggest local declares from original lib
To use malloc instead
To reduce footprint
I have also implemented file read callbacks to support spiffy or any other storage that could come in future
My demo is fun too... A screen fill of times that change randomly
Full of tiles
sle118
@sle118
Feb 02 2016 15:28
I know my code doesn't leak, so this isn't the source of crash.
Jpg also is fine
sle118
@sle118
Feb 02 2016 15:37
You should see a pr later today. Got to run
alonewolfx2
@alonewolfx2
Feb 02 2016 16:31
@alon24 is it possible? hmm i have one analog tv in my sofa :) i will try it
robotiko
@robotiko
Feb 02 2016 16:31
there are many examples on how to drive analog tv with a PIC microcontroller
typical pong on MCU
electronics are simple.. timming is another thing
but esp is not 8MHz PIC so .. can manage it
alon24
@alon24
Feb 02 2016 16:33
the video pic is all blurry
alonewolfx2
@alonewolfx2
Feb 02 2016 16:36
@robotiko hoq can i find channel 3
robotiko
@robotiko
Feb 02 2016 16:38
?
on tv?
from what I know you have to use VCR input
but it depends on teh century the TV was manufactured
:)
robotiko
@robotiko
Feb 02 2016 16:50
@harry-boe about PR #561
I wasa bout to test it .. but I see it is closed but not merged
any issue?
alon24
@alon24
Feb 02 2016 17:07
u need the old uhf tv
and manually search for it!
robotiko
@robotiko
Feb 02 2016 17:18
anyone having this with latest sming in develop?
18:17:38 **** Build of configuration Sming for project SmingFramework ****
make all 
AS system/irq_check.s
CC system/flashmem.c
In file included from include/user_config.h:29:0,
                 from system/flashmem.h:11,
                 from system/flashmem.c:1:
system/include/esp_systemapi.h:6:21: fatal error: ets_sys.h: No such file or directory
compilation terminated.
make: *** [out/build/system/flashmem.o] Error 1
robotiko
@robotiko
Feb 02 2016 17:32
ok nevermind
dirty environment
Harry Böttcher
@harry-boe
Feb 02 2016 17:37
@harry-boe about PR #561
on the PR #561
Didi not realized that is has not been merged. Thought it was ?
Ther is no Issue it’s working fine for me and it used in some projects. Unfortunatley i have it already deleted in my fork. Shoul I recreate it ao are yo going to test from the archives ?
Harry Böttcher
@harry-boe
Feb 02 2016 17:53
@sle118 > It would seem so

@sle118 > It would seem so

No worry. I just strted to play around with the lib. Nothing posted yet. I run through the same things as you. The lib is compiles and runs ok but lot’s of things are not usable due to memory constraints. Starting with readng from spiffs or any oher memory buffer. Going on with JPG file that exceed RAM size etc.
So please PR your stuff and i wull check where i can jump in.
BTW: the bmp handling on the TFT samples dow some verry basic BMP handling for 24bit files only. I don’t conider this a library.

robotiko
@robotiko
Feb 02 2016 18:15
@harry-boe I'm testing now
the PR is there.. so if there are no issues it can be merged
I would suggest not to close PR..
to be sure that it gets merged
Dmitry Kireev
@kireevco
Feb 02 2016 18:17
@sle118 esp-alt-sdk has gdb.exe if that helps
fastlink30
@fastlink30
Feb 02 2016 19:47
someone can explain to me how to use sdk 1.5.1, if i try to use it i get this error:
C+ app/TranspSerial.cpp
In file included from include/user_config.h:39:0,
from app/TranspSerial.cpp:1:
c:/tools/sming/Sming/system/include/esp_systemapi.h:6:21: fatal error: ets_sys.h: No such file or directory
compilation terminated.
i put the sdk directory (original expressif) into the expressif directory and change name to ESP8266_SDK_151
after this rename ESP8266_SDK to _ESP8266_SDK
and rename ESP8266_SDK_151 to ESP8266_SDK
must be done some other steps?
Harry Böttcher
@harry-boe
Feb 02 2016 21:09

@robotiko

@harry-boe I'm testing now
Now idea how it got closed ?!
However it restored and ropened the PR and it’s again ready to merge

robotiko
@robotiko
Feb 02 2016 21:11
@harry-boe I tested changing the i2c pins
but could not make it work.. and I'm almost sure that it is because I have a faulty solder .. so I will resolder tomorrow and test
if all goes ok .. I will merge
I also added the eclipse project stuff
you use eclipse? netbeans? clion?
Harry Böttcher
@harry-boe
Feb 02 2016 21:18
i’m using eclipse on OS X
zhivko
@zhivko
Feb 02 2016 21:20
@mtzfactory why do you have: "while (1)" it seems you are doing a constant loop here...
Just use System.deepSleep(30000); probably should work
@hreintke have you seen:
https://github.com/plieningerweb/esp8266-software-uart
@alonewolfx2 told me for this project it is soft uart - it can work on any 2 pinss - kindof - do you think it would be good idea to have this in Sming ?
hreintke
@hreintke
Feb 02 2016 21:30
This message was deleted
zhivko
@zhivko
Feb 02 2016 21:39
@hreintke: sorry this is right repo: https://github.com/plerup/espsoftwareserial
hreintke
@hreintke
Feb 02 2016 21:39
@zhivko :
Yes, I have seen that repo.
The second hardwareserial I am working on is the ESP UART1, not software serial
zhivko
@zhivko
Feb 02 2016 21:42
UART1 doesn't have RX just TX ?
alonewolfx2
@alonewolfx2
Feb 02 2016 21:43
yes just tx
hreintke
@hreintke
Feb 02 2016 21:45

@zhivko : Yes seen that to.
The tricky statement is :

Please note that during read operations interrupts are disabled for a period of time corresponding to reading one byte. For low baud rates with heavy load this can be a problem as the ESP WiFi may not get called often enough and this can cause a crash or watchdog reset. Try to include calls to yield() when possible.

and it interferes with interrupt handling itself

zhivko
@zhivko
Feb 02 2016 21:46
OOPS... :(
alonewolfx2
@alonewolfx2
Feb 02 2016 21:48
@hreintke @zhivko i am trying into the rtos
soo it will not be a problem i think
hreintke
@hreintke
Feb 02 2016 21:48
It might be (hear the hesitation in this) that by using the task mechanism in RTOS it works with less interference
zhivko
@zhivko
Feb 02 2016 21:49
trying to port this library to Sming - what is ESP.getCycleCount() equivalent in Sming ?
hreintke
@hreintke
Feb 02 2016 21:49
Interrupt disabling is always a bad habit. That also prevents task switching
zhivko
@zhivko
Feb 02 2016 21:50
@hreintke is Sming rtos already available - develop branch maybe ?
hreintke
@hreintke
Feb 02 2016 21:51
There is just a master branch for now. Ready for beta release.
The readme is not correct anymore, needs updating :worried:
zhivko
@zhivko
Feb 02 2016 21:52
OK no problem...
@hreintke this serial of yours can work on another pins ?
@hreintke is the serial part of rtos - I mean if I checkout it is there to be tested ? I want to interface an sensor - and I do not want to mix debug serial and sensor serial.
hreintke
@hreintke
Feb 02 2016 21:54
No, it is the interface to the esp uarts, that has own interrups
@zhivko : I had an issue with disabling the serial output.
That is finally solved with help from @raburton tonight.
First thing now is fixing the serial. It all works a little as expected is in the repo tomorrw
zhivko
@zhivko
Feb 02 2016 21:57
So that is great news... I read in readme RTOS POC that:
it is based on Espressif RTOS_SDK 1.3.0
I hope this is not true? ;)
hreintke
@hreintke
Feb 02 2016 21:58
Yes it is. That is the latest from Espressif, Not identical to NONOS SDK 1.3.0 :smile:
zhivko
@zhivko
Feb 02 2016 22:00
Ah - so I guess it is ahead of my Sming esp_iot_sdk_v1.5.0_15_11_27.zip ?
hreintke
@hreintke
Feb 02 2016 22:03
That depends on the functionality you are using.
For details see http://bbs.espressif.com/viewtopic.php?f=46&t=1329
zhivko
@zhivko
Feb 02 2016 22:15
@hreinttke: I got this laser sensor I would like to test... cannot wait...
maybe you know what is equivalent of ESP.getCycleCount in Sming?
https://github.com/plerup/espsoftwareserial/blob/master/SoftwareSerial.cpp#L113
hreintke
@hreintke
Feb 02 2016 22:22
Probable something with system_rtc_clock_cali_proc
zhivko
@zhivko
Feb 02 2016 22:29
OK THANKS!!! Now without errors ready to try SoftwareSerial in Sming :)
alonewolfx2
@alonewolfx2
Feb 02 2016 22:29
is it working ?
@hreintke have we beginTransaction in rtos spi?
hreintke
@hreintke
Feb 02 2016 22:32
rtos spi is the same as nonos spi
And did't you convert/test already some libraries using spi ?
zhivko
@zhivko
Feb 02 2016 22:33
UPs One error more:
void ICACHE_RAM_ATTR SoftwareSerial::rxRead() {
It seems ICACHE_RAM_ATTR is not recognized in Sming environment...
alonewolfx2
@alonewolfx2
Feb 02 2016 22:34
yes but include <spi.h> working on nonos butcant find rtos
i confused
hreintke
@hreintke
Feb 02 2016 22:34
use IRAM_ATTR
C:\Userdata\RTOS_Project\sming\sming\core\SPI.h
zhivko
@zhivko
Feb 02 2016 22:36
Yes I tried that but I get:
make all 
C+ Libraries/SoftUart/SoftwareSerial.cpp
In file included from system/include/esp_systemapi.h:6:0,
                 from Wiring/../include/user_config.h:29,
                 from Wiring/Arduino.h:6,
                 from Libraries/SoftUart/SoftwareSerial.cpp:17:
Libraries/SoftUart/SoftwareSerial.cpp: In constructor 'SoftwareSerial::SoftwareSerial(int, int, bool, unsigned int)':
/home/kz/esp8266/esp-open-sdk/sdk/include/ets_sys.h:58:56: error: invalid conversion from 'void (*)(void*)' to 'void*' [-fpermissive]
     ets_isr_attach(ETS_GPIO_INUM, (func), (void *)(arg))
                                                        ^
Libraries/SoftUart/SoftwareSerial.cpp:50:13: note: in expansion of macro 'ETS_GPIO_INTR_ATTACH'
             ETS_GPIO_INTR_ATTACH(handle_interrupt, 0);
             ^
In file included from Wiring/../include/user_config.h:29:0,
                 from Wiring/Arduino.h:6,
                 from Libraries/SoftUart/SoftwareSerial.cpp:17:
system/include/esp_systemapi.h:48:13: error:   initializing argument 2 of 'void ets_isr_attach(int, void*, void*)' [-fpermissive]
 extern void ets_isr_attach(int intr, void *handler, void *arg);
             ^
Makefile:242: recipe for target 'out/build/Libraries/SoftUart//SoftwareSerial.o' failed
make: *** [out/build/Libraries/SoftUart//SoftwareSerial.o] Error 1
hreintke
@hreintke
Feb 02 2016 22:37
Probably need to update include spi.h to the correct setting, directory structure changed in rtos
zhivko
@zhivko
Feb 02 2016 22:39
I am trying in classical Sming for now.
but probably need to change .h also...
hreintke
@hreintke
Feb 02 2016 22:40
Did the errors from above come from rtos or nonos ?
zhivko
@zhivko
Feb 02 2016 22:41
ah yes... that did the trick
from nonos
alonewolfx2
@alonewolfx2
Feb 02 2016 22:42
@hreintke i will try with lastest one
hreintke
@hreintke
Feb 02 2016 22:44
Ok, let me know the results (both @alonewolfx2 & @alonewolfx2 ) :smile:
I am out for now.
zhivko
@zhivko
Feb 02 2016 23:38
@hrsavla @hreintke it Seems I cannot compile and I experience similar problem like hrsavla in thread: http://bbs.espressif.com/viewtopic.php?t=871&start=10
00:36:59 **** Build of configuration Sming for project SmingFramework ****
make all 
C+ Libraries/SoftwareSerial/SoftwareSerial.cpp
In file included from system/include/esp_systemapi.h:6:0,
                 from Wiring/../include/user_config.h:29,
                 from Wiring/Arduino.h:6,
                 from Libraries/SoftwareSerial/SoftwareSerial.cpp:17:
Libraries/SoftwareSerial/SoftwareSerial.cpp: In constructor 'SoftwareSerial::SoftwareSerial(int, int, bool, unsigned int)':
/home/kz/esp8266/esp-open-sdk/sdk/include/ets_sys.h:58:56: error: cannot convert 'SoftwareSerial::handle_interrupt' from type 'int (SoftwareSerial::)(void*)' to type 'void*'
     ets_isr_attach(ETS_GPIO_INUM, (func), (void *)(arg))
                                                        ^
Libraries/SoftwareSerial/SoftwareSerial.cpp:50:13: note: in expansion of macro 'ETS_GPIO_INTR_ATTACH'
             ETS_GPIO_INTR_ATTACH(handle_interrupt, 0);
             ^
Makefile:242: recipe for target 'out/build/Libraries/SoftwareSerial//SoftwareSerial.o' failed
make: *** [out/build/Libraries/SoftwareSerial//SoftwareSerial.o] Error 1

00:37:00 Build Finished (took 355ms)