These are chat archives for esp8266/Arduino

22nd
Dec 2015
Oleg
@5LICK
Dec 22 2015 11:07 UTC
hi, what to chose for esp8266 - arduino nano or arduino pro mini/micro?
Chris Elsworth
@celsworth
Dec 22 2015 11:07 UTC
why do you need an arduino? :(
I would choose neither and use the esp itself :D
Sven Eliasson
@comino
Dec 22 2015 11:07 UTC
Jedi waving hand - you dont need an arduino
Oleg
@5LICK
Dec 22 2015 11:07 UTC
)))
with arduino its better
Helio Machado
@0x2b3bfa0
Dec 22 2015 11:08 UTC
@5LICK: Why?
Oleg
@5LICK
Dec 22 2015 11:08 UTC
but i can connect to arduino any sensors
Chris Elsworth
@celsworth
Dec 22 2015 11:08 UTC
you can connect to esp any sensors
Oleg
@5LICK
Dec 22 2015 11:08 UTC
hmm
Chris Elsworth
@celsworth
Dec 22 2015 11:09 UTC
this entire gitter channel is about making the esp act just like the arduino you're trying to attach to it ;)
Helio Machado
@0x2b3bfa0
Dec 22 2015 11:09 UTC
@5LICK: What sensor, what protocol?
Sven Eliasson
@comino
Dec 22 2015 11:09 UTC
Asking this question here is like asking a vegan which meat is better. The whole project here is about replacing the arduino with an esp ;)
Chris Elsworth
@celsworth
Dec 22 2015 11:09 UTC
yes how did you even find us :D
Helio Machado
@0x2b3bfa0
Dec 22 2015 11:10 UTC
@comino https://cdn01.gitter.im/_s/75cadb0/images/emoji/wink.png
Oleg
@5LICK
Dec 22 2015 11:11 UTC
i need send commands from my controller to mqtt
Oleg
@5LICK
Dec 22 2015 11:12 UTC
its cool, thanks
Sven Eliasson
@comino
Dec 22 2015 11:13 UTC
Works fine for me so far. So if its realy just attaching a sensor and sending its data via mqtt - esp can do that without any additional hardware ( a sensor of course ;) )
Oleg
@5LICK
Dec 22 2015 11:16 UTC
and for using this pubsubclient library, i need to use Arduino IDE?
Sven Eliasson
@comino
Dec 22 2015 11:18 UTC
not nessesary
you can, and its maybe the quickest approach ;)
Oleg
@5LICK
Dec 22 2015 11:20 UTC
for connect espp8266 to pc, i need usb converter?
Sven Eliasson
@comino
Dec 22 2015 11:20 UTC
depends on your board - what board do you have?
e.g. nodemcu already has a usb-serial on board
my board
Sven Eliasson
@comino
Dec 22 2015 11:21 UTC
yep you need a USb-to-serial adapter
Oleg
@5LICK
Dec 22 2015 11:21 UTC
ok, thanks
Sven Eliasson
@comino
Dec 22 2015 11:26 UTC
welcome :)
Mario Mikočević
@mozgy
Dec 22 2015 12:20 UTC
beikeland
@beikeland
Dec 22 2015 12:24 UTC
@5LICK the important part is that it needs to be a 3.3V usb converter if that isn't clear
Helio Machado
@0x2b3bfa0
Dec 22 2015 12:26 UTC
@mozgy: € 0,55 piece on Ali.
@beikeland: I'm using mine at 5V to flash the sketch, because the 3V3 part of my adapter only has a few mA. And the ESP is alive ;-)
Chris Elsworth
@celsworth
Dec 22 2015 12:28 UTC
brave :)
none of my 8266's know what 5v looks like and they never will ;)
beikeland
@beikeland
Dec 22 2015 12:30 UTC
@crushedice2000 the uart ttl level might be 3.3v even if the Vcc on the usb serial converter is 5v? Or are you feeding the esp 5V Vcc?
Either way, i wouldn't want to recommend it to anyone who doesn't have a ample stock of esps
Helio Machado
@0x2b3bfa0
Dec 22 2015 12:31 UTC
@beikeland: The power and the signal are both TTL. Never tested with 5V power and 3V3 logic level.
Also, I tried this after ordering 10 ESP-01, and yet I fried my NodeMCU with 220V :worried:
I don't recommend powering ESP-01 with 5V nor using NodeMCU with 220V AC logic level in its inputs. :smiling_imp:
beikeland
@beikeland
Dec 22 2015 12:34 UTC
@crushedice2000 while "standard" ttl is often 5V; all of my usb serial converter still use only 3.3v on the signaling; as anything over 2.2v is considerd a logic 1; that way they work with 3.3v and 5v.
"AC logic level" :D
Helio Machado
@0x2b3bfa0
Dec 22 2015 12:35 UTC
@beikeland: Never used the scope with the USB adapter, so I don't know what voltage uses on the TX and RX pins.
About the AC project I have, was trying to drive a led driver without optoisolation. :smile:
Chris Elsworth
@celsworth
Dec 22 2015 12:37 UTC
AC mains, no isolation?
nice knowing you ;)
beikeland
@beikeland
Dec 22 2015 12:37 UTC
lol, i saw some of the comments.. you're a brave man :P
Helio Machado
@0x2b3bfa0
Dec 22 2015 12:39 UTC
@celsworth @beikeland: :smile: I'm more silly than brave... It was a short circuit between my computer's plug Neutral and the LED driver Line (all trough the USB port). I wonder how my computer is alive and with the all the USB ports working.
Now I have a NodeMCU Amica with ESP-12E to remove the metal shielding and try to see the SPI flash model, as before this, I didn't knew the flash size.
then you have the flash size ;)
Helio Machado
@0x2b3bfa0
Dec 22 2015 12:42 UTC
@Links2004: Now? I'm waiting until the new NodeMCU arrive. Could you send me a link with a step-by-step guide to flashing a 220V AC powered NodeMCU?
It seems to ignore normal flashing commands.
https://cdn01.gitter.im/_s/75cadb0/images/emoji/smiling_imp.png
Markus
@Links2004
Dec 22 2015 12:43 UTC
OTA, connecting to PC is a bad idea.
Chris Elsworth
@celsworth
Dec 22 2015 12:43 UTC
phew, for a second I thought you were serious ;)
Helio Machado
@0x2b3bfa0
Dec 22 2015 12:43 UTC
However, thanks for the link!
@Links2004 @celsworth: :smirk:
Mario Mikočević
@mozgy
Dec 22 2015 12:44 UTC
I've fried one esp-01
Helio Machado
@0x2b3bfa0
Dec 22 2015 12:44 UTC
@Links2004: What kind of wireless should I need for OTA at 50HZ?
@mozgy: How?
Mario Mikočević
@mozgy
Dec 22 2015 12:44 UTC
turned out that one was lucky one as I upgraded it to 4MiB :)
7V from LiPo :(
Markus
@Links2004
Dec 22 2015 12:45 UTC
@crushedice2000 Powerlan ;)
Helio Machado
@0x2b3bfa0
Dec 22 2015 12:45 UTC
@mozgy: :worried:
@Links2004: :smile:
Mario Mikočević
@mozgy
Dec 22 2015 12:45 UTC
esp chip survived, ram didnt
Helio Machado
@0x2b3bfa0
Dec 22 2015 12:45 UTC
@mozgy: How did you made the upgrade? Soldering?
Mario Mikočević
@mozgy
Dec 22 2015 12:45 UTC
aye
@crushedice2000 lunch break .. bbl
Helio Machado
@0x2b3bfa0
Dec 22 2015 12:46 UTC
@mozgy: Bye!

