These are chat archives for esp8266/Arduino

26th
Dec 2015
Sven Eliasson
@comino
Dec 26 2015 00:34
never tried but I would use the http client -
Or look at this as a starting point: https://github.com/garthvh/esp8266button or https://gist.github.com/outofmbufs/d6ced37b49a484c495f0 or https://github.com/ericoporto/IFTTTButton
Aditya Tannu
@AdySan
Dec 26 2015 00:50
Thanks @comino, I used HTTPClient example, was rather straightforward.
Stavros Korokithakis
@skorokithakis
Dec 26 2015 02:21
has anyone used an RFID reader?
brutzler
@brutzler
Dec 26 2015 08:47

OTA on 2.0.0 stable / Arduino 1.6.5
Do I still have to run a TCP-Server on port 8266?
I have a normal Webserver running at port 80 and defined

const uint16_t OTAport = 80;
ArduinoOTA.setPort(OTAport);

But I get an "Error: No Answer"

Kiril Zyapkov
@kzyapkov
Dec 26 2015 10:47
Hi all! Has anyone seen failing SPIFFS uploads? I have a sketch which works great on a Nodemcu module with a 4M flash chip, but when flashing on a 2M Olimex device the spiffs upload hangs at a random spot
I'm pretty sure I'm generating the image with correct options, using the correct linker script and all, but both esptool-ck and esptoo.py just bail in the middle of the spiffs upload with a "bad packet response" or sth. of this sort
Kiril Zyapkov
@kzyapkov
Dec 26 2015 10:56
I tried uploading separately, tried combining the binary images into one and uploading the entire 2M block, with or without the sdk config sectors ... no luck
I'm starting to think these chips have something in their rom/bootloader which screws the upload, or maybe my fake FTDI usb adapter is acting up?
Helio Machado
@crushedice2000
Dec 26 2015 11:46
@kzyapkov: themadinventor/esptool#67 I'm sure that is your FTDI, as it hangs at a random point using the default speed. Maybe a counterfeit FTDI chip?

See this:
Helio Machado
@crushedice2000
Dec 26 2015 11:59

Using esptool-ck (the default one):

No known method.

The only way I've found is using my wrapper: https://github.com/crushedice2000/esptool-wrapper (coming soon)

Using esptool.py (the better one -for me-):

I can fix this changing on esptool.py this

ESP_RAM_BLOCK = 0x1800
ESP_FLASH_BLOCK = 0x400 

by this

ESP_RAM_BLOCK = 0x180
ESP_FLASH_BLOCK = 0x40

Quote from: themadinventor/esptool#67

Kiril Zyapkov
@kzyapkov
Dec 26 2015 12:32
Alas, that doesn't fix it for me, Writing at 0x00160800... (38 %) A fatal error occurred: Invalid head of packet
Helio Machado
@crushedice2000
Dec 26 2015 12:35
@kzyapkov: Triple-check your wiring (Are you hand-holding the cable on GPIO0)?
Also you can try to lower the speed even more 0x18/0x4
Is good the 3v3 power supply?
Do you have another adapter? Let's say a atmega16u2 or cp2102
Are you putting the device in flash mode manually?
Did you try the OTA spiffs upload?
Ivan Kravets
@ivankravets
Dec 26 2015 13:02

Dear PlatformIO Users,

Merry Christmas and Happy Holidays! :christmas_tree: We prepared for you excellent present! :gift:

PlatformIO will not require SCons to be installed in your system or via pip. All problems with PlatformIO installation will be resolved in PlatformIO 2.7.0 (planned for release on Dec 29, 2015). No need to install latest pip or setuptools. Simple ONE command pip install platformio and all should work from the box!

Related issue platformio/platformio#406

Welcome to test first development build of PlatformIO 2.7.0.dev0 http://docs.platformio.org/en/latest/installation.html#d-development-version

