What am I missing here?



  • I've got two nodes sitting on my desk right now. An MQTT gateway, and a DHT sensor node. Both of them are hooked into my computer, and both of them are in debug mode so that I can troubleshoot them. They're not talking, but they're not giving me any useful output, either. Hell, I can't even get an ICMP response from the MQTT node...

    The DHT node simple displays this, I hit the reset button, same thing.

    find parent
    

    And my MQTT gateway just displays this.

    0;0;3;0;9;gateway started, id=0, parent=0, distance=0
    Ok!
    

    I've run through the troubleshooting flowchart, put 4.7uf caps on both of them, measured voltage with a multimeter, they're literally sitting right next to eachother on my desk, but neither one of them will talk to eachother, or anything. I've set the IP in the MQTT sketch, and practically changed nothing in the DHT sketch. #define debug is set in MyConfig.h to provide verbose output, yet I see absolutely nothing here. It's getting frustrating, because this is the 3rd gateway I've build (first 2 were serial), and the 5th sensor (tried making an LM35 sensor, then a tilt sensor, then a light sensor, and this is the 2nd DHT sensor) that I've built, thinking maybe I had faulty hardware.

    My end goal here is to get them talking with openHAB. I'm also a newbie there, but I've got it up and running and configured pretty much as described in this post. I'm doing this mainly as a grad school project for a wireless sensor network class, which I'm hoping to have a good bit of documentation from to donate to the project, but also as a proof of concept for deployment in my own home.


  • Hero Member

    @Apocrathia It sounds like you followed the right track.. But obviously the nodes are not talking to each other. We you able to get the other nodes communicating?
    To get the whole picture, please post you sketches and photo of your setup.



  • I haven't been able to ANY of the nodes to talk to each other. For the sensor nodes, I've been able to write test sketches just to dump variables to the serial output in order to make sure that the sensors are being read correctly (they are), but there is zero output from the MySensors nodes other than 'find parent'.

    Rather than spam this post with a thousand lines of code, here is a GitHub Gist containing all of the relevant files, including the excerpt from my openhab.cfg.

    So, here is the DHT sensor.
    DHT Sensor

    And here is the MQTT gateway.
    MQTT Gateway

    See anything out of the ordinary? The MySensors code came directly from the master branch of the Arduino GitHub repository, and I loaded the nodes using the Arduino IDE version 1.6.8. I tried the Codebender stuff, and it wouldn't compile anything correctly for me. I'm really hoping that someone notices something painstakingly stupid here and calls me out on it. Because I feel like this should be a lot easier to setup than it has been.


  • Mod

    It looks like you are powering the nrf from the 5V pin on the nano. Is that correct? It should be powered by 3.3V.

    Edit: never mind, I think I misjudged from the photo.


  • Hero Member

    @Apocrathia Nothing very strange other than that you seem to be powering an unshielded NRF+LNA plus the Hanrun board from the Nano 3.3v. The voltage regulator on a Nano clone can only handle a few mA. (ref)
    (-and- probably using a very unbranded radio on the other node (there is no print at the bottom) .

    What I would do start off with a simple Serial gateway and use standard NRF radio's.



  • @mfalkvidd I have read both nodes' radio with a multimeter to ensure that I was getting adequate power, and they are both sitting at 3.3v. I have some extra wires in my wiring bundle which may be confusing. Also the ethernet module runs off of 5v. Everything is being powered off of a powered USB hub right now, with a 5v 2A power supply. So, everything should have plenty of power.

    @AWI Using the serial gateway was my first attempt at this. I have a bunch of off-brand nanos that had the cheap USB chip (CH340 and didn't do FTDI serial). The gateway nano is an FTDI capable unit now, though. As, initially, I was running it with a Vera and couldn't get the thing to show up. However, even then, while using both the normal and long range radios, I couldn't get anything to communicate. For the project I'm working on now, I'd prefer to get everything working with openHAB, but I can't get serial or MQTT to work. :/



  • I replaced the long range radio with a standard one, and I'm still getting the same problem. Re-uploaded the serial gateway switch (stock code from github repo), same problem. Again, they are right next to eachother on my desk.

    Imgur

    Here's the screen /dev/ttyUSB# 115200 output on both nodes.

    Imgur

    Hit the reset button a few times on each, in different orders, same thing.

    Shouldn't the two be doing something with one another at this point? I got all of my hardware from the eBay stores linked by the project. The first nano that I got didn't even have the FTDI chip and I had to go get another one.



  • What about inclusion? Is there something that I need to do in order to get the node to attach to the gateway? I noticed when I had the gateway hooked to my Vera, there was an inclusion option. I assume you press the inclusion button, restart the sensor, and the gateway will see the new node come online and grab it. It never worked with the Vera, though. Do I need to add an inclusion button to the gateway? I'm getting so frustrated that this isn't working, but I'm sure it's got to be something completely idiotic that I'm doing wrong?

    Looking a little bit more into the code for the DHT sketch, I'm seeing the following line in the variable initialization: int numSensors=0; And then both the setup and main loop have for (int i=0; i<numSensors && i<MAX_ATTACHED_DS18B20; i++) {. This seems a bit off. Shouldn't there be 2 sensors? That way sensor 0 and 1 are presented to the gateway? I know that on line 61, before the for loop in the setup function, there's a numSensors = sensors.getDeviceCount();, but is there a way to see what the values of sensors is? Perhaps my OneWire bus isn't working, but there's really no way to debug that.

    Unfortunately, I'm not sitting in front of everything right now, but I'm trying to make as much sense of it as I can. Would I be correct in thinking that if the node has no sensors to present to the gateway, the gateway won't see the node? Or would an empty node still be able to find it's parent?



  • I uploaded a DHT test sketch, just to make sure everything was hooked up and reading right, and I got perfectly good readings off of it. Okay, let's try 2 other things: a simple button node, and an inclusion button.

    Well, the button node does the exact same thing, so let's try putting the button on the gateway to run inclusion.

    0;0;3;0;5;1
    0;0;3;0;5;0
    

    Looking at the API, the message type 5 is for inclusion, and 1 meant it started, 0 meant it ended. So, that works. However, if I try to restart the other two nodes during inclusion, it still doesn't see anything.



  • I swear I'm going to quit spamming this thread once I have a solution, but the more I post, the most some other poor soul having the same issue out there might be able to find an answer to the same issue.

    I ran across this amazing gem in the forums: http://forum.mysensors.org/topic/1648/test-your-home-made-controller-with-mockmysensors-w-tutorial/

    So, I threw together an entirely new node, and uploaded this sketch to it. Surely, it'll start spamming messages, right?

    find parent
    
               find parent
    
                          find parent
    
                                     find parent
    

    Do I need to hard-code none IDs? That was something I noticed in the gateway sketch; 0 seems to be hard-coded as the ID. In the mock sketch, it's hardcoded to 50. So, it's different there, shouldn't cause an issue. Again, I've literally got everything sitting together on my desk, all running off of a powered USB hub, all radios have 4.7uf caps, and I've measured everything with my multimeter at 3.3v. There has got to be something completely stupid that I'm doing here, because the fake sensor sketch should have worked, but nothing is talking.


  • Hero Member

    @Apocrathia Starting from the beginning:

    • A standard serial gateway with radio and sketch. This seems to be working looking at the serial output.
    • A standard DHT11 sensor with radio and original sketch. From the serial output you only have the output "find parent".

    Both the nodes recognize the radio (otherwise there would be a failure message saying "check wires"). If you haven't messed the with the other radio settings that my next guess would be that the radio's themselves are not working. I don't know if you have some from another batch but I already had to trash 20 samples because I couldn't get them to communicate. And it is hard to recognize the difference sometimes. With me the "fake" ones don't have a print. (further reading in this subject). I had the luck to get started with a working batch..

    If you have two amplified ones (with antenna) you could try these with a low power setting.

    0_1459234654781_upload-57f98464-51af-4221-845f-cdfccd62e136

    0_1459234800739_upload-8c4c9d31-a4f7-4ff3-944d-fa7d6df3587b

    And

    @Apocrathia said:

    Looking a little bit more into the code for the DHT sketch, I'm seeing the following line in the variable initialization: int numSensors=0;

    The DHT sketch does/ should not contain code related to DS18B20 sensors. So I think you are mixing things up here.



  • I have not messed with any of the radio settings (such as power). Unfortunately, I do not have any radios from another batch, but it looks like I might have to try buying some new ones. I just tried putting two next to each other with the long range radios, and still nothing. Since none of these actually have print on them, does anyone have a link to some "genuine" Nordic radios? Amazon Prime shipping would be excellent, as I can get them quicker. Almost all of these were bought from eBay already. It looks like these have good reviews on Amazon, and one user even calls out the MySensors project.

    Again, sorry for spamming the thread. Since I'm working on this for a grad project, I'm getting more frustrated than I should.


  • Hardware Contributor

    @Apocrathia Try clearing the eeprom if you have not done that already with the sketch included from MySensors. Then reupload the sketch again.



  • @sundberg84 So, to clear the EEPROM, you basically run an EEEPROM.write(pos, val) as shown in this tutorial from Arduino, right? And then are you referring to any of the example sketches (which are the ones that I've been using) from the master branch of the GitHub repository?

    As an added note: I have now tried 4 different controllers with this; Vera, OpenHAB, Domoticz, and HomeAssistant. None of them have had any outcome. Even without a controller, the nodes should still "link" and dump some sort of output to serial (since debug is on), right?


  • Hardware Contributor



  • @sundberg84 Excellent. Is it okay if I run the master branch version instead? It doesn't appear to be any different other than variable names, but I've already got the master branch cloned. I'd rather not make anything confusing by using multiple branches. I'm not in front of the nodes right now, but I will be in a couple of hours.

    Another thing that I started doing with the radios that I had, was soldering the 4.7uf caps onto the header pins, rather than shoving them into the crimped connector sleeve. Is this okay to do? I've seen it a couple of times on the forum.


  • Hardware Contributor

    @Apocrathia Sorry - my misstake, you should use the master branch.
    Its better you solder them on the pins as close as possible to VCC/GND. The close the better. If you crimp them i guess there is a change they do not get connected?



  • @sundberg84 No worries. Thank you for clarifying. I will definitely run that sketch here in a little while and update the thread with my results. While I was soldering, I had my big magnified ring light out and was double checking continuity between pins with the multimeter to make sure that they weren't touching. They're so close that it'd be easy to connect two of the pins on accident and screw everything up.



  • @sundberg84 Okay, so I have uploaded the ClearEepromConfig sketch to all of my sensors, and then re-uploaded the respective sketch, all from the GitHub master repo. I have also double checked my solder joints for continuity issues. Same problem.

    At this point, I have ordered a couple of new radios off of Amazon (as linked earlier), and I am going to wait to see what it looks like when they come in. Hopefully, @AWI was correct about the radios being crap. Either way, thanks for your help thus far.

    With the node IDs, I still wasn't quite sure on if I have to hard-code node IDs somewhere, or if they were automatically assigned somewhere.

    One more thing, with the DHT sketch I mentioned, I think I uploaded the wrong sketch then. I was uploading this sketch for the DallasTemeratureSensor and you were referring to the HumiditySensor sketch. I uploaded the other sketch, just to be sure, same problem. I'm hoping it's just bad radios.


  • Hardware Contributor

    @Apocrathia Ok, sorry to hear - it must be some sort of hardware failure then. I cant think of anything else at this point. Maybe someone else can... let us know how things work out.


Log in to reply
 

Looks like your connection to MySensors Forum was lost, please wait while we try to reconnect.