These are chat archives for esp8266/Arduino

29th
Jan 2016
Rocco Musolino
@roccomuso
Jan 29 2016 04:12
Hei guys, I wanna show you my last open source project, the hope is that someone can contribute improving the english on the README.md and why not, the code too ;) https://www.npmjs.com/package/iot-433mhz
Any feedback is appreciated ;)
Here the page on github: https://github.com/roccomuso/iot-433mhz
Aditya Tannu
@AdySan
Jan 29 2016 04:17
@Links2004 in your websockets library, any use adding delay(0) in my code anywhere? I get very stable performance on macbook, while on mac mini (same browser, different router) I get LmacRxBlk:1 often.
Ivan Grokhotkov
@igrr
Jan 29 2016 05:55
@Makuna delay(0) calls esp_schedule() and then esp_yield(). These are the same two calls that yield() does.
Naming might be a bit confusing, i guess.
esp_yield() is "switch from sketch context to scheduler context".
esp_schedule() is "make scheduler resume the sketch at next opportunity"
tzapu
@tzapu
Jan 29 2016 07:03
@AdySan there is smartconfig https://tzapu.com/esp8266-smart-config-esp-touch-arduino-ide/ but it s so unreliable (at least for me) that i can t say it s an option, last it tried anyway. there s also the way electric imp do it, if someone could build something like that... out of my depth
Markus
@Links2004
Jan 29 2016 10:10
@me-no-dev there is no issue, only the example code use a AVR timer and will not work like it is on the ESP ;)
@AdySan LmacRxBlk is Overflow in the phy part of the WiFi driver, but why is the big question.
are you able to sniff the WiFi with wireshark?
Me No Dev
@me-no-dev
Jan 29 2016 10:15
for all you ArduinoIDE users. Here is a tool to "decode" the Exception stack traces: https://github.com/me-no-dev/EspExceptionDecoder
Screen Shot 2016-01-28 at 11.29.34.png
@Links2004 will your thing work with my syma X8?
Markus
@Links2004
Jan 29 2016 10:18
there is support for the SYMAX5C1 protocol, not sure if the X8 use it too.
https://github.com/Links2004/nrf24_multipro/blob/library/examples/protocol_select_by_channel/protocol_list.md
Me No Dev
@me-no-dev
Jan 29 2016 10:18
it's different. they changed it for the X8
some new thing with sopposedly better hopping
acyually this is encouraging: Syma X5C-1 (not older X5C)
Stavros Korokithakis
@skorokithakis
Jan 29 2016 10:49
@me-no-dev whaaaaaaaat, you can decode traces?
can the tool be changed to support non-arduino users?
Me No Dev
@me-no-dev
Jan 29 2016 10:50
what should I make it with
Stavros Korokithakis
@skorokithakis
Jan 29 2016 10:50
just cli
Me No Dev
@me-no-dev
Jan 29 2016 10:50
the tool is nothing special
it uses addr2line to decode the 40X addresses
it just regexes the trace to extract the numbers and runs the command on the elf
Stavros Korokithakis
@skorokithakis
Jan 29 2016 10:51
oh right
well, when you don't know how, it's good to have :smile:
Me No Dev
@me-no-dev
Jan 29 2016 10:52
yup :) if you have a GUI framework in mind I can give it a go
and make it standalone
Helio Machado
@0x2b3bfa0
Jan 29 2016 10:52
@me-no-dev: Would be great to have in PlatformIO!
Or standalone.
Me No Dev
@me-no-dev
Jan 29 2016 10:54
platformio guys can implement it in Atom prolly
Stavros Korokithakis
@skorokithakis
Jan 29 2016 10:59
that's platformio ide
just platformio is cli
Stavros Korokithakis
@skorokithakis
Jan 29 2016 11:35
damnit
how do you flash the 0.9 nodemcu
i can't believe i didn't add headers farther inside so i could support other versions
what a dumb dumb
Tony Kambourakis
@tonykambo
Jan 29 2016 11:37
@skorokithakis i’ve been using the nodemcu 1.0 - has been nice and easy to program using arduino ide
Stavros Korokithakis
@skorokithakis
Jan 29 2016 11:37
@tonykambo yeah, same here, i just have these two left over and i used them in my design
i just can't remember how you flash them, you need to press a combination of buttons
Tony Kambourakis
@tonykambo
Jan 29 2016 11:39
Stavros Korokithakis
@skorokithakis
Jan 29 2016 11:40
ah, thanks
Mario Mikočević
@mozgy
Jan 29 2016 11:54
@skorokithakis you push 'flash' button on nodemcu 0.9, start IDE upload, when upload starts release button
Stavros Korokithakis
@skorokithakis
Jan 29 2016 11:54
@mozgy thanks, looks like my nodemcu is shot
Mario Mikočević
@mozgy
Jan 29 2016 11:54
interesting tho, it worked before w/o button intervention
Stavros Korokithakis
@skorokithakis
Jan 29 2016 11:55
@mozgy really? i never could get it to work
Mario Mikočević
@mozgy
Jan 29 2016 11:55
yep, before 2.0.0
nodemcu 1.0 works fine tho
Stavros Korokithakis
@skorokithakis
Jan 29 2016 11:56
yeah, all the others i have are fine
Mario Mikočević
@mozgy
Jan 29 2016 11:56
both amica and doit versions
Tony Kambourakis
@tonykambo
Jan 29 2016 11:56
@skorokithakis do you power the nodemcu 1.0 with 3.3V or 5V?
Stavros Korokithakis
@skorokithakis
Jan 29 2016 11:56
@tonykambo USB, so 5
Tony Kambourakis
@tonykambo
Jan 29 2016 11:57
i’ve tried with 3.3 direct to one of the 3V3 pins, seems to work OK though the writing on the LCD attached to one of the GPIOs using I2C is very dim when using 3V3
wasn’t sure whether these devkit devices were designed to only be powered by 5V
Stavros Korokithakis
@skorokithakis
Jan 29 2016 12:14
yeah, i think they are
powering with 3v3 should work fine, but your lcd needs 5v
Stavros Korokithakis
@skorokithakis
Jan 29 2016 12:23
aw maaaaaaaaan
i printed the damn PCB connected to the wrong pins!
Tony Kambourakis
@tonykambo
Jan 29 2016 12:23
yeah, bit confusing with the lcd - its components (eg 44780, 8574) state they can be powered with less than 5v - but the lcd states 5v (dfrobot 1602)
bidyutper
@bidyutper
Jan 29 2016 12:26
how to compile this code found on net