Helio Machado
@crushedice2000
Dec 26 2015 13:16
@ivankravets: Thank you very much! That is amazing!
Merry Christmas, Happy Holidays and happy coding ;-)
Helio Machado
@crushedice2000
Dec 26 2015 13:27
I'm expecting platformio/platformio#382 to solve!
I'll try to solve it, however I don't know how is formio structured :smile_cat:
Ivan Kravets
@ivankravets
Dec 26 2015 13:42
Please share in that issue which commands should be run and in which order. Then I'll try to make new build.
Helio Machado
@crushedice2000
Dec 26 2015 14:42
@ivankravets: Please check the issue.
Stavros Korokithakis
@skorokithakis
Dec 26 2015 18:15
@ivankravets that's great news! i love platformio
Ivan Kravets
@ivankravets
Dec 26 2015 18:16
@skorokithakis Thanks! Please test PlatformIO 2.7.0.dev0 http://docs.platformio.org/en/latest/installation.html#d-development-version
Stavros Korokithakis
@skorokithakis
Dec 26 2015 18:16
will do as soon as i finish this code!
Ivan Kravets
@ivankravets
Dec 26 2015 18:18
@crushedice2000 Thanks, I see it. Will try to implement uploading data to SPIFFS.
Stavros Korokithakis
@skorokithakis
Dec 26 2015 18:25
has anyone used an rfid sensor?
Markus
@Links2004
Dec 26 2015 18:25
Stavros Korokithakis
@skorokithakis
Dec 26 2015 18:26
oh, nice page
i bought one from dx.com but it reads cards constantly
which is fine
the problem is that every odd read fails
even if the card is near
Markus
@Links2004
Dec 26 2015 18:28
strange, how do you know that it fails?
Stavros Korokithakis
@skorokithakis
Dec 26 2015 18:28
mfrc522.PICC_IsNewCardPresent() returns false
so, when a card is near, it returns true, next read is false, next is true, next is false
if a card isn't near, they're all false
maybe because it's checking for a "new" card? hm
Markus
@Links2004
Dec 26 2015 18:30
I have no experiences with mfrc522,
you may shut read the datasheet for the chip.
Stavros Korokithakis
@skorokithakis
Dec 26 2015 18:30
i'll try to find it, thank you
Aditya Tannu
@AdySan
Dec 26 2015 18:50
Trying to make some battery powered ESP8266 sensors with deep sleep. There's a zillion 18650 batteries on AliExpress, anyone have anything good to say about a particular brand?
Stavros Korokithakis
@skorokithakis
Dec 26 2015 18:53
no, but you have to be careful because they put out 4.1v
Aditya Tannu
@AdySan
Dec 26 2015 18:54
yep, when fully charged
Stavros Korokithakis
@skorokithakis
Dec 26 2015 18:54
yep
other than that, i have some, but not nearly enough to recommend
Aditya Tannu
@AdySan
Dec 26 2015 18:55
from the reviews all look shitty, ~1000 mAH. They should be able to hold 3000-4000mAH just based on size.
btw, is the difference between ESP8266WiFiMulti and ESP8266WiFi documented somewhere, I'm noticing that some examples like HTTPClient only work with ESP8266WiFiMulti. Not sure why..
Stavros Korokithakis
@skorokithakis
Dec 26 2015 19:00
@AdySan i got some that claim they are 4700 mAh
Aditya Tannu
@AdySan
Dec 26 2015 19:01
@skorokithakis should try measuring them. Most AliExpress sellers claim 9800mAH, which is impossible in that size. And people in comments have measured them to be ~1000mAH. I would rather buy something more reliable at 2000-3000mAH.
Stavros Korokithakis
@skorokithakis
Dec 26 2015 19:01
yeah, wow
look at this:
Capacity: 3600mAh (actual 2200mAh)
like, how the fuck is that warranted :P
Aditya Tannu
@AdySan
Dec 26 2015 19:02
haha, its like music systems in old days, 4000W PMPO, 40W RMS
Stavros Korokithakis
@skorokithakis
Dec 26 2015 19:03
nah man, PMPO was at least some weird voodoo math, this is just lying
like, what is 4000 based on? lies :P
Markus
@Links2004
Dec 26 2015 19:25
@AdySan the ESP8266WiFiMulti is designed to manage multible SSIDs and ESP8266WiFi connect to only on AP.
they are interchangeable, you can use what fits your needs.
Aditya Tannu
@AdySan
Dec 26 2015 19:30
@Links2004 Thanks, will try again. so WiFi.waitForConnectResult() == WL_CONNECTED and WiFiMulti.run() == WL_CONNECTED are more or less the same checks?
Markus
@Links2004
Dec 26 2015 19:32
no, WiFi.waitForConnectResult waits,
WiFiMulti.run is more like WiFi.status
Stavros Korokithakis
@skorokithakis
Dec 26 2015 20:09
i have a byte array variable, how can i compare it to a hardcoded value?
Stavros Korokithakis
@skorokithakis
Dec 26 2015 20:11
hmm, how can i make a string out of my byte array to pass it in there?
Markus
@Links2004
Dec 26 2015 20:11
you not need a string.
Dmitry Kireev
@kireevco
Dec 26 2015 20:11
I have a question asked millions of times: what is the estimated # of reflashes for esp?
Stavros Korokithakis
@skorokithakis
Dec 26 2015 20:12
@Links2004 what do i need?
@kireevco i think i've heard values as low as 100 for defective units
Dmitry Kireev
@kireevco
Dec 26 2015 20:13
@skorokithakis what about normal units?
Stavros Korokithakis
@skorokithakis
Dec 26 2015 20:13
@kireevco i'm not sure, a few thousand?
Dmitry Kireev
@kireevco
Dec 26 2015 20:13
more like 3000 or 10 000?
Markus
@Links2004
Dec 26 2015 20:14
@kireevco its normal flash life time, typical around ~100K erases
Me No Dev
@me-no-dev
Dec 26 2015 20:14
most flashes are supposed to go beyond 100K
Markus
@Links2004
Dec 26 2015 20:14
@skorokithakis you can pass any ptr to the function.
Dmitry Kireev
@kireevco
Dec 26 2015 20:14
alright, thank you
Stavros Korokithakis
@skorokithakis
Dec 26 2015 20:15
does anyone know how i can compare a fixed array with memcmp?
Markus
@Links2004
Dec 26 2015 20:15
This message was deleted
Stavros Korokithakis
@skorokithakis
Dec 26 2015 20:16
great, thank you!
Markus
@Links2004
Dec 26 2015 20:16
hups..
want to edit it.
uint8_t buffer1[2] = {0x04, 0x12};
uint8_t buffer2[2] = {0x04, 0x12};

