These are chat archives for SmingHub/Sming

25th
Dec 2015
Dmitry Kireev
@kireevco
Dec 25 2015 04:37
@hreintke which repo are you pushing your changes to?
I can setup some CI for your stuff
Dmitry Kireev
@kireevco
Dec 25 2015 04:43
I didn't see anything here https://github.com/SmingHub/SmingRTOS
question, @hreintke why are you using a very old Makefile from CHERTS?
it's not crossplatform in any form
hreintke
@hreintke
Dec 25 2015 08:38
@kireevco : I am using https://github.com/hreintke/Sming_RTOS_POC.git
That is the one I have full control of. I asked @anakod to give me more access rights on SmingHub to be able to do the same at SmingHub but he did not reply. Maybe you can reach him but I can't.
For then I stick to mine.
Dmitry Kireev
@kireevco
Dec 25 2015 08:44
I asked him, he created that repo
hreintke
@hreintke
Dec 25 2015 08:44
@kireevco :
I know it the ols from Cherts. Reason :
  • The cherts makefile is "only one" as as such easier to get updated for me.
  • The Cherts one is known to work with RTOS toolkit -> easy start for a Proof of Concept.
  • I don't have complete knowledge knowledge on makefile and the way to keep it crossplatform -> I imagined that it was better to have a separate one now and leave the updating to final solution to others :smile:
Dmitry Kireev
@kireevco
Dec 25 2015 08:44
why don't you want to use it?
hreintke
@hreintke
Dec 25 2015 08:44
. I asked @anakod to give me more access rights on SmingHub to be able to do the same at SmingHub but he did not reply
Dmitry Kireev
@kireevco
Dec 25 2015 08:45
create a develop branch in https://github.com/SmingHub/SmingRTOS
that will solve all things
what is the problem?
hreintke
@hreintke
Dec 25 2015 08:46
No, that has the same problem. I only have limited access. F.e if I need to add some additional people to get a quick/easy solution I cannot and have to wait until @Anakod wishes to act/reply
Dmitry Kireev
@kireevco
Dec 25 2015 08:47
what do you mean?

add some additional people

?

hreintke
@hreintke
Dec 25 2015 08:48
Collaborators to the repo
Adding another repo if we need to
Dmitry Kireev
@kireevco
Dec 25 2015 08:49
you are an admin
you can add collaborators.
Just admit, you want admin control :-D
hreintke
@hreintke
Dec 25 2015 08:55
If it needs to be admin to properly/quick to be able to act adequate to move to RTOS -> Yes.
If someone doesn't trust me to act with responsibility to have that rights he should at least tell me and not be silent.
Dmitry Kireev
@kireevco
Dec 25 2015 08:56
I don't have any rights on the group.
I personally think repo admin is enough.
hreintke
@hreintke
Dec 25 2015 09:02
I'v been waiting for three weeks to get something done and finally @anakod acted, but silently. I have no idea about the timing of actions to next requests and what/how his ideas are on future of Sming
girish kolte
@koltegirish
Dec 25 2015 09:03
Can any one guide me OTA using ESP8266
I am off for X-mas breakfast. I wish you all a merry Xmas.
Dmitry Kireev
@kireevco
Dec 25 2015 09:10
@hreintke I don't know, I asked him and he created it
girish kolte
@koltegirish
Dec 25 2015 09:17
Thank you . Merry Christmas
Richard Antony Burton
@raburton
Dec 25 2015 10:47
@hreintke enjoy your breakfast
I'm at work for 12.5 hours today, tomorrow and the day after :-(
Dmitry Kireev
@kireevco
Dec 25 2015 11:39
@raburton are you around? what are corret rboot offsets?
I'm making qemu work
Dmitry Kireev
@kireevco
Dec 25 2015 12:00
it finds rom0
Richard Antony Burton
@raburton
Dec 25 2015 12:30
@kireevco I'm here, but only on my phone as in at work
So can't view that flash thing.
Flash locations will be 0x2000 and (half rom size + 0x2000).
sle118
@sle118
Dec 25 2015 17:18
Hi everyone and Merry Christmas to those of you that celebrate!
I have been playing around with the ESP for a few months and after much frustration over NodeLua (which was fine enough to have fun with), I decided to jump on the Sming bandwagon
alonewolfx2
@alonewolfx2
Dec 25 2015 17:20
welcome in our place :)
sle118
@sle118
Dec 25 2015 17:21
@alonwwolfx2, thanks for all your efforts!
@kireevco, thanks to you too!
I am hoping I'll be able to make it a bit my own place too. Been following your path up to heer
here
;)
I have setup all my tools in Linux
I am able to make and flash (sudo su, then make flash)
but somehow my ESP07 is choking at the binaries
I am getting the following error and Google doesn't help : "flash read err, ets_unpack_flash_code"
I am using make V=1 to build
not sure why "V=1"
Here is the full boot log