@All:

This afternoon I'll be traveling, see you later (this evening or tomorrow)
brutzler
@brutzler
Dec 22 2015 14:51 UTC
Hi
using the ESP as little Webserver, I need a password-request to grant access to my site.
Actually I have a little starting page on handleroot with a form and an "input-submit-form" where the browser is asking for the PW. I receive the pw at the ESP, and if it is matching, then I redirect the handleroot to my hidden side.
Is this a good way, or does anybody know something better?
One negative I see is, that the pw is transmitted in plain text.
Chris Elsworth
@celsworth
Dec 22 2015 14:59 UTC
without employing https there's no easy way around that in http forms
a bit of javascript to check the password against a hash on the client side maybe, but thats really beyond the scope of arduino core gitter channel :)
Chris Elsworth
@celsworth
Dec 22 2015 15:04 UTC
http://programmers.stackexchange.com/a/76947 not bad either, sha1 the password before sending in the form then compare that on the server side. but like I said, well out of scope and completely offtopic
Mario Mikočević
@mozgy
Dec 22 2015 16:08 UTC
ok, finished library for TM1650 LCDs, both 8.8.8.8. and 88:88 versions ..
Kiril Zyapkov
@kzyapkov
Dec 22 2015 16:09 UTC
So .. I'm having trouble getting WiFi to connect after a restart, and maybe it's the way I use the WiFi class methods. This used to work until recently, now my router logs this every time the ESP tries to associate: "daemon.info hostapd: wlan0: STA 18:fe:34:a7:03:a1 IEEE 802.11: Station sent an invalid association request"
has anyone seen anything like this?
Calling WiFi.mode() / begin() etc don't seem to help
what's the proper way to bootstrap WiFi?
onkelfunny
@onkelfunny
Dec 22 2015 16:34 UTC
This message was deleted
brutzler
@brutzler
Dec 22 2015 17:03 UTC
@celsworth: ok thx
Markus
@Links2004
Dec 22 2015 17:10 UTC

@kzyapkov you can try to delete all configs first whit:

WiFi.disconnect(true);

normal WiFi.begin shut simply do the jop.

Me No Dev
@me-no-dev
Dec 22 2015 17:20 UTC
@brutzler the Web server supports authentication as it is. No need for form :) Standard HTTP Basic auth/
in the handler you need to check
if(!server.authenticate("user", "pass"))
  return server.requestAuthentication();
@kzyapkov try power cycle also... I had this happen to me all of the time and only power cycle
fixes it
brutzler
@brutzler
Dec 22 2015 17:24 UTC
@me-no-dev: Wow. sounds good. Will look how to integrate this....Perhaps I will come back with some questions ;-)
Me No Dev
@me-no-dev
Dec 22 2015 17:25 UTC
sure thing :)
Chris Elsworth
@celsworth
Dec 22 2015 17:30 UTC
careful, its still basically cleartext.
brutzler
@brutzler
Dec 22 2015 17:31 UTC
and not working :-(
Arduino: 1.6.5 (Windows 7), Platine: "NodeMCU 1.0 (ESP-12E Module), 80 MHz, Serial, 115200, 4M (3M SPIFFS)"

WebServer.ino: In function 'void handleRoot()':
WebServer:72: error: 'class ESP8266WebServer' has no member named 'authenticate'
WebServer:73: error: 'class ESP8266WebServer' has no member named 'requestAuthentication'
WebServer:73: error: return-statement with a value, in function returning 'void' [-fpermissive]
'class ESP8266WebServer' has no member named 'authenticate'
Chris Elsworth
@celsworth
Dec 22 2015 17:32 UTC
further reading if interested: https://security.stackexchange.com/questions/988/is-basic-auth-secure-if-done-over-https but the punchline is don't use http basic auth if you care about security
brutzler
@brutzler
Dec 22 2015 17:33 UTC
cleartext: is not the main problem. I am not the major aim of the NSA. Its only a warmwater-controller. But I have a better feeling, cause its reachable from outside. But "hacker" has to know my ip, and the port. And the password.
Me No Dev
@me-no-dev
Dec 22 2015 17:35 UTC
@brutzler maybe not in the version of the core that you have
brutzler
@brutzler
Dec 22 2015 17:35 UTC
hmmm.. Arduino-core, or ESP?
Me No Dev
@me-no-dev
Dec 22 2015 17:35 UTC
it's a recent addition :)
ESP
Me No Dev
@me-no-dev
Dec 22 2015 17:36 UTC
to be honest I'm not at all familiar with the release cycle of those
brutzler
@brutzler
Dec 22 2015 17:36 UTC
2.0.0-rc2
Me No Dev
@me-no-dev
Dec 22 2015 17:37 UTC
but you obviously do not have the methods in the source :)
they are not much but need some extra files as well
Markus
@Links2004
Dec 22 2015 17:37 UTC
2.0.0 is newer then 2.0.0-rc2
check https://github.com/esp8266/Arduino/releases and you see the date and commits behind.
brutzler
@brutzler
Dec 22 2015 17:38 UTC
How to get? My Boards Manager doesn't suggest a 2.0.0
only in the stable
brutzler
@brutzler
Dec 22 2015 17:39 UTC
Always thought staging is more actual than stable....
Chris Elsworth
@celsworth
Dec 22 2015 17:39 UTC
it usually is
but staging is old, time for a new one
hasn't been updated since last release of 2.0.0
Markus
@Links2004
Dec 22 2015 17:41 UTC
yes @igrr will create a new staging if we have fixed some of this:
https://github.com/esp8266/Arduino/issues?q=is%3Aopen+is%3Aissue+milestone%3A2.1.0+label%3Abug
brutzler
@brutzler
Dec 22 2015 17:41 UTC
Should I change? Or is some known problems to expect?
Markus
@Links2004
Dec 22 2015 17:41 UTC
2.0.0 works better then rc2
brutzler
@brutzler
Dec 22 2015 17:42 UTC
downloading....
Markus
@Links2004
Dec 22 2015 17:42 UTC
but delete rc2 before installing 2.0.0
brutzler
@brutzler
Dec 22 2015 17:43 UTC
ups... wanted to change the "Additional Boards Manager URL" in my arduino preferences. Hoping rest will do automatical
Markus
@Links2004
Dec 22 2015 17:44 UTC
when you end up with rc2 + 2.0.0 you can still delete and download new.
Markus
@Links2004
Dec 22 2015 17:51 UTC
@igrr I think we shut also add the stable releases to the staging json.
brutzler
@brutzler
Dec 22 2015 17:51 UTC
!delete...move for first :-)
Me No Dev
@me-no-dev
Dec 22 2015 17:53 UTC
I advise leaving a version with SDK 1.3 and stock lwip as reference
brutzler
@brutzler
Dec 22 2015 17:53 UTC
BTW. Is it still recommended to use 1.6.5 IDE? Or can I make the step to 1.6.6 or 1.6.7?
Me No Dev
@me-no-dev
Dec 22 2015 17:53 UTC
1.6.7
Chris Elsworth
@celsworth
Dec 22 2015 17:53 UTC
@me-no-dev does this core not use stock lwip anymore?
Me No Dev
@me-no-dev
Dec 22 2015 17:53 UTC
youll get OTA using the upload button
@celsworth I'm not sure which version is in 2.0.0 but someone can easily check
in esp8266/tools/sdk/lib there should be only on liblwip.a
if you see liblwip_5XX.a (do not remember the exact number) then you are running a build from source lwip
which I found to have issues compared to stock
Chris Elsworth
@celsworth
Dec 22 2015 17:56 UTC
looks like its stock then
in 2.0.0
personally I just wish they'd build ipv6 into liblwip
esp32 version of liblwip has it though :)
brutzler
@brutzler
Dec 22 2015 17:58 UTC
OK: 2.0.0 stable with 1.6.5:
Still
'class ESP8266WebServer' has no member named 'authenticate'
Me No Dev
@me-no-dev
Dec 22 2015 17:59 UTC
go into the esp code folder, into libraries/ESP8266WebServer/src and check ESP8266WebServer.h to have the methods.
@Links2004 and @igrr how do you feel about ditching the UART TX buffer and use the build-in 127 byte hardware buffer?
I have been using it developing interrupt driven stuff and it's working without a single problem
it does not use interrupt and blocks if buffer is full
brutzler
@brutzler
Dec 22 2015 18:03 UTC
@me-no-dev : My lib is different to your link @github:
class ESP8266WebServer
{
public:
  ESP8266WebServer(IPAddress addr, int port = 80);
  ESP8266WebServer(int port = 80);
  ~ESP8266WebServer();

