- Wed Dec 07, 2016 6:30 pm
#59230
Oh, now the code works!
The main problem was related to my Webbrowser. Because I found the code above by using the search field, there happend some strange stuff with the code in the box, like linebreaks and other things.
After entering the thread in a normal way, it was possible to use it, per copy it from the website and paste it into the edit field of the ESP8266Basic, many thanks to the author!
But it ist to say (maybe it can help other people), that the code allone wansn't enought. It's necessary to make the right (and different) settings in the setting section of both modules.
It is too early for me, to share my solution, because I have to do some changings for my own need and I get many many many problems all the time with the stability of the modules, also with the strange behavior, that sometimes everything works fine, but sometimes not. I think there is need for a much better error handling, for cases like timewise corrupted connection between the modules.
I tried out different modules, like NodeMCU, Witty and other, with soldering additional capacitors direct to VCC and GND and so on, but until now, nothing solves my temoparily problems.
But what I can say: If the connection works, than also the code from joeygbsn does!
Many thanks to him, for sharing it! It's a usefull base for going further.
There is one thing left, that seems strange for me: I come from Atmel AVR and BASCOM. There it was so, that a seriell incomming triggered an Interrupt, so that the programm knows, there are datas to pick up.
The code above goes an other way: It uses a timer to look periodically for incomming datas.
I must say, that this seems a bit strange for me, because most of the time there are no datas, why "bothering" a timer for nearly nothing?
Isn't there a way to implement an UART-interrupt?