These are chat archives for SmingHub/Sming

3rd
Feb 2016
Dmitry Kireev
@kireevco
Feb 03 2016 07:27
This message was deleted
@hreintke I removed appveyor sming project, it should also remove hooks
Dmitry Kireev
@kireevco
Feb 03 2016 07:36
have anyone tried esp-alt-sdk?
Jakub Sobieraj
@sobiso
Feb 03 2016 07:38
@kireevco what is diff to esp-iot-sdk ?
Dmitry Kireev
@kireevco
Feb 03 2016 08:01
@sobiso it's fully cross-platform
@sobiso do you mean esp-open-sdk?
and is:
  • Cross platform
    • Windows
    • Linux
    • MacOS
  • Up-to-date binary builds
  • Open build process
  • Gcc 5.1.0
  • Gdb on all platforms
  • Additional tools (also compiled from source)
  • Small size
    • Stripped out debug symbols
    • UPX compressed
well, lots of improvements, really :)
and you can easily contribute to it if you want to add stuff for windows.
and other platforms.
hreintke
@hreintke
Feb 03 2016 08:03
@kireevco :
Dmitry Kireev
@kireevco
Feb 03 2016 08:03
hreintke
@hreintke
Feb 03 2016 08:03
Can you include RTOS SDK too?
Dmitry Kireev
@kireevco
Feb 03 2016 08:03
it's there
I need more testing
I mean more feedback
hreintke
@hreintke
Feb 03 2016 08:05
What kind of testing do you need, it is "just the same as NONOS" but with a different sdk downloaded
Dmitry Kireev
@kireevco
Feb 03 2016 08:05
:) just use and feedback.
it's different from cherts or esp-open-sdk, that kind of feedback
Jakub Sobieraj
@sobiso
Feb 03 2016 08:06
@kireevco where i can download and it's works with sming 2.1 ?
hreintke
@hreintke
Feb 03 2016 08:06
I did not look around for it but where are the download instructions ?
for rtos
I haven't touched it in a while
but I still feell it's better than CHERTS
and esp-open-sdk because of windows support
Jakub Sobieraj
@sobiso
Feb 03 2016 08:10
ok i download and do some basic test (with regular) :D
i have some problems with disconnecting phone in ap mode, so maybe this will help for
Dmitry Kireev
@kireevco
Feb 03 2016 08:11
dunno dunno...
hreintke
@hreintke
Feb 03 2016 08:14
@kireevco : Can you name SDK ESP8266_RTOS_SDK.
You cannot use both NONOS and RTOS simultanuous
Dmitry Kireev
@kireevco
Feb 03 2016 08:16
how do you switch between then?
*them
I won't have multiple SDKs in one zip
so, you can just change the path to the whole esp-alt-sdk directory
@sobiso
another good thing, that it has gdb.exe on windows:)
and other platforms too
as well as memanalyzer on linux/mac
and prebuilt esptool,esptool2 for all platforms.
alon24
@alon24
Feb 03 2016 08:20
can u give a link on how to use memanalyser?
Dmitry Kireev
@kireevco
Feb 03 2016 08:20
although, file paths might be different, something to fix for me.
alon24
@alon24
Feb 03 2016 08:20
i never know
Dmitry Kireev
@kireevco
Feb 03 2016 08:20
it's a part of make for sming
for windows
not for mac (it's a c# app). but I've built it for mac and linux too
check memanalyzer in Makefile-windows.mk
@alon24 it's a very veeeeeery simple app
:)
alon24
@alon24
Feb 03 2016 08:25
:)
Dmitry Kireev
@kireevco
Feb 03 2016 08:29
seriously. look at the code
it's executing objdump , parsing numbers and doing some math.
alon24
@alon24
Feb 03 2016 08:30
i will need to look into it (need TIME)
or do we have an example for that
Jakub Sobieraj
@sobiso
Feb 03 2016 09:32
@kireevco on 1.5.0 phone leave too from AP(ESP)
Dmitry Kireev
@kireevco
Feb 03 2016 09:35
I will add 1.5.1 some day
or you can be free to add it to the dev branch
well, i guess you can just download zip from espressif for yourself
Jakub Sobieraj
@sobiso
Feb 03 2016 09:37
at now compile 1.5.1
Dmitry Kireev
@kireevco
Feb 03 2016 09:39
I'm recreating my build environment to use cygwin
with build target mingw
mignw environment is really limited.
hreintke
@hreintke
Feb 03 2016 09:40
@kireevco :
I really see no use of twice the whole toolchain when using another SDK.
Only thing to do is change one env variable and your done using one or the other.
Dmitry Kireev
@kireevco
Feb 03 2016 09:42
I really see no use of having 2 sdks in one zip file. why?
:)
you will never use 2 at the same time
hreintke
@hreintke
Feb 03 2016 09:42
And having the name "ESP8266_SDK" for both confuses.
You have to go into the directory to see which sdk you have
Yes you will, especially now where RTOS in in beta state
and NONOS production
And for the time we will support both in production state
Dmitry Kireev
@kireevco
Feb 03 2016 09:44
no, if you have c:\esp-alt-sdk-nonos-1.5.0 and c:\esp-alt-sdk-rtos-1.3.0
hreintke
@hreintke
Feb 03 2016 09:45
So I propose esp-alt-sdk-N1.5.0-R1.3.0
And one should not force users to directory names, they own their own systrems
Or you have esp-alt-sdk-toolchain + esp-alt-sdk-NONOS-1.5.0+alt-esp-sdk-RTOS-1.3.0
hreintke
@hreintke
Feb 03 2016 09:50
You will be prepared also for ESP32, that will have a different SDK too.
hreintke
@hreintke
Feb 03 2016 09:58
@kireevco : For CI/Appveyor. The result of a CI test just now :
CI.PNG
Dmitry Kireev
@kireevco
Feb 03 2016 10:07
ah, maybe I deleted a wrong sming project.. .check onw
now
Jakub Sobieraj
@sobiso
Feb 03 2016 10:42
on 1.5.1 phone leave too ;/
sle118
@sle118
Feb 03 2016 11:00
@hreintke @robotiko I have created a PR for my image library. The example app works well enough with jpg on a SSD1306 oled
SmingHub/Sming#588
anyone willing to explore png/gif/ etc feel free
anyone willing to explore png/gif/ etc feel free
the drawing routine is simple enough to understand. Drawing to a different TFT or oled is a matter of calling the correct "drawpixel" function
of the screen
note: the following "load" is what determines the number of elements to keep for color
image_struct * pnewImage = image_load(fileName,1);
note: the following "load" is what determines the number of elements to keep for color
the example only keeps one component of the picture it decodes (this is because OLEDS are monochrome anyhow and I let the library convert the color space)
the example only keeps one component of the picture it decodes (this is because OLEDS are monochrome anyhow and I let the library convert the color space)
here are the options for # of components (this is also documented in the stb_image.h file
// N=#comp components
// 1 grey
// 2 grey, alpha
// 3 red, green, blue
// 4 red, green, blue, alpha
enjoy!
hreintke
@hreintke
Feb 03 2016 11:07
@zhivko :
I updated Sming_RTOS to enable systemDebugOuput.
As in NONOS debugf can be set/unset by using this function and by the commands debugon/debugoff if you have commandprocessing enabled on one of serial/telnet/websocket/http-post
hreintke
@hreintke
Feb 03 2016 11:21