  void begin();
  void handleClient();

  typedef std::function<void(void)> THandlerFunction;
  void on(const char* uri, THandlerFunction handler);
  void on(const char* uri, HTTPMethod method, THandlerFunction fn);
  void on(const char* uri, HTTPMethod method, THandlerFunction fn, THandlerFunction ufn);
  void addHandler(RequestHandler* handler);
  void serveStatic(const char* uri, fs::FS& fs, const char* path, const char* cache_header = NULL );
  void onNotFound(THandlerFunction fn);  //called when handler is not assigned
  void onFileUpload(THandlerFunction fn); //handle file uploads
Me No Dev
@me-no-dev
Dec 22 2015 18:04 UTC
maybe not in 2.0.0 stable then?
can anyone else confirm?
Markus
@Links2004
Dec 22 2015 18:05 UTC
@me-no-dev not blocking if buffer full is not good, for debug out its may acceptable but if you run a protocol its bad very bad.
Me No Dev
@me-no-dev
Dec 22 2015 18:05 UTC
maybe then make os_printf go through there and integrate some sort of option
because it is safe for use inside interrupt handlers
Markus
@Links2004
Dec 22 2015 18:06 UTC
os_printf blocks on full buffer too.
Me No Dev
@me-no-dev
Dec 22 2015 18:06 UTC
also AVR has 64 bytes of buffer. How is that any better than the 127 that this has in the harware
problem is not blocking, but rather not using interrupt to send the next byte
you can skip it if you want, but once you put a byte inside, you have no need to worry that there will be interrupt to mess things up
Markus
@Links2004
Dec 22 2015 18:08 UTC
interrupt are only needed when the HW buffer where full and the data is stored in cbuf, as long only HW buffer is used no interupts are needed.
Chris Elsworth
@celsworth
Dec 22 2015 18:08 UTC
does anyone know what the max interrupt rate is on 8266?
ie if I wanted 100khz interrupt rate on a pin, is that achievable?
I haven't got a signal generator that can test it :(
Me No Dev
@me-no-dev
Dec 22 2015 18:09 UTC
@celsworth I was able to run 230400bps uart over interrupt
it's doable
Chris Elsworth
@celsworth
Dec 22 2015 18:09 UTC
is that interrupt for each byte or each bit?
Me No Dev
@me-no-dev
Dec 22 2015 18:10 UTC
using attachInterrupt got the interrupt 2uS after the event
brutzler
@brutzler
Dec 22 2015 18:10 UTC
and now? is it enough to change the ESP8266WebServer-lib? or is there more work? In that case I stop trying to use the "authenticate"
Me No Dev
@me-no-dev
Dec 22 2015 18:10 UTC
@brutzler it needs the base64 library as well
that is in the core folder
Markus
@Links2004
Dec 22 2015 18:11 UTC
@brutzler you can switch to the git version, but SDK 1.5 may make problems right now.
Me No Dev
@me-no-dev
Dec 22 2015 18:11 UTC
@brutzler if you really want it, I can give you a stable 1.3 git to use
has all of the new stuff here but the SDK
it's what I actually use for development
1.5 is too much of a headache
Chris Elsworth
@celsworth
Dec 22 2015 18:12 UTC
this wifi issue in 1.5 is worrying :(
Me No Dev
@me-no-dev
Dec 22 2015 18:12 UTC
it's way more than that :(
Chris Elsworth
@celsworth
Dec 22 2015 18:13 UTC
what else?
Me No Dev
@me-no-dev
Dec 22 2015 18:13 UTC
missing packets, unaligned allocs
same code runs beautifully on 1.3 stock lwip
brutzler
@brutzler
Dec 22 2015 18:13 UTC
@me-no-dev: never used a "git" version. only integrated with the boards manager url.
If I find a howto, then I would be glad about your dev-version.
Me No Dev
@me-no-dev
Dec 22 2015 18:14 UTC
:D the how-to is the readme of the git repo
mine is a branch of my fork of this repo
brutzler
@brutzler
Dec 22 2015 18:14 UTC
ok. Should I prior upgrade to 1.6.7?
Me No Dev
@me-no-dev
Dec 22 2015 18:14 UTC
sure, but close your old IDE first
brutzler
@brutzler
Dec 22 2015 18:15 UTC
YES i know.....
already made this failure
there is a "Download ZIP" button in the header on the right if you do not want to mess with git clone
brutzler
@brutzler
Dec 22 2015 18:17 UTC
Nice ReadMe. But no git clone on a Windows PC ;-)
Me No Dev
@me-no-dev
Dec 22 2015 18:17 UTC
download and unpack the zip
will contain the same files
brutzler
@brutzler
Dec 22 2015 18:19 UTC
hmm... my Arduino15-folder is >500MB. Your zip is only 4MB ???
Me No Dev
@me-no-dev
Dec 22 2015 18:22 UTC
this is the same as this repo. then you run get.py to download the tollchain
Arduino-15 might contain other things as well
brutzler
@brutzler
Dec 22 2015 18:23 UTC
get.py??? sure running on M$?
Chris Elsworth
@celsworth
Dec 22 2015 18:23 UTC
python exists for windows :)
you'll need to install it though
brutzler
@brutzler
Dec 22 2015 18:24 UTC
oh, yes. Have installed rel2.7 for OTA
Me No Dev
@me-no-dev
Dec 22 2015 18:24 UTC
then you are all set :D
follow the readme
jsut replace unzip with the git part
brutzler
@brutzler
Dec 22 2015 18:26 UTC
OK. will start with update to 1.6.7
Mario Mikočević
@mozgy
Dec 22 2015 18:38 UTC
I had to reinstall 1.6.7
it wasnt working right until I gave it full m$ admin rights
brutzler
@brutzler
Dec 22 2015 18:39 UTC
1.6.7 is working. But have probs to integrate the ESP-package. Is 1.6.7 using different directories as 1.6.5?
Mario Mikočević
@mozgy
Dec 22 2015 18:39 UTC
@platformio folks - I'll check that later, atm I like the pain of crude IDE :)
Me No Dev
@me-no-dev
Dec 22 2015 18:40 UTC
where are you trying?
something like [install folder]\hardware?
Mario Mikočević
@mozgy
Dec 22 2015 18:40 UTC
@brutzler as I said, give it full admin rights and then git install will work
Me No Dev
@me-no-dev
Dec 22 2015 18:41 UTC
@mozgy it's not a git install
Mario Mikočević
@mozgy
Dec 22 2015 18:43 UTC
ah ok
brutzler
@brutzler
Dec 22 2015 18:44 UTC
I installed 1.6.7. Then http://arduino.esp8266.com/stable/package_esp8266com_index.json into the boards manager URL. (Want to try this first)
then into boards manager: IDE is installing some files, and tells me, that 2.0.0 is installed.
But There is no Arduino15-directory as before, and on compiling, there is a "Board nodemcuv2.... unknown"
Even with admin rights :-(
Mario Mikočević
@mozgy
Dec 22 2015 18:46 UTC
there is stable installed :)
\Users\brutzler\AppData\Local
brutzler
@brutzler
Dec 22 2015 18:47 UTC
Just seen: old release was in \roaming. now in \local
Mario Mikočević
@mozgy
Dec 22 2015 18:47 UTC
yep
brutzler
@brutzler
Dec 22 2015 18:48 UTC
deleted the \local\Arduino15 and now boards manager is installing a longer time.
oh dear god. I have so much probs with my code. And then the IDE too.....
Mario Mikočević
@mozgy
Dec 22 2015 18:49 UTC
normal day in coders life :)
brutzler
@brutzler
Dec 22 2015 18:51 UTC
BTW: empty project compiling now succesfull. Will try as next my code
OMG. Lots of errors now. (only change is 1.6.5 -> 1.6.7)
Looks like new IDE is working different with code in more than one ino.
I call a LCD_Setup() in void setup(). But this is defined in a different ino.
Was no prob with 1.6.5. But now a lot of similiar errors.
I am done :-(
Me No Dev
@me-no-dev
Dec 22 2015 18:57 UTC
you mean whan you have multiple ino files in the same sketch folder?
brutzler
@brutzler
Dec 22 2015 18:58 UTC
Yes. I like this, cause of better code structure in bigger projects
Me No Dev
@me-no-dev
Dec 22 2015 19:01 UTC
maybe using cpp and h files would help? plus will make the code buildable with any builder
Chris Elsworth
@celsworth
Dec 22 2015 19:01 UTC
+1, whoever came up with ino. they're cpp damnit.
Markus
@Links2004
Dec 22 2015 19:01 UTC
@celsworth ack
Me No Dev
@me-no-dev
Dec 22 2015 19:02 UTC
multiple ino is a really old concept and most projects that used it moved to h and cpp (Multiwii)
Markus
@Links2004
Dec 22 2015 19:03 UTC
some other strange thing i often see on library is code in h files and non c or cpp file in there.
Me No Dev
@me-no-dev
Dec 22 2015 19:04 UTC
ClientContext.h ? :D
brutzler
@brutzler
Dec 22 2015 19:05 UTC
CHanged all secondary .inos to .cpp. But not better
Me No Dev
@me-no-dev
Dec 22 2015 19:06 UTC
now you need to define the functions that you use in between them
brutzler
@brutzler
Dec 22 2015 19:08 UTC
oh no. sitting 2 hours and no progress only step back :-(
define? anybody has an example?
Markus
@Links2004
Dec 22 2015 19:08 UTC
@me-no-dev i mean normal c like function without a class.
Me No Dev
@me-no-dev
Dec 22 2015 19:09 UTC
//Project.h
#ifndef _MY_PROJECT_HEADER_H_
#define _MY_PROJECT_HEADER_H_
#include "Arduino.h"
//any other needed include
void functionInCppOne(char c);
bool functionInAnotherCpp(String arg1, bool anotherArg);
#endif
@brutzler something like that
name it Project.h for example and iclude it in all cpp+ino
then it shouldcompile
that way the cpp files will know of the existence of those other functions that are in other files
brutzler
@brutzler
Dec 22 2015 19:10 UTC
sorry. give up. not my stuff. only "low level lib-user". going back to 1.6.5.
Me No Dev
@me-no-dev
Dec 22 2015 19:12 UTC
@brutzler you will need to move on at some point :) can't sit on 1.6.5 forver
brutzler
@brutzler
Dec 22 2015 19:14 UTC
maybe, but actually I am destroyed.
Me No Dev
@me-no-dev
Dec 22 2015 19:17 UTC
take a deep breath :) it's not really complcated and we can help you get through this. Then you will know how to deal in such cases down the road. Only if you want to though :)
fmgomes
@fmgomes
Dec 22 2015 19:21 UTC
This message was deleted
brutzler
@brutzler
Dec 22 2015 19:22 UTC
OK. took my medicine (Augustiner-Edelstoff). Lets go ahead....
Me No Dev
@me-no-dev
Dec 22 2015 19:22 UTC
gimme a sec, I'm writing someting in the editor for easier
fmgomes
@fmgomes
Dec 22 2015 19:23 UTC

