Hi all,
I've made my gateway and sensor nodes and they're working perfectly. Now suppose that I have a neighbour that he has a MySensor gateway and sensors. How is it guaranteed that my sensors are not discovered by my neighbour's gateway!? I tought about inclusion mode but it is just defined for the gateway not for the sensors.
foad62
@foad62
Best posts made by foad62
-
Multiple Gateway Interference
-
RE: Using nrf24l01 with other devices on one SPI bus
@mfalkvidd
Yes you are right, Thank you.
Latest posts made by foad62
-
RE: Using nrf24l01 with other devices on one SPI bus
@mfalkvidd
Yes you are right, Thank you. -
RE: Using nrf24l01 with other devices on one SPI bus
Since I'm using Arduino Nano because of it's small size, I think I can't use softspi. Am I correct?
-
RE: Using nrf24l01 with other devices on one SPI bus
@mfalkvidd
Can nrf24l01+ coexist with TFT LCD on one SPI port? -
RE: SOFT-SPI on Arduino Nano
It is 1.8" TFT LCD (TFT-LCD-ST7735).
I'm not sure if it supports I2C connection! -
SOFT-SPI on Arduino Nano
My goal is to connect an LCD to Arduino Nano. I'm using Arduino Nano because of it's small size. Since SPI port is used by NRF24 module, is it possible to enable SOFT-SPI on arduino nano and connect the LCD to it?
-
RE: Missing Bracket in DallasTemperatureSensor Sketch
@hek
But when I add the missing closing bracket I get the following error:DallasTemperatureSensor:123: error: expected declaration before '}' token
}
^
exit status 1
expected declaration before '}' token -
RE: Missing Bracket in DallasTemperatureSensor Sketch
@hek
The closing bracket you mentioned is not for "loop()" it is for the following "for":// Read temperatures and send them to controller for (int i=0; i<numSensors && i<MAX_ATTACHED_DS18B20; i++) {
if you count the opening brackets starting from the loop(), there are 4 opening brackets and 3 closing brackets.
-
Missing Bracket in DallasTemperatureSensor Sketch
I was developing my project basde on DallasTemperatureSensor sketch and I found something strange. The loop function has no closing brackets! However the code compiles without errors. And since I'm adding receive function at the end of the sketch it has made me confused about the loop functionality!
/** * The MySensors Arduino library handles the wireless radio link and protocol * between your home built sensors/actuators and HA controller of choice. * The sensors forms a self healing radio network with optional repeaters. Each * repeater and gateway builds a routing tables in EEPROM which keeps track of the * network topology allowing messages to be routed to nodes. * * Created by Henrik Ekblad <henrik.ekblad@mysensors.org> * Copyright (C) 2013-2015 Sensnology AB * Full contributor list: https://github.com/mysensors/Arduino/graphs/contributors * * Documentation: http://www.mysensors.org * Support Forum: http://forum.mysensors.org * * 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. * ******************************* * * DESCRIPTION * * Example sketch showing how to send in DS1820B OneWire temperature readings back to the controller * http://www.mysensors.org/build/temp */ // Enable debug prints to serial monitor //#define MY_DEBUG // Enable and select radio type attached #define MY_RADIO_NRF24 //#define MY_RADIO_RFM69 #include <SPI.h> #include <MySensors.h> #include <DallasTemperature.h> #include <OneWire.h> #define COMPARE_TEMP 1 // Send temperature only if changed? 1 = Yes 0 = No #define ONE_WIRE_BUS 3 // Pin where dallase sensor is connected #define MAX_ATTACHED_DS18B20 16 unsigned long SLEEP_TIME = 30000; // Sleep time between reads (in milliseconds) OneWire oneWire(ONE_WIRE_BUS); // Setup a oneWire instance to communicate with any OneWire devices (not just Maxim/Dallas temperature ICs) DallasTemperature sensors(&oneWire); // Pass the oneWire reference to Dallas Temperature. float lastTemperature[MAX_ATTACHED_DS18B20]; int numSensors=0; bool receivedConfig = false; bool metric = true; // Initialize temperature message MyMessage msg(0,V_TEMP); void before() { // Startup up the OneWire library sensors.begin(); } void setup() { // requestTemperatures() will not block current thread sensors.setWaitForConversion(false); } void presentation() { // Send the sketch version information to the gateway and Controller sendSketchInfo("Temperature Sensor", "1.1"); // Fetch the number of attached temperature sensors numSensors = sensors.getDeviceCount(); // Present all sensors to controller for (int i=0; i<numSensors && i<MAX_ATTACHED_DS18B20; i++) { present(i, S_TEMP); } } void loop() { // Fetch temperatures from Dallas sensors sensors.requestTemperatures(); // query conversion time and sleep until conversion completed int16_t conversionTime = sensors.millisToWaitForConversion(sensors.getResolution()); // sleep() call can be replaced by wait() call if node need to process incoming messages (or if node is repeater) sleep(conversionTime); // Read temperatures and send them to controller for (int i=0; i<numSensors && i<MAX_ATTACHED_DS18B20; i++) { // Fetch and round temperature to one decimal float temperature = static_cast<float>(static_cast<int>((getConfig().isMetric?sensors.getTempCByIndex(i):sensors.getTempFByIndex(i)) * 10.)) / 10.; // Only send data if temperature has changed and no error #if COMPARE_TEMP == 1 if (lastTemperature[i] != temperature && temperature != -127.00 && temperature != 85.00) { #else if (temperature != -127.00 && temperature != 85.00) { #endif // Send in the new temperature send(msg.setSensor(i).set(temperature,1)); // Save new temperatures for next compare lastTemperature[i]=temperature; } } sleep(SLEEP_TIME); }```
-
RE: Multiple Gateway Interference
@tbowmo
Thank you
Network address and radio channels were what I was looking for. Using network address and changing radio channel I can make my network unique and enabling signing option secures my network.