Raspberry Gateway + Arduino pro mini (atmega328p) NRF24L01 (without plus +)
-
@alop geat.
Until you have the capacitors in place, see if sundberg's advice on moving the nodes apart helps, about 2-3 meters. The signal can become too strong.@mfalkvidd
Just in general: What is the procedure if I change the MyConfig.h on raspberry? -
@mfalkvidd
Just in general: What is the procedure if I change the MyConfig.h on raspberry? -
@mfalkvidd Ok, so far :)
But do I need to "compile", "build", "make" something so that changes in MyConfig.h will be taken? -
@mfalkvidd Ok, so far :)
But do I need to "compile", "build", "make" something so that changes in MyConfig.h will be taken? -
@alop ok :)
I think make is sufficient (and make install if you want the new binary installed).
make is smart enough to recompile everything that has been modified.
@mfalkvidd
Unfortunatelly no change after adding capacitor :(
Now I have bought NRF24L01 WITH Plus and I'm trying with them.
I have reinstalled from skratch everything.
Gateway and sensor are now ca. 3-4 meters appart.Sketch on atmega328p (light sensor)
/** * 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. * ******************************* * * REVISION HISTORY * Version 1.0 - Henrik EKblad * * DESCRIPTION * Example sketch showing how to measue light level using a LM393 photo-resistor * http://www.mysensors.org/build/light */ // Enable debug prints to serial monitor #define MY_DEBUG // Enable and select radio type attached #define MY_RADIO_NRF24 //#define MY_RADIO_RFM69 #include <MySensors.h> #define CHILD_ID_LIGHT 15 #define LIGHT_SENSOR_ANALOG_PIN 0 unsigned long SLEEP_TIME = 30000; // Sleep time between reads (in milliseconds) MyMessage msg(CHILD_ID_LIGHT, V_LIGHT_LEVEL); int lastLightLevel; void presentation() { // Send the sketch version information to the gateway and Controller sendSketchInfo("Light Sensor", "1.0"); // Register all sensors to gateway (they will be created as child devices) present(CHILD_ID_LIGHT, S_LIGHT_LEVEL); } void loop() { int16_t lightLevel = (1023-analogRead(LIGHT_SENSOR_ANALOG_PIN))/10.23; Serial.println(lightLevel); if (lightLevel != lastLightLevel) { send(msg.set(lightLevel)); lastLightLevel = lightLevel; } sleep(SLEEP_TIME); }On raspberry
./configure --my-transport=nrf24 --my-gateway=serial --my-serial-is-pty --my-serial-pty=/dev/ttyUSB020Serial on the sensor
114445 !TSM:FPAR:NO REPLY 114447 TSM:FPAR 114449 TSF:MSG:SEND,255-255-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK: 116457 !TSM:FPAR:FAIL 116459 TSM:FAIL:CNT=7 116461 TSM:FAIL:DIS 116463 TSF:TDI:TSL 176465 TSM:FAIL:RE-INIT 176467 TSM:INIT 176475 TSM:INIT:TSP OK 176477 TSM:FPAR 176479 TSF:MSG:SEND,255-255-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK: 178487 !TSM:FPAR:NO REPLY 178489 TSM:FPAR 178491 TSF:MSG:SEND,255-255-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK: 180499 !TSM:FPAR:NO REPLY 180501 TSM:FPAR 180503 TSF:MSG:SEND,255-255-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK: 182511 !TSM:FPAR:NO REPLY 182513 TSM:FPAR 182515 TSF:MSG:SEND,255-255-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK:on raspberry
pi@RP3HA:~/MySensors $ sudo ./bin/mysgw -d mysgw: Starting gateway... mysgw: Protocol version - 2.2.0-beta mysgw: MCO:BGN:INIT GW,CP=RNNG----,VER=2.2.0-beta mysgw: TSF:LRT:OK mysgw: TSM:INIT mysgw: TSF:WUR:MS=0 mysgw: TSM:INIT:TSP OK mysgw: TSM:INIT:GW MODE mysgw: TSM:READY:ID=0,PAR=0,DIS=0 mysgw: MCO:REG:NOT NEEDED mysgw: MCO:BGN:STP mysgw: MCO:BGN:INIT OK,TSP=1And on my home automation (home assistant)
2017-07-22 13:00:19 ERROR (Thread-13) [mysensors.gateway_serial] Unable to connect to /dev/ttyUSB020Update:
After 15-20 minutes running the gateway I received following lines:mysgw: TSF:SAN:OK mysgw: TSM:READY:NWD REQ mysgw: TSF:MSG:SEND,0-0-255-255,s=255,c=3,t=20,pt=0,l=0,sg=0,ft=0,st=OK: -
It's a workaroud, but not "nice".
Since I have no problem on creating gateway on another arduino pro mini, I just connected per USB the arduino to RP3 and everything is working fine.
So sensors can be read by a controller (home assistant).
Big downside is, that for pro mini I have to use usb to ttl convertor in between.
Maybe the code for raspberry is with bugs, since to be able to see my rf radio on raspberry I had to install the "development" branch. -
Just follow the guide of raspberry gateway and choose to configure it as ethernet, it makes it easier to setup con controller.