- Posts: 46
- Karma: 1
- Thank you received: 7
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
VasilijHCN wrote: U can programm esp8266 directly in arduino ide !!!
Link is on the russian.
(download & explanation bellow)
If someone is intesrested, i can translate most important parts to english.
esp8266.ru/arduino-ide-esp8266/#more-851
This give us possibility to create only esp8266 nodes.(need to change original admin code for arduino mini to work on esp8266 only)
In english
sermus.github.io/ESP8266_ArduinoIDE/
Please Log in or Create an account to join the conversation.
/*
V1.0 - first version
Created by Igor Jarc <igor.jarc1@gmail.com>
See http://iot-playground.com for details
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
version 2 as published by the Free Software Foundation.
*/
#include <Esp8266EasyIoT.h>
//#include <SoftwareSerial.h>
#include <OneWire.h>
#include <DallasTemperature.h>
#define CHILD_ID_TEMP 1
#define ONE_WIRE_BUS 2
OneWire oneWire(ONE_WIRE_BUS);
DallasTemperature sensors(&oneWire);
Esp8266EasyIoT esp;
//SoftwareSerial serialEsp(10, 11);
float lastTemp;
//Esp8266EasyIoTMsg msgHum(CHILD_ID_HUM, V_HUM);
Esp8266EasyIoTMsg msgTemp(CHILD_ID_TEMP, V_TEMP);
void setup()
{
// serialEsp.begin(9600);
Serial.begin(115200);
sensors.begin();
Serial.println("EasyIoTEsp init");
esp.begin(NULL, 3, &Serial);
//esp.begin(NULL, &serialEsp);
pinMode(13, OUTPUT);
// Serial.println("present S_TEMP");
esp.present(CHILD_ID_TEMP, S_TEMP);
}
void loop()
{
while(!esp.process());
delay(1000);
while(!esp.process());
sensors.requestTemperatures();
float temperature = (sensors.getTempCByIndex(0));
if (isnan(temperature)) {
Serial.println("Failed reading temperature from DS18B20");
}
else if (temperature != lastTemp)
{
lastTemp = temperature;
esp.send(msgTemp.set(temperature, 1));
Serial.print("T: ");
Serial.println(temperature);
}
}
Please Log in or Create an account to join the conversation.
VasilijHCN wrote: Now easy iot compiles with errors.
IDE errorC:\Users\IOT\Desktop\arduino-1.6.1\libraries\Esp8266EasyIoT\EEPROM.cpp:26:21: fatal error: c_types.h: No such file or directory
#include "c_types.h"
^
compilation terminated.
Error compiling.
When try compile this (code compiles in standart arduino ide)
esp8266 ds18b20 arduino mini code/* V1.0 - first version Created by Igor Jarc <igor.jarc1@gmail.com> See http://iot-playground.com for details This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. */ #include <Esp8266EasyIoT.h> //#include <SoftwareSerial.h> #include <OneWire.h> #include <DallasTemperature.h> #define CHILD_ID_TEMP 1 #define ONE_WIRE_BUS 2 OneWire oneWire(ONE_WIRE_BUS); DallasTemperature sensors(&oneWire); Esp8266EasyIoT esp; //SoftwareSerial serialEsp(10, 11); float lastTemp; //Esp8266EasyIoTMsg msgHum(CHILD_ID_HUM, V_HUM); Esp8266EasyIoTMsg msgTemp(CHILD_ID_TEMP, V_TEMP); void setup() { // serialEsp.begin(9600); Serial.begin(115200); sensors.begin(); Serial.println("EasyIoTEsp init"); esp.begin(NULL, 3, &Serial); //esp.begin(NULL, &serialEsp); pinMode(13, OUTPUT); // Serial.println("present S_TEMP"); esp.present(CHILD_ID_TEMP, S_TEMP); } void loop() { while(!esp.process()); delay(1000); while(!esp.process()); sensors.requestTemperatures(); float temperature = (sensors.getTempCByIndex(0)); if (isnan(temperature)) { Serial.println("Failed reading temperature from DS18B20"); } else if (temperature != lastTemp) { lastTemp = temperature; esp.send(msgTemp.set(temperature, 1)); Serial.print("T: "); Serial.println(temperature); } }
Please Log in or Create an account to join the conversation.