I'm making a library for the ESP8266, I made some libraries in the past for the ATMEGA (with an older IDE version), and I'm finding include errors, can you give me some clue?

For example, including:

include <Arduino.h>

include "WiFiClient.h"

Gives the following error:
D:\arduino-1.6.5-r5\portable\packages\esp8266\hardware\esp8266\2.0.0-rc2\libraries\WebRadio\webradio.cpp:24:24: fatal error: WiFiClient.h: No such file or directory

include "WiFiClient.h"

It seems the cpp file doesn't find the other libs, like the WiFiClient lib...
But I've checked the ESP8266WebServer.cpp and it seems to do the same as me, so I'm not understanding the issue
Me No Dev
@me-no-dev
Dec 22 2015 19:26 UTC
WiFiClient is in the ESP8266WiFi library. Do you have that header included in the ino at least?
fmgomes
@fmgomes
Dec 22 2015 19:29 UTC
Thanks, that seems to be the problem!
fmgomes
@fmgomes
Dec 22 2015 19:34 UTC
Thanks for your help, as soon as the library is working I will share it!
Me No Dev
@me-no-dev
Dec 22 2015 19:35 UTC
:) youre welcome
@brutzler here is an example with 2 cpp files , one header file and an ino file
//Project.h
#ifndef _MY_PROJECT_HEADER_H_
#define _MY_PROJECT_HEADER_H_
#include "Arduino.h"