/opt/Sming/HttpServer_ConfigNetwork# python -m serial.tools.miniterm /dev/ttyUSB1 74880
--- Miniterm on /dev/ttyUSB1: 74880,8,N,1 ---
--- Quit: Ctrl+] | Menu: Ctrl+T | Help: Ctrl+T followed by Ctrl+H ---

ets Jan 8 2013,rst cause:2, boot mode:(3,6)

load 0x40100000, len 23176, room 16
tail 8
chksum 0xde
load 0x21002220, len 555757619, room 0
flash read err, ets_unpack_flash_code
ets_main.c

alonewolfx2
@alonewolfx2
Dec 25 2015 17:26
it can be 2 error. 1- your flash corrupted, 2- you are using wrong flash size option. what is your flash size on esp8266
sle118
@sle118
Dec 25 2015 17:26
ok
I am leaning towards 2 then
I am not fluent at make files
but I'll poke around and study the build process
crosofg
@crosofg
Dec 25 2015 17:30
what improvements do I need to make in my code so that esp assign IP to my pc/phone immediatley? ESP is in AP mode and now its taking around 30 secs for phone to connect
sle118
@sle118
Dec 25 2015 17:31
@alonewolfx2 thanks!
alonewolfx2
@alonewolfx2
Dec 25 2015 17:31
@crosofg its weird . my esp can assign ip almost 2-3 second on my roter
crosofg
@crosofg
Dec 25 2015 17:32
router? I am using esp as an AP. I need to connect my phone to esp @alonewolfx2
it is always stuck for some time in obtaining ip address
alonewolfx2
@alonewolfx2
Dec 25 2015 17:33
@crosofg sorry miss understand
i will test it when i went to my home
crosofg
@crosofg
Dec 25 2015 17:33
ok
sle118
@sle118
Dec 25 2015 17:43
for the sake of others reading here, I had to run the following command in Linux to allow flashing without root
sudo usermod -a -G dialout $USER
followed by a reboot
sle118
@sle118
Dec 25 2015 17:55
@alonewolfx2 issue was SPI size and spi mode!

working config for ESP07: # SPI_MODE: qio, qout, dio, dout
SPI_MODE ?= dio

SPI_SIZE: 512K, 256K, 1M, 2M, 4M

SPI_SIZE ?= 4M

