These are chat archives for esp8266/Arduino

13th
Mar 2016
Lars Englund
@larsenglund
Mar 13 2016 13:58
Is there any arduino library that deals with the esp8266 mesh implementation? (http://espressif.com/sites/default/files/documentation/30a-esp8266_mesh_user_guide_en_v1.2.pdf)
brutzler
@brutzler
Mar 13 2016 14:47
Hi, just struggling with my DHT22.
Thought I had one running last year, but today I do not get it working.
Checked wiring twice. Seems OK.
Using adafruit lib. PIN is GPIO0. Is this pin not usable for the DHT?
Always get theese values back...
Humidity: 6553.50 % Temperature: -3276.70 *C
brutzler
@brutzler
Mar 13 2016 15:00
yippiee working now.
tried this lib: https://github.com/adafruit/DHT-sensor-library
looks like I somehow got the wrong one before
brutzler
@brutzler
Mar 13 2016 18:54
Hi,
because of less time, I didn't follow the newest scopes of the IDE in the last weeks.
Is there any possibility to make a "safe" webserver?
I want to bring my little webserver online, and therefore some secure mechanism should be implemented.
The only thing I do now, is to make a little password query at an index-page, and then redirecting to the mainpage.
Ivan Grokhotkov
@igrr
Mar 13 2016 18:59
ESP8266WebServer library has a "SimpleAuthentication" sample
I think that could be a good start
You can also take a look at this comment which mentions using Authorization HTTP header to implement HTTP Basic auth
(just keep in mind that the header is not Authenticationbut Authorization)
brutzler
@brutzler
Mar 13 2016 19:13
@igrr : thx. will give it a try. What release do I need for this? Actually I am working with Ardu-IDE 1.6.5 & esp8266 rel. 2.0.0
Ivan Grokhotkov
@igrr
Mar 13 2016 19:14
I think we had this in 2.0.0
brutzler
@brutzler
Mar 13 2016 19:14
Just did a look on the example. But imho this is not far different from my way!?

I send this page for authorization:

const char html_login[] PROGMEM = R"---(
<form name="login" action="password" method="get" accept-charset="utf-8">
    <ul>
        <li>
        <label for="password">Password</label>
        <input type="password" name="password" placeholder="password" required>
        </li>
        <li>
        <input type="submit" value="Login">
        </li>
    </ul>
</form>
)---";

And then serve the main page, if user/password is matching

Ivan Grokhotkov
@igrr
Mar 13 2016 19:16
That's why i suggest using HTTP basic auth: get Authorization header which the browser supplies along with the request
See code sample from issue #1035 linked above
bobcroft
@bobcroft
Mar 13 2016 19:18
@5LICK
There is also a 'library' called jeelabs/esp-link that can be used to communicate between the ESP and Arduinos. There is a gitter room for esp/link. as Martinayotte says there is much you can do directly with the ESP and I have an ESP-03 running a BH1750 light sensor, a DHT22, a DS18B20 and an OLED display. The display and light sensor are I2C devices and so are on the same bus but with different addresses.
Even an ESP-12 struggles when you need a lot of pins like, for example, what an Arduino Mega linked to an ESP could provide. The jeelabs esp/link is a serial ink between the two devices.
brutzler
@brutzler
Mar 13 2016 19:21
@igrr : ok will take a closer look to this auth-header...
Martin Ayotte
@martinayotte
Mar 13 2016 19:23
@brutzler , Basic Auth is the simplest thing to do. If you create you own page with login, it can be bypassed except if you provide some session cookies, which needs even more code ...
brutzler
@brutzler
Mar 13 2016 19:28

@martinayotte: how should it be bypassed? I only send the "right" page if pw is matching.

  server.on("/", handleRoot);
  server.on("/main", handleMain);

The first one sends the page from above (5 posts ago) and the second is blocked on not matching pw.

Martin Ayotte
@martinayotte
Mar 13 2016 19:38
But do you ask password to any of the pages ? That will be painful ... Except if you manage sessions with timeout.
Ivan Grokhotkov
@igrr
Mar 13 2016 21:29
Would be awesome if someone could test this: esp8266/Arduino#1768