|
Post by papa on Dec 23, 2017 15:58:15 GMT
Without an RFM69 Gateway, a RFM69 Home Automation node (perhaps with sensors or relay) is useless because it has no way to communicate to a home automation system such as OpenHAB. Such a Gateway is a specialized node through which OpenHAB & an RFM69 node can have bi-directional communication. If you intend to use nodes that communicate via an RFM69 radio, you must successfully build & program an RFM69 Gateway.
Update, Oct. 11, 2021: Posts below will lead you in creating an Ethernet RFM69 Gateway. Now you may also see this thread for creating an ESP32 RFM69 Gateway (WiFi) that will connect RFM69 nodes just the same as with the Ethernet RFM69 Gateway.
Note: ESP8266 WiFi nodes can accomplish some home automation & do not need a gateway. They can connect directly with a computer (possibly a Raspberry Pi) hosting OpenHAB. RFM69 nodes are usually capable of a wider range of home automation. See this thread for a comparison of RFM69 nodes vs. ESP8266 WiFi nodes, suggestions on where to start, & maps of how the nodes connect to OpenHAB home automation. Below I intend to revisit my earlier documentation on achieving an RFM69 Gateway. For readability's sake, I'll aim to post it in smaller pieces & perhaps make other improvements.
|
|
|
Post by papa on Dec 23, 2017 16:28:20 GMT
The RFM69 Gateway Node, an Introduction Updated Oct. 11, 2021
This RFM69 Gateway is a communication bridge between OpenHAB / MQTT running on your computer & one or more RFM69 end nodes. Gateway & nodes communicate with each other via RFM69 radios. Via your local Ethernet network, the Gateway connects to a computer hosting MQTT message service & OpenHAB. Through the Gateway, OpenHAB & nodes can have bi-directional communication. For the original materials, I adapted from computourist's github. For an overview of this Home Automation network, read this file by computourist. Also see the summary diagram in this post. After you build your Gateway & upload customized programming to it, you will need to have a local network-connected computer running the MQTT message service & openHAB. You can do that between now (perhaps while you are waiting for Gateway parts to arrive) & just after this post. This thread offers help on installing openHAB 3 & MQTT messaging.
|
|
|
Post by papa on Dec 23, 2017 16:38:21 GMT
RFM Gateway Node, Notes on the Schematic & a Key Part Updated, Oct. 11, 2021
For my Gateway, I basically followed the schematic CompuTourist used for all versions, EXCEPT I used a Buono Uno Arduino compatible switched to 3.3v mode instead of a ProMini. You could instead use a regular Arduino Uno compatible hacked to 3.3 volt operation like this. Caution: A regular Arduino that runs on 5 volts & sends 5 volts through the digital pins (D2, etc) will make your RFM69 radio defective.I recommend you use a Buono Uno (link above) which provides the amount of 3.3 volt current needed by the RFM69 radio. To connect to your local network, the Gateway needs a W5100 Ethernet circuit & its easy to plug a W5100 Ethernet Shield on top the Buono Uno. I had some success using a Massduino (Arduino compatible switchable to 3.3 volts). See this thread starting here for my review & where to buy. 3.3 volt Arduino ProMinis & CH340 boards may not be able to provide enough current by themselves. If not a Buono Uno, your options are the regular Arduino Uno hacked to 3.3 volts (link above) or an added power supply circuit to provide sufficient 3.3 volt current (via a 5 volt adapter. a 3.3 volt regulator, & capacitors.) For the last option, see this computourist circuit. Connect the circuit's 3.3 volt output to wherever a gateway or node needs a VCC or 3.3 volt connection. At the end of this post below, see one more possible option, using an Adafruit RFM69 breakout board with a regular 5 volt Arduino. Also see my disclaimer in that post.
|
|
|
Post by papa on Dec 23, 2017 16:57:25 GMT
RFM69 Gateway Node, Schematic & Completed GatewayThe Gateway schematic has some similarities to an End Node schematic. However, the Gateway has an Ethernet Shield plugged on top the Buono & has signal LEDs. Caution: on the Gateway, the RFM69's NSS wire plugs into D8, while it plugs into D 10 on the end node. The main similarities between Gateway & End node are that both use Buono Unos or some 3.3 volt Arduino compatible AND all RFM69 wires EXCEPT NSS plug into the same Arduino locations. ( Click on the images for a larger view.) Completed ^^ Gateway ^^ Gateway Schematic
|
|
|
Post by papa on Dec 23, 2017 17:36:12 GMT
RFM69 Ethernet Gateway, Parts Needed Updated, Oct. 11, 2021 ONE Buono Uno Arduino compatible ( See this post above for source, explanation & other options.) Does NOT need 2 as for the Uber Home Automation Instructable. While buying this compatible, get at least one more to build end nodes later. one W5100 Arduino Ethernet Shield for Uno R3 Board To see & perhaps order one, do a search like this, BUT for "Model,' select "Ethernet Shield W5100." You do NOT need the regular Arduino Unos that are offered. one RFM69 radio module (at your chosen frequency, see the next post). While buying this, get at least one more to build end nodes later. An Antenna for your RFM69 Radio's frequency Use some of your wire or buy one See this post below for more info. A supply of 22 gauge insulated wire (at least red, black, & yellow) 3/32 inch heat shrink tubing (at least red, black, & yellow). 2 LEDs (2 different colors) 2 resistors (one for each LED, see note below for size) one Ethernet Cable to connect to your Ethernet router Tools ! See this post about tools & other hints on soldering A power source for the Gateway: a 9 volt adapter that plugs into the Arduino's barrel connector or a 5 volt phone charger adapter that plugs into via Arduino's USB socket. Optional: Other colors of wire & heat shrink tubing can help with color coding. Note on LEDs: computourist used a 1 kilo ohm resistor with LEDs. I prefer 100ohm which lets the LED be somewhat brighter without burning out. For a dimmer LED & to reserve more current for other gateway parts, use higher than 100 ohms (220ohms or 1 kilo ohms. May 19, 2016, computourist said: With 100 ohms, current will be around 15 mAmps, well within specs.
|
|
|
Post by papa on Dec 23, 2017 18:09:22 GMT
RFM69 Gateway: RFM69 Radio Needed Updated, Oct. 11, 2021
RFM69 radios are sold at frequencies of 433 MHz, 868 MHz, & 915 MHz. I adapted the following from Table 1 at this site. It gives appropriate regions for the frequencies: Available Unlicensed Frequency Bands Frequency Regions433 MHz Europe, Asia, Australia, U.S. (limited) 868 MHz Europe only 915 MHz U.S. and Australia (& Canada ??) Computourist here: (If appropriate to your region,) "433 Mhz should give you a bit more range in comparison to 868 or 915 Mhz. However the 433 MHz frequency is crowded with many 'noisy' devices that could interfere." Besides frequencies, RFM69 radios are also sold in different forms. I recommend one with "H" in its part number which means it uses higher power for better signal coverage. Our Gateway & End Node programs can take advantage of that. Part numbers may include HC, HCW, HW. According to here, they are functionally equivalent, but pins may be in different locations. HC & HCW are slightly smaller than HW. To buy RFM69 radios, you could go here & search the page for RFM69 H & find your chosen frequency. Note: For the Gateway you need the RFM69 transceiver NOT the miniwireless device (a tiny Arduino compatible with RFM69 transceiver radio installed). A miniwireless will work for some nodes. By themselves RFM69s are small & their solder holes are less than 2.54mm apart, but the holes' material & notches are helpful for soldering. One can also buy RFM69 radios on breakout boards. These would take more space & cost, but soldering would be less close together. See here for examples of a breakout board. See here for other RFM69 breakout boards, in this case, ones that can take 5 volts from a regular Arduino. Disclaimer: I've never used these breakout boards, but a few others report good results. Next, An Antenna for Your RFM69 Radio's Frequency
|
|
|
Post by papa on Dec 23, 2017 21:27:41 GMT
RFM69 Gateway: RFM69 Radio Antenna Needed Updated, Oct. 11, 2021 See here about antenna sizes for RFM69 radio frequencies. I also adapted the following from Table 1 at this site. It gives appropriate regions for the frequencies. Antenna sizes (1/4 wave) may be close but a little different from other tables: Available Unlicensed Frequency Bands Frequency Antenna length Regions433 MHz 173 mm Europe, Asia, Australia, U.S. (limited) 868 MHz 82 mm Europe only < corrected Dec. 22, 2021915 MHz 78 mm U.S. and Australia (& Canada ??) < corrected Dec. 22, 2021 Other research says, a 1/4 wave ANT or ANA (antenna) wire for 868 or 915 MHz can be about 3 inches (80mm), about 6.5 inches (165 mm) for 433MHz. You can make an antenna from regular wire or buy one. This page shows a 433MHz antenna that is somewhat coiled & somewhat straight. Ahead, Assembling the Gateway
|
|
|
Post by papa on Dec 23, 2017 21:46:37 GMT
Assembling the Gateway, Planning for a RFM69 radio to plug into the Gateway's Ethernet Shield: (Updated, Oct. 11, 2021) ^^ my RFM69HC mini-board ^^ Gateway Schematic (Click on pics for larger view) Plan & prepare the needed 22 gauge wires (color coded?) to the RFM69 module & strip the other wire ends to fit into the right Ethernet Shield sockets for each Arduino connection. Above is my RFM69HC mini-board. Pre-soldering, one wire is crimped to the radio's MOSI solder hole. Before soldering, all wires' one end is stripped 1/8 inch to crimp on an RFM69 solder hole. Except for the antenna, the wires' other end is stripped 1/4 inch to insert into an Arduino Shield socket. Your board's hole labels may be in similar locations or different. As the Gateway schematic indicates, SCK connects Arduino D13, MISO to D12, MOSI to D11, NSS to D8 (different from an end node), DIO0 to D2, 3.3v to a source of Arduino 3.3 volts, & one RFM69 GND to an Arduino GND. My RFM69 has 3 GND solder holes to choose from, & my Shield has 3 Arduino GND sockets. As much as possible, plan for the most possible RFM69 wires to be on the same side as the Arduino connection they need. Using those wiring/inserting locations & having the radio above the Shield, cut each wire to be able to bend, reach, & insert into its connection socket. For all wires, strip one end just long enough to insert into its RFM69 solder hole & crimp back over the hole. For all wires, except ANT (ANA), strip the wire's other end to insert totally into a socket & remaining insulation stops just at the top of the socket. Except for possible space needs, I like using the same wire lengths all my RFM69 radios. (Takes less thinking & let's me move radios from device to device.) To allow for taller components to be installed below the RFM69 radio (like a transistor for a relay), I suggest you make the RFM69 & its plugged wires a little "roof" about 1.25 inch above the Ethernet Shield's base. If your RFM69 radio is like mine (adjust if it is not), cut the following (color coded?) wires: 4 wires 1.5 inches long (GND, MISO, MOSI, NSS); two wires 1 5/8 inches long (3.3v & SCK), & one wire 2.25 inches long (DIO0). If components will NOT be very high below the RFM69 radio (like for this Gateway), these wires may be about 1/4 inch shorter. Strip all these wires 1/2 inch on one end (for the shield sockets) and 3/8 inch (to crimp & solder at the radio's solder holes). Unless you buy an antenna, also cut one wire at the length needed for your radio's frequency ( See the previous post above). Strip a home-made antenna wire 3/8 inch on only the solder end. After soldering, you may leave the antenna straight or wind it around a pencil into a coil. Both ways seem to work. For optimal communication, leave the antenna straight & perpendicular to the radio board. Ahead, Soldering the RFM69's Wires
|
|
|
Post by papa on Dec 24, 2017 2:21:59 GMT
Preparing the RFM69 radio, Soldering the WiresFollow the schematic & the right wire length for each hole. With the radio's labelled side up, start on the edge with the least wires. Insert each wire's shortest stripped end from the bottom of its hole. With a finger/finger nail if possible, bend the end over the hole's notch. With needle nose pliers, crimp the end straight with the rest of the wire. Do this for all wires on this side of the RFM69. See this post about using a Helping Hands method to hold the RFM69 board & wires steady so you can solder one side of the board at a time. Remember a piece of cardboard to protect RFM69 components from the Helping Hand alligator clip. Also see later in that same post about checking the quality of your soldering with multimeter, etc. RFM69 solder holes are close together. Soldering them gets easier with practice. For all wires on the RFM69's other edge, as above, insert, crimp, solder, & check. Install the RFM69 radio: Into the Ethernet Shield's schematic-indicated Arduino sockets, plug the indicated wires soldered to the RFM69 transceiver mini board. As the Gateway schematic indicates, SCK connects to D13, MISO to D12, MOSI to D11, NSS to D8, DIO0 to D2, 3.3v to a source of Arduino 3.3 volts, & one RFM69 GND to an Arduino GND. Ahead, Prepare & Install the Gateway's Signal LEDs
|
|
|
Post by papa on Dec 24, 2017 2:32:30 GMT
Prepare & Install the Gateway's Signal LEDsThe Gateway would work without LEDs, but with them, it's easier to see that it is working. As all diodes, LEDs (Light Emitting Diodes) allow current to pass in one direction & block it in the other direction so they must be placed properly. For each of the signal LEDs, (maybe applying heat shrink tubing to protect the bare wire leads) solder a resistor to the LEDs longer wire lead (the plastic LED base above that lead is usually round). Again see in this post about using a Helping Hand tool to help hold the parts for soldering Plug one LED's resistor into the Ethernet Shield's D7 & its shorter, remaining LED wire lead in a Gnd socket on the other side (the plastic LED base above that lead is usually flat). This first LED's steady shine will indicate the gateway is connected to the MQTT service on the computer. Plug the other LED's resistor into the Ethernet Shield's D9 & its free LED wire lead in a Gnd socket on the other side. This LED flashes to indicate radio signals being sent. Resistor & LED wire leads are small gauge & fit loose in shield sockets. You can "bulk them up" to fit tighter: On each end of an LED/resistor, fold over 3/8 inch of lead & crimp the bend. See if it now fits tighter in the socket. If not, try folding & crimping once more. Experiment until each lead solidly enters & stays in socket.) Ahead, A Hack Fix to Protect the RFM69 radio from Damaging Voltages
|
|
|
Post by papa on Dec 24, 2017 2:57:34 GMT
Important: A Hack Fix to Protect the RFM69 radio from Damaging Voltages (See an explanation in this thread.) Rising up from one side of the Buono Uno are a group of 6 pins called ICSP, one pin is VCC (power). Holding the Buono as it's oriented in the picture below, VCC is the upper right pin (& is labeled in the pic) << Click on the pic for a larger view. The ICSP pin labeled "1" is MISO, & VCC is pin 2, the pin paired with pin 1. The hack fix is ... bend out only the Buono's ICSP VCC pin so it will not connect to the matching Ethernet Shield (ES) socket above. Sufficiently insert all the other Ethernet Shield pins & sockets into the Buono Uno which is switched to 3.3 volt operation. Avoid forcing the insertion which could crack traces on the boards & cause erratic behavior. Rather see how to bend the Shield pins gently so they more easily enter their sockets. Later with the Ethernet cable, you will connect the Ethernet Shield (& thus the Gateway) to your home network. I believe this completes assembling the Gateway hardware. Next, Programming the Gateway
|
|
|
Post by papa on Dec 24, 2017 3:15:24 GMT
Prepare to Program the Gateway RFM_MQTT_GW_25.4_pub.ino (26.15 KB) << As a forum member, download this & save it where you can find it. ^^March 29, 2019, papa added Automatic Transmission Control to the Gateway. Dec. 15, 2018, papa added ability to program more than one gateway. April 1, 2018, brump added devices 73-76, giving four more binary inputs.Open the Arduino IDE (program for loading, editing, & uploading Arduino sketch programs). From the Arduino IDE, open the sketch (program) file downloaded above. Before uploading (sending) the Gateway sketch to the Gateway, you must edit it to customize to your situation. Your IDE computer must also have the additional code library files that the Gateway sketch needs. The following posts offer guidance.Note: In editing a sketch, sometimes we are told to " comment out a code line" which means put two forward slashes ("//") at the start of the code line to make the rest of a line a "comment" (not programming code) & disables the code. To UNcomment a line means to remove the two forward slashes ("//") at the start of the line to make the rest of the line into working code except "//" later in the line still indicates comment there. For example in the Gateway sketch, see "// #define DEBUGRADIO" which is a comment, not active code. The line "#define DEBUG // uncomment for MQTT debugging" starts with active code & ends with a comment (after //). Ahead, Get Your Computer's IP Address
|
|
|
Post by papa on Dec 24, 2017 14:15:36 GMT
Prepare to Program the Gateway, Get Your Computer's IP Address Updated Dec. 6, 2018
Your Gateway program needs the IP address of your computer that will host the home automation services (OpenHAB/MQTT). Also if your computer has a "dynamic" (rather than static or fixed) IP address via your router's DHCP, the address can change & disconnect it from the Gateway & other things. So do the following ... Get the present IP address of your computer that will host the home automation services (OpenHAB/MQTT): For example in Windows, click the Start button. In the search box type cmd [enter]. In that black & gray window type ipconfig [enter]. Look for Ethernet adapter, IPv4 Address ….. 192.168.nn.aa Make note of the numbers in the “nn” & "aa" positions.
I recommend that you log in to your router & make sure your computer has a static or fixed IP address. You can use the same IP address you just found for the static IP address. Also note those 192.168.nn.aa numbers to use in the post below. Ahead, Customizing the Gateway Sketch Program
|
|
|
Post by papa on Dec 24, 2017 14:35:07 GMT
Prepare to Program the Gateway, Customize the Gateway Sketch Program
Updated Dec. 15, 2018
Here's where to edit & customize the Gateway sketch for your setup:
Find #define NetworkOne & two lines after it. UNcomment (no // at the start) only ONE of the three lines. In most cases, UNcomment #define NetworkOne. If you UNcomment one of the other 3 lines, be sure to do the same when you later use the choose_nodes sketch to program a node for that gateway.
Find 3 lines with "#define FREQUENCY" ( radio hardware version). UNcomment (no "//" at the start) the line that matches frequency of your RFM69 transceivers & comment the rest (start the line with "//"). Find the line with #define IS_RFM69HW & leave it uncommented ONLY if your RFM69 transceivers have "H" in their part number.
Comment out #define DEBUGRADIO (change it to // #define DEBUGRADIO...) Make sure #define DEBUG is uncommented (NO "//" at the line's start). Later you will reverse the comment / uncomment of these two lines.
Find byte mqtt_server[] = { 192, 168, nn, aa } finish the IP address to match that of your "computer" where MQTT service is running. (For example, if your computer's IP address is 192.168.1.100, then nn = 1 & aa = 100.) ===================================================
Starting with "#ifdef NetworkOne ...," find 3 sections of settings.
In each Network section, edit these first two settings only:
byte ip[] = { 192, 168, nn, ?? } "nn" will be the same as in mqtt_server & "??" will be a UNIQUE & higher, but available network number than that in mqtt_server (following our made up example nn = 1 & bb could be 140, cc could be 141, & dd 142.).
After ENCRYPTKEY, choose a UNIQUE 16 character encryption key for EACH of your networks, make note of it. Later help connect end nodes to each gateway by giving nodes the encryption key for that gateway. If you already chose an encryption key, use it in the section for GatewayOne.
Keep copies of the 3 ENCRYPTKEYs so you can use them for the 3 Gateway sections in the choose_nodes sketch. Initial customizing of the choose_nodes sketch has changed to match the Gateway customizing above.
Ahead, Code Libraries Needed by the Gateway Programming
|
|
|
Post by papa on Dec 24, 2017 14:46:10 GMT
Prepare to Program the Gateway, Code Libraries Needed by the Gateway Programming
VERY, VERY IMPORTANT ! ! !
Before uploading (sending) the Gateway sketch to the Gateway, besides customizing to your situation, your Arduino IDE computer must also have the additional code library files that the Gateway sketch needs. So ... Be sure your computer has the code libraries that the Gateway sketch program needs & in the right location. Use this post about Downloading, Editing, & Installing Libraries. This contains two important library edits that help make gateway <> node communication reliable. Ahead, Send Programming to the Gateway
|
|
|
Post by papa on Dec 24, 2017 15:02:38 GMT
Send Programming to the GatewayAfter you customize the Gateway programming to your situation AND after you make sure you have the code libraries that the Gateway programmings needs, you should be ready to send the Gateway sketch to the Gateway. Insert one end of a USB cable into the lower level (Buono Uno) of the assembled Gateway & the other end into the computer where you'll use the Arduino IDE to load, edit, & upload the Arduino sketch program that is the Gateway programming. Before uploading, I find it helpful to use the verify feature & let it tell me if it finds sketch problems to fix. ( See this post about troubleshooting code errors.) Continue to verify & fix your customization & installation of code libraries until you eliminate the errors. Using the upload feature of the Arduino IDE, send the Gateway sketch program (above, ending in .ino) to the Arduino. Ahead, Connecting the Gateway to Your Local Ethernet Network
|
|
|
Post by papa on Dec 27, 2017 15:45:21 GMT
Connect the Gateway to Your Local Ethernet Network
After your RFM69 Gateway & at least one RFM69 end node are working & communicating reliably, you can place your Gateway anywhere it can connect to your local network router via an Ethernet cable.
However, for now, the Gateway should be where it can connect to BOTH your router AND (via USB) the computer running the Arduino IDE. This is essential to success. Via your local network, your Gateway must connect to the MQTT message service running on its host computer. Via the USB cable, the Gateway can send helpful feedback to the Arduino IDE Serial Monitor.
So ... while the Gateway still connects to the Arduino IDE computer via USB, also use an Ethernet cable to connect the Gateway to your local network router. If necessary, you can temporarily use an Ethernet cable of up to 100 meters.
Ahead, Make Sure a MQTT Message Broker & OpenHAB 2 Are Installed
|
|
|
Post by papa on Dec 27, 2017 16:17:57 GMT
|
|
|
Post by papa on Dec 27, 2017 16:46:33 GMT
Getting Initial Results from the Gateway
^^ Click on the pic for a larger view. ^^ Getting results: With the programmed Gateway's Arduino / Ethernet shield connected to your Ethernet network & to your computer via USB, with Arduino IDE serial monitor running at same baud as set in the Gateway sketch (115200), & with the Gateway sketch programmed in DEBUG mode (at Line 69, no // in front of #define DEBUG), the Arduino IDE Serial Monitor (SM) should show something like this pic annotated in red text, indicating the Gateway is connected to your home network & MQTT service on its host computer. Also the Gateway's MQTT LED should light steadily. You won't get any other SM results until 1) you build & program a working end node AND 2) in the Gateway 2.5 sketch, comment out #define DEBUG & 3) UNcomment #define DEBUGRADIO. Get the Gateway working before you move on to other things. The next post illustrates less than desired Serial Monitor results & points to some hints for troubleshooting.
|
|
|
Post by papa on Jan 3, 2018 1:27:28 GMT
Troubleshooting Hints for the Gateway Work Just AboveIf you have trouble uploading the Gateway sketch or others, see this post which includes " troubleshooting code errors". << Click on pic for larger view. ^^If your Serial Monitor results (from the top through "no link") look like this pic annotated in red text, your Gateway is not yet receiving an IP address from your local network router (No DHCP) & thus CANNOT connect to the OpenHAB / MQTT running on your computer. Things to check: Are you using an Ethernet Cable to connect your Gateway's Ethernet Shield DIRECTLY to your local network router? Is your OpenHAB / MQTT hosting computer DIRECTLY connected to your local network router? For me these direct connections have worked the best. Sometimes I find that restarting your local network router & your Gateway helps them connect to each other. You might try that more than once. ^^If your Serial Monitor results look like this pic annotated in red text, your Gateway received an IP address, BUT is not yet connected to the OpenHAB / MQTT running on your computer. You may get such errors which try to point you where to troubleshoot. Don't despair, that will help you learn how & why things are supposed to work. Suggested first steps: re-check end node wiring with the schematics. Use a multi-meter to continuity check the wiring (Are the correct things truly connected & did you avoid connecting the wrong things?). Did you download & program the Gateway 2.4 sketch? Recheck how you customized the sketch. Use the sketch's debugging modes & Serial Monitor output to give you clues. Important: Be sure you went to this post about " Downloading, Editing, & Installing Libraries" & later in the post make the changes to the library files, w5100.h & ethernet.h That can help your Gateway & End Node stay connected more reliably. For other hints, see this post which includes " use other available troubleshooting tools".) Ahead, Next Steps after your RFM69 Gateway Is Working
|
|
|
Post by papa on Jan 3, 2018 2:09:47 GMT
Next Steps after your RFM69 Gateway Is WorkingOnce your RFM69 Gateway is working, you can make RFM69 end nodes to work with the Gateway & OpenHAB to form a home automation network. If this will be your first RFM69 end node, I highly urge you to follow the step by step directions starting at this post. After you complete the above thread which in detail, documents building a rudimentary home automation network ... you can then start making one of the several RFM69 end nodes that are documented on this forum. This post << lists links to those end nodes.
|
|
|
Post by papa on Jan 5, 2018 3:34:08 GMT
|
|
|
Post by sunbloquer on Jan 13, 2018 10:44:12 GMT
Fritzing Illustration of the GatewayHi, I'm practicing with the Fritzing and I made this RFM69 connection diagram. papa: Thanks, sunbloquer.
papa: This illustration shows a standard (5 volt) Arduino Uno. To avoid damaging the RFM69 radio, the Gateway must be built on an Arduino compatible that can run mostly at 3.3 volts, especially through its digital pins (like D2, D8, D11-D13), such as a Buno Uno, an Anarduino Miniwireless, a Moteino, an Arduino Pro Mini...RFM69 to BUONO.fzz (26.44 KB)
|
|
|
Post by papa on Jan 13, 2018 21:41:53 GMT
The fritzing diagram is a good addition, sunbloquer. Thanks.
One suggestion: a note to emphasize needing an Arduino compatible that runs only 3.3 volts through its digital pins.
|
|
|
Post by papa on Dec 16, 2018 2:00:02 GMT
Updated Version of the Gateway Programming Updated Dec. 15, 2018
Please use that version of the Gateway sketch because the previous version was flawed.
I added the ability to have up to three RFM69 networks by programming up to three gateways. Please see this thread for an updated choose_nodes sketch & updated customizing to work with the expansion of gateways. Earlier in this version, brump added devices 73-76. Now our nodes can have up to four more binary inputs (like switches). To the most recent Gateway sketch above I added a little more code related to devices 73-76.
Also to this version, I added code so a jumper between Arduino D6 & GND means an "Away Mode" is set. In our intended absence from home, OpenHAB code can act on that mode. For example, lights could be turned off & on simulating our presence for security's sake.
The customization has been updated. The schematic has not changed.
|
|
|
Post by flyyboyy on Dec 26, 2018 20:16:28 GMT
Just a quick question about the updated Gateway sketch: I restarted my last summer's efforts and, kinda starting at square one, have verified proper operation of the Gateway and the "bare bones" multi-function end node; OpenHAB/MQTT on my RPi is getting message data from the BBEN through the Gateway. All is good so far. . .
Reading some newer posts, I see that the new Gateway sketch allows for up to 3 simultaneous GWs (very interesting!), though personally need just one at this time. Also see nodes below 5 are reserved now; no problem here either.
Soooooo. . . is it important to update my GW? Are there other reasons that I'm not seeing? Kinda don't was to fix something that isn't broken unless there's a meaningful reason. And the end node sketches are updated, too. So far, it seems that they are backwardly compatible, so it seems they don't require the newer GW sketch (knowing that there will remain unused functionalilty).
Should I bite the bullet and update GW, or am I OK where I'm at?
Thanks -- flyy
|
|
|
Post by papa on Dec 27, 2018 17:09:22 GMT
flyyboyy, Sounds like you've made good progress with your RFM69 networks of Gateway & end nodes. Congratulations, that's a big step that should help with further developments.
flyyboyy: "is it important to update my GW? Are there other reasons that I'm not seeing? Kinda don't want to fix something that isn't broken unless there's a meaningful reason. And the end node sketches are updated, too. So far, it seems that they are backwardly compatible, so it seems they don't require the newer GW sketch (knowing that there will remain unused functionality). Should I bite the bullet and update GW, or am I OK where I'm at?"
papa: I augmented the Gateway sketch mainly for the convenience of me & others that might want the ability of having multiple gateways & networks. For Gateway programming, you should be OK where you are, but for end nodes, you might avoid NODEIDs less than 5 in case you upgrade gateway programming later. You could switch to the latest Gateway sketch & program the gateway as GatewayOne & avoid end nodes of less than 5 & you should also be fine. GatewayOne in the new gateway programming uses the same NODEID (1) & the same NETWORKID (100) as the previous programming. The main change for users of Gateway 1 is the latest Gateway sketch reserves NODEIDs of 1, 2, 3, & 4 for Gateways & should not treat those NODEIDs as end nodes. The latest Gateway sketch also has the option of one jumper or switch on the Gateway. One should use a Gateway sketch with a versions of at least 2.5 which have small but important changes. In the Gateway sketches, you can read the version history in either early or end lines of the sketch. ============================ Regarding the choose_nodes sketches... In more recent versions, I/we try to add new features & fix problems or limitations in features. Again see node version history in early sketch lines or at the end. If your end nodes are working, you can probably leave them as is. If you have a problem with a certain node, try the latest version of the choose_nodes sketch. Using the latest choose_nodes sketch, programming an end node to work with GatewayOne (NODEID of 1) should work with previous Gateway programming or the latest (as long as the end node is 5 or higher).
Later on if you want to add a GatewayTwo & create your second network, you would program a Gateway AND end nodes #defined for GatewayTwo.
For users of GatewayOne, MOST compatibility remains between previous & latest programming. For users of GatewayOne, the only lost compatibility (in latest sketches) is losing NODEIDs of 2, 3, & 4 as end nodes, because they are reserved for Gateways.
|
|
|
Post by papa on Dec 29, 2018 3:36:21 GMT
|
|
|
Post by whippo on Jan 6, 2019 23:00:35 GMT
I am in a similar situation as flyyboyy. I began my build based on the amazing information on this forum early in 2018 but had to put it all on pause from July until now.
In March I successfully completed the Raspberry Pi with OpenHAB and MQTT communicating with 5 Itead ecoplugs that control lights and a window fan. I then built and programed the RFM gateway with RFM_MQTT_GW_25_pub4 and built one DHT node with computourist_node_v2.2Mf4_choices_pub. It took a few days of troubleshooting but got everything communicating and built a simple OpenHAB sitemap with some rules to turn on and off lights based on times of the day and turn on a window fan based on the temperature difference in and out of the house.
Amazingly, I just got everything installed in my new house and it all worked perfectly after simply connecting everything and turning it all on! Now I have been reading and relearning everything I had done to get the system built and configured to get back to the knowledge base I was at nine months ago. I am ready to build more nodes and continue this adventure.
Next nodes to build:
1. Garage door sensor/controller 2. Light dimmer 3. Weather station
While I understand the advantages of upgrading the gateway to the latest version, I am having flashbacks to the number of hours working to get the gateway communicating with that first node. I think I may have a bit of PTSD from that experience and, as flyyboyy put it, if it's not broke...
If I update the GW with the single operational node programmed with v2.2Mf4_choices_pub, will it be a simpler process (considering that I have a node proven to communicate with a gateway) than troubleshooting the brand-new GW and node?
|
|
|
Post by papa on Jan 9, 2019 12:44:42 GMT
whippo, good to hear from you & I'm thrilled to hear your successes so far. Traveling, I've been out of touch for a couple days.
From my experience, I believe you've passed through the difficult early stages of the RFM69 side of the project. You were wise to start with the ESP8266 devices which probably help prepare you for the RFM69 programming. Perhaps you also have some familiarity with Arduino programming & building electronics. I do sympathize with being nervous about upgrading when you have a big investment in what you currently have working.
From the above, I believe you have some good choices: 1) You can remain with your existing Gateway & Node programming until you need Node options added in the latest node sketch (like the garage door controller work around). You can have multiple node sketch versions on your nodes as long as they (& the Gateway) use the NetworkOne option & have NODEID greater than 04)
2) You can upgrade either or both of the Gateway or Node sketches. As long as you use the default NetworkOne option of the latest Gateway Sketch AND your NODEID is greater than 04, you should be fine upgrading to the latest Gateway sketch. The latest node sketch mostly adds newer options & should be compatible with the node sketch you used. One exception is that I added a work around to deal with an issue with the garage door opener node. (Keep your current Gateway & Node sketches & if necessary, you can go back to that programming.)
3) When you start on the Garage Door controller node, you should probably use the latest node sketch for that node & choose the NetworkOne option in that sketch & a NODEID greater than 04. Then the node should work with your existing Gateway OR a Gateway using the newest sketch (NetworkOne option). Also be sure you keep openhab's mosquitto.retain setting as false.
Hope that helps. Ask more if needed.
|
|