extern char varInCppOne;

void functionInCppOne(char c);
void anotherFunctionInCppOne(char c);
bool functionInAnotherCpp(const char *arg1, bool anotherArg);
#endif
//CppOne.cpp
#include "Project.h"

char varInCppOne;

void privateFunctionInCpOne(char c){
  //do something private
  varInCppOne = c+1;
}

//this function you want to be used in other cpp/ino files
void functionInCppOne(char c){
  privateFunctionInCpOne(); //maybe call something priivate
  Serial.print(c);
}

//this function you want to be used in other cpp/ino files
void anotherFunctionInCppOne(char c){
  //do something usefull
}
//AnotherCpp.cpp
#include "Project.h"

char privateVarInCppTwo;

bool privateFunctionInCpTwo(char c, bool save){
  //do something private
  if(save)
   privateVarInCppTwo = c;
  return true;
}

//this function you want to be used in other cpp/ino files
bool functionInAnotherCpp(const char *arg1, bool anotherArg){
  anotherFunctionInCppOne(arg1[0]); //call exported function from cpp one
  return privateFunctionInCpTwo(arg1[0]);
}
//ProjectName.ino
#include "Project.h"

void setup(){
  Serial.begin();
  if(functionInAnotherCpp("hello", true)){
    Serial.println("Called function from cpp two with success");
  }
}

void loop(){
  while(Serial.available()){
    functionInCppOne(Serial.read()); //call the exported function from cpp one
  }
}
you mention all of the functions inside the cpp files that you want to use anywhere in the header file
then include the header across the files
and they will know about those functions
the compiler will do the rest
brutzler
@brutzler
Dec 22 2015 19:37 UTC

ok. and what about declarations?
e.g. I made this in the WiFi.cpp:

const char* host = "esp8266";
const char* ssid = "xxx";
const char* password = "yyyy";

can this stay in the cpp?

Me No Dev
@me-no-dev
Dec 22 2015 19:38 UTC
yes
especially if that is the only place where you use it
brutzler
@brutzler
Dec 22 2015 19:39 UTC
ahh. local / global variable???
Me No Dev
@me-no-dev
Dec 22 2015 19:39 UTC
sort of yes :)
brutzler
@brutzler
Dec 22 2015 19:39 UTC
only sort of :-(
Me No Dev
@me-no-dev
Dec 22 2015 19:39 UTC
the others just do not know about them
brutzler
@brutzler
Dec 22 2015 19:40 UTC
???
Me No Dev
@me-no-dev
Dec 22 2015 19:40 UTC
if you put them in the header then all can use them
brutzler
@brutzler
Dec 22 2015 19:40 UTC
-> global use
Me No Dev
@me-no-dev
Dec 22 2015 19:40 UTC
the example with varInCppOne
red above
varInCppOne is mentioned in Project.h so any cpp file that includes it can access it
brutzler
@brutzler
Dec 22 2015 19:41 UTC
yes, I see. :-)
Me No Dev
@me-no-dev
Dec 22 2015 19:41 UTC
the var is actually defined in cpp one
then cpp two has a var that is not mentioned
brutzler
@brutzler
Dec 22 2015 19:42 UTC
and what is this for?
#ifndef _MY_PROJECT_HEADER_H_
#define _MY_PROJECT_HEADER_H_
#include "Arduino.h"
Me No Dev
@me-no-dev
Dec 22 2015 19:42 UTC
and the others do not see it
it's an example
it can be anything really that you need in that file
that is so the header is included only once
if you miss that part the header will get inclided somewhere multiple times and the compiler will error for redefinition/redeclaradion
brutzler
@brutzler
Dec 22 2015 19:43 UTC
ok and the arduino.h?
Me No Dev
@me-no-dev
Dec 22 2015 19:43 UTC
Arduino.h has the same things and it's pulled so you have access to all of the goodies that arduino has to offer
Arduino.h is actually included in your ino file at compile time
and mentions of all of the functions inside are made at the top of the file as well
brutzler
@brutzler
Dec 22 2015 19:44 UTC
I saw it in nearly every lib
Me No Dev
@me-no-dev
Dec 22 2015 19:44 UTC
you just do not get to see that part :)
with multiple ino files, Arduino used to combine them into a single file and do the same thing
brutzler
@brutzler
Dec 22 2015 19:49 UTC
OK understood the basic. Hope so. Will try this now in my project.
Just one question to .h, .cpp ad .ino
1.) Mainfile should stay as .ino? e.g ESP-project.ino
2.) "secondary-code" into .cpp-files?
3.) Have some html-code. This I did into .h-files. OK?
4.) The header should be named as ESP-project.h
Me No Dev
@me-no-dev
Dec 22 2015 19:50 UTC
1 - yes
2 - yes
3 - best to be in one of the cpp and if neede to be used from others, then export it in the header
4 - it does not matter what it's named :) you can have a separate header for each cpp, then later separate them in folders to become libraries :)
brutzler
@brutzler
Dec 22 2015 19:53 UTC
lib is a big step further...
Me No Dev
@me-no-dev
Dec 22 2015 19:53 UTC
not really :) if you do this, it's equivalent to a sketch and a lib
so if you name the header "MyCoolFeatures.h" and put that into a folder with the same name and all of the cpp files inside into the libraries folder
then restart the ide and your cpp will work :)
and you will have a MyCoolFeatures lib that you can include into any project
brutzler
@brutzler
Dec 22 2015 19:55 UTC
3 - its only used in one cpp. But I included it in the main.ino. #include "WebPage_Index.h"
And i like it, because its much html-code, and dosn't waste the normal code
Me No Dev
@me-no-dev
Dec 22 2015 19:55 UTC
sure that works too
brutzler
@brutzler
Dec 22 2015 19:56 UTC
but i could put this include into the header.h or?
Me No Dev
@me-no-dev
Dec 22 2015 19:57 UTC
when you have data in a header and that data is to be used by one cpp,then it should be included there
and only there
there -> that one cpp
brutzler
@brutzler
Dec 22 2015 19:59 UTC
ok. again what learned. (by Lothar Matthäus)
Now its time to thank you very much for your help.
Bringing children to bed, and then make the project-"update" for 1.6.7. :-)
how long are you online ;-)
Me No Dev
@me-no-dev
Dec 22 2015 20:02 UTC
probably another 5-6 hours
have fun with the kids
i'll be around
brutzler
@brutzler
Dec 22 2015 20:02 UTC
:+1:
brutzler
@brutzler
Dec 22 2015 20:17 UTC