alonewolfx2
@alonewolfx2
Dec 25 2015 17:56
what is your spi size?
sle118
@sle118
Dec 25 2015 17:56
4MB
spi mode was the other issue
it was qio, which wasn't working
this is one of the NodeMCU units from china
ESP07 because I wanted an external antenna connector
oh nevermind... this one was an ESP12
This is so cool I think I am going to cry tears of joy ;)
booting esp8266 qemu to rboot
(pure text)
@raburton are you here?
Writing default boot config.                                                                                                          
Booting rom 0.                                                                                                                        
system param error
what does that mean ?
Richard Antony Burton
@raburton
Dec 25 2015 19:08
@kireevco yeah, on my phone, just watched your thing
Dmitry Kireev
@kireevco
Dec 25 2015 19:08
it should be html, so should work everywhere
are you still at work?
(poor man)
Richard Antony Burton
@raburton
Dec 25 2015 19:09
Yeah, it's neat. That message is from the sdk, usually due to sdk configuration area on the flash iirc.
Bad sdk configuration area, I should have said.
Yeah, I'm still here for another 3 hours.
Dmitry Kireev
@kireevco
Dec 25 2015 19:11
@raburton what would that mean?
that's the qemu output http://showterm.io/50c6fb59291425256d02d - looks like gdb no?
:)
Richard Antony Burton
@raburton
Dec 25 2015 19:15
Usually you just erase the flash to clear the configuration area to fix the message.
Dmitry Kireev
@kireevco
Dec 25 2015 19:15
ahh
hm
Im' wondering how can I produce a good flash image. I'm doing:
cat rboot.bin /dev/zero | head -c $(( 0x02000 )) | cat - rom0.bin | head -c $(( 0x100000 )) > flash
@raburton is there a way how esptool2 can help me?
I mean, if there is anything else I need to do to create a right flash
alonewolfx2
@alonewolfx2
Dec 25 2015 19:17
@kireevco can we build one rom for flash (rboot+fw+spiffy) or (rboot+fw+spiffy+fw+spify) for 4mb flash?
Richard Antony Burton
@raburton
Dec 25 2015 19:17
I'm not sure what that command is getting to do.
Easiest option is probably too use a hex editor, create an empty file of x MB and paste in the files to the right locations within it.
Dmitry Kireev
@kireevco
Dec 25 2015 19:18
@raburton it is supposed to write 0x02000 empty right after boot.bin, and then 0x1000000 after it
Richard Antony Burton
@raburton
Dec 25 2015 19:18
Bit manual but quite easy.
Dmitry Kireev
@kireevco
Dec 25 2015 19:18
@raburton hehe, If I had one
:-D
@alonewolfx2 yeah, tha'ts what I'm trying to do
I think I can't use esptool.py because it uses espressif bootloader
and ordering is different, although I could be wrong
Richard Antony Burton
@raburton
Dec 25 2015 19:20
Ok do a bit of manual maths to work out the blank space between parts. Then use DD to from /dev/zero to make empty files if the right size, then just cat them all together.
Sorry, hard to help or even type on my phone.
Dmitry Kireev
@kireevco
Dec 25 2015 19:24
alright
but I was able to boot nodemcu
"no lua file loaded" so that's good
Richard Antony Burton
@raburton
Dec 25 2015 19:24
So rBoot.bin at 0, blank space from end of that to 0x2000, then rom, then space to end of flash size.
Dmitry Kireev
@kireevco
Dec 25 2015 19:31
...I miss being able to go to sming code of previous versions
Richard Antony Burton
@raburton
Dec 25 2015 19:32
So there is esp emulator then?
Dmitry Kireev
@kireevco
Dec 25 2015 19:33
there is, althoug not completely known. I've seen people using gdb on it.
but it clearly loads rboot.bin
Richard Antony Burton
@raburton
Dec 25 2015 19:46
Neat.
I wanna go home!
Dmitry Kireev
@kireevco
Dec 25 2015 19:54
when doing a proven command srec_cat -output flash.bin -binary rboot.bin -binary -fill 0xff 0x00000 0x02000 rom0.bin -binary -offset 0x02000 flash.bin has same error
let me add spiff
Dmitry Kireev
@kireevco
Dec 25 2015 20:18
srec_cat -output flash.bin -binary rboot.bin -binary -fill 0xff 0x00000 0x02000 rom0.bin -binary -offset 0x02000 spiff_rom.bin -binary -offset 0x100000
looks that should create a right flash
but it doens' wokr
alonewolfx2
@alonewolfx2
Dec 25 2015 20:20
@kireevco where is sdk settings area?
Dmitry Kireev
@kireevco
Dec 25 2015 20:20
I dont' know what is it
Richard Antony Burton
@raburton
Dec 25 2015 20:20
Does rBoot still work and say it's booting a rom?
Sdk settings area I'd the last 4 sectors. Are you making the flash up to 32mbit?
Dmitry Kireev
@kireevco
Dec 25 2015 20:21
wdt reset
load 0x40100000, len 1544, room 16
tail 8
chksum 0x99
load 0x3ffe8000, len 700, room 0
tail 12
chksum 0xd1
csum 0xd1

rBoot v1.2.1 - richardaburton@gmail.com
Flash Size:   32 Mbit
Flash Mode:   QIO
Flash Speed:  40 MHz
rBoot Option: Big flash

