These are chat archives for SmingHub/Sming

9th
Feb 2016
Curtis Pope
@piperpilot
Feb 09 2016 02:46
hey everyone...not sure if anyone is around...but does anyone know how to erase the ESP config area? I want to blank out the wifi SSID and Password for station mode so it acts like a fresh device...I want to do it without reflashing the whole device
alonewolfx2
@alonewolfx2
Feb 09 2016 07:20
@piperpilot try flash init target on makefile
hreintke
@hreintke
Feb 09 2016 07:32

@piperpilot :
There is a C:\Espressif\ESP8266_SDK\bin\esp_init_data_default.bin
Did not test/read all the documentation but as far as I know you should flash that to the area depending on the flash size.
This is from a LD file :

/* NOTICE: */ 
/* 1. You can change irom0 org, but MUST make sure irom0text.bin start not overlap flash.bin end.   */
/* 2. You can change irom0 len, but MUST make sure irom0text.bin end not overlap system param area. */
/* 3. Space between flash.bin end and irom0text.bin start can be used as user param area.           */
/* 4. Space between irom0text.bin end and system param area can be used as user param area.         */
/* 5. Make sure irom0text.bin end < 0x100000                                                        */
/* 6. system param area:                                                                            */
/*    1>. 512KB--->0x07b000                                                                         */
/*    2>. 1MB----->0x0fb000                                                                         */
/*    3>. 2MB----->0x1fb000                                                                         */
/*    4>. 4MB----->0x3fb000                                                                         */
/* 7. Don't change any other seg.                                                                   */

I have seen slightly other figures/addresses too but around the ones mentioned in here.

I you find the way how it works exactly could you make a PR for doing this in makefile as a target :smile:

hreintke
@hreintke
Feb 09 2016 07:52
@alonewolfx2 : @piperpilot :
I think flashinit was intended to do the job but flashes more than just the esp_init and to a fixed (not spi_size dependent) location.
Alexander V. Ribchansky
@avr39-ripe
Feb 09 2016 09:48
@alon24 Nice! :)
Jakub Sobieraj
@sobiso
Feb 09 2016 11:32
anyone use AWS MQTT ?
sle118
@sle118
Feb 09 2016 12:29
@sle118 esp-alt-sdk has gdb.exe if that helps
@kireevco I am linux. I will re-read the blog entries and try. I have received my JTAG reader, but will try alt sdk first.
alon24
@alon24
Feb 09 2016 14:48
online ide? with sming?
hreintke
@hreintke
Feb 09 2016 15:21

@/all :

I renamed the repository Sming_RTOS_POC to SmingRTOS : Reason is that it is ready for Beta testing.
If you find any issues, submit an issue on the SmingRTOS repo.

Looking for enthusiasts who are willing to give it a try.
What's in for you ?

  • Conversion from NONOS to RTOS with help from someone who knows the details.
  • Use and experience the (near) future of Sming Framework.
  • Get rid of the WDT resets.
  • Other ?? Go for it and feedback :smile:
slaff
@slaff
Feb 09 2016 15:22
@hreintke Awesome :)
robotiko
@robotiko
Feb 09 2016 15:50
@hreintke THANKS!
ystrem
@ystrem
Feb 09 2016 16:20
guys trying SmingRTOS , but getting this error, I've changed this paths SMING_HOME and ESP_HOME
C:\Users\Ystrem\Desktop\SmingRTOS-master\sming>make
C+ sming/appinit/user_main.cpp
sming/appinit/user_main.cpp:3:40: fatal error: sming/include/sming_config.h: No such file or directory
compilation terminated.
make: *** [build/sming/appinit/user_main.o] Error 1
hreintke
@hreintke
Feb 09 2016 16:35
@ystrem : you also downloaded RTOS SDK and set SDK_BASE?
ystrem
@ystrem
Feb 09 2016 16:36
yep but can't find SDK_BASE in Makefile-project.mk
hreintke
@hreintke
Feb 09 2016 16:42
The SDK_BASE was/is set in the makefile-windows/linux/mac
And in NONOS "derived from" ESP_HOME.
But you are compiling framework ?
ystrem
@ystrem
Feb 09 2016 16:47
yes
hreintke
@hreintke
Feb 09 2016 16:47
what is your sming_home ?
ystrem
@ystrem
Feb 09 2016 16:47
w8
ESP_HOME = C:/Espressif/ESP8266_RTOS_SDK
SMING_HOME = C:/Users/Ystrem/Desktop/SmingRTOS-master/sming
hreintke
@hreintke
Feb 09 2016 16:55
Ok, it's an issue with make from command line.
I have the same error with commandline, using eclipse works OK
ystrem
@ystrem
Feb 09 2016 16:58
ok, from Eclipse I have this issue, even If I compile spiffy from cmd (spiffy compile is ok from cmd)
17:56:18 **** Incremental Build of configuration Default for project Sming_RTOS ****
make all 
Building file: ../spiffy/spiffy.c
Invoking: Cross GCC Compiler
gcc -I"/include" -O2 -g -Wall -c -fmessage-length=0 -MMD -MP -MF"spiffy/spiffy.d" -MT"spiffy/spiffy.o" -o "spiffy/spiffy.o" "../spiffy/spiffy.c"
../spiffy/spiffy.c:4:20: fatal error: spiffs.h: No such file or directory
 #include <spiffs.h>
                    ^
