Ah ok, well I'm very excited to see this area improve, hopefully this v2.2.0 beta is aiming for a release in the near future and is able to include the new driver and linux gateway improvements.
I'll wait patiently for now
Posts made by OpticFroggy
-
RE: RFM69 Supported on RPi Serial gateway?
-
RE: RFM69 Supported on RPi Serial gateway?
Yea I've seen those 2 PR's also.
I've even tried tekkas transportUpdate branch to see if anything on that bleeding edge is working with the RFM69. I ran into build failures when trying to make the Mysgw binary with the define-DMY_RFM69_NEW_DRIVER
included to use the new RFM69 driver. Using the old driver I got closer to it building but still failed due to the chip select define SS not being set.I know this stuff is all very WIP and not expected to work, but still nice to tinker and see if I can get anywhere with it.
-
RFM69 Supported on RPi Serial gateway?
Hey guys,
Just a quickie, does anyone know if the Raspberry Pi Serial gateway works with the RFM69 yet ? I had it working with the NRF24 previously and now that I'm looking to move to RFM69's it would be nice if I could essentially swap out the radio and have it all work with limited changes (within reason obviously).
Cheers
-
RE: RFM69 not initialising (required reset could be the cause)
Yep that did it, removed the lines from the transport and put them in before() and it's now working like a charm.
Kind of interesting how this has only seemingly affected me and none of the other many users of the RFM69
Thanks for the help and pointing me in the right direction scalz!
-
RE: RFM69 not initialising (required reset could be the cause)
So I've managed to now get it working by editing the RFM69 transport as such:
MyTransportRFM69.cpp
bool transportInit(void) { + // Reset the RFM69 Radio + pinMode(5, OUTPUT); + digitalWrite(5, HIGH); + delay(100); + digitalWrite(5, LOW); + delay(100); // Start up the radio library (_address will be set later by the MySensors library) if (_radio.initialize(MY_RFM69_FREQUENCY, _address, MY_RFM69_NETWORKID)) { #ifdef MY_RFM69_ENABLE_ENCRYPTION
Once those lines to reset it were added it works flawlessly every time now
The adafruit breakout has a pull-high on the RST pin and as far as I'm aware reading the RFM69 datasheet, it does a power on reset also, so I'm not sure why this is neccessary. -
RE: RFM69 not initialising (required reset could be the cause)
Hey,
The Hardware I'm using is an Arduino Pro mini (3.3v) and an RFM69HCW on the Adafruit breakout board.
The LPL sketch that works is below, as for the MySensors one It's basically just the examples (as a serial gateway and node) that won't work.
// Sample RFM69 sender/node sketch, with ACK and optional encryption, and Automatic Transmission Control // Sends periodic messages of increasing length to gateway (id=1) // It also looks for an onboard FLASH chip, if present // ********************************************************************************** // Copyright Felix Rusu 2016, http://www.LowPowerLab.com/contact // ********************************************************************************** // License // ********************************************************************************** // This program is free software; you can redistribute it // and/or modify it under the terms of the GNU General // Public License as published by the Free Software // Foundation; either version 3 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will // be useful, but WITHOUT ANY WARRANTY; without even the // implied warranty of MERCHANTABILITY or FITNESS FOR A // PARTICULAR PURPOSE. See the GNU General Public // License for more details. // // Licence can be viewed at // http://www.gnu.org/licenses/gpl-3.0.txt // // Please maintain this license information along with authorship // and copyright notices in any redistribution of this code // ********************************************************************************** #include <RFM69.h> //get it here: https://www.github.com/lowpowerlab/rfm69 #include <RFM69_ATC.h> //get it here: https://www.github.com/lowpowerlab/rfm69 //#include <SPIFlash.h> //get it here: https://www.github.com/lowpowerlab/spiflash #include <SPI.h> //included with Arduino IDE install (www.arduino.cc) //********************************************************************************************* //************ IMPORTANT SETTINGS - YOU MUST CHANGE/CONFIGURE TO FIT YOUR HARDWARE ************ //********************************************************************************************* #define NODEID 2 //must be unique for each node on same network (range up to 254, 255 is used for broadcast) #define NETWORKID 100 //the same on all nodes that talk to each other (range up to 255) #define GATEWAYID 1 //Match frequency to the hardware version of the radio on your Moteino (uncomment one): #define FREQUENCY RF69_433MHZ //#define FREQUENCY RF69_868MHZ //#define FREQUENCY RF69_915MHZ #define ENCRYPTKEY "sampleEncryptKey" //exactly the same 16 characters/bytes on all nodes! #define IS_RFM69HW //uncomment only for RFM69HW! Leave out if you have RFM69W! //********************************************************************************************* //Auto Transmission Control - dials down transmit power to save battery //Usually you do not need to always transmit at max output power //By reducing TX power even a little you save a significant amount of battery power //This setting enables this gateway to work with remote nodes that have ATC enabled to //dial their power down to only the required level (ATC_RSSI) //#define ENABLE_ATC //comment out this line to disable AUTO TRANSMISSION CONTROL // #define ATC_RSSI -80 //********************************************************************************************* #ifdef __AVR_ATmega1284P__ #define LED 15 // Moteino MEGAs have LEDs on D15 #define FLASH_SS 23 // and FLASH SS on D23 #else #define LED 9 // Moteinos have LEDs on D9 #define FLASH_SS 8 // and FLASH SS on D8 #endif #define SERIAL_BAUD 38400 int TRANSMITPERIOD = 200; //transmit a packet to gateway so often (in ms) char payload[] = "123 ABCDEFGHIJKLMNOPQRSTUVWXYZ"; char buff[20]; byte sendSize=0; boolean requestACK = false; // SPIFlash flash(FLASH_SS, 0xEF30); //EF30 for 4mbit Windbond chip (W25X40CL) #ifdef ENABLE_ATC RFM69_ATC radio; #else RFM69 radio; #endif void setup() { pinMode(5, OUTPUT); digitalWrite(5, HIGH); delay(100); digitalWrite(5, LOW); delay(100); Serial.begin(SERIAL_BAUD); radio.initialize(FREQUENCY,NODEID,NETWORKID); #ifdef IS_RFM69HW radio.setHighPower(); //uncomment only for RFM69HW! #endif radio.encrypt(ENCRYPTKEY); //radio.setFrequency(919000000); //set frequency to some custom frequency //Auto Transmission Control - dials down transmit power to save battery (-100 is the noise floor, -90 is still pretty good) //For indoor nodes that are pretty static and at pretty stable temperatures (like a MotionMote) -90dBm is quite safe //For more variable nodes that can expect to move or experience larger temp drifts a lower margin like -70 to -80 would probably be better //Always test your ATC mote in the edge cases in your own environment to ensure ATC will perform as you expect #ifdef ENABLE_ATC radio.enableAutoPower(ATC_RSSI); #endif char buff[50]; sprintf(buff, "\nTransmitting at %d Mhz...", FREQUENCY==RF69_433MHZ ? 433 : FREQUENCY==RF69_868MHZ ? 868 : 915); Serial.println(buff); #ifdef ENABLE_ATC Serial.println("RFM69_ATC Enabled (Auto Transmission Control)\n"); #endif } long lastPeriod = 0; void loop() { //process any serial input if (Serial.available() > 0) { char input = Serial.read(); if (input >= 48 && input <= 57) //[0,9] { TRANSMITPERIOD = 100 * (input-48); if (TRANSMITPERIOD == 0) TRANSMITPERIOD = 1000; Serial.print("\nChanging delay to "); Serial.print(TRANSMITPERIOD); Serial.println("ms\n"); } if (input == 'r') //d=dump register values radio.readAllRegs(); //if (input == 'E') //E=enable encryption // radio.encrypt(KEY); //if (input == 'e') //e=disable encryption // radio.encrypt(null); } //check for any received packets if (radio.receiveDone()) { Serial.print('[');Serial.print(radio.SENDERID, DEC);Serial.print("] "); for (byte i = 0; i < radio.DATALEN; i++) Serial.print((char)radio.DATA[i]); Serial.print(" [RX_RSSI:");Serial.print(radio.RSSI);Serial.print("]"); if (radio.ACKRequested()) { radio.sendACK(); Serial.print(" - ACK sent"); } Serial.println(); } int currPeriod = millis()/TRANSMITPERIOD; if (currPeriod != lastPeriod) { lastPeriod=currPeriod; Serial.print("Sending["); Serial.print(sendSize); Serial.print("]: "); for(byte i = 0; i < sendSize; i++) Serial.print((char)payload[i]); if (radio.sendWithRetry(GATEWAYID, payload, sendSize)) Serial.print(" ok!"); else Serial.print(" nothing..."); sendSize = (sendSize + 1) % 31; Serial.println(); } }
-
RFM69 not initialising (required reset could be the cause)
Hi,
I'm having issues getting my RFM69HCW to work with MySensors.
If I try a bare bones setup with the RFM69 library directly it also failed, until I found a helpful post suggesting resetting the radio before starting.
So once I added a wire for the reset pin and pulsed it high->low in setup it all started working flawlessly!pinMode(RFM69_RST_PIN, OUTPUT); digitalWrite(RFM69_RST_PIN, HIGH); delay(100); digitalWrite(RFM69_RST_PIN, LOW); delay(100);
So now I'm wondering if something similar is required in MySensors to get this to work ?
I tried adding the same block into the my MySensors code but it still fails when trying to initialise the transport0;255;3;0;9;MCO:BGN:INIT GW,CP=RRNGA--,VER=2.2.0-beta 0;255;3;0;9;TSM:INIT 0;255;3;0;9;TSF:WUR:MS=0 0;255;3;0;9;!TSM:INIT:TSP FAIL 0;255;3;0;9;TSM:FAIL:CNT=1 0;255;3;0;9;TSM:FAIL:PDT 0;255;3;0;9;TSM:FAIL:RE-INIT 0;255;3;0;9;TSM:INIT
Thanks guys
-
RE: ESP + RFM69 Gateway Reset issue
Hey,
Yea it's the ESP8266 Gateway sketch, unmodified except for the various defines I'd need afaik./** * 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 * Contribution by a-lurker and Anticimex, * Contribution by Norbert Truchsess <norbert.truchsess@t-online.de> * Contribution by Ivo Pullens (ESP8266 support) * * DESCRIPTION * The EthernetGateway 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. * * VERA CONFIGURATION: * Enter "ip-number:port" in the ip-field of the Arduino GW device. This will temporarily override any serial configuration for the Vera plugin. * E.g. If you want to use the defualt values in this sketch enter: 192.168.178.66:5003 * * LED purposes: * - To use the feature, uncomment any of the MY_DEFAULT_xx_LED_PINs in your sketch, only the LEDs that is defined is used. * - RX (green) - blink fast on radio message recieved. In inclusion mode will blink fast only on presentation recieved * - TX (yellow) - blink fast on radio message transmitted. In inclusion mode will blink slowly * - ERR (red) - fast blink on error during transmission error or recieve crc error * * See http://www.mysensors.org/build/esp8266_gateway for wiring instructions. * nRF24L01+ ESP8266 * VCC VCC * CE GPIO4 * CSN/CS GPIO15 * SCK GPIO14 * MISO GPIO12 * MOSI GPIO13 * GND GND * * Not all ESP8266 modules have all pins available on their external interface. * This code has been tested on an ESP-12 module. * The ESP8266 requires a certain pin configuration to download code, and another one to run code: * - Connect REST (reset) via 10K pullup resistor to VCC, and via switch to GND ('reset switch') * - Connect GPIO15 via 10K pulldown resistor to GND * - Connect CH_PD via 10K resistor to VCC * - Connect GPIO2 via 10K resistor to VCC * - Connect GPIO0 via 10K resistor to VCC, and via switch to GND ('bootload switch') * * Inclusion mode button: * - Connect GPIO5 via switch to GND ('inclusion switch') * * Hardware SHA204 signing is currently not supported! * * Make sure to fill in your ssid and WiFi password below for ssid & pass. */ // Enable debug prints to serial monitor #define MY_DEBUG // Use a bit lower baudrate for serial prints on ESP8266 than default in MyConfig.h #define MY_BAUD_RATE 9600 // Enables and select radio type (if attached) //#define MY_RADIO_NRF24 #define MY_RADIO_RFM69 #define MY_RFM69_FREQUENCY RF69_433MHZ #define MY_IS_RFM69HW #define MY_GATEWAY_ESP8266 #define MY_ESP8266_SSID "xxxxx" #define MY_ESP8266_PASSWORD "xxxxx" // Enable UDP communication //#define MY_USE_UDP // Set the hostname for the WiFi Client. This is the hostname // it will pass to the DHCP server if not static. #define MY_ESP8266_HOSTNAME "sensor-gateway" // Enable MY_IP_ADDRESS here if you want a static ip address (no DHCP) //#define MY_IP_ADDRESS 192,168,178,87 // If using static ip you need to define Gateway and Subnet address as well //#define MY_IP_GATEWAY_ADDRESS 192,168,178,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 // 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, 178, 68 // Enable inclusion mode //#define MY_INCLUSION_MODE_FEATURE // Enable Inclusion mode button on gateway // #define MY_INCLUSION_BUTTON_FEATURE // Set inclusion mode duration (in seconds) //#define MY_INCLUSION_MODE_DURATION 60 // Digital pin used for inclusion mode button //#define MY_INCLUSION_MODE_BUTTON_PIN 3 // Set blinking period // #define MY_DEFAULT_LED_BLINK_PERIOD 300 // Flash leds on rx/tx/err // Led pins used if blinking feature is enabled above #define MY_DEFAULT_ERR_LED_PIN 16 // Error led pin #define MY_DEFAULT_RX_LED_PIN 16 // Receive led pin #define MY_DEFAULT_TX_LED_PIN 16 // the PCB, on board LED #if defined(MY_USE_UDP) #include <WiFiUdp.h> #endif #include <ESP8266WiFi.h> #include <MySensors.h> void setup() { } void presentation() { // Present locally attached sensors here } void loop() { // Send locally attached sensors data here }
-
ESP + RFM69 Gateway Reset issue
Hi all,
Firstly I'm so impressed with the community and the development on MySensors, it's great how the whole DIY IoT thing has boomed over the past couple of years.
I'm trying to get the ESP Gateway example working with a RFM69 radio and having some issues it connects to my Wifi network fine, then fails shortly afterwards, at the same point every time. I've included a dump of the Serial from one full iteration and also a quick photo (though it's not that clear with all the wires) of my setup. Suffice to say it's basically just a normal ESP12 setup connected to the RFM69 as the documentation says.
I'm using the latest versions of everything also.
If anyone has any ideas they would be really appreciated.Starting gateway (RRNGE-, 2.0.0) 0;255;3;0;9;TSM:INIT scandone state: 0 -> 2 (b0) 0;255;3;0;9;!TSM:RADIO:FAIL 0;255;3;0;9;!TSM:FAILURE 0;255;3;0;9;TSM:PDT state: 2 -> 0 (2) reconnect f 0, scandone state: 0 -> 2 (b0) state: 2 -> 3 (0) state: 3 -> 5 (10) add 0 aid 3 cnt connected with xxxxxxxxxxxxxxx, channel 1 dhcp client start... ip:192.168.0.18,mask:255.255.255.0,gw:192.168.0.1 0;255;3;0;9;TSM:INIT Soft WDT reset ctx: cont sp: 3fff00f0 end: 3fff03e0 offset: 01b0 >>>stack>>> 3fff02a0: 00000004 00000000 3fff0480 4020221c 3fff02b0: 00000027 3fff06f4 3fff0480 40202861 3fff02c0: 3fff0498 00000001 3fff0480 402029a5 3fff02d0: 00000000 00000016 3fff0480 40202be0 3fff02e0: 0000002f 3fff06f4 3fff0480 000000ff 3fff02f0: 00000000 00000016 3fff0480 40203d39 3fff0300: 00020401 40040203 33060305 0008d907 3fff0310: 42190009 07264025 dc291028 2d2f882e 3fff0320: 90376430 8f3c4238 306f123d 3fff00ff 3fff0330: 00000064 00000004 3fff0480 40202994```