include <ESP8266WiFi.h>

include <WiFiClient.h>

include <ESP8266WebServer.h>

include <Ticker.h>

include <EEPROM.h>

include <WiFiUdp.h>

include "helpers.h"

include "global.h"

/
Include the HTML, STYLE and Script "Pages"
/

include "Page_Root.h"

include "Page_Admin.h"

include "Page_Script.js.h"

include "Page_Style.css.h"

include "Page_NTPsettings.h"

include "Page_Information.h"

include "Page_General.h"

include "PAGE_NetworkConfiguration.h"

include "example.h"

define ACCESS_POINT_NAME "ESP"

define ACCESS_POINT_PASSWORD "12345678"

define AdminTimeOut 180 // Defines the Time in Seconds, when the Admin-Mode will be diabled

void setup ( void ) {
EEPROM.begin(512);
Serial.begin(115200);
delay(500);
Serial.println("Starting ES8266");
if (!ReadConfig())
{
// DEFAULT CONFIG
config.ssid = "MYSSID";
config.password = "MYPASSWORD";
config.dhcp = true;
config.IP[0] = 192;config.IP1 = 168;config.IP2 = 1;config.IP3 = 100;
config.Netmask[0] = 255;config.Netmask1 = 255;config.Netmask2 = 255;config.Netmask3 = 0;
config.Gateway[0] = 192;config.Gateway1 = 168;config.Gateway2 = 1;config.Gateway3 = 1;
config.ntpServerName = "0.de.pool.ntp.org";
config.Update_Time_Via_NTP_Every = 0;
config.timezone = -10;
config.daylight = true;
config.DeviceName = "Not Named";
config.AutoTurnOff = false;
config.AutoTurnOn = false;
config.TurnOffHour = 0;
config.TurnOffMinute = 0;
config.TurnOnHour = 0;
config.TurnOnMinute = 0;
WriteConfig();
Serial.println("General config applied");
}

if (AdminEnabled)
{
    WiFi.mode(WIFI_AP_STA);
    WiFi.softAP( ACCESS_POINT_NAME , ACCESS_POINT_PASSWORD);
}
else
{
    WiFi.mode(WIFI_STA);
}

ConfigureWifi();


server.on ( "/", processExample  );
server.on ( "/admin/filldynamicdata", filldynamicdata );

server.on ( "/favicon.ico",   []() { Serial.println("favicon.ico"); server.send ( 200, "text/html", "" );   }  );


server.on ( "/admin.html", []() { Serial.println("admin.html"); server.send ( 200, "text/html", PAGE_AdminMainPage );   }  );
server.on ( "/config.html", send_network_configuration_html );
server.on ( "/info.html", []() { Serial.println("info.html"); server.send ( 200, "text/html", PAGE_Information );   }  );
server.on ( "/ntp.html", send_NTP_configuration_html  );
server.on ( "/general.html", send_general_html  );

// server.on ( "/example.html", { server.send ( 200, "text/html", PAGE_EXAMPLE ); } );
server.on ( "/style.css", { Serial.println("style.css"); server.send ( 200, "text/plain", PAGE_Style_css ); } );
server.on ( "/microajax.js", { Serial.println("microajax.js"); server.send ( 200, "text/plain", PAGE_microajax_js ); } );
server.on ( "/admin/values", send_network_configuration_values_html );
server.on ( "/admin/connectionstate", send_connection_state_values_html );
server.on ( "/admin/infovalues", send_information_values_html );
server.on ( "/admin/ntpvalues", send_NTP_configuration_values_html );
server.on ( "/admin/generalvalues", send_general_configuration_values_html);
server.on ( "/admin/devicename", send_devicename_value_html);

server.onNotFound ( []() { Serial.println("Page Not Found"); server.send ( 400, "text/html", "Page not Found" );   }  );
server.begin();
Serial.println( "HTTP server started" );
tkSecond.attach(1,Second_Tick);
UDPNTPClient.begin(2390);  // Port for NTP receive

}