compilation terminated.
make: *** [spiffy/spiffy.o] Error 1

17:56:22 Build Finished (took 3s.758ms)
hreintke
@hreintke
Feb 09 2016 17:00
to fast from me.
When I start from commandline have no env variables set.
I set them in eclipse
But if I set SMING_HOME correct it also compiles from commandline
spiffy is probably the same issue. It is reading spiffs.h from sming framework
hreintke
@hreintke
Feb 09 2016 17:05
from eclipse framework compiles ?
ystrem
@ystrem
Feb 09 2016 17:16
Ok, I made VM with ubuntu and use esp-alt-sdk and now it's ok
hreintke
@hreintke
Feb 09 2016 17:18
Ok, that is good of course,
but to understand what is wrong .., I never get the line Incremental Build of configuration Default for project Sming_RTOS
Curtis Pope
@piperpilot
Feb 09 2016 19:15
@hreintke thanks for that info! Now it makes sense why all of my trials with flashInit haven't worked. I even tried to do SPIErase directly, but I was missing the info that the location is based on the size. I'll give it a try and implement a PR to fix the makefiles
slaff
@slaff
Feb 09 2016 19:52
Guys, the SSL support is ready for prime time. All major bugs are fixed and I was able to have loooong SSL sessions. If you are interested then give it a try: https://github.com/slaff/Sming/tree/feature/axtls-dev
robotiko
@robotiko
Feb 09 2016 19:53
Great stuff
alon24
@alon24
Feb 09 2016 21:02
This message was deleted
@hreintke here? I want ot try new sming rtos
alon24
@alon24
Feb 09 2016 21:21
does it work with esp-alt sdk?
robotiko
@robotiko
Feb 09 2016 21:22
I guess
hreintke
@hreintke
Feb 09 2016 21:31
@ystrem has it running on esp-alt-sdk
alon24
@alon24
Feb 09 2016 21:35
@ystrem u here?
hreintke
@hreintke
Feb 09 2016 21:36
@alon24 :
Do you have an issue getting rtos running ?
alon24
@alon24
Feb 09 2016 21:36
yes
C+ sming/appinit/user_main.cpp
In file included from /opt/esp-alt-sdk-v1.3.0-rtos.258-macos-x86_64/xtensa-lx106-elf/xtensa-lx106-elf/include/espressif/esp_common.h:95:0,
                 from sming/appinit/user_main.cpp:1:
/opt/esp-alt-sdk-v1.3.0-rtos.258-macos-x86_64/xtensa-lx106-elf/xtensa-lx106-elf/include/espressif/esp_misc.h:28:26: fatal error: lwip/ip_addr.h: No such file or directory
 #include "lwip/ip_addr.h"
                          ^
compilation terminated.
make: *** [build/sming/appinit/user_main.o] Error 1