kids sleeping....
made the needed changes.
One further question: I make an instance of the LCD-library. actually the code was in the LCD.cpp

// create an lcd instance with correct constructor for how the lcd is wired to the I2C chip
LiquidCrystal_I2C lcd(lcdAddr, 4, 5, 6, 0, 1, 2, 3, 7, NEGATIVE); // addr, EN, RW, RS, D4, D5, D6, D7, Backlight, POLARITY

Thats making trouble. Where to place it now?
lcdAddr is defined in main.ino

Me No Dev
@me-no-dev
Dec 22 2015 20:22 UTC
define lcdAddr in the header
or in LCD.cpp
if it's used only there
brutzler
@brutzler
Dec 22 2015 20:26 UTC
That was not the solution:
LCD.cpp:5: error: 'LiquidCrystal_I2C' does not name a type
 LiquidCrystal_I2C lcd(lcdAddr, 4, 5, 6, 0, 1, 2, 3, 7, NEGATIVE); // addr, EN, RW, RS, D4, D5, D6, D7, Backlight, POLARITY
 ^
brutzler
@brutzler
Dec 22 2015 20:39 UTC
Ahhh. include the lib was missing in LCD.cpp
brutzler
@brutzler
Dec 22 2015 20:49 UTC
puuhhhh ... 5 errors solved ... 10 more appearing
Basicly: when I have a var, that should be used in different cpps. what is the right way? define it somewhere in one of the cpps/main.ino: int myvar; And then put it into the header.h with: extern int myvar; ?
Or is it enough to define it in the header.h: int myvar;
Until update to 1.6.7 I only defined it in the main.ino and all was fine. I could use it in the cpps too.
Martin Ayotte
@martinayotte
Dec 22 2015 21:01 UTC
Don't declare vars in header if this header is included at several place, you will get "multiple definition" at link time. In the header, use "extern" like me-no-dev mentioned before and define the var in one of the cpps/ino.
brutzler
@brutzler
Dec 22 2015 21:01 UTC
ok thx
brutzler
@brutzler
Dec 22 2015 21:07 UTC
one more to understand:
I have a LCD_Setup() in my LCD.cpp and call it from the main.ino. I understand now, that "void LCD_Setup()" has to be declared in the header.h. But why do all other subroutines and vars, that are used and called in the LCD_Setup(), have to be declared in the header.h too? This makes life not easy...
Martin Ayotte
@martinayotte
Dec 22 2015 21:21 UTC
All functions of your LCD.cpp exposes to other .cpp need to have such declaration in the .h, this is the way C/C++ language is made.
brutzler
@brutzler
Dec 22 2015 21:25 UTC

Another example:
Setup ticker in main.ino

void setup() {
  // Setup Ticker
  SetupTicker();
}

here my code in the ticker.cpp

#include "Header.h"

// Instance of ticker-objects
Ticker tick_60000ms;
Ticker tick_5000ms;
Ticker tick_2000ms;
Ticker tick_1000ms;
Ticker tick_500ms;

void SetupTicker() {
 tick_60000ms.attach_ms(60000, T_60000ms);
 tick_5000ms.attach_ms(5000, T_5000ms);
 tick_2000ms.attach_ms(2000, T_2000ms);
 tick_1000ms.attach_ms(1000, T_1000ms);
 tick_500ms.attach_ms(500, T_500ms);
}

void T_60000ms() {
 //DEBUG_PRINTLN (F("Ticker 60000ms")); 
}

void T_5000ms() {
 //DEBUG_PRINTLN (F("Ticker 5000ms")); 
  Serial.println(ESP.getFreeHeap());
  LCD_Main();
}

void T_2000ms() {
 //DEBUG_PRINTLN (F("Ticker 2000ms"));  
}

void T_1000ms() {
 //DEBUG_PRINTLN (F("Ticker 500ms"));  
  time_t now = time(nullptr);
  struct tm *tmp = localtime(&now);
  sprintf (LCDTime, "%02d:%02d:%02d", tmp->tm_hour , tmp->tm_min, tmp->tm_sec); 
  sprintf (LCDDate, "%02d.%02d.%04d", tmp->tm_mday , tmp->tm_mon+1, 1900+tmp->tm_year); 
}

void T_500ms() {
 //DEBUG_PRINTLN (F("Ticker 500ms"));  
}

needs all this in the header.h for working???

// header.h

#include <Ticker.h>
  void SetupTicker();
  extern Ticker tick_60000ms;
  extern Ticker tick_5000ms;
  extern Ticker tick_2000ms;
  extern Ticker tick_1000ms;
  extern Ticker tick_500ms;
  void T_60000ms();
  void T_5000ms();
  void T_2000ms();
  void T_1000ms();
  void T_500ms();

only asking myself, why it was working in 1.6.5. without the header.h -> This was C/C++ too.
Ok there I had a few *.ino. And no cpp.

