nodeMCU, MY_GATEWAY_ESP8266 and Temp Sensor
-
ok, yes lokks like this. A soon as I try to get temp values then I run into an exception again.
void loop() { // Send locally attached sensors data here Serial.print("Requesting temperatures..."); sensors.requestTemperatures(); // Send the command to get temperatures Serial.println("DONE"); delay(1000); } -
-
As @Yveaux said, it can be lib compatibility with esp.
So If you want to try, I use this lib for ds18b20, with other mcus : http://www.pjrc.com/teensy/td_libs_OneWire.html (his stuff is neat).
I have not tried with esp8266 though, but i'm pretty sure it works ;) there are defines for esp8266 which are not present in mysensors git.. -
ok, i'll try, hmmmm how to import / use this lib ?
-
@mysensors-6043
how did you import Mysensors? ;) that's the same for every lib :)
So if you don't find it in lib manager, then download it and unzip it in your lib folder. restart arduino. go to examples. simple.
You will find this one in lib manager (look at the one with Paul PaulStoffregen contributor). or download it from his git -
@mysensors-6043,
Have you been able to confirm that you get temperature readings on the sensor? I would try to simplify your sketch to rule things out.Here's what I'd do, in the following order:
- Remove all MySensors related code and just get the sensor reading to the serial monitor.
- I see you're looping over several temperature sensors on the node, simplify this, only read one for starters.
- Verify your gateway is on the network by using telnet or netcat. I.e.:
nc xxx.xxx.xxx.xxx 5003 - Try just getting your node to "present" to the gateway. Reading the sensor debug via the serial monitor and watch the gateway via netcat.
-
Hi, yes, the Hardware is ok. running a Dallas example script shows the temperature from the sensor.
The Gateway is on the Network, I see a DHCP request and get Messages on the iobroker. -
@mysensors-6043,
The sketch you posted looks like you combined the sensors with the NodeMCU, is this true? Is this NodeMCU acting as a gateway as well? -
yes, but i'm not shure whether this is correct
All I Need is a sensor that sends the temperature via WLAN to UDP Port 5003 of the iobroker (acting as Controller)Could also be an Arduino Nano with a Radio, e.g. NRF24L01
-
@mysensors-6043,
The normal setup involves 3 pieces:- The sensor (aka node) emitting data via RF using something like a NRF24L01
- A gateway that receives the sensor data via the RF module (NRF24L01) and sends it to a controller over ethernet or wifi.
- A controller to manage connected nodes and present data to the user.
It seems like you're combining the sensor and gateway into one device. If this is the case, I think you can comment out the
#define MY_RADIO_RFM69line as there is no radio connected. I don't know how this plays into the registration process of a sensor. There is no ID getting associated to the sensor because this is a gateway.Maybe someone else can chime in who knows whether it's okay to combine the gateway and sensor into one device. If so, how is registration and ID assignment handled?
@mysensors-6043,
Post a updated version of your sketch. -
ok, looks better, I included the library from Paul Stoffregen and commented out #define MY_RADIO_RFM69.
So far no exception. I still can join my home WLAN, but sensor data can not be read.
All I Need is a temp sensor and send the data do a iobroker instance.The question is whether I'm on the right track with a nodeMCU ?
-
Hey Folks
Thank's a lot, the issue is solved. nodeMCU as a gateway measures the temperature, pass it over to an iobroker / mysensors instance. There with a JavaScript, I set a Homematic System Variable which is displayed in the iPad.
So now, I know, when the coffee machine has the right temp.cheers