These are chat archives for esp8266/Arduino

30th
Jan 2016
Aditya Tannu
@AdySan
Jan 30 2016 01:28
@tzapu thanks, I didn't know this smart config existed for ESP8266.
Aditya Tannu
@AdySan
Jan 30 2016 01:36
Anyone good at iOS dev here? Looks like you just need to send UDP packets to the ESP https://github.com/youngBuger/esp8266-smartconfig/blob/master/smartconfig/src/com/example/smartconfig/UdpThread.java
Seems there is no generic iOS app around though
FWeinb
@FWeinb
Jan 30 2016 12:01
To revisit my question from yesterday. PWM on the Raspberry isn't very stable. The main goal is to create two distinct voltages as a reverence. I think this could be done with a simple binary weighted DAC like this
d-anders
@d-anders
Jan 30 2016 12:07
pwm + low pass want good enough?
maybe change the values of your lowpass
FWeinb
@FWeinb
Jan 30 2016 12:08
The Problem is that the raspberry is used for some CPU intensive tasks and that screws with the PWM timings...
d-anders
@d-anders
Jan 30 2016 12:08
oh
maybe that dac will work, not sure how sensitive i2c is
FWeinb
@FWeinb
Jan 30 2016 12:10
Quite a bit too. I think that a binary weighted dac would be the best solution here.
d-anders
@d-anders
Jan 30 2016 12:16
yeah, or maybe even just a few resistors to make a ladder
if you have a few i/o you dont use i guess it will work fine
FWeinb
@FWeinb
Jan 30 2016 12:16
Yeah GPIOs are not the problem in this case.
But I only need two distinct voltages. (three when you include 0V)
d-anders
@d-anders
Jan 30 2016 12:17
ok, i guess for resistors will do then
FWeinb
@FWeinb
Jan 30 2016 12:20
That looks very simple. Awesome. Thanks!
d-anders
@d-anders
Jan 30 2016 12:22
yeah, in the eighties those were quite popular hacks to use as pc "soundcards" :)
Tony Kambourakis
@tonykambo
Jan 30 2016 12:23
@ivankravets hi, tried compiling my esp8266 arduino code in new platformio ide. Now gives me a few build errors:
In file included from /Users/tonykambo/.platformio/packages/framework-arduinoespressif/tools/sdk/include/os_type.h:10:0,
from /Users/tonykambo/.platformio/packages/framework-arduinoespressif/tools/sdk/include/user_interface.h:9,
from src/incubator.cpp:9:
/Users/tonykambo/.platformio/packages/framework-arduinoespressif/tools/sdk/include/ets_sys.h:148:20: error: 'size_t' was not declared in this scope
Nelio Santos
@nsfilho
Jan 30 2016 12:24
Hello for all!! :) Are anyone here using ESP-01 to read DHT11? -- How many times are getting errors in read?
Ivan Kravets
@ivankravets
Jan 30 2016 12:25
@tonykambo hi, could you provide platformio.ini and source code which reproduces it?
Tony Kambourakis
@tonykambo
Jan 30 2016 12:27
platformio.ini =
[env:nodemcu]
platform = espressif
framework = arduino
board = nodemcu
the error isn’t actually in my source code, it is point to ets_sys.h
/Users/tonykambo/.platformio/packages/framework-arduinoespressif/tools/sdk/include/ets_sys.h:148:20: error: 'size_t' was not declared in this scope
so full error is:
In file included from /Users/tonykambo/.platformio/packages/framework-arduinoespressif/tools/sdk/include/os_type.h:10:0,
from /Users/tonykambo/.platformio/packages/framework-arduinoespressif/tools/sdk/include/user_interface.h:9,
from src/incubator.cpp:9:
/Users/tonykambo/.platformio/packages/framework-arduinoespressif/tools/sdk/include/ets_sys.h:148:20: error: 'size_t' was not declared in this scope
These are the references in my code:
This message was deleted
Nelio Santos
@nsfilho
Jan 30 2016 12:29
@tonykambo if you are using some "includes" in your code (as WString.h) could produce that kind of error
what includes have in your code?
Tony Kambourakis
@tonykambo
Jan 30 2016 12:30
i pasted above
sorry, didn’t enclose it in code markup
Ivan Kravets
@ivankravets
Jan 30 2016 12:31
use ```
Tony Kambourakis
@tonykambo
Jan 30 2016 12:31
extern "C" {
  #include "user_interface.h"
//  #include "Esp.h"
 // #include "gpio.h"
}

#include <ESP8266WiFi.h>
#include <PubSubClient.h> // https://github.com/knolleary/pubsubclient/releases/tag/v2.3
#include <Wire.h>
#include <LiquidCrystal_I2C.h>
#include "DHT.h"
#include "SensitiveConfig.h"
#include <Time.h>
Ivan Kravets
@ivankravets
Jan 30 2016 12:31
please code between
code
Nelio Santos
@nsfilho
Jan 30 2016 12:32
try use a more simple code to compile, as a led blink in ESP,.... this could help you to identify if the problem is in the platform or in your code
because I have experienced something like that a long time ago (more 6 months), when I use some includes (trying to get a compatible version of libraries with Arduino)....
Ivan Kravets
@ivankravets
Jan 30 2016 12:35
@tonykambo please open an issue here https://github.com/platformio/platformio-atom-ide/issues . I'll look on it later
Nelio Santos
@nsfilho
Jan 30 2016 12:35
@tonykambo another example is: if you try to include <Arduino.h> using ESP8266WiFi.h> -- you get exactly this kind of error...
@tonykambo try compile blink led to validate :)
Tony Kambourakis
@tonykambo
Jan 30 2016 12:38
well I put in this code
void setup() {
  pinMode(BUILTIN_LED, OUTPUT);     // Initialize the BUILTIN_LED pin as an output
}

// the loop function runs over and over again forever
void loop() {
  digitalWrite(BUILTIN_LED, LOW);   // Turn the LED on (Note that LOW is the voltage level
                                    // but actually the LED is on; this is because 
                                    // it is acive low on the ESP-01)
  delay(500);                      // Wait for a second
  digitalWrite(BUILTIN_LED, HIGH);  // Turn the LED off by making the voltage HIGH
  delay(500);                      // Wait for two seconds (to demonstrate the active low LED)
}
and get build errors
src/incubator.cpp: In function 'void setup()':
src/incubator.cpp:2:14: error: 'OUTPUT' was not declared in this scope
pinMode(1, OUTPUT);     // Initialize the BUILTIN_LED pin as an output
^
src/incubator.cpp:2:20: error: 'pinMode' was not declared in this scope
pinMode(1, OUTPUT);     // Initialize the BUILTIN_LED pin as an output
^
src/incubator.cpp: In function 'void loop()':
src/incubator.cpp:7:19: error: 'LOW' was not declared in this scope
digitalWrite(1, LOW);   // Turn the LED on (Note that LOW is the voltage level
whereas that works fine in arduino ide
@nsfilho I didn’t have Ardunio.h but I did have ESP8266WiFi.h
Nelio Santos
@nsfilho
Jan 30 2016 12:40
@tonykambo I use platformio (with Atom) in a large project of automation (in my house) — this is my platformio.ini
[env:esp01]
platform = espressif
framework = arduino
board = esp01
src_filter = +<> -<.git/> -<svn/> -<examples/> -<template*>
Tony Kambourakis
@tonykambo
Jan 30 2016 12:42
mine is similar
[env:nodemcu]
platform = espressif
framework = arduino
board = nodemcu
I’m using NodeMCU DevKit 1.0
Nelio Santos
@nsfilho
Jan 30 2016 12:44
I’ll create a simple project as your to test… a second….
@tonykambo what is the extension of your file (blink test)??
Tony Kambourakis
@tonykambo
Jan 30 2016 12:48
@nsfilho you’re onto something. A friend just recommended changing it from .cpp to .ino and it removed all but one error
last build error is:
incubator.ino: In function 'void init_wifi()':
incubator.ino:78:30: error: cannot convert 'String' to 'const char*' for argument '1' to 'int strcmp(const char*, const char*)'
scons: *** [.pioenvs/nodemcu/src/tmp_ino_to.o] Error 1
Nelio Santos
@nsfilho
Jan 30 2016 12:49
exactly :) — and this other error is simple
you need convert String to char * — do that as <variable>.c_str()
Tony Kambourakis
@tonykambo
Jan 30 2016 12:52
this is the line:
  if (strcmp (WiFi.SSID(), ssid) != 0) {
Nelio Santos
@nsfilho
Jan 30 2016 12:52
use: ssid.c_str()
Tony Kambourakis
@tonykambo
Jan 30 2016 12:56
nice. Changed it to this and it now builds!
  if (strcmp (WiFi.SSID().c_str(), ssid) != 0) {
thank you, @nsfilho !
Nelio Santos
@nsfilho
Jan 30 2016 12:58
@tonykambo wellcome!! :)
Chris Elsworth
@celsworth
Jan 30 2016 13:27
#include <Arduino.h> would probably also work as well as renaming to .ino I think
should certainly be able to compile as .cpp in platformio, all my projects do
Martin Ayotte
@martinayotte
Jan 30 2016 13:49
@FWeinb and @d-anders , although I2C can have some jitters on RPi, the I2C won't suffer about it since it synchronous by the clock.
Tony Kambourakis
@tonykambo
Jan 30 2016 13:51
Thanks, @celsworth. Will try that
FWeinb
@FWeinb
Jan 30 2016 13:52
@martinayotte Thanks. Will try that when the ladder isn't enough.
Martin Ayotte
@martinayotte
Jan 30 2016 13:56
You will get issue with ladder too if you turn on/off one gpio at a time, you will need to switch them all of them in one call.
Ivan Kravets
@ivankravets
Jan 30 2016 16:02
Guys, have you resolved all issues with PlatformIO IDE and Linter? @tonykambo ?
I'll add new section to the docs "IDE > PlatformIO IDE for Atom > Migrating from Arduino IDE"
Ivan Kravets
@ivankravets
Jan 30 2016 17:20
PlatformIO IDE users, I've just improved integration between PlatformIO Builder and PlatformIO IDE Linter. This should resolve the all issues with the Linter. It has the same behaviour as PlatformIO Builder now.
You can switch to the development version of PlatformIO directly from PlatformIO IDE. Click on "Settings" button (gear) and Packages > platformio-ide > settings > Use development version of PlatformIO (please wait while dev will be installed).
Aditya Tannu
@AdySan
Jan 30 2016 17:41
@Links2004 @d-anders strange that it worked fine on some random router outside home after disabling wifi sleep, at home using AirPort Extreme and Chrome, same disconnect happens
[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.1.10 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:
Markus
@Links2004
Jan 30 2016 17:48
@AdySan are you able to sniff the WiFi?
Aditya Tannu
@AdySan
Jan 30 2016 17:49
@Links2004 @d-anders Here's the sketch https://github.com/AdySan/WittyCloudTest/tree/master/WittyCloudTest Yes, will do that next.
Mario Mikočević
@mozgy
Jan 30 2016 17:49
hmm, 1.5.2 :)
Aditya Tannu
@AdySan
Jan 30 2016 17:50
yep, this morning
well thats relative
Markus
@Links2004
Jan 30 2016 17:50
what happens when you disable all mdns stuff like OTA?
Mario Mikočević
@mozgy
Jan 30 2016 17:51
Added APIs:

    SDIO slave APIs
Aditya Tannu
@AdySan
Jan 30 2016 17:51
will try, mdns is very strange btw, access via browser works but the websocket wont connect. have to do this var wsUri = "ws://192.168.1.185:81/"
you suspect the webserver, websocket server and ArduinoOTA mgiht interfere with each other somehow?
Markus
@Links2004
Jan 30 2016 17:53
no mdns is used for apple bonjour since your router is apple may it does strange thinks
its only a guess, have only bad experiences with apple products.
Aditya Tannu
@AdySan
Jan 30 2016 17:55
hmm, mdns works fine at times, if I move around the mdns(begin) statement
for WireShark you recommend I filter the computer and ESP ip only?
Markus
@Links2004
Jan 30 2016 17:56
you need to sniff all WiFi packages that goes to the ESP,
so ESP ip + broadcast + multicast
Aditya Tannu
@AdySan
Jan 30 2016 17:56
ok thanks
Markus
@Links2004
Jan 30 2016 17:57
and WireShark need to sniff at WiFi low level (monitor mode)
or you will only see the packages that for or from your computer
Aditya Tannu
@AdySan
Jan 30 2016 17:58
I'm new to wireshark, might take a while, I'll report back when I have meaningful results, thanks for the continued help!
Mario Mikočević
@mozgy
Jan 30 2016 19:41
I've got SPI1 interface Error!, anyone have a clue what I've done wrong ?
Markus
@Links2004
Jan 30 2016 20:03
when by booting?
if so check your flash chip
Mario Mikočević
@mozgy
Jan 30 2016 20:15
no, on SPI.begin()
Mario Mikočević
@mozgy
Jan 30 2016 20:29
I can flash simple I2C sketches just not SPI ones (and they work) .. I must've b0rken some soldering ..
Aditya Tannu
@AdySan
Jan 30 2016 22:13
trying to setup wireshark, but man this is confusing