These are chat archives for SmingHub/Sming

24th
Mar 2017
Curtis Pope
@piperpilot
Mar 24 2017 13:05
Hey guys, finally trying to migrate to the latest SMING and having problems. I'm getting ERROR in flash_read: r=1. I have looked through the threads and tried the things that are implemented there. I ran make flashinit, I made sure spiffs_mount_manual is set properly. Any suggestions? Is there a new rboot needed to work with the new version?
Alexander V. Ribchansky
@avr39-ripe
Mar 24 2017 13:29
@piperpilot yesterday I also try to clean my esp-12 by make flashinit, it throw me error after erase flash, and my esp-12 become unbootable by many example app and even some rBoot aware app. only after esptool.py -p /dev/cuaU0 -b 460800 write_flash 0x7c000 esp_init_data_default.bin my module can boot any example app and my own rBoot app.. I think something in make flashinit target is broken.. :(
Curtis Pope
@piperpilot
Mar 24 2017 13:30
OK, I'll take a look at that then. I'm using SDK 1.5.4 and will also try going to 2.0
Alexander V. Ribchansky
@avr39-ripe
Mar 24 2017 13:31
@piperpilot I use 2.0 with patches from espressif and recent Sming/develop
Curtis Pope
@piperpilot
Mar 24 2017 13:41

I tried the init, it looks fine. I think there might be something we broke with Rboot...Here is the full initial start messages:
`start: size:976 Kb, offset:0x40300000

ERROR: ERROR in flash_read: r=1 at 40300000
`

Alexander V. Ribchansky
@avr39-ripe
Mar 24 2017 13:43
@piperpilot try esptool.py -p /dev/cuaU0 -b 460800 erase_flash and then flashinit again and then reflash your app. What is your module? esp-12 esp-01 or what?
Curtis Pope
@piperpilot
Mar 24 2017 13:51
esp-12F
Alexander V. Ribchansky
@avr39-ripe
Mar 24 2017 13:53
@piperpilot good module! It can work WITHOUT external resistors to gpio0/gpio2/gpio15 it has them inside :)
Curtis Pope
@piperpilot
Mar 24 2017 14:00
Well after just running erase and flashing the init, I get a different result...
‚cÛÆÉlcb....lŒ›lc.„#ân€Äœx.œÇ.n.|..œ.b..Œ’l..lx.„Ø..ŽìŽ€..€..l˜.!‚cÛÆÉlcb....lŒÛlc.Ä#ân€Äœx.œÇ.n.|..œ.b..Œ’l..lx.„Ø..ŽìŽ„..€..l˜.!`‚cÛÆÉlcb....lŒ›lc.„#ânÀĜ8.œÇ.n.|..œ.b..Œ’l..lx.„Ø..ŽìŽ˜..€..l˜.!
just a bunch of garbage now
repeating
Alexander V. Ribchansky
@avr39-ripe
Mar 24 2017 14:01
@piperpilot now you need to esptool.py -p /dev/cuaU0 -b 460800 write_flash 0x7c000 esp_init_data_default.bin
@piperpilot or/and may be also esptool.py -p /dev/cuaU0 -b 460800 write_flash 0x3fc000 esp_init_data_default.bin and/or esptool.py -p /dev/cuaU0 -b 460800 write_flash 0x1fc000 esp_init_data_default.bin
Curtis Pope
@piperpilot
Mar 24 2017 14:02
yeah, I did
/opt/esp-alt-sdk//utils/esptool.py -p /dev/tty.usbserial-A50285BI -b 115200 write_flash 0x7c000 sdk/bin/esp_init_data_default.bin
hmmm, OK, I will try those other locations too
Alexander V. Ribchansky
@avr39-ripe
Mar 24 2017 14:03
@piperpilot try to write it also on other location..
Curtis Pope
@piperpilot
Mar 24 2017 14:08
with flashing those additional locations, I get back to the previous flash_read error. I'll try rolling back SMING versions real quick and see if I can figure out where things broke. I do see a lot of compile warnings in the newer versions and they have to do with the memory reading...so maybe there is a problem there
I'll also try the rboot example to narrow down that it isn't a problem in my code
Alexander V. Ribchansky
@avr39-ripe
Mar 24 2017 14:09
@piperpilot try to flash some generic sming example, if it works, then it is your app problem
Curtis Pope
@piperpilot
Mar 24 2017 14:10

Here is an example of some of the warnings...
`include/lwip/mem.h:55:21: warning: implicit declaration of function 'vPortFree' [-Wimplicit-function-declaration]

define mem_free(s) vPortFree(s, "", 0)

                 ^

lwip/core/dhcp.c:629:5: note: in expansion of macro 'mem_free'
mem_free(netif->dhcp);
`

