These are chat archives for esp8266/Arduino

3rd
Aug 2015
Jakub Sobieraj
@sobiso
Aug 03 2015 14:16
In esp/arduino we must delarete html files in code or we can put html to files, something like FS ?
Neil Kolban
@nkolban
Aug 03 2015 14:18
It takes programming ... but you can place your HTML files in either on-board flash memory (about 1-4MB max) or you can add a micro SD device and use a micro SD storage unit (GBytes)
Jakub Sobieraj
@sobiso
Aug 03 2015 14:19
so i cannot put this file to the same flash as program ?
Neil Kolban
@nkolban
Aug 03 2015 14:21
Oh yes ... you can do that too ... that was meant to be my first point ... your HTML can be loaded into your "app".
Jakub Sobieraj
@sobiso
Aug 03 2015 14:25

But not like that :

String s = "HTTP/1.1 200 OK\r\nContent-Type: text/html\r\n\r\n<!DOCTYPE HTML>\r\n<html>\r\nGPIO is now ";
  s += (val)?"high":"low";
  s += "</html>\n";

I want in separately files .html .js .jpg etc

?
Neil Kolban
@nkolban
Aug 03 2015 14:27
Right ... correct. In your app code, you need to provide a "pointer" to an area of memory that holds the data to be sent to the browser. Where you get this data can be a variety of places ... in-line static code, retrieval from flash or retrieval from SD ... etc etc
Jakub Sobieraj
@sobiso
Aug 03 2015 14:30
@Links2004 thx for link, @nkolban thx for answer, in Sming it's simpler but i have unstable problem
Harrison Mclean
@h4rm0n1c
Aug 03 2015 14:42
Actually, now that I think about it, how does one get files into the spiffs fs at the moment?
Apart from writing to it from your code running on the esp...
I've seen some discussion in the issues tracker about it, but that was months ago, not sure if it's still valid info.
Markus
@Links2004
Aug 03 2015 14:43
Harrison Mclean
@h4rm0n1c
Aug 03 2015 14:44
ah. right.
thanks :)
Ivan Grokhotkov
@igrr
Aug 03 2015 14:45
I have a tool, mkspiffs, which builds SPIFFS images. and me-no-dev wrote a plugin for Arduino to upload that to flash
will be integrated within days, not working for boards manager installs due to a paths issue
Jakub Sobieraj
@sobiso
Aug 03 2015 14:47
@igrr when i upload images i can write some files form app ? some config stuff ?
Harrison Mclean
@h4rm0n1c
Aug 03 2015 14:48
@sobiso should be the same, it's just tools to make initial upload of files easier.
Harrison Mclean
@h4rm0n1c
Aug 03 2015 14:56
@igrr Thanks for the clarification. You're a powerhouse, man :) I
Ivan Grokhotkov
@igrr
Aug 03 2015 14:58
no problem) sorry I'm a bit distracted these days, doing a workshop on ESP8266s at Fab Fest Boston...
will be back by the end of the week and will push more stuff.
Jakub Sobieraj
@sobiso
Aug 03 2015 15:00
Yes we are waiting for this :D
Harrison Mclean
@h4rm0n1c
Aug 03 2015 15:24
There's EAGLE to be learned in the meantime. I've been getting by on autocad and easypcb for far too long...
Markus
@Links2004
Aug 03 2015 15:25
EAGLE is easy to use when you get some basics
Lukas Höppner
@Wuschli
Aug 03 2015 17:17
Hey, is it normal, that TX is always high while running an arduino sketch on an esp-12?
I am on windows and inspecting the serial connection with realterm. And there is a continous data flow with just 1 from the esp.
And I am trying to run the WiFi AP sample sketch
Me No Dev
@me-no-dev
Aug 03 2015 18:05
not normal
Neil Kolban
@nkolban
Aug 03 2015 18:05
In your question ... is it TX from the Arduino or TX from the ESP?
Also realize that the pins on an ESP are multiplexed ... this means that a given pin can be configured to perform a variety of tasks. Depending on your code logic, the pin that you call TX on an ESP can be repurposed as a genral IO pin and have its value set to 1.
Lukas Höppner
@Wuschli
Aug 03 2015 18:09
TX from the ESP. I just tried to use GPIO2 as TX and it doesn't set it to HIGH. Another fact i recognized is that one time after a reset the bootmode was (3,6) instead of (3,7). Do you know what that second number means? Because in the (3,6) case TX wasn't HIGH, too.
In all cases none of my code seems to be executed. At the moment i am trying to run something like ```
void setup() {
  Serial.begin(9600);
}

void loop() {
  delay(1000);
  Serial.print("Test");
}
but there is no "Test" in my terminal at all :(
Me No Dev
@me-no-dev
Aug 03 2015 18:11
GPIO2 is TX for Serial1
Lukas Höppner
@Wuschli
Aug 03 2015 18:11
but it also sends boot info in my case
Me No Dev
@me-no-dev
Aug 03 2015 18:12
yes it does
both serials are active at boot
Neil Kolban
@nkolban
Aug 03 2015 18:12
For debugging, I write to Serial1 which is UART1 ... TX = GPIO2 ... I use TWO UARTs ... one for flashing the device and one for debugging.
Lukas Höppner
@Wuschli
Aug 03 2015 18:13
maybe i can try that too. I have another Serial to USB converter somewhere. brb :D
Neil Kolban
@nkolban
Aug 03 2015 18:13
Just connect GPIO2 on the ESP (UART1 TX) to the RX on the USB->UART ...
connect a terminal monitor continuously to that Serial port
Lukas Höppner
@Wuschli
Aug 03 2015 18:15
in the arduino IDE i have to use Serial1 instead of Serial, right?
Me No Dev
@me-no-dev
Aug 03 2015 18:15
yes
Neil Kolban
@nkolban
Aug 03 2015 18:15
There are two UARTs on the ESP ... UART0 and UART1
UART0 is used for flashing
UART1 is what I use for logging
And to write to UART1, use the class called "Serial1" as opposed to "Serial" which is UART0
Me No Dev
@me-no-dev
Aug 03 2015 18:17
void setup(){
  Serial.begin(9600);
  Serial1.begin(9600);
}

void loop(){
  Serial.println("This is the first serial");
  Serial1.println("This is the second serial");
  delay(1000);
}
Lukas Höppner
@Wuschli
Aug 03 2015 18:17
still no output from the ESP :(
Neil Kolban
@nkolban
Aug 03 2015 18:17
Nothing at all?
What are you using as a serial terminal?
Lukas Höppner
@Wuschli
Aug 03 2015 18:18
nope. Only some binary data while flashing
realterm on windows
it SHOULD print "Test" once every second. But there's still nothing
Neil Kolban
@nkolban
Aug 03 2015 18:19
Although it will make no difference, I use PuTTY for a serial terminal ... http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html
Me No Dev
@me-no-dev
Aug 03 2015 18:19
try what I pasted
Neil Kolban
@nkolban
Aug 03 2015 18:19
I leave that connected to my UART1 continuously ...
when flashing, I see an indicator that it is flashing
and when it boots, I see additional boot log messages.
Lukas Höppner
@Wuschli
Aug 03 2015 18:27
i get all kinds of boot messages but not a single line of my code
Markus
@Links2004
Aug 03 2015 18:28
is GPIO0 HI or low ? poste use the boot meassages at 74880 baud.
Lukas Höppner
@Wuschli
Aug 03 2015 18:30
 ets Jan  8 2013,rst cause:2, boot mode:(3,6)



load 0x4010f000, len 1264, room 16 

tail 0

chksum 0x42

csum 0x42

~ld
Neil Kolban
@nkolban
Aug 03 2015 18:30
And this is from UART1?
Lukas Höppner
@Wuschli
Aug 03 2015 18:30
yep, but it's the same on UART0
Markus
@Links2004
Aug 03 2015 18:31
its outputted on uart0 and uart1
Lukas Höppner
@Wuschli
Aug 03 2015 18:31
yes
Neil Kolban
@nkolban
Aug 03 2015 18:31
And you had no issues uploading the sketch? Nothing bad reported?
Markus
@Links2004
Aug 03 2015 18:31
the output say your application is booted.
Lukas Höppner
@Wuschli
Aug 03 2015 18:31
nope, uploading finished without a problem
Neil Kolban
@nkolban
Aug 03 2015 18:33
I'm sorry ... I'm not seeing anything that I can spot as a problem :-(
Markus
@Links2004
Aug 03 2015 18:33
what are the level of TX and GPIO2? hi or low? some times the ESP not boot with they are at low.
Lukas Höppner
@Wuschli
Aug 03 2015 18:36
GPIO2 is low, but TX seems to be high after booting, but it's only connected to CP2102's RX
Markus
@Links2004
Aug 03 2015 18:37
GPIO2 low? is it connected to something?
Neil Kolban
@nkolban
Aug 03 2015 18:37
How are you powering the ESP?
Markus
@Links2004
Aug 03 2015 18:37
TX high is ok. but GPIO2 shut be also high.
Lukas Höppner
@Wuschli
Aug 03 2015 18:37
@Links2004 to the other USB to Serial converter's RX.
@nkolban i am using a 3.3V breadboard power supply
@Links2004 I'll try to add a pullup resistor, brb :)
Markus
@Links2004
Aug 03 2015 18:39
Serial is high at idle on TTL level, so if your serial adapter pull it always to low, there is some thing wrong.
is the ESP booting if you unplug the GPIO2 ?
Lukas Höppner
@Wuschli
Aug 03 2015 18:42
nope, it's the same without anything attached to GPIO2
Markus
@Links2004
Aug 03 2015 18:44
GPIO2 is low if nothing is attached? there is something wrong. normally it is high in bootloader mode (alternative TX). and if the application starts its configured as input.
is adding a pullup helping?
Lukas Höppner
@Wuschli
Aug 03 2015 18:46
oops, i'm sorry, GPIO2 is high. I measured it wrong :/
Markus
@Links2004
Aug 03 2015 18:47
k then the hardware is correct. can you poste you code?
Lukas Höppner
@Wuschli
Aug 03 2015 18:48
i am using the code posted by @me-no-dev above
Markus
@Links2004
Aug 03 2015 18:48
k looking good :) what level is GPIO15?
Lukas Höppner
@Wuschli
Aug 03 2015 18:49
it's low. I have one of these white breakout boards and it seems to have a pulldown onboard
but i also tried it with an external pulldown
Me No Dev
@me-no-dev
Aug 03 2015 18:50
by all means that sketch above should have worked if uploaded
Markus
@Links2004
Aug 03 2015 18:50
ok I have them too, they have all needed setup for normal boot mode.
@me-no-dev yes normally it work
Lukas Höppner
@Wuschli
Aug 03 2015 18:51
idk, i have checked everything a hundred times and i am trying to make this work since friday. It's very frustrating :P
but i will not surrender :D
Me No Dev
@me-no-dev
Aug 03 2015 18:52
i have a little idea what could help
Markus
@Links2004
Aug 03 2015 18:52
the load 0x4010f000, len 1264, room 16 shows that the eboot code is running and after this normaly the app code is started
Me No Dev
@me-no-dev
Aug 03 2015 18:52
dump your flash and compare with the bin
Lukas Höppner
@Wuschli
Aug 03 2015 18:53
how does that work?
Me No Dev
@me-no-dev
Aug 03 2015 18:53
I use hex editor/viewer for that
what size is your flash?
Lukas Höppner
@Wuschli
Aug 03 2015 18:54
i am not sure. It should be an esp12e
Markus
@Links2004
Aug 03 2015 18:54
esptool.py -p $(ESPPORT) -b $(ESPBAUD) read_flash 0x00000 0x80000 dump.bin will dump 512kb
but this take some time :) the easyer way is an external SPI flash programmer (if available)
Lukas Höppner
@Wuschli
Aug 03 2015 18:56
okay, i will try this in a moment :) I am very thankfull for you helping me, guys :D
Lukas Höppner
@Wuschli
Aug 03 2015 19:13
the flash and the sketch binary are definitely not the same :/ One of them has html page fragments inside. I think it's the flash dump
Me No Dev
@me-no-dev
Aug 03 2015 19:13
check up to the size of the Arduino bin file
everythng after that is leftover
Lukas Höppner
@Wuschli
Aug 03 2015 19:14
oh, yeah, that sounds plausible :P
i have to find an editor to view them side-by-side
Markus
@Links2004
Aug 03 2015 19:18
winmerge or notepad++
k HxD is better :) to many tools installed
Lukas Höppner
@Wuschli
Aug 03 2015 19:21
alright. The sketch binary and the first part of the dump are identical
so my program is on the chip
Markus
@Links2004
Aug 03 2015 19:23
can you upload you bin from the compiler then i can check it on my board, then we know if its software or hadware problem
d-anders
@d-anders
Aug 03 2015 19:24
my money is on hardware
Markus
@Links2004
Aug 03 2015 19:24
yup me too, after this we know it :)
Lukas Höppner
@Wuschli
Aug 03 2015 19:24
i am not sure about that. I just connected another esp and get the same behaviour
Markus
@Links2004
Aug 03 2015 19:27
oO no output only boot message.
#------- RS232 -------#
| Port:  /dev/ttyS2   |
|        COM3         |
| Baud:  9600         | 
| Mode:  8N1          | 
#---------------------#
Open for reset.
reboot ESP8266...
reboot ESP8266... Done.


------------------ ESP8266 BOOTLOADER ------------------

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

load 0x4010f000, len 1264, room 16  
tail 0 
chksum 0x42 
csum 0x42 
~ld

------------------ ESP8266 APP ------------------
d-anders
@d-anders
Aug 03 2015 19:28
was that the bin from the compiler or read from the chip?
Markus
@Links2004
Aug 03 2015 19:28
what is you version of the ESP in board manager?
Lukas Höppner
@Wuschli
Aug 03 2015 19:29
that was the compiler bin
Markus
@Links2004
Aug 03 2015 19:31
shut be Staging: 1.6.5-990-gc8a63ce or Stable: 1.6.5-947-g39819f0
Lukas Höppner
@Wuschli
Aug 03 2015 19:32
it's 1.6.5-990-gc8a63ce
Markus
@Links2004
Aug 03 2015 19:32
you also can check here:
Windows: C:\Users[username]\AppData\Roaming\Arduino15\packages\esp8266\hardware
Linux: /home/[username]/.arduino15/packages/esp8266/hardware
is there is on old version sometimes the IDE does not clean up on update
d-anders
@d-anders
Aug 03 2015 19:33
maybe try to add a softap or something to see if any code at all is executing
you havent edited any files outside arduino ide without closing and reopening the project?
Lukas Höppner
@Wuschli
Aug 03 2015 19:34
nope
at least i am not doing somethin significantly wrong :D
Markus
@Links2004
Aug 03 2015 19:41
same here. will build the same bin here then we can test your hardware, if they is working, you shut reinstall the arduino stuff complete.
d-anders
@d-anders
Aug 03 2015 19:41
i would change the code a little and compare the new bin to the old one
maybe add a print in setup
Markus
@Links2004
Aug 03 2015 19:42
code is working here :)
This is the second serial                                                       
This is the second serial                                                       
This is the second serial                                                       
This is the second serial                                                       
This is the second serial                                                       
This is the second serial                                                       
This is the second serial                                                       
This is the second serial
only one byte is different and this "one" is for Flash ship type.
have you checked the flash settings in the IDE?
Lukas Höppner
@Wuschli
Aug 03 2015 19:46
which one?
Markus
@Links2004
Aug 03 2015 19:46
normally qio + 40Mhz is default but 80Mhz is working fine by me.
Lukas Höppner
@Wuschli
Aug 03 2015 19:46
i tried qio and dio
how can i upload the bin with esptool?
Shelby Merrick
@forkineye
Aug 03 2015 19:47
anyone know if the latest staging release fixes has pow() fixed as talked about here - esp8266/Arduino#612
Markus
@Links2004
Aug 03 2015 19:49
$(ESPTOOL) -p $(ESPPORT) -b $(ESPBAUD) write_flash -fm qio -ff 80m -fs 32m 0x00000 ESP8266_serial_test_9600.bin
qio + 80Mhz for 4MB chip
$(ESPTOOL) = esptool.py :)
Lukas Höppner
@Wuschli
Aug 03 2015 19:51
thx. upload in progress :D
Markus
@Links2004
Aug 03 2015 19:51
@forkineye if the bug is fixed we drop an comment on the issues, so not fixed.
Lukas Höppner
@Wuschli
Aug 03 2015 19:53
still nothing :(
Markus
@Links2004
Aug 03 2015 19:55
oO ok this is hard
Shelby Merrick
@forkineye
Aug 03 2015 19:55
@Links2004 Thanks, I'll dig around on how to compile the toolchain and see if I can't figure it out
Lukas Höppner
@Wuschli
Aug 03 2015 19:58
i think i will give up for today :( i have some other stuff to do. Thank you very much for trying to help me :) Maybe I#ll come back in a few days :D
Neil Kolban
@nkolban
Aug 03 2015 19:58
What about a photo of your setup?
Lukas Höppner
@Wuschli
Aug 03 2015 19:59
it's too dark at the moment for a photo, but i can take on in the next days ;)
Markus
@Links2004
Aug 03 2015 19:59
@forkineye for the build process ant dist will start the build process, for more details @igrr can help.
Shelby Merrick
@forkineye
Aug 03 2015 20:09
Thanks! Adding gamma table generation to my pixel driver - https://github.com/forkineye/ESPixelStick. Love the work you all have down with ESP8266 Arduino
Russ Mathis
@RussMathis
Aug 03 2015 20:45
Anybody know if there is a queque object available?
Neil Kolban
@nkolban
Aug 03 2015 20:46
Russ Mathis
@RussMathis
Aug 03 2015 20:46
Need a way to que up a simple structure with some bools and doubles...
Russ Mathis
@RussMathis
Aug 03 2015 20:46
k, thank @nkolban !
Kiril Zyapkov
@kzyapkov
Aug 03 2015 21:30

https://github.com/kzyapkov/Arduino/tree/avrisp/hardware/esp8266com/esp8266/libraries/ESP8266AVRISP

ArduinoISP over TCP. I'll add some docs before a pull request, but the example works