23:34:57 Build Finished (took 176ms)
SDK_BASE=/opt/esp-alt-sdk-v1.3.0-rtos.258-macos-x86_64
ESP_HOME=/opt/esp-alt-sdk-v1.3.0-rtos.258-macos-x86_64
SMING_HOME=/Users/iklein/docker/sming-docker/workspace/SmingRTOS/sming
hreintke
@hreintke
Feb 09 2016 21:39
are you sure that sdk_base and esp_home should be the same ?
alon24
@alon24
Feb 09 2016 21:40
no?yes? ? do not know
:(
hreintke
@hreintke
Feb 09 2016 21:41
what is your directory structure beneath sdk_base ?
alon24
@alon24
Feb 09 2016 21:43
➜  esp-alt-sdk-v1.3.0-rtos.258-macos-x86_64  ls -la
total 16
drwx------@  6 iklein  staff   204 Feb  9 23:20 .
drwxr-xr-x@ 16 root    wheel   544 Feb  9 23:40 ..
-rw-r--r--@  1 iklein  staff  6148 Feb  9 23:26 .DS_Store
drwxr-xr-x@ 14 iklein  staff   476 Feb  9 23:20 sdk
drwxr-xr-x@  5 iklein  staff   170 Jan  2 18:40 utils
drwxrwxrwx@  8 iklein  staff   272 Jan  1 19:31 xtensa-lx106-elf
hreintke
@hreintke
Feb 09 2016 21:44
This message was deleted
This message was deleted
alon24
@alon24
Feb 09 2016 21:45
SDK_BASE=/opt/esp-alt-sdk-v1.3.0-rtos.258-macos-x86_64/sdk fixed it
hreintke
@hreintke
Feb 09 2016 21:45
rtossdk.PNG
OK, good
alon24
@alon24
Feb 09 2016 21:47
now 2nd question
did u havea chance to add delegate to know when server is up instaed of serverready?
sorry instaed of System.onReady
hreintke
@hreintke
Feb 09 2016 21:49
There was someone (in an submitted issue) who said he would implement.
So i wait(ed ?) for that.
Will check the issue and push :wink:
alon24
@alon24
Feb 09 2016 21:50
k, so how to continue now, wait 5 secs and start my servers?
i mean when is it correct to startservers?
also is this in rtos? SmingHub/Sming#420
also in sming_rtos, does "all" - also build spiffy?
alon24
@alon24
Feb 09 2016 21:57
also is there software pwm, or only hw_pwm in rtos?
robotiko
@robotiko
Feb 09 2016 21:58
@alon24 just HW pwm
timer resolution is ms
Skurydin Alexey
@anakod
Feb 09 2016 21:58
Is SoftPWM needed at all?
alon24
@alon24
Feb 09 2016 21:59
i remember thetre was a tradeof of sorts when using hwpwm, u lost some abuluty - do not remember what exactly
or I might be mistaken
robotiko
@robotiko
Feb 09 2016 21:59
@alon24 nopes.. you are right
you loose HW timer
so servo and other HW_timer dependent timers.. are gone
because sming is just using 1 Hw timer
alon24
@alon24
Feb 09 2016 22:00
so maybe this is why driver pwm is needed
softpwm
robotiko
@robotiko
Feb 09 2016 22:00
maybe it is better to enable the other HW timer
Esp arduino has both hw timers enabled
hreintke
@hreintke
Feb 09 2016 22:03
Don't know how they did it but I presume by implementing HWtimer on NMI.
esporessif pwm uses frc1
robotiko
@robotiko
Feb 09 2016 22:04
I guess yes .. NMI and FRC1
alon24
@alon24
Feb 09 2016 22:04
This message was deleted
hreintke
@hreintke
Feb 09 2016 22:05
rboot generic is not yet in. I have it partly running in rtos.
Was focusing on framework itself.
When beta goes OK, I can start working on new features.
@alon24 : hiding for FBI that you know them ? :smile:
alon24
@alon24
Feb 09 2016 22:06
YES!!!! - shhhh
hreintke
@hreintke
Feb 09 2016 22:09
@anakod : sotware timer as in NONOS is not possible.
espressif sotware timer is millisecond resolution.
Freertos timer 2 millisecond
alon24
@alon24
Feb 09 2016 22:11
so for hwpwm, (and I do not know how to find this myself) what are max min vals?
@hrsavla told me '
"But I remember getting min / max values of PWM from ESP sdk user manual. And to stop PWM you would need to set that port pin OFF. "
i do not know where to search exactly
robotiko
@robotiko
Feb 09 2016 22:14
sdk docs I guess
alon24
@alon24
Feb 09 2016 22:17
question for hw_pwm, can we add an init method? I do not know the pins I would use, until after my class is initialized with them
and having to declare the pins is bad for me
uint8_t pins[8] = { 4, 5 }; // List of pins that you want to connect to pwm
HardwarePWM pwmMotors(pins, 2);
so I am guesssing 22222 is max for hw_pwm
robotiko
@robotiko
Feb 09 2016 22:24
anyone tested teh ssl under windows?
hreintke
@hreintke
Feb 09 2016 22:28
@alon24 : The pwm in rtos from min/max different from nonos .
Values are 0-1023.
alon24
@alon24
Feb 09 2016 22:29
but the example shows 22222
hreintke
@hreintke
Feb 09 2016 22:29
See SmingRTOS readme for NONOS/Sming differences
alon24
@alon24
Feb 09 2016 22:29
I saw it, did not understand which is correct
void doPWM() {
    if (countUp == true) {
        i += inc;
        if (i >= 22222) {
            i = 22222;
            countUp = false;
        }
    } else {
        i -= inc;
        if (i <= 0) {
            i = 0;
            countUp = true;
        }
    }
    HW_pwm.analogWrite(4, i);
}
hreintke
@hreintke
Feb 09 2016 22:31
I know, I was researching pwm issues up till this afternoon.
Finally finding the undocumented espressif update.
Did not have the time to updated the example.
alon24
@alon24
Feb 09 2016 22:31
k, i am just checking - like u told to do
please consider adding a method to define pins AFTER u init the hw_timer
hreintke
@hreintke
Feb 09 2016 22:32
Sure, no problem at all. Even : good that you see the issue/difference.
The we can solve it.
robotiko
@robotiko
Feb 09 2016 22:33
@hreintke that means that the duty is now set with 0-1023?
100% is 1023
and 0 is 0?
alon24
@alon24
Feb 09 2016 22:33
but does 0 stop?
(I bet it does not ....)
hreintke
@hreintke
Feb 09 2016 22:34
Noticed the same when testing.
I used an declaration of HardwarePWM * myPWM;
Then I can do myPWM = new HardwarePWM (pins, count) when I know the values.
And use myPWM->.. for accessing.
alon24
@alon24
Feb 09 2016 22:36
yes I do that a lot
hreintke
@hreintke
Feb 09 2016 22:36
As far as an inexperienced, one week owner of a logic analyzer can tell.
When 0 there is only low value :smile:
robotiko
@robotiko
Feb 09 2016 22:36
low value ...
how big?
hreintke
@hreintke
Feb 09 2016 22:37
sorry donn't know I just see high and low on the LA screen
alon24
@alon24
Feb 09 2016 22:41
what is equivalent to pwmMotors.noAnalogWrite ??
what will stop the motor? (not just some low value)
hreintke
@hreintke
Feb 09 2016 22:42
There isn't. That is not available from espressif sdk
Just for my learning, I am new in servo's and motors.
What is the difference between 0 and off ?
robotiko
@robotiko
Feb 09 2016 22:44
none
alon24
@alon24
Feb 09 2016 22:44
0 - cheap motor whines, off -no power
at least thats what software pwm did for me
did not check hw pwm yet
robotiko
@robotiko
Feb 09 2016 22:45
probably the hw off dissables the PWM ... saving cpu and batt
alon24
@alon24
Feb 09 2016 22:45
hw off?
how?
robotiko
@robotiko
Feb 09 2016 22:45
while 0.. leaves pwm running
but signal is the same
alon24
@alon24
Feb 09 2016 22:46
how to set hw off?
hreintke
@hreintke
Feb 09 2016 22:46
if you try, do it in rtos. The signal is much cleaner
What is your period and duty cycle for the motors ?
alon24
@alon24
Feb 09 2016 22:47
i am new, I do not know how to answer, how to know?
2nd day with owm only
hreintke
@hreintke
Feb 09 2016 22:48
Isn't that something you have to define too in softwarePWM ?
alon24
@alon24
Feb 09 2016 22:48
no, just analogwrite
i think, it worked - not gr8, i mean i tried changing the values, and it did not react liniary, but .... it worked
i figured i would look into it
robotiko
@robotiko
Feb 09 2016 22:49
probably you set thr freq too high
alon24
@alon24
Feb 09 2016 22:50
i did not set freq at all
i do not know how to use pwm correctly
robotiko
@robotiko
Feb 09 2016 22:50
it is a motor.. so it doenst react fast due to inertia
if you change the pwm but freq is too high.. the motor will move almost the same
try with low freq.. 250hz or lower
and change the duty to chaneg speed
serious example how to determine freq
simple ref
the funny noises coming from motors are the coil resonance..
it is like a speaker
robotiko
@robotiko
Feb 09 2016 22:56
fine tuning the freq for my steppers.. in the 20Hx to 20KHz.. I had all the musical scale in several tones
hreintke
@hreintke
Feb 09 2016 22:57
I am out for now
Have fun with Sming_RTOS and motors :smile:
alon24
@alon24
Feb 09 2016 23:00
CC rboot-stage2a.c
LD /Users/iklein/docker/sming-docker/workspace/SmartCarWithOTA/out/build/rboot-stage2a.elf
E2 /Users/iklein/docker/sming-docker/workspace/SmartCarWithOTA/out/build/rboot-hex2a.h
CC rboot.c
LD /Users/iklein/docker/sming-docker/workspace/SmartCarWithOTA/out/build/rboot.elf
E2 /Users/iklein/docker/sming-docker/workspace/SmartCarWithOTA/out/firmware/rboot.bin
C+ app/CarCommand.cpp
C+ app/application.cpp
C+ app/configuration.cpp
CC /Users/iklein/docker/sming-docker/workspace/SmingRTOS/sming/rboot/appcode/rboot-api.c
CC /Users/iklein/docker/sming-docker/workspace/SmingRTOS/sming/rboot/appcode/rboot-bigflash.c
AR out/build/app_app.a
LD out/build/app_0.out
/opt/esp-alt-sdk-v1.3.0-rtos.258-macos-x86_64/xtensa-lx106-elf/bin/../lib/gcc/xtensa-lx106-elf/5.1.0/../../../../xtensa-lx106-elf/bin/ld: out/build/app_0.out section `.irom0.text' will not fit in region `irom0_0_seg'
/opt/esp-alt-sdk-v1.3.0-rtos.258-macos-x86_64/xtensa-lx106-elf/bin/../lib/gcc/xtensa-lx106-elf/5.1.0/../../../../xtensa-lx106-elf/bin/ld: region `irom0_0_seg' overflowed by 38674 bytes
out/build/libmain2.a(app_main.o): In function `user_fatal_exception_handler':
(.text+0x1a8): dangerous relocation: call0: call target out of range: Cache_Read_Enable_New
out/build/libmain2.a(app_main.o): In function `user_start':
(.text+0x3bb): dangerous relocation: call0: call target out of range: Cache_Read_Enable_New
collect2: error: ld returned 1 exit status
make: *** [out/build/app_0.out] Error 1
help some more?
alon24
@alon24
Feb 09 2016 23:06
void setupSpiffs() {
    // mount spiffs
    currentRbootSlot = rboot_get_current_rom();
    #ifndef DISABLE_SPIFFS
        if (currentRbootSlot == 0) {
    #ifdef RBOOT_SPIFFS_0
            debugf("trying to mount spiffs at %x, length %d", RBOOT_SPIFFS_0 + 0x40200000, SPIFF_SIZE);
            spiffs_mount_manual(RBOOT_SPIFFS_0 + 0x40200000, SPIFF_SIZE);
    #else
            debugf("trying to mount spiffs at %x, length %d", 0x40300000, SPIFF_SIZE);
            spiffs_mount_manual(0x40300000, SPIFF_SIZE);
    #endif
        } else {
    #ifdef RBOOT_SPIFFS_1
            debugf("trying to mount spiffs at %x, length %d", RBOOT_SPIFFS_1 + 0x40200000, SPIFF_SIZE);
            spiffs_mount_manual(RBOOT_SPIFFS_1 + 0x40200000, SPIFF_SIZE);
    #else
            debugf("trying to mount spiffs at %x, length %d", 0x40500000, SPIFF_SIZE);
            spiffs_mount_manual(0x40500000, SPIFF_SIZE);
    #endif
        }
    #else
        debugf("spiffs disabled");
    #endif
}

void init() {

    Serial.begin(115200); // 115200 by default
    Serial.systemDebugOutput(true); // Debug output to serial
    setupSpiffs();
ok, continue in the morning
robotiko
@robotiko
Feb 09 2016 23:09
@alon24
in the rtos readme
When using spiffs_mount_manual()
use the actual flash address : For conversion of current spiffs_mount_manual : subtract 0x40200000 from start address
use filesize is 0 (zero) for autodetected size of FS