if(memcmp ( buffer1, buffer2, sizeof(buffer1) ) == 0) {
//its the same
}
Stavros Korokithakis
@skorokithakis
Dec 26 2015 20:19
fantastic, thanks
Steve Nelson
@zenmanenergy
Dec 26 2015 20:20
Is there a method in the websocket server to send a message to a single client? Or does the server have to broadcast to all clients?
Markus
@Links2004
Dec 26 2015 20:20
yes there is.
Steve Nelson
@zenmanenergy
Dec 26 2015 20:21
is uint8_t num the ID of the client?
Markus
@Links2004
Dec 26 2015 20:21
the first parameter is the "ID" of the client you want to send the message to
Steve Nelson
@zenmanenergy
Dec 26 2015 20:21
perfect.
when is that value set?
i see in the example for the server:
case WStype_CONNECTED:
            {
                IPAddress ip = webSocket.remoteIP(num);
                USE_SERIAL.printf("[%u] Connected from %d.%d.%d.%d url: %s\n", num, ip[0], ip[1], ip[2], ip[3], payload);
            }
Markus
@Links2004
Dec 26 2015 20:23
Steve Nelson
@zenmanenergy
Dec 26 2015 20:23
is that num in the printf() the first place.
ok. i think I’m getting it. thanks Links
Stavros Korokithakis
@skorokithakis
Dec 26 2015 20:30
hmm, i wrote this code: https://www.pastery.net/ywbktv/
well, i wrote the bottom code, but it's complaining about a type
would it be better to iterate on the twodimensional array above, or just cast the ones in the argument to byte?
Markus
@Links2004
Dec 26 2015 20:31
the argument has no type when you add the array direct.
Stavros Korokithakis
@skorokithakis
Dec 26 2015 20:31
yeah :/
and even if i cast it, it's complaining about taking the address of a temporary array
so i need to cast it as above
Markus
@Links2004
Dec 26 2015 20:32
a iterateion is better
Stavros Korokithakis
@skorokithakis
Dec 26 2015 20:32
but then i'm not sure how to iterate over them, i guess i need a pointer to the one i want?
    for (i = 0; i < 3, i++) {
        card = authorizedCards[i];
        (memcmp(mfrc522.uid.uidByte, card, sizeof(mfrc522.uid.uidByte) ) != 0)
    }
like that?
Markus
@Links2004
Dec 26 2015 20:34

#define CARD_COUNT (3)

uint8_t authorizedCards[CARD_COUNT ][4] = {
    {0x34, 0x38, 0xC9, 0xFC},
    {0x92, 0x3E, 0xE9, 0x75},
    {0x44, 0x54, 0xCE, 0xFC}
}