brutzler
@brutzler
Dec 22 2015 21:33 UTC
Thought, i have heard that Arduino-IDE makes one big ino of all inos in a sketch folder and then compiles it.
Looks imho like this worked in 1.6.5 and not even more in 1.6.7 :-(
Me No Dev
@me-no-dev
Dec 22 2015 21:34 UTC
for what you have pasted all you need is void SetupTicker(); in the header
include Ticker.h in the ticker.cpp file
and include header.h in the ino
brutzler
@brutzler
Dec 22 2015 21:35 UTC
"include ticker.h" is in the header.h. That should be enough or?
Me No Dev
@me-no-dev
Dec 22 2015 21:35 UTC
no
include "Ticker.h" in ticker.cpp
brutzler
@brutzler
Dec 22 2015 21:36 UTC
WHY NOT (desperating)
ok try
Me No Dev
@me-no-dev
Dec 22 2015 21:37 UTC
// header.h
#ifndef _MY_HEADER_H_
#define _MY_HEADER_H_
  void SetupTicker();
#endif
brutzler
@brutzler
Dec 22 2015 21:37 UTC
thought "include ticker.h" in header.h and then "include header.h" in ticker.cpp is the same?
Me No Dev
@me-no-dev
Dec 22 2015 21:38 UTC
#include "Header.h"
#include "Ticker.h"

// Instance of ticker-objects
Ticker tick_60000ms;
Ticker tick_5000ms;
Ticker tick_2000ms;
Ticker tick_1000ms;
Ticker tick_500ms;

void SetupTicker() {
 tick_60000ms.attach_ms(60000, T_60000ms);
 tick_5000ms.attach_ms(5000, T_5000ms);
 tick_2000ms.attach_ms(2000, T_2000ms);
 tick_1000ms.attach_ms(1000, T_1000ms);
 tick_500ms.attach_ms(500, T_500ms);
}

void T_60000ms() {
 //DEBUG_PRINTLN (F("Ticker 60000ms")); 
}

void T_5000ms() {
 //DEBUG_PRINTLN (F("Ticker 5000ms")); 
  Serial.println(ESP.getFreeHeap());
  LCD_Main();
}

void T_2000ms() {
 //DEBUG_PRINTLN (F("Ticker 2000ms"));  
}

void T_1000ms() {
 //DEBUG_PRINTLN (F("Ticker 500ms"));  
  time_t now = time(nullptr);
  struct tm *tmp = localtime(&now);
  sprintf (LCDTime, "%02d:%02d:%02d", tmp->tm_hour , tmp->tm_min, tmp->tm_sec); 
  sprintf (LCDDate, "%02d.%02d.%04d", tmp->tm_mday , tmp->tm_mon+1, 1900+tmp->tm_year); 
}

void T_500ms() {
 //DEBUG_PRINTLN (F("Ticker 500ms"));  
}
#include "Header.h"
void setup() {
  // Setup Ticker
  SetupTicker();
}
actually for header.h
```
// header.h
#ifndef _MY_HEADER_H_
#define _MY_HEADER_H_
#include "Arduino.h" 
 void SetupTicker();
#endif
```
brutzler
@brutzler
Dec 22 2015 21:40 UTC
OK makes that error:
Ticker.cpp:14: error: 'T_1000ms' was not declared in this scope

  tick_1000ms.attach_ms(1000, T_1000ms);
Me No Dev
@me-no-dev
Dec 22 2015 21:40 UTC
is ticker.cpp your file as well?
Markus
@Links2004
Dec 22 2015 21:41 UTC
the local prototypes in ticker.cpp are missing.
brutzler
@brutzler
Dec 22 2015 21:41 UTC
???
Me No Dev
@me-no-dev
Dec 22 2015 21:41 UTC
ah yeah :D
Markus
@Links2004
Dec 22 2015 21:42 UTC
#include "Header.h"
#include "Ticker.h"

// Instance of ticker-objects
Ticker tick_60000ms;
Ticker tick_5000ms;
Ticker tick_2000ms;
Ticker tick_1000ms;
Ticker tick_500ms;

// local functions
void T_60000ms();
void T_5000ms();
void T_2000ms();
void T_1000ms();
void T_500ms();


void SetupTicker() {
 tick_60000ms.attach_ms(60000, T_60000ms);
 tick_5000ms.attach_ms(5000, T_5000ms);
 tick_2000ms.attach_ms(2000, T_2000ms);
 tick_1000ms.attach_ms(1000, T_1000ms);
 tick_500ms.attach_ms(500, T_500ms);
}

void T_60000ms() {
 //DEBUG_PRINTLN (F("Ticker 60000ms")); 
}

void T_5000ms() {
 //DEBUG_PRINTLN (F("Ticker 5000ms")); 
  Serial.println(ESP.getFreeHeap());
  LCD_Main();
}

void T_2000ms() {
 //DEBUG_PRINTLN (F("Ticker 2000ms"));  
}

void T_1000ms() {
 //DEBUG_PRINTLN (F("Ticker 500ms"));  
  time_t now = time(nullptr);
  struct tm *tmp = localtime(&now);
  sprintf (LCDTime, "%02d:%02d:%02d", tmp->tm_hour , tmp->tm_min, tmp->tm_sec); 
  sprintf (LCDDate, "%02d.%02d.%04d", tmp->tm_mday , tmp->tm_mon+1, 1900+tmp->tm_year); 
}

void T_500ms() {
 //DEBUG_PRINTLN (F("Ticker 500ms"));  
}
Me No Dev
@me-no-dev
Dec 22 2015 21:42 UTC

you can do that or you can also move

void SetupTicker() {
 tick_60000ms.attach_ms(60000, T_60000ms);
 tick_5000ms.attach_ms(5000, T_5000ms);
 tick_2000ms.attach_ms(2000, T_2000ms);
 tick_1000ms.attach_ms(1000, T_1000ms);
 tick_500ms.attach_ms(500, T_500ms);
}

to the bottom of the file

problem is that T_60000... is not defined at the position of the method and one way is to put it after those things are defined locally, define them on top of the fiile, or define them in the header
brutzler
@brutzler
Dec 22 2015 21:46 UTC
ok. that works for now.
OMG. I am a hopeless c-programmer.
Up to the next 500 errors LOL
Me No Dev
@me-no-dev
Dec 22 2015 21:47 UTC
you will get the hang of it :)
brutzler
@brutzler
Dec 22 2015 21:48 UTC
And again my main question:
WHY WAS MY (perhaps not good code) WORKING IN 1.6.5 ????
Me No Dev
@me-no-dev
Dec 22 2015 21:48 UTC
a couple of times do this then read a few libs and you'll be all set for greatness
because what Arduino did back then is to combine all ino files into a single cpp file
put include "Arduino.h" on top
and define all methods (like in the header) right after that
so all your code is in a single file and all functions know about each other
Markus
@Links2004
Dec 22 2015 21:50 UTC
its easier to learn when you not do arduino before ;)
arduino does many stuff in backround may works sometimes not, and if not you are happy to have learned C / C++ and know whats go wrong.
brutzler
@brutzler
Dec 22 2015 21:50 UTC
on top of what?
@Links2004: And this is exact my problem. Never learned C/C++. Was happy to get success with less effort on arduino ide.
Can I ask one more question?
Markus
@Links2004
Dec 22 2015 21:56 UTC
at a basic level arduino is nice for the begin, you get results fast and for the most users of it that just fine,
but in result its make the step to real C / C++ harder.
mostly ending why this is not working it work in arduino?
but when you get over this, you have a bunch of nice possibility and your code gets cleaner.
brutzler
@brutzler
Dec 22 2015 22:00 UTC

Yes you are right. Looks like I am no make my upgrade from beginner to something different. LOL
Now working on this:
Setup Webserver in main.ino

void setup() {
  // Setup Ticker
  SetupTicker();
}

here my code in the WebServer.cpp

void WebServer_setup () {
  server.on("/", handleRoot);
  server.begin();
  Serial << "HTTP server started at Port " << HTTPport << endl;  
}

