Thanks a lot for the reply! It was very useful. After debugging I came to the conclusion that one of the nrf24 modules was faulty.
Stoica Andreea
@Stoica Andreea
Best posts made by Stoica Andreea
-
RE: raspberrry pi 4 + rf24 receives data from arduino + rf24
Latest posts made by Stoica Andreea
-
RE: raspberrry pi 4 + rf24 receives data from arduino + rf24
@mfalkvidd I have renamed it to /dev/ttyAMA0
-
RE: raspberrry pi 4 + rf24 receives data from arduino + rf24
I have replaced de nrf24 sensors and I managed to get the right message for testing:
I am confused because I have read a lot of posts and I couldn't find a clear answer.
I want to use the rpi as the gateway without connecting a controller via the usb port. Still, I have used ./configure with the serial gateway tags as explained in this tutorial https://www.mysensors.org/build/raspberry because I have read that the port can be virtual and it doesn't need a controller connected to the rpi. The mysgw.service is up and running at every boot of the rpi.I am working with openhab and I need to display the measured values on the web site. Here is the debug window for openhab.
Do you have any suggestions or tutorials I can follow?
-
RE: ethernet gateway tsp fail
I have missed an important detail in the earlier post.
I am working on a project that has some constraints - I have to find a way to send data through Wifi and another way to send data through radio waves (the nrf).
This post was regarding the Wifi connection. From what I understood from your last post, the communication between the gateway and the node is established through the nrf24 module and then the message is send via Wifi. Is that correct?
Also, if you could point me out a method using mysensors with the Wifi only it would be very helpful.
-
RE: ethernet gateway tsp fail
I intend to use wemos as a node and the raspberry as the gateway.
I want to implement a system on openhab with the mysensors binding. I am trying to read a value from a sensor attached to wemos (I have removed the interactive part and I am only sending a true "1" value for the tripped variable) then send it to the raspberry pi and later display it via the openhab platform.
For now, I am testing the interaction between wemos and raspberry in the openhabian terminal.
-
ethernet gateway tsp fail
Hello!
I am using a raspberry pi 4 that has openhabian as an SO.
I have installed mysensors binding in the karaf console with these 2 lines:
bundle:install http://www.oberfoell.com/openhab2/org.openhab.binding.mysensors-2.5.0-SNAPSHOT.jarbundle:start 237
Now, mysensors binding appears active:
I have also installed the additional features as said here https://github.com/tobof/openhab2-addons/wiki/Installation (the mqtt and serial).
I have followed the instructions here https://www.mysensors.org/build/raspberry and configured the gateway like this ./configure --my-gateway=ethernet --my-port=5003. I ran make afterwards.
I am using a Wemos that has the following code
// Enable debug prints to serial monitor
#define MY_DEBUG#define MY_GATEWAY_ESP8266
//#define MY_WIFI_SSID "DIGI-7xj8"
//#define MY_WIFI_PASSWORD "redacted"#define MY_WIFI_SSID "TP-Link_DFA1"
#define MY_WIFI_PASSWORD "redacted"// Enable UDP communication
#define MY_USE_UDP // If using UDP you need to set MY_CONTROLLER_IP_ADDRESS or MY_CONTROLLER_URL_ADDRESS below// Set the hostname for the WiFi Client. This is the hostname
// it will pass to the DHCP server if not static.
#define MY_HOSTNAME "ESP8266_GW"// The port to keep open on node server mode
#define MY_PORT 5003// How many clients should be able to connect to this gateway (default 1)
#define MY_GATEWAY_MAX_CLIENTS 2// Controller ip address. Enables client mode (default is "server" mode).
// Also enable this if MY_USE_UDP is used and you want sensor data sent somewhere.
#define MY_CONTROLLER_IP_ADDRESS 192,168,0,104
#define IP_PORT 5003
//#define MY_CONTROLLER_URL_ADDRESS "my.controller.org"#include <MySensors.h>
uint32_t SLEEP_TIME = 120000; // Sleep time between reports (in milliseconds)
#define DIGITAL_INPUT_SENSOR 3 // The digital input you attached your motion sensor. (Only 2 and 3 generates interrupt!)#define MY_NODE_ID 1
#define CHILD_ID 1 // Id of the sensor child// Initialize motion message
MyMessage msg(CHILD_ID, V_TRIPPED);void setup()
{
Serial.begin(115200);
pinMode(DIGITAL_INPUT_SENSOR, INPUT); // sets the motion sensor digital pin as input
}void presentation()
{
// Send the sketch version information to the gateway and Controller
sendSketchInfo("Motion Sensor", "1.0");// Register all sensors to gw (they will be created as child devices) present(CHILD_ID, S_MOTION);
}
void loop()
{
// Read digital motion value
//bool tripped = digitalRead(DIGITAL_INPUT_SENSOR) == HIGH;
bool tripped=true;
Serial.println(tripped);
//send(msg.set(tripped?"1":"0")); // Send tripped value to gw
send(msg.set(tripped));Serial.println(WiFi.localIP()); // Sleep until interrupt comes in on motion sensor. Send update every two minute. //sleep(digitalPinToInterrupt(DIGITAL_INPUT_SENSOR), CHANGE, SLEEP_TIME); //sleep(SLEEP_TIME); delay(SLEEP_TIME);
}
When I run this command sudo ./bin/mysgw I have the following error:
Do you have any suggestions?
-
RE: raspberrry pi 4 + rf24 receives data from arduino + rf24
Thanks a lot for the reply! It was very useful. After debugging I came to the conclusion that one of the nrf24 modules was faulty.
-
raspberrry pi 4 + rf24 receives data from arduino + rf24
Hello!
I have a Raspberry Pi 4 with a nrf24l01 module connected that has to receive data (temperature measured by a DHT) from an Arduino that also has a nrf24l01 connected to it. I want to implement it to Openhab, but first I am trying to see in the terminal if the connection is ok - currently it fails (it doesn’t receive any data). Here are the steps I have taken.
I have connected the Arduino to the nrf24l01 module and to a DHT sensor as it follows:
nrf24l01 Arduino Uno GND GND CE pin 4 SCK pin 13 MISO pin 12 VCC 3.3V CSN pin 2 MOSI pin 11 IRQ to nothing
The code on the Arduino is:
// Enable debug prints #define MY_DEBUG // Enable and select radio type attached #define MY_RADIO_RF24 //#define MY_RADIO_RFM69 //#define MY_RS485 // Enable serial gateway #define MY_GATEWAY_SERIAL #include <SPI.h> #include <MySensors.h> #include <DHT.h> // Set this to the pin you connected the DHT's data pin to #define DHT_DATA_PIN 3 #define DHTTYPE DHT11 // Sleep time between sensor updates (in milliseconds) // Must be >1000ms for DHT22 and >2000ms for DHT11 static const uint64_t UPDATE_INTERVAL = 60000; #define CHILD_ID_TEMP 2 float lastTemp; uint8_t nNoUpdatesTemp; bool metric = true; MyMessage msgTemp(CHILD_ID_TEMP, V_TEMP); DHT dht(DHT_DATA_PIN, DHTTYPE); void presentation() { // Send the sketch version information to the gateway sendSketchInfo("Temperature", "1.1"); // Register all sensors to gw (they will be created as child devices) present(CHILD_ID_TEMP, S_TEMP); } void setup() { dht.begin(); } void loop() { // Get temperature from DHT library float temperature = dht.readTemperature(); send(msgTemp.set(temperature, 1)); // Sleep for a while to save energy sleep(UPDATE_INTERVAL); }
The wiring scheme for the Raspberry Pi 4 is:
I have followed the instructions at https://www.mysensors.org/build/raspberry with the following configurations:
--my-transport=rf24
--my-gateway=serial --my-serial-is-pty —my-serial-port=/dev/ttyMySensorsGatewayI have build the gateway but when I test it with sudo ./bin/mysgw I get the following error message:
Do you know what may cause the error? I am relatively new and I didn’t try debugging it yet.
Thanks!