Writing default boot config.
Booting rom 0.
system param error
@raburton do I need to fill it with more stuff?
Richard Antony Burton
@raburton
Dec 25 2015 20:23
Don't know what the emulator will do for the flash, does is only emulate the size you give it? If so you'll need to give it a full sized image.
Dmitry Kireev
@kireevco
Dec 25 2015 20:23
srec_cat -output flash.bin -binary rboot.bin -binary -fill 0xff 0x00000 0x02000 rom0.bin -binary -offset 0x02000 spiff_rom.bin -binary -offset 0x100000 so, spiff_rom.bin is going to 0x100000 and that's it
Richard Antony Burton
@raburton
Dec 25 2015 20:23
That's 8mbit right?
Dmitry Kireev
@kireevco
Dec 25 2015 20:23
I think so, not sure
so, what I know that nodemcu firmware works
I can see serial output
do you want me to reconfigure rboot?
Richard Antony Burton
@raburton
Dec 25 2015 20:24
rBoot is reporting a 32mbit flash, but you're not giving the emulator a 32mbit file for the flash.
So the sdk will be looking for configuration at the last 4 sectors of a 32mbit flash and the emulator will do what then?
I assume not anything useful, hence the errors.
But it could just return zeros.
Dmitry Kireev
@kireevco
Dec 25 2015 20:30
hm
so, what would be any suggestio how to fix it?
can rboot report differently?
ok, so I need to add up until 32 MB
Mb
Dmitry Kireev
@kireevco
Dec 25 2015 20:35
32 Mb is 4MB, my flash.bin is 1245184 bytes, so I need to add 2949120
which is 0x2D0000
is thar right?
(@rabutron)
Richard Antony Burton
@raburton
Dec 25 2015 20:37
Sounds about right, don't have a hex calculator on my phone, but the decimal calculation looks fine.
Dmitry Kireev
@kireevco
Dec 25 2015 20:39
what about 0xFFFFC000 padding that was there
Richard Antony Burton
@raburton
Dec 25 2015 20:58
Last 4 sectors can just be blank (0xff), but they need to be there. So long as you have exactly 32mbit you should be fine.
Dmitry Kireev
@kireevco
Dec 25 2015 21:07
ok, trying to figure this out
@raburton thank you
Dmitry Kireev
@kireevco
Dec 25 2015 21:28
@raburton weird, doesn't help
flash_size_max=4000000
flash_size=$((8192 + $(stat -L -f%z "rom0.bin") + 1048576 + $(stat -L -f%z "spiff_rom.bin")))
flash_end=0x$(echo "obase=16; $(( $flash_size + ($flash_size_max - $flash_size) )) " | bc)

srec_cat -redundant-bytes=ignore -output flash.bin -binary \
 rboot.bin -binary \
 -fill 0xff 0x00000 0x02000 \
 rom0.bin -binary -offset 0x02000 \
 spiff_rom.bin -binary -offset 0x100000 \
 -fill 0xff 0x100000 $flash_end