void handleRoot() {
   Serial.println("HTML-Anforderung");
}

Is this the same problem?

need an additional void handleRoot() on top?
Me No Dev
@me-no-dev
Dec 22 2015 22:01 UTC
yes
Markus
@Links2004
Dec 22 2015 22:01 UTC
yes, first step you get it :)
brutzler
@brutzler
Dec 22 2015 22:01 UTC
or the WebServer_setup() at the bottom? as me-no-dev told
Me No Dev
@me-no-dev
Dec 22 2015 22:02 UTC
the same difference :)
WebServer_setup() needs to know that void handleRoot() exists
so it either should be decalred above or the whole function moved
result is the same
brutzler
@brutzler
Dec 22 2015 22:03 UTC
And this is no double declaration?
Me No Dev
@me-no-dev
Dec 22 2015 22:03 UTC

putting

void handleRoot();

on top or in the header is called "forward declaration"

you declare that this method exists
and you implement it somewhere else below or in a different file
Markus
@Links2004
Dec 22 2015 22:04 UTC

no, you have a declaration:

void handleRoot();

and one implementation:

void handleRoot() {
   Serial.println("HTML-Anforderung");
}
Me No Dev
@me-no-dev
Dec 22 2015 22:05 UTC
so no "forward"?
brutzler
@brutzler
Dec 22 2015 22:06 UTC
and this has to be done with all subroutines in the cpp?
Me No Dev
@me-no-dev
Dec 22 2015 22:06 UTC
I usually structure the cpp so all private methods are ordered above the public ones
add declarations only when not possible to arrange in such way
Markus
@Links2004
Dec 22 2015 22:07 UTC
yes, if they needed to be accessed beforimplementation , the IDE does this in backround for the ino files, one of the hidden thinks.
brutzler
@brutzler
Dec 22 2015 22:08 UTC
Then this comes up, because of changing ino to cpp?
Me No Dev
@me-no-dev
Dec 22 2015 22:08 UTC
yes
Screen Shot 2015-12-23 at 0.09.52.png
on the left is the result of arduino ide turning the ino into cpp
brutzler
@brutzler
Dec 22 2015 22:12 UTC
aha :+1:
Me No Dev
@me-no-dev
Dec 22 2015 22:12 UTC
Screen Shot 2015-12-23 at 0.09.52.png
this is with two ino files
Markus
@Links2004
Dec 22 2015 22:13 UTC
wrong paste?
brutzler
@brutzler
Dec 22 2015 22:13 UTC
Hey last problem (hope so):
How to declare a function with parameters:
   void color (float tempin, String &stringout) {
...}
Markus
@Links2004
Dec 22 2015 22:13 UTC
void color (float tempin, String &stringout);
brutzler
@brutzler
Dec 22 2015 22:13 UTC
void color() is not good
Me No Dev
@me-no-dev
Dec 22 2015 22:13 UTC
yup
Screen Shot 2015-12-23 at 0.12.29.png
brutzler
@brutzler
Dec 22 2015 22:14 UTC
oh no, thats tooo easy
Me No Dev
@me-no-dev
Dec 22 2015 22:14 UTC
yes :) it's all easy
brutzler
@brutzler
Dec 22 2015 22:16 UTC
WOW only one error left. But this is not caused by my stupid programming:
sketch\WiFi.cpp: In lambda function:

WiFi.cpp:45: error: 'OTA_RECIEVE_ERROR' was not declared in this scope

     else if (error == OTA_RECIEVE_ERROR) Serial.println("Receive Failed");

exit status 1
'OTA_RECIEVE_ERROR' was not declared in this scope
perhaps a type mismatch and now corrected?
Me No Dev
@me-no-dev
Dec 22 2015 22:17 UTC
include ArduinoOTA.h in both the ino and in WiFi.cpp
brutzler
@brutzler
Dec 22 2015 22:18 UTC
Nope. "OTA_RECIEVE_ERROR" was changed into "OTA_RECEIVE_ERROR"
Hey guys, good news: compiling completed. Jipiahjey
Me No Dev
@me-no-dev
Dec 22 2015 22:19 UTC
my typo too :D
brutzler
@brutzler
Dec 22 2015 22:22 UTC
When i define the void LCD_Setup() in the header.h to get access from the main.ino, then I do not need to declare it in the LCD.cpp any more. Right?
Markus
@Links2004
Dec 22 2015 22:23 UTC
yes only one declaration
brutzler
@brutzler
Dec 22 2015 22:23 UTC
and only when i need it outside the cpp, then it has to be declared in the header.h!?
Markus
@Links2004
Dec 22 2015 22:24 UTC
yes, you can see the header files as interface or API to the cpp
you start to getting the concept :+1:
brutzler
@brutzler
Dec 22 2015 22:28 UTC
hehe.
And how about variables? is there no possibility to declare them global?
Is this the only way to declare in a cpp and then declare an extern in the header.h?
Markus
@Links2004
Dec 22 2015 22:30 UTC
yes,
you want to have one instance :)
and the extern is to only way for it to access them from a other file
(excepted from writing a get / set function)
brutzler
@brutzler
Dec 22 2015 22:35 UTC
OK thx to you ( @me-no-dev , @Links2004 )
And my final words:
Arduino IDE 1.6.7 is not even more for the beginners. All what helped me during the last two years is gone. Or out of other view: I learned bad coding....
Helio Machado
@0x2b3bfa0
Dec 22 2015 22:37 UTC
@ivankravets @celsworth: I sent a mail to @fgclaramonte, he replied this paragraph about PlatformIO:
En cuanto a PlatformIO también me gustaría verlo con más calma. Podría
ser interesante introducirlo en
Debian. Aunque ahora mismo voy a tope de trabajo, me gustaría revisarlo.

I'll try to translate it:

About PlatformIO, I also want to see it later with more calm.
Would be interesting to introduce it on Debian. However now I
have lots of work to do. I would like to review it.

brutzler
@brutzler
Dec 22 2015 22:38 UTC
@me-no-dev .... Oh lost focus on your Arduino-sdk-1.3 and "server.authenticate". Perhaps tomorow
Chris Elsworth
@celsworth
Dec 22 2015 22:41 UTC
@crushedice2000 well that sounds promising :D
Helio Machado
@0x2b3bfa0
Dec 22 2015 22:42 UTC
Good night!
Me No Dev
@me-no-dev
Dec 22 2015 22:46 UTC
@brutzler sure thing
the hard part is over
:D
brutzler
@brutzler
Dec 22 2015 22:51 UTC
hope so. what will wait for me in future.......brrrr... ;-)
Ivan Kravets
@ivankravets
Dec 22 2015 23:10 UTC
The JSON library has just received support for PlatformIO. And of course, support for ESP8266! Related issue platformio/platformio#357
@crushedice2000 thanks a lot for the email! I'm ready to help @fgclaramonte