|
Post by tjohansen on Feb 28, 2016 14:44:05 GMT
I have my end node (DHT) up and running its a pro mini 3.3v I havent got all the components for the powersuply, so at the moment its powered by the usb "CH340G progammer". (guess it gets enough power to run?)
Its runing with 868 mhz RFM69HW. I have removed the DHT11 temporaly, just to get the connection working first.
the debug log says:
Node Software Version DHT V2.2
Transmitting at 868 Mhz... No connection... No connection...
(tries 5 times then pause and then tires again, led turns off when it tries)
Its the same on the Gateway The debug log says:
GW Version GW V2.4
868 Mhz... connecting no link MQTT-link OK MQTT-Topic: home/rfm_gw/sb/node02/dev04 READ Val:0 No node 2 MQTT-Topic: home/rfm_gw/sb/node02/dev02 READ Val:0 No node 2
Is there a way to get more infomation on the RFM69 connection faults etc?
I have ofcourse setup same encryption, and used gateway as node 1 and endnode as node 2, same network 100.
|
|
|
Post by tjohansen on Feb 28, 2016 14:57:54 GMT
picture of the endnode without the DHT11
|
|
|
Post by papa on Feb 28, 2016 18:34:59 GMT
Good description of your situation, tjohansen.
So the Gateway is connecting to the MQTT service on the computer, but the gateway & node are NOT connecting.
Near as I can tell from the pic, the wires are going to the correct locations. Have you used a multimeter to do a continuity test making sure intended locations ARE truly connected & UNintended locations are NOT connected?
I don't know if CH340G programmer provides enough power. If RFM69 is not getting enough that could be an issue. Data Sheet says you can supply 3.35 -12 V to Arduino RAW. So for an alternate powering test, you could try three 1.5 volt batteries in series, battery + connected to RAW & - to GND.
|
|
|
Post by tjohansen on Feb 28, 2016 19:25:15 GMT
tried with a multimeter, as far as I can see there are connection from pins on pro mini to end points of wires, I measured the volt on the RFM69 and its about 3.25 or so.
I tried to connect 3x 1,5 AA batteries (total of 4,47v) to VCC and GND, and the arduino console showed gibberish, so maybe it was too much.
I tried to connect 3x 1,5 AA batteries (total of 4,47v) to RAW and GND, and the arduino console showed "no connection" and the RMF69 had 3.2v, same as with the CH340G programmer.
|
|
|
Post by tjohansen on Feb 28, 2016 19:38:52 GMT
But if the D9 LED lights up when the console shows "no connection" doesnt it mean that the RFM69 chip is transmitting?
|
|
|
Post by tjohansen on Feb 28, 2016 19:59:03 GMT
I have measured the RFM69 on the gateway too, it has 3.3v.
I can add that on the gateway the D9 LED lights up solid, for a minut or so and then it outputs in the console:
No node 2 MQTT-Topic: home/rfm_gw/sb/node02/dev04 READ Val:0 No node 2 MQTT-Topic: home/rfm_gw/sb/node02/dev02 READ Val:0
|
|
|
Post by papa on Feb 29, 2016 0:54:14 GMT
Looking closer, I see no verbal or picture reference to the end node's push button & its 10 kilo ohm resistor. If those are absent, that could be your problem.
As the schematic & sketch show, D8 is to be connected to power via a (pull up) resistor (that gives it a HIGH state) & also to one of the button's terminal. The button's other terminal connects to GND. When the button is pushed, D8 goes to LOW state via the GND. On that LOW state, the sketch in turn powers D9 HIGH which would power the LED.
I'm thinking that without a push button & its resistor, D8 stays LOW all the time (like the button was held down permanently) & confuses & overwhelms things. Using the schematic & my description in the last paragraph, try wiring the push button & see if things work better. If you don't have a push button, you could temporarily connect D8 to 3.3 volts via a 10 kilo ohm resistor.
If you have neither push button resistor, I think this could work until you wire the push button & resistor: Find the TWO sketch lines that read if (curState == LOW)
& change them to if (curState == HIGH)
If you make the above temporary changes, remember to restore them when you wire the push button.
|
|
|
Post by tjohansen on Feb 29, 2016 7:15:09 GMT
Great, Papa, you are quite sharp. I thought I could just leave out these parts, until I got them bought, later this week. Have forgotten that I skipped the button thought, else I would have mentioned it, for faultseeking.
But It makes perfect sense. I'll try to make a temporary solution with the 10k ohm resistor. The pushbutton and the other parts for the power volts control, will be ordered tonight.
Thank you for being so observant.
|
|
|
Post by papa on Feb 29, 2016 10:51:27 GMT
You're welcome, tjohansen. I remembered a similar incident earlier in my DIY Home Automation adventure when I left out the push button (on purpose), but did not change the sketch code accordingly.
In troubleshooting, it often seems that what causes a glitch is some thing left out or moved. It could be small, but it makes a significant difference.
|
|
|
Post by greginkansas on Mar 1, 2016 1:02:12 GMT
papa do you know about this- pinMode(buttonbackdoor, INPUT_PULLUP); I am using this on my garage arduino 30 foot wire run and it is a strong enough pullup to be stable. From www.arduino.cc/en/Reference/ConstantsPins Configured as INPUT_PULLUP The Atmega microcontroller on the Arduino has internal pull-up resistors (resistors that connect to power internally) that you can access. If you prefer to use these instead of external pull-up resistors, you can use the INPUT_PULLUP argument in pinMode().
|
|
|
Post by papa on Mar 1, 2016 1:14:47 GMT
Greg, I must confess I have not used Arduino's internal resistors for pins. I just took a look at your supplied link & this official Arduino page & this one. Looks like the values are 20k to 50k vs the typical 10K external resistor we use. Does not seem like it could hurt anything unless one connects the pin to higher than the rail voltage. All the setting needs to do is keep the pin at a stable HIGH until the button is pushed & pulls the pin LOW. Avoid the pin "floating" & giving an uncertain reading. Using the internal resistor would save soldering one thing. Seems like one could use it & watch to see if d9 output is triggered falsely when the button is NOT pushed. Your bringing it up gives me one more thing to try when I get a chance. Thanks Does the following sound right:tjohansen or anyone making the DHT end node could add the line pinMode(Btn, INPUT_PULLUP); after about line 81, (probably in the SETUP section that starts about line 135) which says #define BTN 8 // Button pin AND the above would take the place of an external 10k ohm resistor? Is that right? Looks like this is possible for any of the digital pins, except D13.
|
|
|
Post by greginkansas on Mar 1, 2016 10:57:42 GMT
Greg, I must confess I have not used Arduino's internal resistors for pins. I just took a look at your supplied link & this official Arduino page & this one. Looks like the values are 20k to 50k vs the typical 10K external resistor we use. Does not seem like it could hurt anything unless one connects the pin to higher than the rail voltage. All the setting needs to do is keep the pin at a stable HIGH until the button is pushed & pulls the pin LOW. Avoid the pin "floating" & giving an uncertain reading. @yes, it is a weak pullup but it is working on a long wire run for me. Does the following sound right:AND the above would take the place of an external 10k ohm resistor? Is that right? Yes
|
|
|
Post by tjohansen on Mar 2, 2016 19:07:04 GMT
Im stuck... I now got my buttons etc. Quickly I mounted it in the breadboard and added the DHT11. But still "no connection" problems. It's still powered by the USB programmer, but it seems it run fine. When I press the button the LED starts to light and it tries to connect, but no success. Any ideas to troubleshoot this? Is there a RFM69 "test sketch" to test whether it works?
|
|
|
Post by papa on Mar 2, 2016 21:33:49 GMT
At least according to the Fritzing pic, I don't see problems with your wiring, except one possibility ...
In the Fritzing pic,
maybe you missed including a wire from your actual build or removed it to get other things going, but the DHT11 needs one more wire: From D4 to the DHT11 pin connected to the resistor. The RFM69 library folder has some short example sketches that you can load into the Arduino IDE. Maybe those would help you test.
|
|
|
Post by tjohansen on Mar 2, 2016 22:19:23 GMT
corrected the dht11 wire, but thats not the problem at the moment :-)
have looked a bit on those examples.
maybe I must try them to see if there are problems there.
I suspect my gateway, with the logic level shifters.
|
|
|
Post by papa on Mar 3, 2016 0:15:58 GMT
I did not think the DHT11 wiring was the main problem unless power & gnd were reversed.
"I suspect my gateway, with the logic level shifters." Seems like a logical place to suspect.
Also if the RFM69 was connected to 5 volts before using the level shifters, the RFM69 could have been damaged.
|
|
|
Post by tjohansen on Mar 7, 2016 17:45:45 GMT
trying everything... and came across this post about differences between RFM69W and RFM69HW. lowpowerlab.com/forum/index.php?topic=291.0Do you know if what's in the first post, in that link, is "calculated" in the schematics/sketches? Or do others in here use the RFM69HW version without problems? On my DHT end node, I tried to measure the amp, at its swinging between 33-15 mA. Does that sound right? or am I just measuring it wrong. (The multimeter is at A= 200m)
|
|
|
Post by computourist on Mar 7, 2016 18:18:36 GMT
Hi tjohansen, I have used the same module (RFM69HW) in my gateway and nodes without problems. If indeed you have connected these modules to 5 Volts (as papa suggested in an earlier post) I would suspect your RFM modules to be faulty.
|
|
|
Post by tjohansen on Mar 7, 2016 18:51:33 GMT
yeah maybe must solder on some new ones....
I have tried almost everything else :-)
|
|
|
Post by papa on Mar 7, 2016 19:05:31 GMT
I have used RFM69HW's in all my nodes (& customized the sketches accordingly) without problems.
Not that I did not have OTHER problems along the way. Hang in there. You'll get it working & you will have learned about troubleshooting these things.
|
|
|
Post by tjohansen on Mar 7, 2016 22:04:06 GMT
tried a new rfm69hw module, but same results...
|
|
|
Post by papa on Mar 8, 2016 1:00:20 GMT
Bummer! Are you still using logic level shifters? Did you put a NEW RFM69 in both the Gateway & the end node? Did you try the examples that come with the RFM69 library, doing a very simple gateway & a very simple node? If so, with what results? Do they connect? Did you make the change in the library file w5100.h as indicated in the Gateway sketch lines as followed? ... "// - Interrupts are disabled during ethernet transactions in w5100.h (Ethernet library) // (See harizanov.com/2012/04/rfm12b-and-arduino-ethernet-with-wiznet5100-chip/)" My Success... thread gives more details on accomplishing the w5100.h changes in the Oct 7, 2015 at 11:15am post I would think that your Gateway & node should connect somewhat without those w5100.h changes, but if not already done, give it a try. Once communication is working, these changes make them more reliable. Another forum user who had connection problems discovered they did not have the latest version of the PubSubClient library. Replacing that solved their problem. I believe you'll find the latest here.
|
|
|
Post by papa on Mar 8, 2016 2:14:28 GMT
Please consider the questions & suggestions in my last post just above but also ...
Above in different posts you reported "Node Software Version DHT V2.2 Transmitting at 868 Mhz... No connection... (tries 5 times then pause and then tries again, led turns off when it tries)"
"if the D9 LED lights up when the console shows "no connection" doesnt it mean that the RFM69 chip is transmitting?" [Papa: The way I read the Gateway sketch, it TRIES 5 times to send a message & each time flashes the GATEWAY D9 LED so ... that would mean it's trying to transmit, not necessarily connecting. Similarly the End Node sketch TRIES 5 times to send a message, BUT it's D9 LED should NOT flash but rather be on or off.]
"I can add that on the gateway the D9 LED lights up solid, for a minut or so and then it outputs in the console: No node 2 ..." [Papa: does not sound right]
then more recently "When I press the [end node ?] button the [end node D9?] LED starts to light and it tries to connect, but no success." [Papa: As I read the End Node sketch, when its push button is pressed it should toggle the LED on D9 & LED should stay that way until the next button press. Though after a button press, the sketch ignores more presses for the value of HOLDOFF milliseconds (2 seconds in the original sketch) ]
The above may be important clues, but of what, I'm not sure yet. They certainly sound suspicious of some faulty wiring or defective part.
|
|
|
Post by tjohansen on Mar 8, 2016 20:33:54 GMT
Im looking at your suggestions...
but just wanted to tell that rarely I get this on the end node:
No connection... 4, 1, 0, 0.00, RSSI= -33 Node: 1 No connection...
is that just noise or is it getting a short connection?
|
|
|
Post by papa on Mar 8, 2016 21:11:08 GMT
"is that just noise or is it getting a short connection?" Good question. I'm hoping computourist will respond to these most recent posts.
As I read "4, 1, 0, 0.00, RSSI= -33 Node: 1" it says device 4 (voltage), read, empty integer value, empty floating value, & then a radio signal strength
There's a lot I do not know about this radio stuff, but I think the end node got a message to read its voltage & had a connection, but then quickly lost it.
Again to me it sounds suspicious of some faulty wiring or defective part & I hope computourist will weigh in on this.
Please do respond on my previous questions & suggestions.
|
|
|
Post by tjohansen on Mar 8, 2016 22:06:55 GMT
Okay... now I think I know where the problem is or is not.
I uploaded a Struct_send example to my endnode.
and a Struct_receive to my gateway with the LLC.
...Didnt work.
Then tried stripping the gateway for everything, shield etc. ...Didnt work.
Also tried another uno r3 v5 with LLC. ...Didnt work.
Then I replaced the gateway with a new simple mini pro v3.3 and with rfm69hw uploaded the Struct_receive ... tada now its receiving from the endnode with the Struct_send. So the rfm69hw's works And my conclusion so far must be that the Uno R3 v5 with LLC's dont work.
Kmacs if you are reading this could you take a picture of your setup with the gateway using LLC's?
|
|
|
Post by papa on Mar 9, 2016 1:48:11 GMT
Yes, I've been skeptical about using the LLCs for something as ticklish as the RFM69 radios. Better to use a device made to be 3.3 volts or hack a 5 volt device to be 3.3 volts.
Glad you've run the problem down.
|
|
|
Post by computourist on Mar 9, 2016 10:55:50 GMT
Good you finally got it working.
My guess would be that the SPI-communication is not working in your original setup. As I stated in an earlier post, the sharing of the SPI-bus between three devices (in the gateway) using level converters is a tricky business.
With the SPI bus not working, the RFM module doesn't get initialised, and also some variables used for the RFM69-communications are not initialised. They are in a random state, and that may be the reason of contradicting debug messages showing 'no connection' and at the same time an RSSI of -30.
But again, tops that you finally can start having fun with your system...
|
|
|
Post by tjohansen on Mar 9, 2016 17:30:52 GMT
I know its proberly a "stupid" question but do you know if converting the arduino clone from 5v to 3.3v is just to replace the AMS1117 with a 3.3v? I saw some place else that replacing the AMS1117 with a 3.3v and removing the fuse and adding a power diode to the usb was one way of doing it, but mine have a different design than that example. Until further I'll work on the mini pros. Here's the layout of mine:
|
|
|
Post by computourist on Mar 9, 2016 19:59:17 GMT
Unfortunately a schematic of this DccDuino is nowhere to be found on Internet. This makes it difficult to be sure on the power circuit. If you want to try it out I would do the following:
- The component marked PT (next to the USB plug) seems to be the fuse that is connected to the USB-port. Remove it, and leave the connections open. - Verify that the Arduino runs when powered from the power plug, and does NOT run when powered over USB. - If this is the case, component PT was indeed used to allow power from USB and you can continue with: - Replace the Voltage regulator AMS1117 with a 3.3 Volt type. (Best to cut if off, remove and clean solder pads, solder new component)
With these changes the Arduino will run in 3.3 Volt mode, but it will only run when powered over the power plug.
Good luck
|
|