Alexander V. Ribchansky
@avr39-ripe
Mar 24 2017 14:13
also in recent sming do make dist-clean && make rebuild to apply all patches correctly
what is your dev platform? win/linux?
Curtis Pope
@piperpilot
Mar 24 2017 14:14
OSX
Alexander V. Ribchansky
@avr39-ripe
Mar 24 2017 14:14
wow.. almost BSD :) or "with FreeBSD in heart :) "
Curtis Pope
@piperpilot
Mar 24 2017 14:16
yeah, osx is pretty good for a developer
OK...so I get basic_rboot working, so there is something with my app that isn't working
Alexander V. Ribchansky
@avr39-ripe
Mar 24 2017 14:21
@piperpilot one more thing! if you use rBoot and spiff fs in recent Sming there was some changes to mount address of fs..
Curtis Pope
@piperpilot
Mar 24 2017 14:22
ahhh, thats probably it
I was just looking at that...what changed?
ahhh, I see it...its just an offset now
Alexander V. Ribchansky
@avr39-ripe
Mar 24 2017 14:23
yes, without 40xxx :)
Curtis Pope
@piperpilot
Mar 24 2017 14:25
awesome!
Alexander V. Ribchansky
@avr39-ripe
Mar 24 2017 14:25
@piperpilot works?
Curtis Pope
@piperpilot
Mar 24 2017 14:26
yup, it was the spiffs address
Alexander V. Ribchansky
@avr39-ripe
Mar 24 2017 14:26
@piperpilot sad :( I try hard not to help you.. I fail ;((
Curtis Pope
@piperpilot
Mar 24 2017 14:27
@avr39-ripe you were a big help! Now I have to go look and see why webserver is crashing
Alexander V. Ribchansky
@avr39-ripe
Mar 24 2017 14:28
@piperpilot what is your hw/code do if it not NDA covered? :)
Curtis Pope
@piperpilot
Mar 24 2017 14:29
Alexander V. Ribchansky
@avr39-ripe
Mar 24 2017 14:33
@piperpilot WOW! really nice! And it has esp-12 + sming inside??
Curtis Pope
@piperpilot
Mar 24 2017 14:33
yup
Alexander V. Ribchansky
@avr39-ripe
Mar 24 2017 14:34
do you have native iOs/android app or web interface?
Curtis Pope
@piperpilot
Mar 24 2017 14:35
web interface right now...it has a local web server based on Sming, and once connected to wifi, it sends data to our cloud application. we are working on IOS/android apps as well...will use websockets in Sming...
we have a microchip PIC onboard too that does a lot of the major calculations, servo control, etc. I could have probably done it all with the ESP but we already had the PIC code developed when we added wifi
Alexander V. Ribchansky
@avr39-ripe
Mar 24 2017 14:36
@piperpilot WOW again.. will you use JSON or binary protocol on top of websockets? Does any part of you webinterface code publically available ?
@piperpilot do you use any JS-framework for webiface or vanilla JS?
Curtis Pope
@piperpilot
Mar 24 2017 14:38
my cloud web interface is all custom written in Groovy/Grails. On Sming I use bootstrap and jquery
Alexander V. Ribchansky
@avr39-ripe
Mar 24 2017 15:15
@piperpilot nice project, really nice!!
Curtis Pope
@piperpilot
Mar 24 2017 15:23
thank you...I have been working on it for a really long time and we are finally going to market. I will be deep in my firmware over the next couple of months making sure it is bulletproof
Alexander V. Ribchansky
@avr39-ripe
Mar 24 2017 15:48
@piperpilot I wish you a GOOD, BULLETPROOF, LUCK! only hw developer can understand another hw dev... :) As I always say to my pure software friends: "if it doesn't work, you never know whether IT doesn't work, or thing on which IT work doesn't work at all" :))
slaff
@slaff
Mar 24 2017 16:31

. I'm getting ERROR in flash_read: r=1.
ERROR: ERROR in flash_read: r=1 at 40300000

@paperpilot Since version 3.1.0 ...

spiffs_mount_manual() is using the actual Flash address. Before that it was using the memory-mapped address. If you used this function you should recalculate the mounting address using this formula: `new_address = (old_address - 0x40200000)

It is in our release notes: https://github.com/SmingHub/Sming/releases. Replace 0x40300000 with 0x100000 and Bob is your uncle.

we are finally going to market.

Interesting. Another project from my side is coming to the phase where we are ready for tests with real consumers ;)