void loop ( void ) {
if (AdminEnabled)
{
if (AdminTimeOutCounter > AdminTimeOut)
{
AdminEnabled = false;
Serial.println("Admin Mode disabled!");
WiFi.mode(WIFI_STA);
}
}
if (config.Update_Time_Via_NTP_Every > 0 )
{
if (cNTP_Update > 5 && firstStart)
{
NTPRefresh();
cNTP_Update =0;
firstStart = false;
}
else if ( cNTP_Update > (config.Update_Time_Via_NTP_Every * 60) )
{

        NTPRefresh();
        cNTP_Update =0;
    }
}

if(DateTime.minute != Minute_Old)
{
     Minute_Old = DateTime.minute;
     if (config.AutoTurnOn)
     {
         if (DateTime.hour == config.TurnOnHour && DateTime.minute == config.TurnOnMinute)
         {
              Serial.p
omg
Tony Kambourakis
@tonykambo
Jan 29 2016 12:30
@skorokithakis what is dirtypcbs.com like? happy with their pcbs?
Stavros Korokithakis
@skorokithakis
Jan 29 2016 12:30
very happy
they look great
zero complaints so far
Tony Kambourakis
@tonykambo
Jan 29 2016 12:31
haha - see their message on the order page? http://dirtypcbs.com/index.php
“A big nothing burger"
bidyutper
@bidyutper
Jan 29 2016 12:32
this one i got......fatal error: helpers.h: No such file or directory
sry guyz copy paste wont wrk..ths tme
Stavros Korokithakis
@skorokithakis
Jan 29 2016 12:35
@tonykambo haha, i hadn't seen that, no
funny
hmm, can i use D0 as input on a NodeMCU?
GPIO16
user/wake, it says
Tony Kambourakis
@tonykambo
Jan 29 2016 12:37
from the 1.0 devkit instructions (which I google translated from chinese) "GPIO16 not support interrupts, PWM, I2C and One-wire functions only as a general input / output port."
Stavros Korokithakis
@skorokithakis
Jan 29 2016 12:38
that's fine, but when i try to use it, it looks like the nodemcu doesn't boot
Tony Kambourakis
@tonykambo
Jan 29 2016 12:38
"If you need to use the hibernate feature, you need to be directly connected with the RST GPIO16. Users can connect the two pins on their own, or position welding 0 ohm resistor in the development board R3. Note that after use the hibernate feature, GPIO16 prohibited."
Stavros Korokithakis
@skorokithakis
Jan 29 2016 12:38
oh sorry
no, it's fine
hmm
Ivan Kravets
@ivankravets
Jan 29 2016 13:02
Stavros Korokithakis
@skorokithakis
Jan 29 2016 13:03
woooo
great job, @ivankravets
Tony Kambourakis
@tonykambo
Jan 29 2016 13:32
@ivankravets I tried to initialize a new project and received this error message: "PlaftormIO: Failed to initialize PlatformIO project!
Usage: platformio init [OPTIONS]
Error: Invalid value for "--ide": invalid choice: atom. (choose from clion, eclipse, emacs, qtcreator, sublimetext, visualstudio)"
Ivan Kravets
@ivankravets
Jan 29 2016 13:33
@tonykambo please platformio upgrade. Looks like you use very obsolete PlatformIO
@tonykambo what do you have platformio --version ?
@tonykambo do you have previously installed PlatformIO?
Tony Kambourakis
@tonykambo
Jan 29 2016 13:34
from a terminal it says PlatformIO, version 2.7.0 but when I select Upgrade PlatformIO from Atom menu it says "You’re upt—date! PlatformIO 2.8.0 is currently the newerst version available"
Ivan Kravets
@ivankravets
Jan 29 2016 13:36
ok, please go to terminal and pip uninstall platformio
@tonykambo which is your OS?
Tony Kambourakis
@tonykambo
Jan 29 2016 13:37
os x
Ivan Kravets
@ivankravets
Jan 29 2016 13:38
@tonykambo do you use the latest PlatformIO IDE 0.3.0 ? Menu: PlatofrmIO > Help > About
Tony Kambourakis
@tonykambo
Jan 29 2016 13:39
yes
I uninstalled platformio, then installed 2.8
Ivan Kravets
@ivankravets
Jan 29 2016 13:39
You don't need to install PlatformIO. It's built-in IDE
Tony Kambourakis
@tonykambo
Jan 29 2016 13:40
ok
Ivan Kravets
@ivankravets
Jan 29 2016 13:40
Use PlatformIO IDE Terminal for CLI operations
Tony Kambourakis
@tonykambo
Jan 29 2016 13:40
gotcha
Ivan Kravets
@ivankravets
Jan 29 2016 13:40
try to uninstall it from system
I'll work on this issue and try to reproduce it.
Tony Kambourakis
@tonykambo
Jan 29 2016 13:41
I added a project folder
and tthen tried to initialise project
now it says: "PlaftormIO: Failed to initialize PlatformIO project!
Error: [Sat Jan 30 00:40:48 2016] Processing nodemcu (platform: espressif, board: nodemcu, framework: arduino)
--------------------------------------------------------------------------------
Error: Nothing to build. Please put your source code files to '/Users/tonykambo/Documents/Development/Embedded/PlatformIO/IncubatorController/src' folder
========================= [ ERROR ] Took 0.22 seconds =========================
"
Ivan Kravets
@ivankravets
Jan 29 2016 13:42
Opsssss :((( It's my fault. I'm going to release PlatformIO 2.8.1. Sorry.
Tony Kambourakis
@tonykambo
Jan 29 2016 13:43
np
ystrem
@ystrem
Jan 29 2016 13:43
Hi, any news about Sming in Platformio ?
Ivan Kravets
@ivankravets
Jan 29 2016 13:51
@tonykambo please Menu: PlatformIO > Upgrade PlatformIO
Tony Kambourakis
@tonykambo
Jan 29 2016 13:53
that worked
thanks
Ivan Kravets
@ivankravets
Jan 29 2016 13:56
@ystrem I've opened this issue platformio/platformio#479 . PlatformIO 3.0 will allow developers to create own platform with boards, frameworks, build scripts and don't depend on PlatformIO Core
Tony Kambourakis
@tonykambo
Jan 29 2016 13:56
@ivankravets is there a tutorial on how I can take the arduino/libraries/project across to Atom?
for NodeMCU 1.0 that is
Ivan Kravets
@ivankravets
Jan 29 2016 13:56
@tonykambo does it work know with 2.8.1?
Tony Kambourakis
@tonykambo
Jan 29 2016 13:57
yes
Ivan Kravets
@ivankravets
Jan 29 2016 13:57
@tonykambo cool, sorry, it were hard days for us. A tone of updates to PlatformIO CLI and PlatformIO IDE
@tonykambo As for Arduino IDE -> PlatformIO IDE. Looks like need to write simple tutorial for that. What do you want "keep" from Arduino IDE in PlatformIO IDE?
Tony Kambourakis
@tonykambo
Jan 29 2016 13:59
I guess the libraries that were ported for esp8266
and my source code (-:
Ivan Kravets
@ivankravets
Jan 29 2016 13:59
You can use the same project for Arduino IDE and PlatformIO IDE
Add
[platformio]
src_dir = %NAME_OF_PROJECT%
lib_dir = %PATH_TO_ARDUINO_IDE_LIBS%

[envs:nodemcu]
Tony Kambourakis
@tonykambo
Jan 29 2016 14:02
right, thanks
Ivan Kravets
@ivankravets
Jan 29 2016 14:02
However, I recommend to use PlatformIO-based project structure to be compatible with the PlatformIO features
Also, PlatformIO has own Library Manager http://platformio.org/#!/lib
We are working on GUI within our IDE for that
@tonykambo please report here that it works for you. Thanks
Stavros Korokithakis
@skorokithakis
Jan 29 2016 15:22
@ivankravets i'd like to add a preprocessor flag, but not to platformio.ini, is that possible?
Ivan Kravets
@ivankravets
Jan 29 2016 15:26
@skorokithakis PLATFORMIO_BUILD_FLAGS system environment?
Aditya Tannu
@AdySan
Jan 29 2016 15:27
@Links2004 I'll put the project up on GitHub and sniff wifi with wore shark today. I'm doing websocket messages from browser to ESP in a ping pong fashion, so should be ok, but on this setup it does overflow.
Stavros Korokithakis
@skorokithakis
Jan 29 2016 15:27
@ivankravets that works, thanks!
Ivan Kravets
@ivankravets
Jan 29 2016 15:34
@skorokithakis Happy coding! :)
Stavros Korokithakis
@skorokithakis
Jan 29 2016 15:35
thank you! i wanted to publish some code to github but i didn't want to have my wifi password in it
i can just make a script to set PLATFORMIO_BUILD_FLAGS and not include that in the repo

@ivankravets would I do:

export PLATFORMIO_BUILD_FLAGS="-DWIFI_PASS=mypass"

?

Ivan Kravets
@ivankravets
Jan 29 2016 15:38
@skorokithakis looks like it should work
Stavros Korokithakis
@skorokithakis
Jan 29 2016 15:38
great, thank you
Stavros Korokithakis
@skorokithakis
Jan 29 2016 15:48
@ivankravets hmm, no, the command line looks like this: "-DWIFI_PASS=my pass"
and i get "'my' was not defined in this scope" when expanding
Stavros Korokithakis
@skorokithakis
Jan 29 2016 15:58
@ivankravets yeah, quotes aren't handled properly, it seems
they're just removed
Chris Elsworth
@celsworth
Jan 29 2016 16:02
escape them
export FOO="-DWIFI_PASS=\"something with spaces in\""
then in shell, echo $FOO should give you what is being passed to the compiler
Stavros Korokithakis
@skorokithakis
Jan 29 2016 16:03
@celsworth i did, line 2: unexpected EOF while looking for matching `''
which is very odd
besides, i'm using two kinds of quotes
Chris Elsworth
@celsworth
Jan 29 2016 16:04
two kinds of quotes?
Stavros Korokithakis
@skorokithakis
Jan 29 2016 16:04
export PLATFORMIO_SRC_BUILD_FLAGS='-DWIFI_PASS="my pass"'
@celsworth by the way, i made my first mistake on a pcb! yaay :P
Chris Elsworth
@celsworth
Jan 29 2016 16:05
aw, not too critical I hope
Stavros Korokithakis
@skorokithakis
Jan 29 2016 16:05
nah, it was okay, just wrong pin
i changed the software the leds don't work, but it's fine
i can run a wire on the next one
@celsworth have you migrated to kicad yet?
Chris Elsworth
@celsworth
Jan 29 2016 16:11
I've not designed another pcb in the last few weeks
maybe I should do something like my own breakout board to get used to it :)
Stavros Korokithakis
@skorokithakis
Jan 29 2016 16:15
yep
it's a good idea
Ivan Kravets
@ivankravets
Jan 29 2016 17:13
@skorokithakis have you resolved issue with PLATFORMIO_BUILD_FLAGS
Stavros Korokithakis
@skorokithakis
Jan 29 2016 17:28
@ivankravets no :/ it doesn't quote the strings
Markus
@Links2004
Jan 29 2016 17:37
@AdySan I have push a version of ws that uses async TCP, may it work better,
https://github.com/Links2004/arduinoWebSockets/tree/async#esp-async-tcp
but with sync i never get LmacRxBlk:1 in ping pong style since the system rate limit itself thanks to ping pong.
whit one direction its possible to overload the ESP but that is the case for all TCP applications on the ESP, whit async it much harder ;)
Aditya Tannu
@AdySan
Jan 29 2016 17:39
@Links2004 Cool! will give it a try today for sure. Maybe I'm doing something wrong.
d-anders
@d-anders
Jan 29 2016 17:42
i read something yesterday about waiting for ack before sending next package
i thought that sounded strange
Markus
@Links2004
Jan 29 2016 17:43
@d-anders this is how the sync TCP work in arduino :) the async do it better.
d-anders
@d-anders
Jan 29 2016 17:44
i thought fire away, set a timer and if no ack has been received in x ms act
not every platform send acks right away
Markus
@Links2004
Jan 29 2016 17:44
yes windows is a example, for small package it needs 200ms for some strange reason.
for big ones or when data flows from Windows to ESP too its less then 1ms.
d-anders
@d-anders
Jan 29 2016 17:46
yeah i think it is a "feature" rather than a bug
sending acks for every packet is stupid, especially for lots of small packages
on ethernet it may not matter that much but for largish wlans sending a lot of acks is not optimal
Markus
@Links2004
Jan 29 2016 17:48
the TCP protocol allow it, so its ok, but not good for the "arduino style" of handling data ;)
ESPAsyncTCP can handle it well, but no "arduino style"
d-anders
@d-anders
Jan 29 2016 17:49
ok
how fast can i expect the async webserver to serve a ~50kB page?
from spiffs
(running in ap mode)
Markus
@Links2004
Jan 29 2016 17:53

downloading a 310KB image from SPIFFS over the AsyncWebServer takes currently 550ms

~563,63KB/s --> ~80ms

d-anders
@d-anders
Jan 29 2016 17:55
nice
maybe i should switch to a nice jquery charting lib then
Me No Dev
@me-no-dev
Jan 29 2016 18:00
This message was deleted
This message was deleted
Chris Elsworth
@celsworth
Jan 29 2016 18:17
@me-no-dev did your SoftwareSerial changed from a while back get merged?
I'm still seeing open issues about the crashes
Stavros Korokithakis
@skorokithakis
Jan 29 2016 18:22
okay these AO3400 mosfets are fantastic, highly recommended
they saturate at 1.5V or so
Chris Elsworth
@celsworth
Jan 29 2016 18:23
easy to drive from a gpio direct then?
Me No Dev
@me-no-dev
Jan 29 2016 18:23
@celsworth nope. Maybe I'll sit down and finish it...
Stavros Korokithakis
@skorokithakis
Jan 29 2016 18:23
@celsworth yep, that's what i want them for
Chris Elsworth
@celsworth
Jan 29 2016 18:23
@me-no-dev oh I thought it was finished.. did you want to rewrite it not to use a timer at all or something?
Me No Dev
@me-no-dev
Jan 29 2016 18:24
i want to use timer0 for RX and timer1 for TX then also exclusive pin interrupt
Chris Elsworth
@celsworth
Jan 29 2016 18:24
ah yes full duplex, I remember
Me No Dev
@me-no-dev
Jan 29 2016 18:24
then it might go above 250Kbps
Stavros Korokithakis
@skorokithakis
Jan 29 2016 18:25
yay i made a wifi-enabled air freshner
i love these mosfets
Stavros Korokithakis
@skorokithakis
Jan 29 2016 18:29
oooh
that's nice, what does that do?
oh, breakout to a camera?
Mario Mikočević
@mozgy
Jan 29 2016 18:30
yep
Stavros Korokithakis
@skorokithakis
Jan 29 2016 18:30
wait, can you make wifi-enabled cameras with that?
Mario Mikočević
@mozgy
Jan 29 2016 18:30
yep
Stavros Korokithakis
@skorokithakis
Jan 29 2016 18:30
how much is the arducam?
Mario Mikočević
@mozgy
Jan 29 2016 18:30
a LOT
Stavros Korokithakis
@skorokithakis
Jan 29 2016 18:30
how lot a lot?
Mario Mikočević
@mozgy
Jan 29 2016 18:31
2Mpix one is $26
Stavros Korokithakis
@skorokithakis
Jan 29 2016 18:31
ouch
never mind :P
d-anders
@d-anders
Jan 29 2016 18:49
STP16NF06L is also a quite nice fet
not as cheap, but usually cheap enough on ali and can handle a few amps
d-anders
@d-anders
Jan 29 2016 19:32
hm, the irlz44 is now really cheap as well, and even better
Aditya Tannu
@AdySan
Jan 29 2016 20:04
@Links2004 Tried the async branch, same thing, Here's what happens, the socket disconnects for some reason after 30 seconds or so, the browser tries to reconnect, but the ESP thinks its a different client, these multiple reconnect requests, seem to cause a LmacRxBlk:1, heres the serial trace.
[0] Disconnected!
[1] Disconnected!
[1] Connected from 0.0.0.0 url: 
[2] Disconnected!
[2] Connected from 0.0.0.0 url: 
[3] Disconnected!
[3] Connected from 0.0.0.0 url: 
[0] Connected from 192.168.91.112 url: /
[0] Got message: ping
LmacRxBlk:1
LmacRxBlk:1
LmacRxBlk:1
[0] Disconnected!
[1] Disconnected!
[1] Connected from 0.0.0.0 url: 
[2] Disconnected!
[2] Connected from 0.0.0.0 url: 
[3] Disconnected!
[3] Connected from 0.0.0.0 url: 
[0] Connected from 192.168.91.112 url: /
[0] Got message: ping
that connected from 0.0.0.0 seems fishy
Markus
@Links2004
Jan 29 2016 20:06
yes 0.0.0.0 is strange. since the IP comes from the socket.
Aditya Tannu
@AdySan
Jan 29 2016 20:06
here's the reconnect request
in the JS file
Markus
@Links2004
Jan 29 2016 20:11
the JS looks good, may add a delay (setTimeout) between websocket.close(); and the reconnet
but I see no reason for a 0.0.0.0
d-anders
@d-anders
Jan 29 2016 20:12
it's strange that it disc at all though
Aditya Tannu
@AdySan
Jan 29 2016 20:13
seems to happen periodically
d-anders
@d-anders
Jan 29 2016 20:13
i cant recall that ever happening
Aditya Tannu
@AdySan
Jan 29 2016 20:13
30 sec to 1 minute
d-anders
@d-anders
Jan 29 2016 20:13
is it idle or sending periodically?
Aditya Tannu
@AdySan
Jan 29 2016 20:14
sending periodically
theres always something going back and forth
Markus
@Links2004
Jan 29 2016 20:15
@AdySan you can try WiFi.setSleepMode(WIFI_NONE_SLEEP);
Aditya Tannu
@AdySan
Jan 29 2016 20:15
and where would that go? in the loop or setup
Markus
@Links2004
Jan 29 2016 20:16
setup
Aditya Tannu
@AdySan
Jan 29 2016 20:18
delay seems to make it worse
will change the sleep mode
@Links2004 thanks, the setSleepMode seems to be the solution, going strong for a few minutes now, no disconnects!
d-anders
@d-anders
Jan 29 2016 20:24
maybe then changing your dtim would fix the prbolem w/o disabling sleep
Aditya Tannu
@AdySan
Jan 29 2016 20:25
sorry, no idea what that is
FWeinb
@FWeinb
Jan 29 2016 20:25
A Little off topic. Can I control the output current of
d-anders
@d-anders
Jan 29 2016 20:25
im just guessing, but your esp8266 may be kicked by your wlan router
FWeinb
@FWeinb
Jan 29 2016 20:25
gpio of an raspberry
Aditya Tannu
@AdySan
Jan 29 2016 20:25
PWM?
@d-anders ok, will see if there's any such setting on the router
at home its an Apple Airport, unlikely
FWeinb
@FWeinb
Jan 29 2016 20:26
yeah PWM would be my solution too but thought there is something not timing dependent.
d-anders
@d-anders
Jan 29 2016 20:26
dtim settings controls how long a device can sleep w/o responding to the router and still not lose connection
Markus
@Links2004
Jan 29 2016 20:26
PWM is no current control
PWM switch between max current an 0 so its not limiting
Aditya Tannu
@AdySan
Jan 29 2016 20:27
but isnt that how you effectively limit the current, like say motor speed control
on average there is less current drawn
Markus
@Links2004
Jan 29 2016 20:28
yes on average, but max current can by over the max for the GPIO and that will kill it.
Aditya Tannu
@AdySan
Jan 29 2016 20:28
@FWeinb is there hardware controlled PWM in RPi GPIO?
yeah thats right
d-anders
@d-anders
Jan 29 2016 20:30
get a logic level mosfet hook up the load and power source and pwm the gate
d-anders
@d-anders
Jan 29 2016 20:36
what is it you are trying to do?
FWeinb
@FWeinb
Jan 29 2016 20:49
I want to control the voltage on a gpio.
It is to control a laser diode.
Aditya Tannu
@AdySan
Jan 29 2016 20:50
you sure the GPIO can handle that current?
Martin Ayotte
@martinayotte
Jan 29 2016 20:51
GPIOs on ESP can outstand up to 12mA
Aditya Tannu
@AdySan
Jan 29 2016 20:51
do you need a constant voltage? i mean will a resistor divider do?
he's using an RPi
FWeinb
@FWeinb
Jan 29 2016 20:53
There is a Diode driver in between. I just need to control the intensity of the laser based on a reference voltage.
d-anders
@d-anders
Jan 29 2016 20:53
oh
pwm + low pass filter then is my guess
if the ref needs to be reasonably stable
it probably doesnt load the output at all, so my guess is a simple rc filter will do
FWeinb
@FWeinb
Jan 29 2016 21:00
That sounds good.
d-anders
@d-anders
Jan 29 2016 21:00
google pwm low pass arduino
the arduino keyword is to make sure to find easy to understand info :)
always works
FWeinb
@FWeinb
Jan 29 2016 21:02
Thanks. will check that out.
If I understand this correct the low pass filter is used to make output more stable. right?
d-anders
@d-anders
Jan 29 2016 21:06
yes
without it your output will look something like a square wave
and your led driver maybe (likely) doesnt accept that as ref
FWeinb
@FWeinb
Jan 29 2016 21:08
Thanks. That should work great than.
d-anders
@d-anders
Jan 29 2016 21:09
hopefully it is easy to try, just a cap and a resistor
FWeinb
@FWeinb
Jan 29 2016 21:09
Thanks. Will try.