@hlehoux Here is a useful link how to do that: https://learn.sparkfun.com/tutorials/rfm69hcw-hookup-guide/the-antenna
Posts made by hakha4
-
RE: Help needed to setup a RFM69 & ESP8266 Gateaway on Adafruit Feather Huzzah
@hlehoux Hi!
I'm not sure what the "W" means, i read chinese copy don't have it ?W means the low power output variant (+13dBm). There is another version named 'HW' which give a higher transmission output (+20 dBM). As elektik pointed out, check out the solder of the antenna. Did the antenna come presoldered or you did it yourself?
Another option for the coiled antenna is a straight copper wire (8,6 cm long) that gives better transmission according to many sources. Google! theres's alot information about this -
RE: Help needed to setup a RFM69 & ESP8266 Gateaway on Adafruit Feather Huzzah
@hlehoux Hi!
I had quite alot of trouble with NRF24 modules with shaky connections despite doing everything that has been discussed in forum with power supply etc and have ordered a bunch of RFM69's to hopefully improve this according to others in forum claiming better stability with RFM''s. Haven't tested yet but reading this is a bit dissapointing.
One thing though. Readings in log shows very high RSSI values and if it is measured in dBm this is very bad. The lower value the better I believe. Antenna issue ? -
Error sending switch command, check device/hardware (idx=57)
Re: [Error sending switch command](check device/hardware !)
I know this has been discussed before but with an earlier version of MySensors.
I have the same problem as disscussed here and want to add an delay for testing if that solves the problem. Using MySensors 2.3.2 but can't find where to add the delay in MyTransport.cpp. Anyone know where to change or having the same issue and found a solution ? -
RE: RPI Gateway Error
Hi! Thank's for info. I had almost given up and now using an ESP GW instead but I'll give your setup a try
-
RE: RPI Gateway Error
I have updated Buster and Domoticz works ok but can't get the gw to work. Btw is it normal (ok) to get a number of warnings when compiling??
-
RPI Gateway Error
Hi!
I'm using a rpi gw with nrf24 in combination with Domoticz,worked ok until upgrading Domoticz that must have debian buster to work! Now it is impossible to build the gw , I have tried a number of times with fresh debian installs. and different pi's- when doing 'make' a number of warnings but no errors : one example see below
./core/MyMessage.cpp:284:17: warning: ‘char strncpy(char*, const char*, size_t ’ output may be truncated copying between 0 and 25 bytes from a string of length 25 [-Wstringop-truncation]
(void)strncpy(buffer, this->data, this->getLength());
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
In member function ‘char* MyMessage::getString(char*) const’,*- output from test :
Mar 25 10:59:23 INFO Starting gateway...
Mar 25 10:59:23 INFO Protocol version - 2.3.2
Mar 25 10:59:23 DEBUG MCO:BGN:INIT GW,CP=RNNGL---,FQ=NA,REL=255,VER=2.3.2
Mar 25 10:59:23 DEBUG TSF:LRT:OK
Mar 25 10:59:23 DEBUG TSM:INIT
Mar 25 10:59:23 DEBUG TSF:WUR:MS=0
Mar 25 10:59:23 DEBUG !TSM:INIT:TSP FAIL
Mar 25 10:59:23 DEBUG TSM:FAIL:CNT=1
Mar 25 10:59:23 DEBUG TSM:FAIL:DIS
Mar 25 10:59:23 DEBUG TSF:TDI:TSL
Mar 25 10:59:33 DEBUG TSM:FAIL:RE-INIT
Mar 25 10:59:33 DEBUG TSM:INIT
Mar 25 10:59:33 DEBUG !TSM:INIT:TSP FAIL
Mar 25 10:59:33 DEBUG TSM:FAIL:CNT=2
Mar 25 10:59:33 DEBUG TSM:FAIL:DIS
Mar 25 10:59:33 DEBUG TSF:TDI:TSL
^CMar 25 10:59:38 NOTICE Received SIGINTI am using an adapter (https://oshpark.com/shared_projects/aXLXBO3f) so pinout is ok.
Configuration :
./configure --my-transport=rf24 --my-rf24-irq-pin=18 --my-gateway=ethernet --my-port=5003 --my-leds-err-pin=11 --my-leds-rx-pin=13 --my-leds-tx-pin=15
(tried with just ./configure --my-transport=rf24, same result)Software/hardware:
debian ver 10.3 (with SPI enabled)processor : 0
model name : ARMv7 Processor rev 5 (v7l)
BogoMIPS : 38.40
Features : half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt vfpd32 lpae evtstrm
CPU implementer : 0x41
CPU architecture: 7
CPU variant : 0x0
CPU part : 0xc07
CPU revision : 5processor : 1
model name : ARMv7 Processor rev 5 (v7l)
BogoMIPS : 38.40
Features : half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt vfpd32 lpae evtstrm
CPU implementer : 0x41
CPU architecture: 7
CPU variant : 0x0
CPU part : 0xc07
CPU revision : 5processor : 2
model name : ARMv7 Processor rev 5 (v7l)
BogoMIPS : 38.40
Features : half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt vfpd32 lpae evtstrm
CPU implementer : 0x41
CPU architecture: 7
CPU variant : 0x0
CPU part : 0xc07
CPU revision : 5processor : 3
model name : ARMv7 Processor rev 5 (v7l)
BogoMIPS : 38.40
Features : half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt vfpd32 lpae evtstrm
CPU implementer : 0x41
CPU architecture: 7
CPU variant : 0x0
CPU part : 0xc07
CPU revision : 5Hardware : BCM2835
Revision : a01041
Serial : 000000004831d281
Model : Raspberry Pi 2 Model B Rev 1.1Compiler : gcc (Raspbian 8.3.0-6+rpi1) 8.3.0
Is there a known problem with latest debian Buster ?
I'm going nut's and have run out of ideas how to solve thisSorry for this long text, but wanted to give as much information as possible.
Any help appreciated! -
RE: DS18B20 + multi relay
Hi
I have a similar setup but I'm using MCP23017 for the relays wich only takes two pins and it works perfect.
As to your question about presenting sensors to gateway. Code snippet below is one way to do this I think// in my setup ID for tempsensors starts with number of relays plus one uint8_t RELAY_First_Child_ID = 1;//First relay Child-ID uint8_t DS_First_Child_ID = NUMBER_OF_RELAYS + 1; //First Child-ID to be used by Dallas Bus; set this to be higher than number of relays who need EEPROM storage to avoid conflicts // in YOUR setup ID för trmpsensors could be like below uint8_t RELAY_First_Child_ID = 1;//First relay Child-ID uint8_t DS_First_Child_ID =100; // //PRESENT TO GATEWAY void presentation() { // Send the sketch version information to the gateway and Controller sendSketchInfo("Your info", "1.0"); // Register relays to gateway for (int i = 0; i <= NUMBER_OF_RELAYS-1; i++) { present(RELAY_First_Child_ID + i, S_BINARY);// delay(200);//uncomment if all relays not being registered correct }// end for loop //----------------------------------------------------------------------------- // Register temperature sensors to gateway as child devices // Fetch the number of attached temperature sensors // Present all temperature sensors to controller for (int i = 0; i < numberOfDevices; i++) { present(DS_First_Child_ID + i, S_TEMP);// in your case first ID=100 //delay(200);//uncomment if all sensors not being registered correct }// end for loop
Hope this might give you an idea how to. If you want I can give you my sketch doing what you want to accomplish but as I said it's based on MCP23017 to drive relays
-
RE: Arduino Nano Every problem
Ok. Thanks for answer. I have to wait until it is eventually implemented. Could be nice to have bigger sketches in a smaller Arduino compare to Mega
Regards Håkan -
Arduino Nano Every problem
Hi
Error when compiling a node sketch to Arduino Nano Every :xxx\Arduino\libraries\MySensors/MySensors.h:83:2: error: #error Hardware abstraction not defined (unsupported platform)
If I understand right the old Nano and Every are compatible, just more memory etc in the Every. Is there a change in MySensors library that can be changed to accept the Nano Every ?
Regards Håkan -
RE: Multiple relay arduino nano
Hi
Or use a Mcp23017, 16 extra pins and only sda/scl pins from Arduino (I have a functioning sketch for this including reading multiple ds1820 sensors that can be used as a template. Let me know of you want this)
Regards Håkan -
RE: ESP32 gateway pinout
Hi
Thank's for answer. RF24 isn't a wifi radio, work's like RFM I believe.
I'm building a Mysensors gateway with lan for Domoticz and as I said with Esp8266 it works and I've used the example sketch for Esp32 GW so I must made some fault. I'll try and error but if someone have tips I appreciate comment's -
ESP32 gateway pinout
Hi
I'm trying to get a gateway with ESP32 devkit V1.0 to work. I have an ESP8266 GW working but want some extra pins for traffic light to work and perhaps better speed etc.
I found a pinout in 'MyHWESP32.h' as below but I always get confused refeering to pin number. I assume the numbers refeers to GPIO number ?. I use an adapter for the radio to get extra juice and power the adapter from the Vin pin (5V from USB) but I can't get radio to work.
Checked and rechecked wiring.Output from serial port :
10040 TSM:FAIL:RE-INIT
10041 TSM:INIT
10048 !TSM:INIT:TSP FAIL
10050 TSM:FAIL:CNT=2
10052 TSM:FAIL:DIS
10053 TSF:TDI:TSL
20056 TSM:FAIL:RE-INIT
20057 TSM:INIT
20064 !TSM:INIT:TSP FAIL
20066 TSM:FAIL:CNT=3
20068 TSM:FAIL:DIS
20069 TSF:TDI:TSL
Adapter used :
Code :
/** * 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-2018 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 - tekka * * DESCRIPTION * The ESP32 gateway sends data received from sensors to the WiFi link. * The gateway also accepts input on ethernet interface, which is then sent out to the radio network. * ----------- PINOUT -------------- * | IO | RF24 | RFM69 | RFM95 | |------|------|-------|-------| | MOSI | 23 | 23 | 23 | | MISO | 19 | 19 | 19 | | SCK | 18 | 18 | 18 | | CSN | 5 | 5 | 5 | | CE | 17 | - | - | | RST | - | 17 | 17 | | IRQ | 16* | 16 | 16 | * Make sure to fill in your ssid and WiFi password below. */ // Enable debug prints to serial monitor #define MY_DEBUG // Enables and select radio type (if attached) #define MY_RADIO_RF24 //#define MY_RADIO_RFM69 //#define MY_RADIO_RFM95 #define MY_GATEWAY_ESP32 #define MY_WIFI_SSID "xxxxxxx" #define MY_WIFI_PASSWORD "xxxxxxxx" // Set the hostname for the WiFi Client. This is the hostname // it will pass to the DHCP server if not static. #define MY_HOSTNAME "ESP32_GW" // Enable MY_IP_ADDRESS here if you want a static ip address (no DHCP) #define MY_IP_ADDRESS 192,168,1,10 // If using static ip you can define Gateway and Subnet address as well #define MY_IP_GATEWAY_ADDRESS 192,168,1,1 #define MY_IP_SUBNET_ADDRESS 255,255,255,0 // 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 #include <MySensors.h> void setup() { // Setup locally attached sensors } void presentation() { // Present locally attached sensors here } void loop() { // Send locally attached sensors data here }
Anyone succesfully get the ESP32 to work ? Any idea what could be the problem ? Can someone confirm that pin numbers are correct ?
Any help appreciated -
RE: Changing a node not captured by gateway
You're absolutely right. Should be MyMessage msgC(SSR_C_ID, V_STATUS);
Sometimes you get blind when looking for typos. Thank's -
RE: Changing a node not captured by gateway
I'll try put in a delay and get back if not solved. Thank's
-
RE: Changing a node not captured by gateway
Thankäs for answer. I've find code on internet with two relay's 'A and B'. Just added a third relay 'C'. When first using two relays everything worked ok with two child's registered in Domoticz but when updating the node with relay 'C it don't shows up in Domoticz. So my main question is if gateway recognize changes in an earlier reg. node or if you have to delete some info for a fresh reg. ? I've checked code for typo error but can't see any obvious errors. See code below:
/* * NANO: * Radio occupies pin 2,9-13 * */ #define MY_DEBUG #define MY_RADIO_NRF24 #define MY_REPEATER_FEATURE #include <SPI.h> #include <MySensors.h> #include <Bounce2.h> #define RELAY_ON 1 #define RELAY_OFF 0 #define SSR_A_ID 1 // Id of the sensor child pump filter #define SSR_B_ID 2 // Id of the sensor child pump waterfall #define SSR_C_ID 3 // Id of the sensor child pump waterfall const int buttonPinA = 3; const int buttonPinB = 7; const int buttonPinC = 8; const int relayPinA = 4; const int relayPinB = 5; const int relayPinC = 6; int oldValueA = 0; int oldValueB = 0; int oldValueC = 0; bool stateA = false; bool stateB = false; bool stateC = false; Bounce debouncerA = Bounce(); Bounce debouncerB = Bounce(); Bounce debouncerC = Bounce(); MyMessage msgA(SSR_A_ID, V_STATUS); MyMessage msgB(SSR_B_ID, V_STATUS); MyMessage msgC(SSR_B_ID, V_STATUS); void setup() { pinMode(buttonPinA, INPUT_PULLUP); // Setup the button Activate internal pull-up pinMode(buttonPinB, INPUT_PULLUP); // Setup the button Activate internal pull-up pinMode(buttonPinC, INPUT_PULLUP); // Setup the button Activate internal pull-up // Then set relay pins in output mode pinMode(relayPinA, OUTPUT); pinMode(relayPinB, OUTPUT); pinMode(relayPinC, OUTPUT); // After setting up the buttons, setup debouncer debouncerA.attach(buttonPinA); debouncerA.interval(5); debouncerB.attach(buttonPinB); debouncerB.interval(5); debouncerC.attach(buttonPinC); debouncerC.interval(5); // Make sure relays are off when starting up digitalWrite(relayPinA, RELAY_OFF); digitalWrite(relayPinB, RELAY_OFF); digitalWrite(relayPinC, RELAY_OFF); /*--------------------- Added these lines for toggle switch-------------------------*/ oldValueA = digitalRead(buttonPinA); // set oldValueA to the current status of the toggle switch oldValueB = digitalRead(buttonPinB); // set oldValueB to the current status of the toggle switch oldValueC = digitalRead(buttonPinC); // set oldValueB to the current status of the toggle switch send(msgA.set(false)); // Send off state for relayA to ensure controller knows the switch is off send(msgB.set(false)); // Send off state for relayB to ensure controller knows the switch is off send(msgC.set(false)); // Send off state for relayB to ensure controller knows the switch is off } void presentation() { // Send the sketch version information to the gateway and Controller sendSketchInfo("Pond Controller", "1.0"); // Register all sensors to gw (they will be created as child devices) present(SSR_A_ID, S_LIGHT); present(SSR_B_ID, S_LIGHT); present(SSR_C_ID, S_LIGHT); } /* Example on how to asynchronously check for new messages from gw */ void loop() { debouncerA.update(); // Get the update value int valueA = debouncerA.read(); if (valueA != oldValueA) { send(msgA.set(stateA ? false : true), true); // Send new state and request ack back oldValueA = valueA; } debouncerB.update(); // Get the update value int valueB = debouncerB.read(); if (valueB != oldValueB) { send(msgB.set(stateB ? false : true), true); // Send new state and request ack back oldValueB = valueB; } debouncerC.update(); // Get the update value int valueC = debouncerC.read(); if (valueC != oldValueC) { send(msgC.set(stateC ? false : true), true); // Send new state and request ack back oldValueC = valueC; } } void receive(const MyMessage &message) { // We only expect one type of message from controller. But we better check anyway. if (message.type == V_STATUS) { switch (message.sensor) { case 1: stateA = message.getBool(); digitalWrite(message.sensor + 4, stateA ? RELAY_ON : RELAY_OFF); break; case 2: stateB = message.getBool(); digitalWrite(message.sensor + 4, stateB ? RELAY_ON : RELAY_OFF); case 3: stateC = message.getBool(); digitalWrite(message.sensor + 4, stateC ? RELAY_ON : RELAY_OFF); break; } // Write some debug info Serial.print("Incoming change for sensor:"); Serial.println(message.sensor); Serial.print("from node:"); Serial.println(message.sender); Serial.print(", New status: "); Serial.println(message.getBool()); } }
Regards
-
Changing a node not captured by gateway
I'm new to Mysensors but must say that I'm impressed sofar! Great job from the developers. I've made a gateway with ESP8266 that work's just fine. Now to my issue. Made a node with two relays and it show's up as expected in Domoticz and seems to work perfect. When upgrading the node by adding another relay it don't shows the added relay. What do I have to do for gateway to see that a node has changed ?
Any help appreciated
Regards