@zhivko :
On SoftwareSerial :
Beware, it takes over ALL interrupt processing when instantiating :

         if (!InterruptsEnabled) {
            ETS_GPIO_INTR_ATTACH(handle_interrupt, 0);
            InterruptsEnabled = true;
         }
         InterruptList[m_rxPin] = this;
         GPIO_REG_WRITE(GPIO_STATUS_W1TC_ADDRESS, BIT(m_rxPin));

InterruptsEnabled is a Class variable which has no knowledge or checking on actual state of interrupt handling

zhivko
@zhivko
Feb 03 2016 11:23
@hreintke: so probably HWTimer will not work with that together?
@hreintke: anyway is HWtimer part of Sming rtos?
hreintke
@hreintke
Feb 03 2016 11:28
@zhivko : on hwtimer not 100% sure but expect interference.
Yes HWtimer is part of Sming_RTOS and works OK with servo lib.
I checked and think I can add Serial2 (=UART1 from esp) as output only fairly easy (good design :smile: )
Would you be able to test that
zhivko
@zhivko
Feb 03 2016 11:30
@hreintke: NICE - So in sming rtos you use uart0 for debug out or uart1? Can I select to communicate (Just RX I need) with uart1?
Yes for me solution would be to use UART0 for sensor , and for debug output I use UART1
If that scenario is possible somehow with RTOS I will be glad to test.
hreintke
@hreintke
Feb 03 2016 11:33
need to check how I get debugf to output to uart1, the first would be Serial2.printf(....)
If that works I can take the next step for debugf.
I prefer smaller steps to get forward
zhivko
@zhivko
Feb 03 2016 11:33
thats ok with me...
just say when you commit so I could test
hreintke
@hreintke
Feb 03 2016 11:34
OK, will let you know here.
hreintke
@hreintke
Feb 03 2016 11:50

