Hallo!
Ich habe gerade meinen Aduino Nano mit einem GY-BME/P-280 verbunden über SPI verbunden.
Im Sketch habe ich nur die PINS geändert und zwar auf:
#define BMP_SCK 13
#define BMP_MISO 12
#define BMP_MOSI 11
#define BMP_CS 10
Ich bekomme aber bei der Ausgabe am seriellen Monitor nur "Hyroglyphen" zB 5��,�lh����}����'�O8��m�h,�
Mit einem anderen Sketch funktioniert der Sensor einwandfrei. Auch mit einem anderen Nano dasselbe Ergebnis.
Hat jemand eine Idee was das Problem sein könnte?
Zusatzfrage da ich in C++ nicht so firm bin: Könnte es sein, dass MY_DEBUG oder MY_RADIO_NRF24 das problem verursacht. Was machen diese Definitionen eigentlich?
Grüße
@OldSurferDude
yeah, 10 virgin nodes powered up at the same time is a bad idea I seem to remember reading somwewhere here warning aginst that.
If yu have node ID trust issues with Mysensors you should move your address to different locaion as 0x00 is used by Mysensors... just sayin..;)
@Paul-Scarbro There are multitude of solution, but since we are in MySensors Land, let's do a MySensors solution. You'll quickly see that doing that adds a lot of overhead.
We'll use an Arduino Nano or RF Nano if you're going to go whole hog. It can be run from 3.3V or 5V DC, not AC.
The reed switch would be connected to an input of the Nano and one of the outputs would drive a relay. The relay would drive the chime.
Your C++ program would be something like:
#define inputButton 2; // connect reed switch here
#define outputRelay 4; // connect relay to this pin see MySensors Relay example
#define RELAY_ON 1 // GPIO value to write to turn on attached relay
#define RELAY_OFF 0 // GPIO value to write to turn off attached relay
void setup() {
pinmode(inputButton,INPUT);
pinmode(outputRelay,OUTPUT);
// put your setup code here, to run once:
}
void loop() {
// put your main code here, to run repeatedly:
if (digitalRead(inputButton) == 0) {
digitalWrite(outputRelay,RELAY_ON);
wait(2000); // wait 2 seconds
digitalWrite(outputRelay,RELAY_OFF);
// now wait for door to close
while(digitalRead(inputButton) == 0) ; //does nothing until reed switch opens
}
}
There are some subtleties that I may have glossed over, but this is the gist.
By looking at the MySensors Relay example, you'll see how to integrate this into a MySensors environment. That's where you'd want to get the RF Nano.
I've made the assumption you're familiar with the Arduino IDE and you've looked into the MySensors environment.
Quick Range Check on the WIO-E5-LE. The LE version uses only the low power PA, +14dBm max. Using the default settings except for 915MHz
#define MY_SX126x_FREQUENCY (SX126x_915MHZ)
#define MY_SX126x_LORA_SF LORA_SF7
#define MY_SX126x_LORA_BW LORA_BW_125
#define MY_SX126x_LORA_CR LORA_CR_4_5
I get about 190 meter range, just walking around the neighborhood, line of site except for some trees and power lines.
No tuning on the antenna. Just using a 77.9mm wire.
Not as dramatic as some have achieved with LoRa radio's, but plenty good enough for my house and yard : )