|
Post by agecrabahaykubo on Feb 10, 2017 21:20:54 GMT
Hi all, I decided to create this thread for the fact that I am thinking of not making any progress with this project. What I have done or accomplished lately was buying the parts needed, solder the RFM69 which I sucked big time, attaching the wires to the arduinos, downloaded and uploaded the sketches which I also encountered errors mostly missing libraries. My question is how do i know if I have a working RFM gateway and Ethernet gateway? Should I see their IP addresses in my devices network when I plug them in? I am now trying to build the sensors and I am starting on PIR motion sensor. I just can't figure it out how to wire the 10 ohm resistor really. Here's the image of RFM69 gateway and Ethernet Gateway. Hope someone can help me. Thanks.
|
|
|
Post by papa on Feb 10, 2017 23:48:38 GMT
Welcome, agecrabahaykubo, to the DIY Home Automation party & sometimes frustration. Sorry, you're having trouble. Let's see if we can get you going. Making your first gateway & node are usually the hardest for beginners. When you say, "working RFM gateway and Ethernet gateway," it sounds like you are using the original Uber Home Automation Instructable where the link to this forum was posted. The approach in this forum uses only one gateway. The Instructable is inspiring, but had limitations & glitches (admitted by the author). In this forum, we use a refined version (based on computourist's work) that has more capability & more reliable communication between devices. I recommend you use documentation in this forum mostly. If there are sensor nodes in the Instructable that are not covered in this forum, perhaps when you understand more you can return to those Instructable nodes & adapt the sensors to this forum approach. All or most parts you bought should be useful in this approach. I just did a thread called Building a Home Automation Network (Beginners ??). I've tried to make it as simple & complete as I can (but it may still be challenging) & I included things like what results you should expect & dealing with the libraries needed. I believe if you successfully work your way through that thread (& other threads it links to), you'll be off to a good start. Once you get through that Building... thread, I can point you to some of my documentation on using PIR sensors. We in this forum will try to help you. Please continue posting in THIS thread (Help im stuck) & as you move through attempts, give some details what instructions you're following, what you're using, what you're trying, & what results you get. Again, if you're following the Uber Home Automation Instructable, I recommend you set that aside for now & use what's in this forum. Even if you're not following the Instructable, my Building... thread might be helpful to you.
|
|
|
Post by agecrabahaykubo on Feb 11, 2017 0:59:52 GMT
Thank you for the warm welcome papa, yes frustration is a big part of success. Well, I'm going to jump right into the thread that you mentioned and will be posting questions once again if I'm getting some difficulties. Best regards. Welcome, agecrabahaykubo, to the DIY Home Automation party & sometimes frustration. Sorry, you're having trouble. Let's see if we can get you going. Making your first gateway & node are usually the hardest for beginners. When you say, "working RFM gateway and Ethernet gateway," it sounds like you are using the original Uber Home Automation Instructable where the link to this forum was posted. The approach in this forum uses only one gateway. The Instructable is inspiring, but had limitations & glitches (admitted by the author). In this forum, we use a refined version (based on computourist's work) that has more capability & more reliable communication between devices. I recommend you use documentation in this forum mostly. If there are sensor nodes in the Instructable that are not covered in this forum, perhaps when you understand more you can return to those Instructable nodes & adapt the sensors to this forum approach. All or most parts you bought should be useful in this approach. I just did a thread called Building a Home Automation Network (Beginners ??). I've tried to make it as simple & complete as I can (but it may still be challenging) & I included things like what results you should expect & dealing with the libraries needed. I believe if you successfully work your way through that thread (& other threads it links to), you'll be off to a good start. Once you get through that Building... thread, I can point you to some of my documentation on using PIR sensors. We in this forum will try to help you. Please continue posting in THIS thread (Help im stuck) & as you move through attempts, give some details what instructions you're following, what you're using, what you're trying, & what results you get. Again, if you're following the Uber Home Automation Instructable, I recommend you set that aside for now & use what's in this forum. Even if you're not following the Instructable, my Building... thread might be helpful to you.
|
|
|
Post by agecrabahaykubo on Feb 15, 2017 16:45:15 GMT
Hi papa, I am reading a lot lately of your post about assembling the Gateway node and the DHT End node and I realized that I can't use my Arduino Uno unless I hack it to 3.3. So I ordered the two(2) Buono R3 and still waiting for it to arrive. I did also reorder two(2) RFM69 but I am using RFM69HW not RFM69HC would this be OK? And order 1 more Protoshield. So right now I'm just waiting. But I went to some DIY store today and found a solid state relay and I tried making it! Please see attached image and could you please let me know if the specifications are good enough to use. Specifications: 5.5 - 10 VDC 10A/240 VAC Here's the solid state relay image. will do next the protective cover. Thanks.
|
|
|
Post by papa on Feb 15, 2017 21:22:57 GMT
agecrabahaykubo, good to hear from you. Good that you noticed about needing a fully 3.3 volt Arduino for this project. Any RFM69 part number with "H" in it can use that define in the sketch. Your Solid State Relay (SSR) may not work. According to the specs, the SSR needs at least 5.5 volt input (& enough current) to activate the AC. Even a regular Arduino Uno's digital pins output only 5 volts. Digital pins of a Buono (switched to 3.3 volt operation safe for RFM69s) output 3.3 volts. My schematic with the SSR shows how to use a digital pin's 3.3 volts to send 5 volts to the SSR, but according to the specs, that 5 volts may not be enough. The fotek ssr-10da solid state relay shown in the Success... thread (the Oct 15, 2015 post starting with "Preparing a Solid State Relay to control AC devices") has worked well for me. It's specs are 3 - 32 volts DC (Buono's 3.3 volts may not have enough current, but it's 5 volts controlled by a transistor works) & 24 - 380 volts AC. Since you bring up using the Solid State Relay, I wonder, "Are you starting with that project?" OR "Are you just trying to get readily available local parts for the future?" Again, I recommend that you start this project with something like that Building a Home Automation Network (Beginners ??) thread so you can start as simple as possible & build up successes. Once you get the FULL DHT End Node working, you're close to an AC controlling node. To control AC, instead of the LED, the ACTOR digital pin output goes to a transistor that gates the Buono UNO 5 volts to trigger the Relay.
|
|
|
Post by agecrabahaykubo on Feb 15, 2017 21:54:35 GMT
Hi papa,
I am restarting the home automation from scratch again following your adapted schematics. But I am still waiting for the parts to arrive namely the 2 Buono R3 and RFm69. I just happen to visit a DIY shop and saw the solid state relay and bought it and made the hack.
Will post again of any news or question. Thanks.
|
|
|
Post by agecrabahaykubo on Mar 4, 2017 3:04:16 GMT
Hi papa, I got some good news and bad news, the good news is I got the Buono R3 today. To my excitement I quickly plugged it to my computer and uploaded the RFM sketch. And the bad news is I can't connect to MQTT, the error message it "No DHCP, connecting, no link". I did follow your troubleshooting when we got no result from connecting to MQTT, unplugged the wires from RFM69 and ethernet cable and restart the serial monitor but still I'm getting the same No DHCP error. So then I plugged in the ethernet cable and the result is still the same. I even reinstall and start the MQTT service on my RPi3 but no luck. Any suggestions? I'm running out of ideas on how to make this work. I don't want to end up wasting all the resources that I bought for this project. Thanks.
|
|
|
Post by papa on Mar 4, 2017 14:05:30 GMT
OK, another warning, getting started in this project is a good opportunity to practice patience & learning to troubleshoot. Your picture indicates your gateway is not connecting to your local network router. You did not mention plugging a w5100 Ethernet shield on top the gateway Buono. Do you have one of those installed with the Buono's ICSP VCC disabled? (See this thread, the first post on that page 2)
Sometimes rebooting the router & then (when the router is fully up) the gateway seem to help. If that does not help ... Tell me the IP address of your PI. Then from your sketch you used to program your gateway, copy & paste in your reply: the contents of these lines (the originals which need customizing to your PI): // Ethernet settings byte mqtt_server[] = { 192, 168, x, y}; // IP of computer hosting the MQTT service byte ip[] = { 192, 168, x, z }; // default IP for this Gateway if DHCP does not assign it
|
|
|
Post by agecrabahaykubo on Mar 6, 2017 1:04:20 GMT
You did not mention plugging a w5100 Ethernet shield on top the gateway Buono. Do you have one of those installed with the Buono's ICSP VCC disabled? (See this thread, the first post on that page 2) Yes I plugged the shield on top of Buono with RFM69 connected. I did also bend(disabled) ICSP VCC. So when RFM69 is attached to the shield I don't get the "No DHCP, connecting, no link" message.
Sometimes rebooting the router & then (when the router is fully up) the gateway seem to help. I did reboot my router to try but no luck. I connected my Pi directly to router no luck. I haven't try to connect the Arduino/sheild to the router directly.
If that does not help ... Tell me the IP address of your PI. My Pi's address is 192.168.0.12
Then from your sketch you used to program your gateway, copy & paste in your reply: the contents of these lines (the originals which need customizing to your PI):
// Ethernet settings byte mqtt_server[] = { 192, 168, x, y}; // IP of computer hosting the MQTT service byte ip[] = { 192, 168, x, z }; // default IP for this Gateway if DHCP does not assign it
// Ethernet settings byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xBA, 0xBE }; // Assigns Gateway's MAC address for Ethernet byte mqtt_server[] = { 192, 168, 0, 12 }; // IP of computer hosting the MQTT service byte ip[] = { 192, 168, 0, 12 }; // default IP for this Gateway if DHCP does not assign it
I'm just wondering if the DHCP problem is caused by my network switch where my Pi, desktop and ethernet shield is connected.
|
|
|
Post by agecrabahaykubo on Mar 6, 2017 1:21:01 GMT
I logged into my router to check my IP addresses and saw this. I am wondering if this is because I connect RPi to a switch but I am pretty sure 192.168.0.12 is my Pi's address. Attachments:
|
|
|
Post by papa on Mar 6, 2017 2:37:06 GMT
agecrabahaykubo : "I'm just wondering if the DHCP problem is caused by my network switch where my Pi, desktop and ethernet shield is connected."
I must mention one possibility I've sometimes seen before when the gateway did not work: the ethernet shield might be defective. For now, let's hope it is not.
In my experience, it can take a while before the gateway's Ethernet shield to get an IP address via DHCP & the default IP in the sketch does not necessarily help. Once you get the gateway connected, it seems to work ok after that. The difficulty of connecting seems to increase if another device (like a switch) is between the gateway & the assigning router. Is there any way you could connect the Pi & the Gateway directly to the router via Ethernet cables? Then again, it'd be good if the gateway could connect to the desktop's USB & Arduino IDE so you could check the Serial Monitor. So it might be much trouble to get them all directly connected to the router.
For now, we want to avoid "No DHCP" on the Serial Monitor. It may take more patience. Seems like the hardest part of this project is getting a working & connected gateway & first end node. After that it typically goes more smoothly.
Try this maybe when you can start it & leave it for a good while: Start with all these shut down: Gateway, Switch (if you cannot avoid using it), & Router. Then restart them in this order one at a time, not moving to start the next device until the current one is fully up (all its LEDs "go"): 1) Router 2) Switch (if you must, leave out of the chain if possible) 3) Gateway. (Set the Pi aside for now). After all the devices are fully up one at a time, check the router to see if the gateway's MAC address (DE:AD:BE:EF:BA:BE from Ethernet settings in the gateway sketch) shows up. How about an IP address for the gateway? Also check the Serial Monitor where we hope to avoid the "No DHCP" message.
If the gateway still does not have an IP, go do something else for a while, maybe a LONG while (even overnight). Come back & check if the gateway has an IP. If necessary repeat (a couple more times) the shutdowns, progressive startups, check for gateway IP, wait a while, recheck again.
Once the gateway get's an IP, start the RPi running OpenHAB & MQTT to see if the gateway connects to MQTT.
|
|
|
Post by agecrabahaykubo on Mar 6, 2017 16:30:23 GMT
Hi papa, I have a working gateway now at the expense of getting a new shield and you are right the shield is defective. One thing I'm concern right now is the VCC pin (ICSP) when I bend it I don't get any response from the shield, from the serial monitor I am only seeing gateway version and 915 mhz. But when I don't bend the VCC pin I get a quick response from the shield and MQTT link OK message. Is it safe to not bend the VCC pin? As I am writing this I bend the VCC pin again but no response from the SM. Thanks.
|
|
|
Post by papa on Mar 6, 2017 18:55:25 GMT
agecrabahaykubo, that's great to see you had DHCP & MQTT connecting. That's a big step accomplished. I'm glad I mentioned the possibility of a defective shield.
You ask, "Is it safe to not bend the [Buono's ICSP] VCC pin?" Possibly, in fact, with your Ethernet shield you MAY need to leave it up to connect.
I came up with the bent VCC pin hack because some of us found without that disabling, the Buono (even when switched to 3.3 volt mode) supplied higher voltage to all the shield's pins which meant the RFM69 radio was getting voltage that could eventually damage it.
In your case, 1) Maybe your w5100 Ethernet Shield does not have the flaw for which I developed the bent pin hack.
Here's how to check: Have the ICSP VCC pin in original erect position. Plug the Ethernet Shield on top. Be sure the Buono is switched to 3.3 volts. Unplug the RFM69 radio. Power the assembled (but radio-less) Gateway with USB or wall power. Use a multi-meter switched to read low voltage. Connect the multi-meter's common to a GND on the Ethernet Shield. Then with the multi-meter's other probe check these Ethernet Shield sockets: 3.3 volts & some of the digital pins used by the RFM69 radio (d13, d12, d2 ...) If those sockets read something like 3.3 volts, then it's safe, maybe even necessary, to leave the ICSP VCC pin as manufactured.
2) If in 1), Ethernet Shield sockets read significantly more than 3.3 volts then ... Are you bending the Buono's ICSP VCC pin at a 90 degree angle near where it leaves the Buono's circuit board? Is it possible it's preventing the shield's other pins from connecting to the Buono to get power & signals? Could it be the first Ethernet Shield was ok, but was not adequately connected to the Buono?
Please let me know what you find out in case I need to add to the gateway instructions.
Another question: Did the gateway connection to DHCP & MQTT happen when the gateway was connected to the switch or was the gateway directly connected to the router?
|
|
|
Post by agecrabahaykubo on Mar 6, 2017 23:06:18 GMT
papa, I checked the voltage of the shield (VCC pin bent) and the readings for 3.3v socket/pin is 4.6v, D13 is 3.3v D12 is 4.6v, D2 is 0.05vnot really sure if the reading were accurate though as I can't insert my meter's probe into the socket instead I probe the exposed header pns/legs. I then bent the VCC pin and i got constant 3.3v reading from the sockets I mentioned above but couldn't connect to MQTT or maybe get signals. I believe that the first shield was defective because I tried running the sample sketch from the Arduino IDE where it will print my shield's IP address and the result was " Failed to configure Ethernet using DHCP." And when I tried the new shield, it gave me the IP address. When I got the MQTT-ok connection the shield was connected to the network switch but my Pi was directly connected to the router. Thanks again for your time responding to my frustrations.
|
|
|
Post by papa on Mar 7, 2017 0:40:46 GMT
You're welcome, agecrabahaykubo, I'm glad we got some progress. Thanks for answering my questions
I think you may mean "papa, I checked the voltage of the shield (VCC pin UNbent) and the readings for 3.3v socket/pin is 4.6v, D13 is 3.3v D12 is 4.6v, D2 is 0.05v"
The voltages on the RFM69 used pins will vary according to what signal Arduino/Shield & RFM69 radio are sending each other or down time between signals. If the VCC pin was indeed UNbent, then that way the RFM69 radio could indeed be getting voltage to damage it eventually.
Question: When the VCC pin was BENT, did the Ethernet Shield's built in LEDs light up & flash?
BTW one can somehow (clip, tape) connect the multi-meter probe to one end of a male to male wire & insert the other end into a socket. It might be a steadier connection you could watch for a little while.
What to do?? At the moment, I see 2 choices for you: 1) Maybe risk leaving the VCC pin UNbent & see if the radio lasts (mine did last several months at least before someone drew my attention to the too-high voltage)
2) Maybe (in a different way) test the hack that has worked for me & some others AND perhaps test other potential hacks. I believe if I had that problem I would experiment & test this way: I would not plug the shield directly into the Buono & would first leave off the RFM69 radio. I would connect shield pins to the Buono via short male to female DuPont cables, leave ICSP VCC pin UNconnected & test voltages. Still using the Dupont cables to connect Buono & shield, power down the Gateway, install the RFM69 radio, power up, & see if the Gateway connects to DHCP & MQTT. (If so, the bent pin is preventing a vital connection & you may need to cut off the VCC pin.) If the gateway does not connect, maybe experiment with connecting the VCC pin but disconnecting just the 3.3 volt pin, just the 5 volt pin, & then disconnecting both 3.3 & 5 volt pins. I would try different combinations to see if I could get safe <= 3.3 volts AND connection to DHCP & MQTT.
I'd appreciate hearing what you try & what you find out.
|
|
|
Post by agecrabahaykubo on Mar 7, 2017 3:40:46 GMT
I think you may mean "papa, I checked the voltage of the shield (VCC pin UNbent) and the readings for 3.3v socket/pin is 4.6v, D13 is 3.3v D12 is 4.6v, D2 is 0.05v" That's what I meant.The voltages on the RFM69 used pins will vary according to what signal Arduino/Shield & RFM69 radio are sending each other or down time between signals. If the VCC pin was indeed UNbent, then that way the RFM69 radio could indeed be getting voltage to damage it eventually. Please don't, I really struggled soldering that RFM69, I got shaky hands now . I've wasted 2 already and I think the one for Bare bones node is a wasted one too. I'm not getting any response/result displayed from the serial monitor, just the version and transmitting at 915 mhz. Will try again.Question: When the VCC pin was BENT, did the Ethernet Shield's built in LEDs light up & flash? Yes I believe it was lit up and flashing, though I could not get anything even the No DHCP or no link displayed at serial monitor.BTW one can somehow (clip, tape) connect the multi-meter probe to one end of a male to male wire & insert the other end into a socket. It might be a steadier connection you could watch for a little while. Will try again next time.What to do?? At the moment, I see 2 choices for you: 1) Maybe risk leaving the VCC pin UNbent & see if the radio lasts (mine did last several months at least before someone drew my attention to the too-high voltage) Yes I will leave it unbent for now and will test again the hack.2) Maybe (in a different way) test the hack that has worked for me & some others AND perhaps test other potential hacks. I believe if I had that problem I would experiment & test this way: I would not plug the shield directly into the Buono & would first leave off the RFM69 radio. I would connect shield pins to the Buono via short male to female DuPont cables, leave ICSP VCC pin UNconnected & test voltages. Still using the Dupont cables to connect Buono & shield, power down the Gateway, install the RFM69 radio, power up, & see if the Gateway connects to DHCP & MQTT. (If so, the bent pin is preventing a vital connection & you may need to cut off the VCC pin.) If the gateway does not connect, maybe experiment with connecting the VCC pin but disconnecting just the 3.3 volt pin, just the 5 volt pin, & then disconnecting both 3.3 & 5 volt pins. I would try different combinations to see if I could get safe <= 3.3 volts AND connection to DHCP & MQTT. Will gonna try your suggestion and will let you know of the result. BTW how do you power down the Gateway? Just unpluged it from USB port? And also one more question about the gateway, after I got MQTT connection OK I followed the instruction to uncomment #define DEBUGRADIO and commented #define DEBUG then I check serial monitor and nothing displayed on serial monitor, is this right?
|
|
|
Post by papa on Mar 7, 2017 12:45:24 GMT
agecrabahaykubo, sorry about your struggles. Again these first steps are the hardest ones, including getting used to soldering those close pads on the RFM69 radios. Applying a little from a solder flux pen to the pad & its wire seems to help a little.
Thanks for answering my questions. It helps me help you & may help someone else who's looking for similar help. I also compliment you for the information you provide. It helps me narrow down what may be happening with your efforts.
You asked, "BTW how do you power down the Gateway? Just unplug it from USB port?" Yes, the only way one can power it down is unplug it from the power source.
You asked, "one more question about the gateway, after I got MQTT connection OK I followed the instruction to uncomment #define DEBUGRADIO and commented #define DEBUG then I check serial monitor and nothing displayed on serial monitor, is this right?" Papa: ^^ In this comment / question, you may have just given a big clue on the latest frustration.
"Is this right?" Yes, probably.
Explanation follows: Those lines in the gateway sketch say (with // left out): #define DEBUGRADIO // uncomment for radio debugging #define DEBUG // uncomment for MQTT debugging
The sketch's author had us alternately comment & uncomment those lines to save Arduino memory in what could be a large sketch. an active #define DEBUG gives us serial monitor (SM) feedback on the gateway connecting (or not) to DHCP & MQTT
an active #define DEBUGRADIO gives us SM feedback on the gateway's radio communications with an end node If you have not built & powered a working end node yet, I believe that option will show very little on the serial monitor, maybe just like your last pic above that ends with 915 MHz.
So until you have a working end node for the gateway to communicate with, leave DEBUGRADIO commented out & leave DEBUG UNcommented.
Could it be that your gateway with a BENT VCC pin was actually working fine, but SM showed little because DEBUG was commented out?
I suggest you try again on a gateway with a BENT VCC pin & with #define DEBUG UNcommented & DEBUGRADIO commented. & Please let me know the results on the Serial Monitor.
When I get a chance later, I'll review my gateway documentation in relation to this discussion.
|
|
|
Post by papa on Mar 7, 2017 14:13:06 GMT
agecrabahaykubo, do not miss my post just above. You may have provided a clue to having a working gateway with proper voltages.
Reviewing my gateway documentation in relation to the discussion on this thread: In this thread, a Jan 31, 2017 post, says (leaving out some & emphasizing some more), In this thread page, the first post said in the black text & I just added more in the reddish text:
|
|
|
Post by agecrabahaykubo on Mar 8, 2017 5:33:45 GMT
papa, I'm pretty sure #define DEBUG was still uncommented (no //) when i tried the hack.
You know what, Buono R3 serial monitor was kind of not responding when vcc pin is bent while the other Uno that i have is responding and displaying MQTT Link Ok when VCC pin is either bent or unbent.
I will take some voltage reading for Uno both bent/unbent vcc pin tom and will post it here.
|
|
|
Post by papa on Mar 8, 2017 15:19:40 GMT
"I will take some voltage reading for Uno both bent/unbent vcc pin tom and will post it here."
OK, I'll be interested to hear.
I hope "the other Uno" you mention is either a regular Uno hacked to 3.3 volt operation or another Buono Uno. As mentioned before, a regular UNhacked Uno supplies too much voltage to be safe for the RFM69 radio
"Buono R3 serial monitor was kind of not responding when vcc pin is bent" ^^ maybe that Buono has some flaws. For one thing, sometimes those Buono 3.3v <-> 5v switches can be flaky & need fiddling with to get a good supply of 3.3 volts going to the Buono.
|
|
|
Post by agecrabahaykubo on Mar 9, 2017 1:36:29 GMT
papa, here's the voltage reading I got last night with the RFM69 plugged on a regular Uno not hack to 3.3v PIN#
| Bent VCC Pin
| UnBent VCC Pin
| D13 | 0.49
| 0.49 | D12
| 0.45
| 0.45 | D11 | 3.86
| 3.86 | D10 | 3.05
| 3.05 | D9
| 0.00 | 0
| D8 | 4.68 | 4.68
| D7 | 4.21 | 4.71 | D2
| 0.00
| 0 | 3.3V | 3.31
| 4.10 |
for now I'll stick to the unbent position of the vcc pin, i'm afraid that it will break with a few more bending.
|
|
|
Post by papa on Mar 9, 2017 4:00:32 GMT
Yes, on a regular, UNhacked Uno, a bent VCC pin probably not make much difference in voltages. & according to specs, a bit above 3.3 volts is too much in the long run for a RFM69 radio.
A RFM69 radio connected to a BUONO switched to 3.3 volts should be fine.
?? But I thought we were discussing building a working gateway (Buono switched to 3.3 volts + w5100 Ethernet shield) & avoiding RFM69 damaging voltages at the Ethernet Shield sockets.
|
|
|
Post by agecrabahaykubo on Mar 9, 2017 15:30:11 GMT
I may be off topic now sorry about that. I'm still committed to build a working gateway only that I have issues with getting to work in the voltage that we expected.
|
|
|
Post by papa on Mar 9, 2017 16:46:23 GMT
OK, certainly, explore, test, & learn from the results. Best wishes for building towards success.
|
|
|
Post by agecrabahaykubo on Mar 10, 2017 3:59:23 GMT
Update: I got the second RFM69 working for the bare bones node, I tested it with RFM gateway and it connects to MQTT. Bare bones node isn't working yet, might be my soldering or wiring/connection again. The somewhat defective ethernet shield ( Failed to configure Ethernet using DHCP) is working now thanks to the circuit masters out there.
|
|
|
Post by papa on Mar 10, 2017 12:34:11 GMT
Sounds like you're making progress & have the dedication to get results.
|
|
|
Post by agecrabahaykubo on Mar 14, 2017 1:37:29 GMT
Latest update: DHT node still not working (no connection). Did a search for this kind of problem and found lucidbuddha 's thread.Followed the suggestions and action made, edit ethernet.h and w5100.h, did the strip down bare bones node and still not getting any luck. Here's my code for RFM gateway which is MQTT-link OK #include <RFM69.h> #include <SPI.h> #include <Ethernet.h> #include <PubSubClient.h> void mqtt_subs(char* topic, byte* payload, unsigned int length);
//#define DEBUGRADIO // uncomment for radio debugging #define DEBUG // uncomment for MQTT debugging #define VERSION "GW V2.4"
// Ethernet settings byte mac[] = { 0xDA, 0xAD, 0xBE, 0xEF, 0xBA, 0xBE }; // Assigns Gateway's MAC address for Ethernet byte mqtt_server[] = {192,168,x,x}; // IP of computer hosting the MQTT service Raspberry Pi3 byte ip[] = {192,168,x,x}; // default IP for this Gateway if DHCP does not assign it
// Wireless settings #define NODEID 1 // unique node ID in the closed radio network; gateway is 1 #define RFM_SS 8 // Slave Select RFM69 is connected to pin 8 #define NETWORKID 100 // closed radio network ID
//Match frequency to the hardware version of the radio (uncomment one): //#define FREQUENCY RF69_433MHZ //#define FREQUENCY RF69_868MHZ #define FREQUENCY RF69_915MHZ #define ENCRYPTKEY "AgecraBahayKubo1" // shared 16-char encryption key is equal on Gateway and nodes #define IS_RFM69HW // uncomment only for RFM69HW! Leave out if you have RFM69W! #define ACK_TIME 50 // max # of ms to wait for an ack Here's the DHT end node configuration/parameters. I just include what I uncommented and deleted the other stuff just to make the code short for this purpose. #include <RFM69.h> #include <SPI.h> #include <SPIFlash.h>
// ****** CONFIGURATION PARAMETERS ****** // (Here - line 205, customize to your network & node)
// Choose options (devices / sensors, temp scale) wanted for this node: // By commenting (//) the start of #define lines below, choose options you do NOT want. // By UNcommenting (no //) the start of #define lines below, choose options you DO want.
// [By comment / uncomment], CHOOSE ONE of these two for your Temperature Scale: // #define FAHR // Fahrenheit #define CELS // Celsius
#define HT // for DHT11 temp / humidity sensor, d4. d7 also w SLEEPY // #define ACTOR // d9, for Actuator of Node LED or Relay via OpenHAB user interface // ^^ AND later, define ALSO with ifdef BUTTON (pointless without ACTOR)
#define NODEID 2 // unique ID of THIS node within closed network [ 2-231 ??] #define ENCRYPTKEY "AgecraBahayKubo1" // 16-char key. Use same key as for the Gateway. NW1 #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 # #ifndef SUMP #ifndef WATERLEVEL long TXinterval = 45; // no battery: node transmission interval in secs, CT=20 or 30, Gandalph=900 // Note, ifdef SUMP & ifdef WATERLEVEL below: TXinterval = 30, good intervals for them #endif // WATERLEVEL #endif // end of ifndef SUMP 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 ??
/* GENERALLY FIXED PARAMETERS */ // Papa moved these here #define GATEWAYID 1 // node ID of Gateway. NW3 #define NETWORKID 100 // network ID of network #define VERSION "2.2Mf4" // version of this sketch, can be queried as device 3 #define ACK_TIME 50 // max # of ms to wait for an ack #define SERIAL_BAUD 115200 // set same rate on Arduino IDE Serial Monitor #define HOLDOFF 2000 // blocking period between button, switch, & PIR messages I did also check the soldering/connection and wiring/schematics of RFM69HW, it looks okay to me. I don't know what else to do.
|
|
|
Post by papa on Mar 14, 2017 14:26:34 GMT
Sorry (for both of us), agecrabahaykubo, that your frustrations continue. Again getting the first gateway & end node working are usually the hardest steps. Let's see what we can find out. Your Gateway quote contains byte mqtt_server[] = {192,168,x,x}; // IP of computer hosting the MQTT service Raspberry Pi3 byte ip[] = {192,168,x,x}; // default IP for this Gateway if DHCP does not assign it When you programmed the gateway, you must have replaced the x,x with the rest of your computer's IP address. Right?? Otherwise the GATEWAY would not get a DHCP / MQTT connection Getting DHCP / MQTT connection on the Gateway is a good step accomplished. HOWEVER, you cannot know if your RFM69 radio is working (on gateway or end node) UNTIL the Gateway radio AND an end node radio are working so they connected & communicate with each other. As I remember, you were trying to use the RFM69s with 5 volts which can cause them to be erratic & defective.I'll suggest other things to try, but it may come down to one or both RFM69 radios being defective. ======================= Regarding your making an end node ... For the end node, on what did you install the RFM69? Buono switched to 3.3 volts? Arduino Uno hacked to 3.3 volts? Unhacked Arduino Uno at 5 volts? If it's Arduino Uno at 5 volts, remember that can make your RFM69 radio erratic & defective. Yes, get the bare bones end node working before you move on. Yes, editing ethernet.h & w5100.h (for programming the gateway) should help connections. That editing should have been done before. Is it possible you missed other pieces of the instructions? I suggest you work thru end node instructions again, this thread, the Feb 1, 2017 post that starts with "Step A) Build & Program a Bare Bones End Node" For programming the bare bones end node, comment out #define HT & #define CELS though I don't believe their being active would cause your problem. Check your bare bones end node's connections with the schematic, including ... For the End Node, is the RFM69's NSS connected to Arduino D10? (NOT D8 as on Gateway) Are all the RFM69 wires securely connected to the right Arduino connection? Referring to the pic of your RFM69 radio ... 1) I don't see an "H" in the radio's part number. Are you sure it's an RFM69 HW? 2) Looks like you soldered two GND pads on the RFM69. If you connected both RFM69 GNDs to the Arduino, I don't believe that would cause problems, but you might try connecting only one RFM69 GND to the Arduino Use a multi-meter to continuity check the RFM69 soldering. Remove the RFM69 from the Arduino. Lay the RFM69's soldered side on a table. On the other (UNsoldered) side of the RFM69, try to touch one multi-meter probe to a pad's edge without touching the wire soldered to it. Touch the other multi-meter probe to the wire end that plugs into the Arduino. If you find a suspicious connection, resolder the RFM69 pad. Here's another way you might check for bad connections, but BE CAREFUL ... While the end node (including installed RFM69) is connected to the computer's USB, watch the Arduino IDE serial monitor as you GENTLY put light finger weight on the RFM69 & then GENTLY lean & hold the RFM69 slightly to one side & then other sides. Does the serial monitor show any connections?
|
|
|
Post by agecrabahaykubo on Mar 14, 2017 16:07:25 GMT
papa, I got a response from the bare bones node now. Is this any good? what I did was replace the some variables on the code specifically on two lines between GATEWAYID AND NODEID here's where I change the variable NODEID to GATEWAYID radio.initialize(FREQUENCY,GATEWAYID,NETWORKID); // initialise radio #ifdef IS_RFM69HW radio.setHighPower(); // only for RFM69Hx! #endif radio.encrypt(ENCRYPTKEY); // set radio encryption radio.promiscuous(promiscuousMode); // only listen to closed network wakeUp = true; // send wakeup message here's the other line void txRadio() // Transmits the 'mes'-struct to the gateway { retx = true; int i = 0; while (retx && i<6) { if (radio.sendWithRetry(GATEWAYID, (const void*)(&mes), sizeof(mes),5)) { retx = false; #ifdef DEBUG Serial.print("Node: "); Serial.print(mes.nodeID); Serial.print(" dev: "); Serial.print(mes.devID); Serial.print(" cmd: "); Serial.print(mes.cmd); Serial.print(" Ival: "); Serial.print(mes.intVal); Serial.print(" Fval: "); Serial.print(mes.fltVal); #ifdef SUMP Serial.print(" LvlSt: "); Serial.print(LevelStat); Serial.print(" StukLoMk: "); Serial.print(StukLowMk); Serial.print(" HowStukLo: "); Serial.print(HowStukLo); Serial.print(" StukHiMk: "); Serial.print(StukHiMk); Serial.print(" HowStukHi: "); Serial.print(HowStukHi); #endif // ifdef SUMP Serial.print(" RSSI: "); Serial.println(radio.RSSI); Serial.flush(); #endif And one last but this is from RFM gateway sketch, I added #define GATEWAYID. //Match frequency to the hardware version of the radio (uncomment one): //#define FREQUENCY RF69_433MHZ //#define FREQUENCY RF69_868MHZ #define FREQUENCY RF69_915MHZ #define ENCRYPTKEY "AgecraBahayKubo1" // shared 16-char encryption key is equal on Gateway and nodes #define IS_RFM69HW // uncomment only for RFM69HW! Leave out if you have RFM69W! #define ACK_TIME 50 // max # of ms to wait for an ack
#define GATEWAYID 1 // node ID of Gateway. NW1
And this is the RFM gateway serail monitor data (DEBUGRADIO uncommented) What do you think? Thanks for your reply.
|
|
|
Post by agecrabahaykubo on Mar 14, 2017 17:20:54 GMT
papa, Yes I did replaced it with the right IP address, just dont want everyone to see it. For both gateway and DHT end node I'm using Buono R3 set to 3.3v and RFM69HW, I just can't seem to make them to work together or communicate. Then I made some changes to the code/sketch and they started to talk.
|
|