here's what I'm doing
drwxr-xr-x  6 dmitry  staff      204 Dec 25 13:26 .
drwxr-xr-x  4 dmitry  staff      136 Dec 25 12:33 ..
-rw-r--r--  1 dmitry  staff  4000000 Dec 25 13:29 flash.bin
-rw-r--r--  1 dmitry  staff     2272 Dec 25 12:33 rboot.bin
-rw-r--r--  1 dmitry  staff   232752 Dec 25 12:33 rom0.bin
-rw-r--r--  1 dmitry  staff   196608 Dec 25 12:33 spiff_rom.bin
flash is exactly 4000000, that's 32Mb, right?
actually, it's not right... hold on
Dmitry Kireev
@kireevco
Dec 25 2015 21:53
@raburton so this parameter https://github.com/xlfe/spiffy
spiffs_embed.bin: (0x10000 + lengthof(iromtext) + 0x4000) & (0xFFFFC000)
@alonewolfx2 @raburton also, how can I explore the final binary? I want to compare it to nodemcu (that works)
Dmitry Kireev
@kireevco
Dec 25 2015 22:36
hm,nodemcu fw size is 402040 not 400000
wait, it's 402040 and not 4000000
Richard Antony Burton
@raburton
Dec 25 2015 22:44
back home, yay!
the size in the directory listing is in decimal not hex
Dmitry Kireev
@kireevco
Dec 25 2015 22:44
@raburton yay!!
I know, but their flash size is significantly lower
I thought it's bigger, but it's 10 times smaller
and it works
Richard Antony Burton
@raburton
Dec 25 2015 22:46
maybe you don't need the full size flash, maybe the emulator just simulates a full size flash with the rom file you specify at the beginning of it, I'm only guessing as to what the problem is
is this something i can easily test here?
Dmitry Kireev
@kireevco
Dec 25 2015 22:48
This message was deleted
you need a full build of qemu
git clone  https://github.com/OSLL/qemu-xtensa.git
git checkout xtensa-esp8266
git submodule update --init dtc
mkdir build
cd build
../configure --prefix=`pwd`/root --target-list=xtensa-softmmu,xtensaeb-softmmu
make && make install
that should work
This message was deleted
This message was deleted
Richard Antony Burton
@raburton
Dec 25 2015 22:51
ok, lets think about this a bit more
the message "system param error" appears to come from libmain, so we have managed to launch the rom, to some extent
Dmitry Kireev
@kireevco
Dec 25 2015 22:52
so, why are there 00 00 00 00? is there anything missing?
and also, don't use rtc mem data -?
Richard Antony Burton
@raburton
Dec 25 2015 22:52
it's dumping the data in the config sectors
Dmitry Kireev
@kireevco
Dec 25 2015 22:52
is that rtc ? and why is it different from nodemcu
ok
empty sectors
Richard Antony Burton
@raburton
Dec 25 2015 22:53
and then the next error sec 3fc error is a reference to the first of the 4 config sectors on a 32mbit chip
Dmitry Kireev
@kireevco
Dec 25 2015 22:54
anything related to sector size?
Richard Antony Burton
@raburton
Dec 25 2015 22:54
sector size is fixed, 4k
Dmitry Kireev
@kireevco
Dec 25 2015 22:54
or flash mode
similar for nodemcu nodemcu/nodemcu-firmware#613 reading
Richard Antony Burton
@raburton
Dec 25 2015 22:55
flash mode could have an effect i suppose, do you know what qemu is emulating? you could switch to dio and see
Dmitry Kireev
@kireevco
Dec 25 2015 22:55
no idea
:-D
let's see
Richard Antony Burton
@raburton
Dec 25 2015 22:55
normally these would be set when flashing, but here you aren't flashing them
Dmitry Kireev
@kireevco
Dec 25 2015 22:55
@raburton how would I set it with robot?
*rboot
Richard Antony Burton
@raburton
Dec 25 2015 22:56
you can set the spi mode and flash size in the makefile-user.mk when you build the project and they should get passed through to the rBoot build
Dmitry Kireev
@kireevco
Dec 25 2015 22:57
is it SPI_MODE = dio?
Richard Antony Burton
@raburton
Dec 25 2015 22:59
yep
that will embed the right flag in the rBoot binary, rather than leaving it to be set at flash time
Dmitry Kireev
@kireevco
Dec 25 2015 23:00
still