@zhivko : Sming_RTOS branch Serial1 contains an update which should enable :

HardwareSerial Serial1(1);
void init()
{
    Serial1.begin(115000);
    Serial1.printf("This is a line which should appear on Uart1\r\n");
}

Just coded, not tested

And : No receive of char and Serial1.systemDebugOutput(true/false) has no effect
zhivko
@zhivko
Feb 03 2016 11:52
For my scenario 2 things:
  1. I need to redirect debugf to uart 1
  2. Use HardwareSerial Serial0(0)
    I guess you just implemented point 2.
    How do I make point 1 ?
Is point 2 functionality possible in this branch?
zhivko
@zhivko
Feb 03 2016 11:59
@hreintke: is argument of HardwareSerial pinNo ? or uart id ?
ok need to try that
HappyCodingRobot
@HappyCodingRobot
Feb 03 2016 12:00
hi .. after a longer pause, i re-started with sming.. really great what hast been done the last month :-)
.. and i have a little question .. im trying to use hwSPI
is there a way to change spi mode or clk? default seems to be 12MHz clock what is way to fast for me
hreintke
@hreintke
Feb 03 2016 12:07
@zhivko : The Serial which is included by default uses UART0
by HardwareSerial Serial(0) in the HardwareSerial.h file.
I implemented that you can also do the HardwareSerial(1) in application
parameter is Uart number
debugf needs some thinking/design as it currently is not implemented in HardwareSerial but in m_printf().
hreintke
@hreintke
Feb 03 2016 12:13
@HappyCodingRobot :
I am no spi expert but know I commited SmingHub/Sming#554 into the develop branch
Is that what you are looking for ?
HappyCodingRobot
@HappyCodingRobot
Feb 03 2016 12:36
@hreintke : thanks, this could help. I take a look at that ..
HappyCodingRobot
@HappyCodingRobot
Feb 03 2016 13:55
@hreintke : it works great. Also the clk seems to be more stable now.
hreintke
@hreintke
Feb 03 2016 13:59
Say thanks to @misterRager, he made the PR :smile:
HappyCodingRobot
@HappyCodingRobot
Feb 03 2016 13:59
before your answer i came across a library from metalphreak on github. This seems to make it possible to configure nearly all hardware parameter for the HSPI interface. Maybe i find he time to convert it to a class and test it ;)
@misterRager .. thanks for your commit ;)
hreintke
@hreintke
Feb 03 2016 14:11
@HappyCodingRobot :
I know some people were talking last days also on improving the SPI class.
Think @alonewolfx2 knows more/who.
Maybe you can join efforts and come with one superb sming spi class :smile:
zhivko
@zhivko
Feb 03 2016 14:41
oh shit
Harry Böttcher
@harry-boe
Feb 03 2016 15:10
@HappyCodingRobot @hreintke
I was looking into the hw spi but got my stuff running with the sming impl. I also liked at the impl from metalphreak along with the examples from the espresif ask. There is room for improvement but the current lib works for now
hreintke
@hreintke
Feb 03 2016 16:17
@harry-boe :
If you are going to work on your crypto project try to have all the "crypto functionality" in an Abstraction layer.
That would give the possibility to use different modules. And we know already that the esp32 has on onboard.
Harry Böttcher
@harry-boe
Feb 03 2016 16:53
@hreintke
Yep i’m with you. There is a need for a HAL as some ic’s talk I2C others SPI or even UART. Second there are chips implementing RSA orge ellyptic curves. We need a software implementation as well to get the stack woking even if there is no crypto chip. My first thougts go in the direction of cryto providers as found in the Java Stack. We just need to take care on the overhead ..
hreintke
@hreintke
Feb 03 2016 16:57
@harry-boe :
Good to hear. I have no direct experience with crypto providers but am willing to participate in the design decisions which need to be made
Harry Böttcher
@harry-boe
Feb 03 2016 16:57
@hreintke on the esp32 crypto features. I I briefly checkt the rtos API for the esp32 but did not find enything specific or usable about crypto call. Could be that its not yet in the API and only used/acessible internal (well known concept seen on IOS etc.)
sle118
@sle118
Feb 03 2016 17:00
@harry-boe you've worked on the stb library? would you mind having a look at my PR and see if we could combine our efforts? I have implemented a callback to read files, but it might be better to re-map the file calls in the library to the spiffy lib. I have spent some time getting rid of the large stack variables and replaced them with malloc/pointers
and pre-defined "JPG only" in my wrapper
let me know your thoughts
Harry Böttcher
@harry-boe
Feb 03 2016 17:07
@sle118 i will have a look once i find some spare time. I struggle with those callacks as well. Right now my implementation on GCC on the mac (without specific system libs) thats way easier to debug and work with. The port is only on the level of: it compiles and build. Have not yet done any reasonable testing - so no watchdog testing, memory allocation etc . Guess you are much further here than I am
robotiko
@robotiko
Feb 03 2016 17:17
@harry-boe @hreintke about crypto stuff, I was looking for possible solutions weeks ago
There is a crypto module with basic support from SDK in some other projects
for stuff like AES-cbc
hreintke
@hreintke
Feb 03 2016 17:22
@sle118 : did not look in your repo but reading : but it might be better to re-map the file calls in the library to the spiffy lib.
I am not in favor of having direct spiffs calls in the library. There is a filesystem and stream layer to access.
If there is additional functionality needed in there we can consider that
Harry Böttcher
@harry-boe
Feb 03 2016 17:23
@robotiko
Amstel ships a SDK in C for their Crypto modules. It's heavy peace of code. I need to check how i can leverage that one (has even a HAL) etc. There is a lot of work on the horizon ;)
sle118
@sle118
Feb 03 2016 17:29
@hreintke I was merely suggesting to map "FILE" calls from the library to the file calls that are exposed by Sming
the library uses stdlib calls if I remember
and file pointers/operations on files are a little bit different than what Sming exposes
so I could just not compild with stdio enabled in the lib
Harry Böttcher
@harry-boe
Feb 03 2016 17:32
@hreintke @sle118 there is a callback handler were you can register callbacks to read and seek from a stream, spiffy etc. It's a new feature and (in my case) does what it was designed for.
But I have not yet spent time for debugging (could be my callback handler as well). But I guess why @sle118 wants to go the simpler way ..
riban-bw
@riban-bw
Feb 03 2016 17:32
@kireevco Do you have details of your cygwin build environment. I have been trying to get that working for Sming and have failed.
sle118
@sle118
Feb 03 2016 17:32
@harry-boe I have implemented the callback
but I am unsure if png is crashing because of it
riban-bw
@riban-bw
Feb 03 2016 17:33
I can't use Chocolaty (doesn't work on my Windows 10 machine and I don't have admin rights on my other Windows laptop)
hreintke
@hreintke
Feb 03 2016 17:33
Are those callbacks ore delegates ?
sle118
@sle118
Feb 03 2016 17:33
function pointers
robotiko
@robotiko
Feb 03 2016 17:33
@harry-boe "amstel" sdk I guess you talk about the crypto SDK for ATECC508A and his smaller brother
there is soem arduino support already
sle118
@sle118
Feb 03 2016 17:33
the only difference between jpg and png is that png uses the "seek" to navigate the stream
so my "seek" implementation might be screwed up
I am 99%sure my ccode doesn't leak
I tested by using my own malloc, which kept a Vecctor of pointer definitions
and freeing up was removing all pointers correctly
so it's something else
in the meantime jpg works well
hreintke
@hreintke
Feb 03 2016 17:37
@sle118 : class functions ?
Dmitry Kireev
@kireevco
Feb 03 2016 17:38
@riban-bw not yet
for sming It will be not different, just mingw tools
sle118
@sle118
Feb 03 2016 17:38
no
regular functions
my wrapper is just simple c functions no instantiation
Dmitry Kireev
@kireevco
Feb 03 2016 17:39
@riban-bw but I was thinking that we might take all nessesary tools and package it into one zip file
for windows
hreintke
@hreintke
Feb 03 2016 17:39
All over Sming we use delegates to enable class function callbacks.
Prefer to keep that at all locations
Dmitry Kireev
@kireevco
Feb 03 2016 17:39
like a small mingw
riban-bw
@riban-bw
Feb 03 2016 17:40
I want something that I can install on a Windows 7 machine without admin rights.
I use portable Cygwin / mingw
Dmitry Kireev
@kireevco
Feb 03 2016 17:41
@riban-bw yeah... I want to create something similar but just for sming... I think sming uses very minimal amount of tools from mingw
that would be great if we can outline it and start stripping down mingw
sle118
@sle118
Feb 03 2016 17:42
@hreintke this would require some re-write of the base library, but why not
I wanted to minimize the changes to the lib so I would do a PR on stb
in such a way that we could merge at will
there is active development on the lib
Dmitry Kireev
@kireevco
Feb 03 2016 17:42
@riban-bw the way it is not required for Arduino ESP or even normal arduino
sle118
@sle118
Feb 03 2016 17:42
so it's worth keeping it as vanilla as possible
robotiko
@robotiko
Feb 03 2016 17:43
@harry-boe @hreintke the only reference to underlaying crypto stuff from SDK (apart from SSL doc) is the direct access here nodemcu/nodemcu-firmware#952
what I thing that needs to be clarified first is the overall design and approach how this Crypt Hal can be used from "the other side"
and how it can protect OTA and transmissions
The good thing abotu those HW crypto is that the phycically protect tokens/ ids
Rudi also posted some examples of rboot with AES128 for secure boot
riban-bw
@riban-bw
Feb 03 2016 17:46
@kireevco I have tried using esp-open-sdk make in cygwin which bombs out trying to build crosstools
undefined reference to `libintl_gettext'
Dmitry Kireev
@kireevco
Feb 03 2016 17:49
@riban-bw try esp-alt-sdk
@riban-bw esp-open-sdk doesn't think about windows (same way as UDK doesn't think about nix)
I've created a process that doesn't use crosstool-ng and easier to replicate on different machines
riban-bw
@riban-bw
Feb 03 2016 17:51
@kireevco I can't figure out how to use esp-alt-sdk
Dmitry Kireev
@kireevco
Feb 03 2016 17:52
@riban-bw do you want to build it yourself or just compile your sming project?
riban-bw
@riban-bw
Feb 03 2016 17:52
I want to be able to work on Sming itself.
I have been doing a load of API docs but am missing core bits!!!!
It relies on choco
Dmitry Kireev
@kireevco
Feb 03 2016 17:53
Yeah, currently sming supports mingw
what happens if install cygwin and use it's bash?
riban-bw
@riban-bw
Feb 03 2016 17:55
Can't run mingw_10.cmd
Relies on choco
Dmitry Kireev
@kireevco
Feb 03 2016 17:57
install choco :)
what's the problem?:)
it's standard in windows 10 by the way
it makes your life easier
riban-bw
@riban-bw
Feb 03 2016 18:00
I can't install software on this laptop
I do not have admin rights.
Dmitry Kireev
@kireevco
Feb 03 2016 18:02
ah
Choco is configurable
what happens when you install chocolatey?
riban-bw
@riban-bw
Feb 03 2016 18:04
choco installation instructions say open admin cmd - I can't do that
Dmitry Kireev
@kireevco
Feb 03 2016 18:05
tha'ts for default locatio
try this PS:
Set-Variable -Name "ChocolateyInstall" -Value (Read-Host -Prompt "Install location")
New-Item $ChocolateyInstall -Type Directory -Force
[Environment]::SetEnvironmentVariable("ChocolateyInstall", $ChocolateyInstall, "User")
iex ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1'))
the other option, well, you can just read what choco is installing and download it yourself (PITA)
riban-bw
@riban-bw
Feb 03 2016 18:09
@kireevco Got to pop out. I will try that when I get back. Cheers!
Dmitry Kireev
@kireevco
Feb 03 2016 18:10
CU
riban-bw
@riban-bw
Feb 03 2016 18:34
@kireevco Okay, choco installed and running esp-alt-sdk.
I will miss the cygwin environment though! I have been using grep a lot recently
hreintke
@hreintke
Feb 03 2016 18:42
@riban-bw : You also can take the CHERTS package as base for your windows environment
zhivko
@zhivko
Feb 03 2016 18:48
@kireevco you tried rtos-poc ?
If there is somebody who uses Sming_RTOS_POC? I am trying to use rboot feature and getting thsi error:
make -C /home/kz/git/Sming_RTOS_POC/sming/rboot
make[1]: Entering directory '/mnt/Extra10Gb/git/Sming_RTOS_POC/sming/rboot'
CC rboot.c
rboot.c: In function 'find_image':
rboot.c:331:20: error: '_text_addr' undeclared (first use in this function)
  ets_memcpy((void*)_text_addr, _text_data, _text_len);
Looking the code this variable is really nowhere defined int this function find_image
Dmitry Kireev
@kireevco
Feb 03 2016 19:04
@zhivko no. haven't touched anything
@riban-bw choco install cygwin :)
choco install conemu
choco install cyg-get && cyg-get install fish
riban-bw
@riban-bw
Feb 03 2016 19:07
@kireevco The install script is chuntering away, using all the CPU on my laptop and telling me (lots of times) about the PATH env var not having cygwin\tools... in it.
I will leave it going while I have dinner
@hreintke I don't know what CHERTS package is!!!
is windows UDK
HappyCodingRobot
@HappyCodingRobot
Feb 03 2016 21:10
hi .. still someone in the chat?
zhivko
@zhivko
Feb 03 2016 21:44
Hi
yes
Does maybe somebody knows how to translate 10V -10V serial communication to 0 - 3.3V serial ?
HappyCodingRobot
@HappyCodingRobot
Feb 03 2016 21:46
there are several ways .. easiest, use a level shifter like max3232
another way, use transistors for up and down shifing
zhivko
@zhivko
Feb 03 2016 21:56
Georgi Dobrishinov
@dobrishinov
Feb 03 2016 23:46
I have strange problem, one week esp8266 logging temp in my room. I forward ports from my router and i have access over internet. One week work fine, but today i dont have access over mobile internet. But when connect to wi-fi network (not my wi-fi network, other) work fine. From Pc work fine, but on mobile data dont work. If i try to load page from mobile data, console say - TCP connection timeout updating: 70 -> 90 : ? Strange
laurentppol
@laurentppol
Feb 03 2016 23:59
ask Your mobile op if they changes something?