bool check_card(void) {

    for(uint8_t i = 0; i < CARD_COUNT; i++) {
        if(memcmp(mfrc522.uid.uidByte, authorizedCards[i], 4) == 0) {
            return true;
        }
    }
    return false;
}
Stavros Korokithakis
@skorokithakis
Dec 26 2015 20:35
oh right, i don't need a temporary var
thank you
brutzler
@brutzler
Dec 26 2015 21:15

Hi,
anybody succesfully used the "DallasTemperature.h"?
This Code makes me trouble:

#define myOWPin 0  // OW <-> D3 (GPIO0) One Wire für DS18B20
OneWire oneWire(myOWPin);
DallasTemperature sensors(&oneWire);
//Setup
  sensors.begin();  
//Loop
   sensors.requestTemperatures();

As soon as the sensors.request is called, I get a reboot.
Perhaps the GPIO0 is not the best solution, but its my last free PIN.

BRB
brutzler
@brutzler
Dec 26 2015 21:32
So do I.....
Helio Machado
@crushedice2000
Dec 26 2015 21:32
So do you... :smile:
brutzler
@brutzler
Dec 26 2015 21:33
@crushedice2000 : ???
Helio Machado
@crushedice2000
Dec 26 2015 21:33
@brutzler: What did you ask?
brutzler
@brutzler
Dec 26 2015 21:34
I answered Links2004, that I use the same library....
Mario Mikočević
@mozgy
Dec 26 2015 21:35
@brutzler I'm using DallasTemperature
works fine
Helio Machado
@crushedice2000
Dec 26 2015 21:35
@brutzler: Sorry, misinterpreted. That's the pity of not using English as mother tongue :-(
brutzler
@brutzler
Dec 26 2015 21:42
hmmm.. looks not far different
Besides the PIN. Maybe the GPIO0 (flash-pin) could cause this? I am using a NodeMCU.
Nope. Using GPIO1 its the same.
I get this:
Exception (9):
epc1=0x401014ed epc2=0x00000000 epc3=0x00000000 excvaddr=0xffffffff depc=0x00000000
ctx: sys 
sp: 3ffffd90 end: 3fffffb0 offset: 01a0
>>>stack>>>
3fffff30:  0021de21 3ffe9900 3ffefac8 60000600 
.......
But I can not "read" this....
Mario Mikočević
@mozgy
Dec 26 2015 21:47
do you have pullup resistor ? VCC is good one ?
Helio Machado
@crushedice2000
Dec 26 2015 21:47
@brutzler: This happens me when the PSU has a low voltage.
Mario Mikočević
@mozgy
Dec 26 2015 21:48
I had exception-9 when I forgot pullup resistor
brutzler
@brutzler
Dec 26 2015 21:50
upps ;-)
4k7 ok?
Will try. Never thought on voltage probs.
Mario Mikočević
@mozgy
Dec 26 2015 21:51
4k7 is fine
brutzler
@brutzler
Dec 26 2015 21:51
thx so far, testing soon
brutzler
@brutzler
Dec 26 2015 22:14
Not the solution.
I tried the "oneWireSearch"-example and it gets me an ID of one sensor back.
But this example is only with the OneWire-lib
Now trying the tester-example. This one uses oneWire.h and DallasTemperature.h
--> Its working.
Will have to look for my code a little bit more...
brutzler
@brutzler
Dec 26 2015 22:34
hmmm not trivial.... locating devices is working fine, but as soon as I call the "sensors.requestTemperatures()" I get the reboot
Mario Mikočević
@mozgy
Dec 26 2015 22:42
what type of dallas connection ?
parasite voltage or normal ?
Helio Machado
@crushedice2000
Dec 26 2015 22:43
nn
Mario Mikočević
@mozgy
Dec 26 2015 22:44
nn @crushedice2000
brutzler
@brutzler
Dec 26 2015 22:44
OK. my fault: called the sensors.request out of a ticker-event. And this was already working during the setup-routine.
Shame on me :-(
But the added resistor was shurely not wrong.
Thx for help.
That happens, when something is programed quick and dirty
Stavros Korokithakis
@skorokithakis
Dec 26 2015 23:24
all of a sudden, i'm getting an error while defining an enum: https://www.pastery.net/wzehfb/
Stavros Korokithakis
@skorokithakis
Dec 26 2015 23:32
apparently the enum can only have two values?
Stavros Korokithakis
@skorokithakis
Dec 26 2015 23:42
ah, looks like DISABLED is defined somewhere else