rBoot v1.2.1 - richardaburton@gmail.com
Flash Size:   32 Mbit
Flash Mode:   QIO
Flash Speed:  40 MHz
rBoot Option: Big flash
let me change in Makefile-rboot
(try
Richard Antony Burton
@raburton
Dec 25 2015 23:01
did you make clean?
and recreate your whole rom image
Dmitry Kireev
@kireevco
Dec 25 2015 23:02
of course
make clean && make
checking
OC out/build/libmain2.a
/Applications/Xcode.app/Contents/Developer/usr/bin/make -C /Users/dmitry/dev/Sming/Sming/rboot
CC rboot-stage2a.c
LD /Users/dmitry/dev/Sming/Basic_rBoot/out/build/rboot-stage2a.elf
FW /Users/dmitry/dev/Sming/Basic_rBoot/out/build/rboot-hex2a.h
CC rboot.c
LD /Users/dmitry/dev/Sming/Basic_rBoot/out/build/rboot.elf
FW /Users/dmitry/dev/Sming/Basic_rBoot/out/firmware/rboot.bin
C+ app/application.cpp
C+ /Users/dmitry/dev/Sming/Sming/appinit/user_main.cpp
CC /Users/dmitry/dev/Sming/Sming/rboot/appcode/rboot-api.c
CC /Users/dmitry/dev/Sming/Sming/rboot/appcode/rboot-bigflash.c
AR out/build/app_app.a
LD out/build/app_0.out
out/build/app_app.a(application.o): In function `OtaUpdate_CallBack(bool)':
/Users/dmitry/dev/Sming/Sming/SmingCore/Boards.h:17: undefined reference to `rBootHttpUpdate::rBootHttpUpdate()'
/Users/dmitry/dev/Sming/Sming/SmingCore/Boards.h:17: undefined reference to `rBootHttpUpdate::addItem(int, String)'
out/build/app_app.a(application.o):(.text._Z9OtaUpdatev+0x24): undefined reference to `rBootHttpUpdate::setCallback(void (*)(bool))'
out/build/app_app.a(application.o):(.text._Z9OtaUpdatev+0x28): undefined reference to `rBootHttpUpdate::start()'
out/build/app_app.a(application.o): In function `OtaUpdate()':
/Users/dmitry/dev/Sming/Basic_rBoot/app/application.cpp:30: undefined reference to `rBootHttpUpdate::rBootHttpUpdate()'
/Users/dmitry/dev/Sming/Basic_rBoot/app/application.cpp:42: undefined reference to `rBootHttpUpdate::addItem(int, String)'
/Users/dmitry/dev/Sming/Basic_rBoot/app/application.cpp:48: undefined reference to `rBootHttpUpdate::addItem(int, String)'
/Users/dmitry/dev/Sming/Basic_rBoot/app/application.cpp:61: undefined reference to `rBootHttpUpdate::setCallback(void (*)(bool))'
/Users/dmitry/dev/Sming/Basic_rBoot/app/application.cpp:61: undefined reference to `rBootHttpUpdate::start()'
collect2: error: ld returned 1 exit status
Dmitry Kireev
@kireevco
Dec 25 2015 23:08
wtf
Richard Antony Burton
@raburton
Dec 25 2015 23:09
looks like the rBoot class isn't built in to your libsming
Dmitry Kireev
@kireevco
Dec 25 2015 23:10
ah
Richard Antony Burton
@raburton
Dec 25 2015 23:12
it should be there, you probably just need to make clean && make sming, but no idea why it's just disappeared since you last built with it???
Dmitry Kireev
@kireevco
Dec 25 2015 23:12
I forgot to rebuild sming. i did git reset --hard
my bad
let's try again
very strange
same QIO
can you build basic_rboot and send me your out/firmware zip please?
Richard Antony Burton
@raburton
Dec 25 2015 23:14
sure
you want any specific options with that?
Dmitry Kireev
@kireevco
Dec 25 2015 23:15
I don't know, just DIO for now
Dmitry Kireev
@kireevco
Dec 25 2015 23:23
ok, it is DIO
but same error:(
alright, thanks for your help. I'll go do chrismas stuff, and come back sometimes tonight :)
Richard Antony Burton
@raburton
Dec 25 2015 23:29
i'll try and have a look at running the thing myself in the next day or two
but i've had a 12.5 hours shift today, and same for next two days
and i'm trying to look at the rtos thing as well for @hreintke
can you chuck me the completed rom image you are using (the full 4mb one), i'll do a quick sanity check
Richard Antony Burton
@raburton
Dec 25 2015 23:35
@hreintke I've got the rtos version building to a libsming.a and separate apps building against it
however, when i run them I'm getting a csum err despite the two checksums values shown above the message matching
have you seen this before? i remember seeing this / discussing this with someone recently
Dmitry Kireev
@kireevco
Dec 25 2015 23:41
somethign like that
@raburton
sanity check would definitely help
that's basic serial
Richard Antony Burton
@raburton
Dec 25 2015 23:47
second one doesn't have rBoot in it, this is just the straight app?
it seems to be zero padded to 256k, then has 16k of 0xff after that
Dmitry Kireev
@kireevco
Dec 25 2015 23:52
Yep, doesn't
No rboot
Richard Antony Burton
@raburton
Dec 25 2015 23:53
and that runs ok?
have a go with this one if you like: https://dl.dropboxusercontent.com/u/5500141/x.zip
a quick rboot + basic serial made from the ones i sent you a few minutes ago
i need to go to bed now, it's almost midnight and i'm tired + have to be at work again for 9am
and i think the Christmas cheer will have worn off the nurses by tomorrow