|
Post by lucidbuddha on Nov 13, 2016 16:54:04 GMT
I've been working on the Computourist RFM69 Gateway with Ethernet Shield on Buono Uno (3.3v) and have gotten a lot of success following Papa's wonderful thread. I got my Gateway set up and MQTT-Link OK. I then uploaded the RFM_DHT_node_22 from Computourist and that serial monitor said, "No connection". I then tried the Multiple-choice node, went through all the settings and again, "No connection". I changed the W5100.h file as reported in multiple threads and afterwards got a wakeup connection right away but nothing else. For each, only once did I get a wake up information on the Gateway. It seemed to be when I initially powered the node after it was off for a bit. Could this be a power problem? If I recall, one time wake up info gave me voltage above 3.3 but not over 4. Basic system info:Raspberry Pi V1 B+ (hopefully upgrade when I can successfully get some nodes working!) -Running Openhab, Mosquitto & MotioneyeOS (all working) Gateway - Computourist v 2.4 -UNO with Ethernet Shield + RFM69HW (MQTT link ok) Node - tried both Computourist 22 & multiple choice node -DHT11 connected as described by Papa (soldering 4.7k resister to VCC & Data pins)
-RFM69HW "Y" connected to 3.3v (I don't have any breadboard or 3-way headers...just twisting and taping ) My main goal is to simply get one Temp/Humidity sensor working and communicating with Openhab via Mosquitto. Once I've got one working, I plan to upgrade to something like moteino's or smaller form factor boards that can be run on batteries. However, I need a success before buying more things! Any thoughts/advice/troubleshooting is appreciated.
|
|
|
Post by papa on Nov 13, 2016 18:36:39 GMT
lucidbuddha, I'm rather busy on a home project at the moment, but will make a few comments / suggestions. I appreciate the details you gave on what you tried & the results. You said, "For each, only once did I get a wake up information on the Gateway. It seemed to be when I initially powered the node after it was off for a bit. Could this be a power problem? If I recall, one time wake up info gave me voltage above 3.3 but not over 4." I wonder, too, if your node is having a power problem. 4 volts would not be good for the radio. Those Buono 3.3v-5v power switches can be flaky. With nothing else connected to your node's Buono, check it's voltage with a multimeter ( MM): connect MM's common to a Buono GND & connect MM's mVAohm to Buono's 3.3v socket. Does MM steadily read about 3.3 volts? If not fiddle with the Buono 3.3v-5v power switch to see if you can get reliable 3.3v. Speaking of possible power problems, the GATEWAY can also have them. In this thread in the Sep 22, 201 6 at 2:58pm post, did you see that in combining the Buono & the Ethernet Shield, that the Ethernet Shields 3.3 volt socket can actually have 5 volts that is not good for the RFM69 radio. This could make your Gateway radio flaky until the problem is fixed, maybe even ruined. The fix is posted there & with the Gateway build instructions in this thread in the Oct 8, 201 5 at 6:40pm post. With the original computourist node sketch you do need the 4.7K resistor with the DHT11. However, for my Multi-choice node sketch, do NOT use the 4.7K resistor for the DHT11. My version does the pull up resistor via software. In the Oct 15, 2015 at 3:36pm post of this thread, in the DHT node build instructions, I mentioned this: "Update, 6/11/2016: To avoid needing the 4.7 kilo ohm resistor mentioned above, see my thread Simplify End Node w Arduino internal pullup resistors" Recheck connections on your Gateway & node by comparing to the schematics. I also wonder if your twisting & taping are always securely connected. Making one wrong connection or one lack of connection can cause problems. It's a lot of details to keep straight & accomplish. Have patience with it & yourself. :-) Best Wishes & welcome to the DIY Home Automation party (& sometimes frustrations ;-)
|
|
|
Post by lucidbuddha on Nov 13, 2016 21:34:34 GMT
Thanks Papa. I checked power for both node and gateway using a multimeter and am getting 3.3v consistently. I had already bent out that VCC header as instructed so don't think my gateway is the problem. I was going to check all connections and re-solder when I simply fried my rfm69 chip. (This was largely due to not having proper soldering equipment - copper solder) My original soldering job was done at a local tinkermill so had a nice set up with magnifier etc. I've just now ordered 5 new rfm69HW chips (I'm confident I'll get this working one day) and a new soldering iron with magnifier and proper solder. When the chips come in I'll re-solder and test the node again.
|
|
|
Post by greginkansas on Nov 14, 2016 1:23:16 GMT
I hand built a few and used these for some www.anarduino.com/miniwireless/if you get one of these it will help testing your gateway. Split the system in half for testing.
|
|
|
Post by lucidbuddha on Nov 28, 2016 3:16:42 GMT
So, my radios came in.
I soldered the rfm69H (thought I'd gotten the HW but the "W" is not marked on the chip). I hooked it up to the breadboard with the DHT11 sensor for both the Computourist sketch (minus led) and the "multi-node" from papa and others.
I'm still getting "No connection". My gateway appears to be listening and serial monitor says MQTT link ok. So, I'm not sure what I'm doing wrong - can I get help creating this node with what I have?
-Buono r3 uno (switched to 3.3v) -RFM69H -DHT11
-Breadboard -resisters
I've currently got the test node running through the breadboard with "no connection". My 16 character password is the same for the 2.4 Gateway as with the node. I've uncommented my 433mhz and the monitor shows "Transmitting at 433 Mhz..." followed by "no connection". What sketch + wiring combo would work with the Gateway?
I'm considering buying an Anarduino miniwireless to help with getting these nodes going. Any help is appreciated.
|
|
|
Post by papa on Nov 28, 2016 16:02:34 GMT
Sorry you're still having trouble, lucidbuddha.
I believe RFM69H & RFM69HW should function the same as long as you pay attention to the RFM69 connection labels & follow the schematics for making their connection to the Arduino. In the node sketch, both can use the #define IS_RFM69HW option.
Are BOTH the Gateway & node set to 433MHz?
On the Gateway, is the RFM69's NSS connected to Arduino D8? On the node, is the RFM69's NSS connected to Arduino D10?
Maybe try this: a stripped down node of just Arduino & RFM69 radio (NO DHT, LED, etc) & a stripped node sketch to match. See a schematic below.
For the stripped program sketch, customize my multi-choice node sketch like this ... In the lines after "****** CONFIGURATION PARAMETERS ******", disable / comment (start the line with //) ALL options, except leave active / UNcommented the option #define GW24. Again leave active the GW24 option, but comment out all the other options.
Then in the sketch, recheck the lines NODEID thru FREQUENCY.
Using that customized multi-choice node sketch in debug mode, (besides one device 99 wake up) at least device 2 (radio signal strength), device 4 (node voltage), & device 9 (number of retried transmissions) should display multiple times on the serial monitor. Please report what results you get from trying this.
|
|
|
Post by greginkansas on Nov 29, 2016 1:42:59 GMT
I was going to say this also "In the node sketch, both can use the #define IS_RFM69HW option."
|
|
|
Post by papa on Nov 29, 2016 2:40:54 GMT
Are BOTH the Gateway & node set to 433MHz? On the Gateway, is the RFM69's NSS connected to Arduino D8? On the node, is the RFM69's NSS connected to Arduino D10? Maybe try this: a stripped down node of just Arduino & RFM69 radio (No DHT, No LED, No resistors, etc) & a stripped node sketch to match. << In schematic form, this is what I mean by a stripped, bare bones node. Click on the pic for a larger view. Again for the stripped program sketch, customize my multi-choice node sketch like this: In the lines after "****** CONFIGURATION PARAMETERS ******", disable / comment (start the line with //) ALL options, except leave active / UNcommented the option #define GW24. Again leave active the GW24 option, but comment out all the other options. Then in the sketch, recheck the lines NODEID thru FREQUENCY. << A bare bones node's first results for me on the Serial Monitor (red ovals added). Click on pic for larger view. Using that bare bones, customized multi-choice node sketch in debug mode, (besides one device 99 wake up) at least device 2 (radio signal strength), device 4 (node voltage), & device 9 (number of retried transmissions) should display multiple times on the serial monitor with pauses between. Please report what results you get from trying this.
|
|
|
Post by lucidbuddha on Dec 4, 2016 22:02:25 GMT
Still no luck.
Gateway: NSS is connected to D8. Set to 433Mhz. I get "MQTT-Link OK" in DEBUG but nothing with DEBUGRADIO. 16 Character password is the same as node.
Node: NSS is connected to D10. Set to 433Mhz. Every option uncommented except GW24. Following lines:
#define NODEID 2 // unique ID of THIS node within closed network [ 2-231 ??]
#define ENCRYPTKEY "1234567812345678" // 16-char encryption key; same as on Gateway!
#define DEBUG // uncomment for debugging messages on Arduino IDE serial monitor
// Below, uncomment only ONE frequency to match hardware version of your radio transceiver
#define FREQUENCY RF69_433MHZ
// #define FREQUENCY RF69_868MHZ
// #define FREQUENCY RF69_915MHZ
#define IS_RFM69HW // uncomment only for RFM69Hx!, transceivers with H in part #
long TXinterval = 45; // no battery: node transmission interval in secs, CT=20 or 30, Gandalph=900
int PIRloops = 112; // If PIR on battery sipping node, how many 8 sec loops of sleep ??
int Loops = 8; // Else if PIR NOT on battery sipping node, how many 8 sec loops of sleep ?? Thoughts? In the meantime, I'll solder another radio to test. Thanks for guidance.
|
|
|
Post by lucidbuddha on Dec 4, 2016 22:32:41 GMT
Just soldered another radio and attached. Still no connection.
|
|
|
Post by papa on Dec 4, 2016 22:48:45 GMT
For the bare bones node test, did you remove everything from the Node except the RFM69 radio?
Are you sure your RFM69's are 433MHz?
Sometimes rebooting the Gateway & node seems to help get them talking to each other.
|
|
|
Post by lucidbuddha on Dec 4, 2016 23:15:24 GMT
Yes, I had everything removed from the node except the RFM69H chip. Both chips say "433Mhz" and the sketches match that frequency. I've rebooted arduinos, re-compiled and uploaded sketches and continue to get "No connection..." I've even changed out the radio on the Gateway to see if that would do anything and still, "No connection..."
Question: Is there anyway to test the radio on just one end? Should I be seeing the serial monitor results on the node end even without the Gateway? If so, I can focus on just the node until I get those results in the Serial Monitor?
|
|
|
Post by lucidbuddha on Dec 5, 2016 1:17:40 GMT
Ok, some progress.
I had my networkID set in the Gateway as 100 but in the new choices sketch, it was 200. Now they're both 200 and on the serial monitor I got:
Transmitting at 433 Mhz... No connection...
Node: 2 device: 2 cmd: 0 val: 0 val: 0.00 RSSI: -32 Node: 2 device: 4 cmd: 0 val: 0 val: 3.38 RSSI: -32 Node: 2 device: 9 cmd: 0 val: 1 val: 3.38 RSSI: -33
But then No Connection for a long time. It seems inconsistent with connection. Next steps?
|
|
|
Post by papa on Dec 5, 2016 2:34:29 GMT
You said, "I had my networkID set in the Gateway as 100 but in the new choices sketch, it was 200. Now they're both 200..." My apologies. You must have customized computourist_node_v2.2Md_choices_pub. I have my own personal sketch version that I lately connect to a second network with networkID of 200. I then aim to edit my personal version to a pub (public) version where among other things the networkID should be 100 as it is in the Gateway sketch. Again my apologies for the delays & frustrations that caused you. I corrected that 2.2Md version in its original thread. For the 2.2Me & 2.2Mf versions, networkID is already 100. As you tested out, the networkIDs need to match in the Gateway & node sketches. You can keep using 200 from now on as long as you are consistent with yourself. Or you can revert Gateway & nodes to networkID 100 to be consistent with the computourist stuff. After correcting MY mistake, you got "Transmitting at 433 Mhz... No connection... [It always starts that way.]Node: 2 device: 2 cmd: 0 val: 0 val: 0.00 RSSI: -32 [Yay, a connection, radio signal strength of -32db, excellent]Node: 2 device: 4 cmd: 0 val: 0 val: 3.38 RSSI: -32 [3.38 volts]Node: 2 device: 9 cmd: 0 val: 1 val: 3.38 RSSI: -33" [Node & Gateway connected on one try, very good]"But then No Connection for a long time." At this point, ( while the Gateway is still powered & connected to your local network AND the node is connected to the Arduino IDE computer's USB) please reboot the node by pressing/ releasing the Buono's reset button & tell me your serial monitor results. Maybe try this a couple times with few minutes in between.
|
|
|
Post by papa on Dec 5, 2016 2:50:30 GMT
Be sure to see my previous post. When you discovered my mistake (networkID) in the node sketch, you may have fixed the main problem.
You ask, "Is there anyway to test the radio on just one end? Should I be seeing the serial monitor results on the node end even without the Gateway? If so, I can focus on just the node until I get those results in the Serial Monitor?"
I don't believe so. The node sketch depends on a powered Gateway successfully connected to your local Ethernet network & does not output much without that connection.
Something else to try (AFTER FIRST rebooting the USB connected node as in my post just above): Power the node with something else besides the computer running the Arduino IDE. Power the Ethernet-connected Gateway (in debug mode) with the Arduino IDE computer's USB & run the serial monitor. Please tell me what results you get then? Maybe reboot the Gateway then the node a time or two.
After I see your results from my suggestions in the just previous post & then this post, I'll see what else I might suggest.
|
|
|
Post by lucidbuddha on Dec 5, 2016 4:25:06 GMT
Ok. I've got the Node in an outlet and the Gateway serial reads: 2,2,0,0.00Node 2,4,0,3.38Node 2,9,1,3.38Node 2,99,0,0.00Node There's no running data. It seems I get inconsistent results when reset or powered on/off. But sometimes I get something! (UPDATE) I forgot to put it into Debug - here are results: MQTT-link OK 2,2,0,0.00Node MQTT msg: home/rfm_gw/nb/node02/dev02: -27 2,4,0,3.37Node MQTT msg: home/rfm_gw/nb/node02/dev04: 3.37 2,9,1,3.37Node MQTT msg: home/rfm_gw/nb/node02/dev09: 1 And this somewhat consistently: 433 Mhz... connecting no link MQTT-link OK 2,99,0,0.00Node MQTT msg: home/rfm_gw/nb/node02/dev99: NODE 2 WAKEUP
|
|
|
Post by papa on Dec 5, 2016 20:13:01 GMT
So summarizing your debug results from the Gateway: Then the good results stop, right? Also you're not seeing error messages after the good results, right? If the above is correct, it looks like the Gateway gets & maintains its connection to the local Ethernet network & to MQTT Then the results show that maybe the Gateway & node get different stages of a brief connection BUT then the Gateway loses connection to the node & shows no more results. You're still using just the BARE node (only Buono & RFM69) with the Gateway, right? (When we get this working, then we can go further on the node) On what operating system is your Arduino IDE hosted? Windows? Linux? ?? Please recheck that you edited the w5100.h library file as instructed. What text editor did you use to edit the file? Compare your file character by character with what I wrote in the middle of this Oct 7, 2015 postPlease respond to the above observations & questions
|
|
|
Post by lucidbuddha on Dec 5, 2016 20:53:27 GMT
Ok I'll work on this tonight. I'm still using the BARE node. My arduino IDE is on Windows 10. But everything you said to sum up where I'm at is correct. I'll recheck the w5100.h library and make sure the file is edited with my notepad++ (is that program ok to use?).
|
|
|
Post by papa on Dec 5, 2016 22:00:58 GMT
Yes, with Windows, it's important to use a text editor like notepad++ Typical Windows editors do end of line in a way that can throw fits in other operating systems. Will also be important when you edit OpenHAB config files.
When you re-edit w5100.h with notepad++ and upload the Gateway sketch, let me know your Gateway's serial monitor results in debug mode.
If that does not help, I've got at least a couple more ideas to try.
|
|
|
Post by lucidbuddha on Dec 6, 2016 3:31:29 GMT
Ok, double-checked that the code in w5100.h in the Ethernet library has some code replaced to look like:
#else inline static void initSS() { DDRB |= _BV(2); }; inline static void setSS() { cli(); PORTB &= ~_BV(2); }; inline static void resetSS() { PORTB |= _BV(2); sei(); }; #endif And the Gateway reads:
MQTT msg: home/rfm_gw/nb/node02/dev99: NODE 2 WAKEUP
2,2,0,0.00Node
MQTT msg: home/rfm_gw/nb/node02/dev02: -36
2,4,0,3.37Node
MQTT msg: home/rfm_gw/nb/node02/dev04: 3.37
2,9,1,3.37Node
MQTT msg: home/rfm_gw/nb/node02/dev09: 1
2,2,0,0.00Node
MQTT msg: home/rfm_gw/nb/node02/dev02: -36
2,4,0,3.37Node
MQTT msg: home/rfm_gw/nb/node02/dev04: 3.37
But then nothing. It gets an initial message but then nothing.
Also, I've already got my Openhab set up with some ESP8266 DHT sensors using MQTT and publishing data to the sitemap. I feel way more comfortable with Openhab than any other part of this project. I'm getting a pi3 by the end of the week and plan to load Openhab2. Oh, that reminds me - are the messages on the serial being published as an MQTT message? If so, I'm not seeing it on my terminal when I subscribe to all topics.
Thanks for your help and continued guidance. Definitely helps with the frustration piece.
|
|
|
Post by papa on Dec 6, 2016 21:47:01 GMT
Yes, the messages should be published as MQTT messages.
Yes, according to computourist, the ESP devices are easier to work with than the Gateway - Node networks.
Next thing to try: Find the Ethernet.h library file. With notepad++, edit it (you may need to shut down the Arduino IDE) so you UNcomment (remove //) the line with #include "w5100.h" I did not have to do that edit for my connections to work, but some have said that it helped them. After editing & saving Ethernet.h , upload the gateway sketch to the Buono. I just made that change in Ethernet.h. I did not see any change, but maybe you will.
|
|
|
Post by greginkansas on Dec 7, 2016 0:52:22 GMT
looking thru the thread I see this
I've just now ordered 5 new rfm69HW chips in the code you posted
// #define FREQUENCY RF69_915MHZ
#define IS_RFM69HW // uncomment only for RFM69Hx!, transceivers with H in part #
Do you have the HW on all nodes and the gateway?
|
|
|
Post by lucidbuddha on Dec 7, 2016 3:19:36 GMT
greginkansas - I've double-checked that both sketches show my 433MHZ chips and both have #define IS_RFM69HW uncommented. My chips are RFM69H without the "W". papa - I changed the Ethernet.h and uncommented the "w5100.h" line so it's included. Now my gateway monitor reads: 433 Mhz...
connecting
no link
MQTT-link OK
MQTT msg: home/rfm_gw/nb/node02/dev09: 6
MQTT msg: home/rfm_gw/nb/node02/dev99: NODE 2 WAKEUP
MQTT msg: home/rfm_gw/nb/node02/dev02: -29
Also, I'm now seeing these on my terminal when I subscribe to all mosquitto messages! Yay! But sometimes I'll get a handful of data and sometimes I get the initial data then nothing else. Also, sometimes my radio LED lights up, indicating radio is working, and other times it doesn't light up but I still get some signals. Odd... Here's latest on my serial: 433 Mhz...
connecting
no link
MQTT-link OK
MQTT msg: home/rfm_gw/nb/node02/dev09: 6
MQTT msg: home/rfm_gw/nb/node02/dev02: -28
MQTT msg: home/rfm_gw/nb/node02/dev04: 3.37
MQTT msg: home/rfm_gw/nb/node02/dev09: 1
MQTT msg: home/rfm_gw/nb/node02/dev02: -29
MQTT msg: home/rfm_gw/nb/node02/dev04: 3.38
Still not sure why I'm getting spotty connection.
|
|
|
Post by lucidbuddha on Dec 7, 2016 3:34:12 GMT
So, I put the Gateway in DEBUGRADIO and now it seems I'm getting consistent results. These are showing up in my terminal as well!
I'm going to see how far I can get with the DHT sensor...
|
|
|
Post by papa on Dec 7, 2016 16:49:27 GMT
lucidbuddha, I'm glad things are working better. Important note on adding the DHT sensor: If you use my multi-choice end node sketch, do NOT use the resistor with the DHT. My sketch version activates a pullup resistor in the Buono processor that take the place of the visible resistor. The software pullup resistor is also true for the pushbutton. You will still need an LED resistor. If you use the original computourist DHT end node sketch, do use the resistor. I recommend you add things to the node progressively: Like 1) get the DHT working. Then 2) add the pushbutton / LED combination. OR 2 then 1. In my multi-choice sketch, for 1) select (UNcomment) #define HT & a temperature scale. For 2) select BUTTON which also gets ACTOR (which actuates the pin for a LED or relay). Regarding " spotty reception," I wonder if other transmitting devices might be competing with your 433MHz transmissions. In this thread, the Oct 7, 2015 at 10:51am post, computourist wrote: You & I never discussed antenna size. In my construction notes, I've listed about 3 inches (77.9mm), which is an appropriate a 1/4 wave antenna for the 915 MHz RFM69 radios that I use. Looks like a 1/4 wave antenna needs to be much longer for 433 MHz, 164.7mm (6.5 inches). Here's what the main Anarduino Miniwireless guy posted about antennas for the RFM69 varieties. BTW, I've had similar response from a straight wire antenna & an antenna wire that had been coiled around a pencil. The coil takes up less space & is less likely to get bumped. I adapted the following from this site. It gives slightly different, but close, antenna sizes & appropriate regions for the frequencies: Available Unlicensed Frequency Bands Frequency Antenna length Regions 433 MHz 173 mm Europe, Asia, Australia, U.S. (limited) 868 MHz 78 mm Europe only 915 MHz 82 mm U.S. and Australia only
|
|
pato
New Member
Posts: 8
|
Post by pato on Apr 19, 2017 20:34:51 GMT
Just wanted to add. I also had exactly this issue here, but didn't anymore find the information about the ethernet.h in the original build thread, nor on the referenced one a few posts earlier by papa. So for everybody who needs the information, I found it here: homeautomation.proboards.com/post/1882/thread
|
|
|
Post by papa on Apr 20, 2017 16:35:26 GMT
Good to hear from you, pato. Sorry you had trouble locating the edits for 5100.h. I did some reorganizing of the posts. Those w5100.h edits are now in an Arduino IDE Hints & Tutorials thread in this post. I corrected the link in the brump post from which you quoted. Also in that post after the w5100.h edits, do not miss another edit necessary for good connections:
|
|
pato
New Member
Posts: 8
|
Post by pato on Apr 20, 2017 21:16:37 GMT
This is interesting. I did not change the ethernet.h file, but could see an immediate change in the behavior after editing w5100.h and uploading the new compiled sketch. I also bent the pin on the 6-pin header of my Buono around the same time, but I'm fairly sure I did it the following: - uploaded original sketch - after some successful packets the communication stopped - bent the pin and restarted - after some successful packets the communication stopped - edited w5100.h - after some successful packets the communication continued (for more than a day)
Then again, it was late in the evening. Testing now with the updated ethernet.h.
Ok, just tested to compile, getting this error now:
It's IDE 1.8.1. The file ethernet.h is in the folder mentioned above, the file w5100.h is in the subfolder utility of that folder. Not sure if I should even try to include the w5100.h, as it is running fine atm, but I also don't really know what I win/loose by including it (need to read up on that first).
[edit] The include works if I state it like this in the Ethernet.h: #include "utility\w5100.h"
|
|
|
Post by papa on Apr 21, 2017 14:27:10 GMT
Good troubleshooting, pato. Updates like for IDE can solve some problems & create new issues. I know what you mean. It does seem that editing only w5100.h improves communication reliability, but it's hard to see how that helps when the Ethernet.h include of w5100.h is commented out. I decided to activate & recommend the include for safety's sake. I'm not sure I see an improvement via the Ethernet.h include, but also no added problems. So again, maybe a logical & safe change to make. My previous research about the Ethernet.h edit did not find anything. Let us know if you find something. Thanks for finding & documenting the possible need to use #include "utility\w5100.h" as the Ethernet.h edit. I've added it in the Arduino IDE Hints & Tutorials thread.
|
|