LowPowerLab Forum

Software support => Pi Gateway => Topic started by: jeremiah on February 04, 2016, 01:24:08 AM

Title: Gateway not showing nodes
Post by: jeremiah on February 04, 2016, 01:24:08 AM
I have a new Pi gateway up and running with a MightyHat R2. I used the Pi Gateway image and the example MightyHat sketch to get it going.

The first thing I did was to remove the nodes that were left as a part of the image. My first node is a GarageMote R1. I got it built and installed the example sketch, making sure to change the network ID, Node ID, and encryptkey to the same as the gateway.

Now that I got them both up and running, I dont get any nodes to show up on the gateway. Is there something I am supposed to do to add it?
I dont see anything in the videos posted, they just show up automatically. Is their some trouble shooting i can do? at this point I am questioning if I soldered something incorrectly or if the antenna I have on the gateway is incorrect? I got a 433mhz montenio and the antenna is from an old router.
Title: Re: Gateway not showing nodes
Post by: Felix on February 04, 2016, 08:16:56 AM
Quote from: jeremiah on February 04, 2016, 01:24:08 AM
I got it built and installed the example sketch, making sure to change the network ID, Node ID, and encryptkey to the same as the gateway.
Only the network ID and encryption key should be the same, the node ID should be different. Also very crucial: the isRFM69HW setting, ensure that matches your radio, if you have a W that should be commented out, if a HW then keep the #define isRFM69HW.

Yes it should just show up in the UI as long as the node sends a valid packet. I would try this on your bench for easy debugging before installing it to confirm it works. Make sure the antenna is NOT from a router, which is 2.4ghz. Use the provided wire antenna you received from Low Power Lab, that will be much better.
Title: Re: Gateway not showing nodes
Post by: jeremiah on February 04, 2016, 10:17:50 PM
Thank you Felix. I have the wire antenna setup for the garatemote. On the mightyhat r2 I have the router antenna currently. Can you recommend an antenna to but for the mighty hat? I am using 433mz transceivers.
Title: Re: Gateway not showing nodes
Post by: jeremiah on February 04, 2016, 11:07:06 PM
some trouble shooting I have done. I checked all setting code in the sketchs, I have the HW code commented out. The correct 433 mhz chosen. NodeID is different on gateway and garagemote. NetworkID is the same.
I have the 2 units sitting right next to each other because I do not have an antenna on the mightyhat (i took the router antenna off). In the Adruino Serial Monitor it shows "Unknown" with the garagemote plugged in.

Still no nodes shows up.

Mighting Hat Sketch
#define NODEID          1  //the gateway has ID=1
#define NETWORKID     100  //all nodes on the same network can talk to each other
#define FREQUENCY     RF69_433MHZ //Match this with the version of your Moteino! (others: RF69_433MHZ, RF69_868MHZ)
//#define FREQUENCY     RF69_915MHZ //Match this with the version of your Moteino! (others: RF69_433MHZ, RF69_868MHZ)
//#define FREQUENCY_EXACT 917000000 //uncomment and set to a specific frequency in Hz, if commented the center frequency is used
#define ENCRYPTKEY    "sampleEncryptKey" //has to be same 16 characters/bytes on all nodes, not more not less!
//#define IS_RFM69HW    //uncomment only for RFM69HW! Leave out if you have RFM69W!
#define ENABLE_ATC    //comment out this line to disable AUTO TRANSMISSION CONTROL //more here: http://lowpowerlab.com/blog/2015/11/11/rfm69_atc-automatic-transmission-control/
#define ENABLE_WIRELESS_PROGRAMMING    //comment out this line to disable Wireless Programming of this gateway node
#define ENABLE_LCD    //comment this out if you don't have or don't want to use the LCD
//*****************************************************************************************************************************
#define ACK_TIME       30  // # of ms to wait for an ack
#define SERIAL_BAUD 115200
#define DEBUG_EN     //comment out if you don't want any serial verbose output (keep out in real use)


GarateMote Sketch
#define GATEWAYID   1
#define NODEID      11
#define NETWORKID   100
#define FREQUENCY     RF69_433MHZ
//#define FREQUENCY     RF69_868MHZ
//#define FREQUENCY       RF69_915MHZ //Match this with the version of your Moteino! (others: RF69_433MHZ, RF69_868MHZ)
#define ENCRYPTKEY      "sampleEncryptKey" //has to be same 16 characters/bytes on all nodes, not more not less!
//#define IS_RFM69HW      //uncomment only for RFM69HW! Leave out if you have RFM69W!
Title: Re: Gateway not showing nodes
Post by: Felix on February 05, 2016, 08:33:18 AM
Several antennas to choose from here (http://www.digikey.com/product-search/en/rf-if-and-rfid/rf-antennas/3540022?FV=93401a8%2C93401aa%2Cfff40036%2Cfff80436%2C1cec00a5%2C1cec00a7&mnonly=0&newproducts=0&ColumnSort=1000011&page=1&stock=0&pbfree=0&rohs=0&k=433mhz+antenna&quantity=&ptm=0&fid=0&pageSize=25), match your SMA connector to the mating termination of the antenna.

Add this to the very end of setup() in your garage sketch:

radio.sendWithRetry(GATEWAYID, "START", 6);

This should make the node show up, not a real metric but it will show you the time the node went live. I started using this on some motes that I want to know when they started and if they ever restart the metric will refresh and help indicate there is a problem. But for your purpose it should just help with getting the mote online (ie node to appear).
Title: Re: Gateway not showing nodes
Post by: mzv72m on February 05, 2016, 01:33:34 PM
I'm using the antenna ANT-433-CW-RCS-ND from the link Felix provided and it works great with the Mighty Hat.  But like Felix said make sure you match the SMA connectors.

Dan
Title: Re: Gateway not showing nodes
Post by: jeremiah on February 05, 2016, 10:26:24 PM
ok, so I added the radio.sendWithRetry(GATEWAYID, "START", 6;). I still dont have an antenna on the MHat, but with them sitting right next to each other I would think that would not matter. I still dont get a node in the gateway.

Is there a way I can see if it is MHat is getting the packets? Trying to determine where the breakdown is, right? If it is getting to the MHat but not getting to the Pi Gateway, There should be a way to determine that, right?

Also, The Antenna icon on the MHat LCD shows 100db, is that because there is no antenna and will change when one is plugged in?
Title: Re: Gateway not showing nodes
Post by: mirko.ugolini on February 07, 2016, 10:43:22 AM
Hi Felix,

I got the same problem.

I setup one Gateway with the  default image that has "doorBell" on node id =32

I setup  one Doorbell  moteino with the id=32  and I can receive commands from the interface  and viceversa.

Then I tryied to change the node id of the Doorbell to  33 and I expected to see the new node popup in the web interface but nothing.

So it is not a communication problem but something seems wrong in code.

How is possible to debug the problem?

Regards

Mirko Ugolini
Title: Re: Gateway not showing nodes
Post by: Felix on February 07, 2016, 06:20:42 PM
I think you guys must have something wrong setup in code either on the gateway or on the nodes.
I am running the same software and everything works, others have verified this also.
A lot of times people ask why something won't work and then in the end it's something trivial like the wrong frequency or the HW setting or something like that.
There's no good way for me or others to verify that information, we can only ask you double check. If everything is right, and connections are good, it should work. I try my best to post valid code and easy instructions so it would generate the least amount of problems and support.

Depending which hardware you are running on the gateway (just Moteino, a MightyHat?) you have to have a specific gateway sketch, here is the one for the Moteino (https://github.com/LowPowerLab/RFM69/blob/master/Examples/PiGateway/PiGateway.ino) and here's the one for the MightyHat (https://github.com/LowPowerLab/RFM69/blob/master/Examples/MightyHat/MightyHat.ino).
Title: Re: Gateway not showing nodes
Post by: jeremiah on February 08, 2016, 06:05:52 PM
So when I set this up, I intentionally didn't change much in the code from the sample sketches included. I just made sure that the define statements for initial setup where correct to my equipment and such. I only have a Pi/MightyHat Gateway and 1 Motenio Node running. I have the Motenio attached to the computer so that I can see the serial output in the Arduino Serial Monitor.

It seems like it is running just fine, as it is logging everything there. So am I safe to say it is sending packets out too?

I guess I don't know of a what to do the same type of thing with the Pi/MightyHat Gateway. I dont know how to tell if it is receiving anything. I saw in one of the demo videos that you had the Gateway Site up on half the screen and a console type window up on the other half and it was streaming info as you used the gateway Site. You say is the "output  from the Node.JS Websockets Script" for debugging.
Title: Re: Gateway not showing nodes
Post by: Kilo95 on February 08, 2016, 06:34:53 PM
If you have it set up for the gateway moteino and the node to "talk" to each other, I'd hook the gateway moteino to the Pi and use minicom on the Pi. You should see the info coming in from the remote node

sudo minicom -b 115200 -o -D /dev/ttyAMA0

Change the ttyAMA0 to whichever serial port the gateway moteino is connected to the Pi on
Title: Re: Gateway not showing nodes
Post by: mzv72m on February 08, 2016, 06:40:56 PM
Are you using one of the standard node skethes?  I know when I setup my first custom node I had to modify the metrics.is file to recognize it.  Another thing that I just thought of, how do you have the gateway moteino connected to the Rpi? I intially had mine set wrong and it did not receive anything. There are two ways USB & GPIO,

Dan
Title: Re: Gateway not showing nodes
Post by: jeremiah on February 08, 2016, 07:06:26 PM
I am using the MightyHat R2 board on the Pi. And I am using the example sketches from the library felix maintains. Only changes I made were to setup NodeID, Network, etc as your supposed to.

The only thing I can think of is the fact that I dont have an antenna hooked to the MightyHat/Pi Gateway yet, but I have the sender note sitting literally right next to it.

Quote from: jeremiah on February 04, 2016, 11:07:06 PM
Mighting Hat Sketch
#define NODEID          1  //the gateway has ID=1
#define NETWORKID     100  //all nodes on the same network can talk to each other
#define FREQUENCY     RF69_433MHZ //Match this with the version of your Moteino! (others: RF69_433MHZ, RF69_868MHZ)
//#define FREQUENCY     RF69_915MHZ //Match this with the version of your Moteino! (others: RF69_433MHZ, RF69_868MHZ)
//#define FREQUENCY_EXACT 917000000 //uncomment and set to a specific frequency in Hz, if commented the center frequency is used
#define ENCRYPTKEY    "sampleEncryptKey" //has to be same 16 characters/bytes on all nodes, not more not less!
//#define IS_RFM69HW    //uncomment only for RFM69HW! Leave out if you have RFM69W!
#define ENABLE_ATC    //comment out this line to disable AUTO TRANSMISSION CONTROL //more here: http://lowpowerlab.com/blog/2015/11/11/rfm69_atc-automatic-transmission-control/
#define ENABLE_WIRELESS_PROGRAMMING    //comment out this line to disable Wireless Programming of this gateway node
#define ENABLE_LCD    //comment this out if you don't have or don't want to use the LCD
//*****************************************************************************************************************************
#define ACK_TIME       30  // # of ms to wait for an ack
#define SERIAL_BAUD 115200
#define DEBUG_EN     //comment out if you don't want any serial verbose output (keep out in real use)


GarateMote Sketch
#define GATEWAYID   1
#define NODEID      11
#define NETWORKID   100
#define FREQUENCY     RF69_433MHZ
//#define FREQUENCY     RF69_868MHZ
//#define FREQUENCY       RF69_915MHZ //Match this with the version of your Moteino! (others: RF69_433MHZ, RF69_868MHZ)
#define ENCRYPTKEY      "sampleEncryptKey" //has to be same 16 characters/bytes on all nodes, not more not less!
//#define IS_RFM69HW      //uncomment only for RFM69HW! Leave out if you have RFM69W!

Title: Re: Gateway not showing nodes
Post by: Kilo95 on February 08, 2016, 07:33:16 PM
You have to edit either the metrics.js or settings.json5(don't remember which) and tell it which serial port the moteino is on. The line ends in ttyAMA0. My Pi is on USB0 so that's what I swap out for AMA0

I went back and looked and it should be the settings.js file.
Title: Re: Gateway not showing nodes
Post by: Felix on February 08, 2016, 08:33:13 PM
jeremiah,
You have a MightyHat, make sure you run the right sketch on that (https://github.com/LowPowerLab/RFM69/blob/master/Examples/MightyHat/MightyHat.ino), do a sudo stop gateway, then use minicom to open the hat's serial port for debugging.
Load a node test sketch (https://github.com/LowPowerLab/RFM69/blob/master/Examples/Node/Node.ino) on your remote node, the data should show up immediately in minicom:

sudo minicom -b 115200 -o -D /dev/ttyAMA0

The hat is connected to the GPIO serial port which is typically ttyAMA0.
If that's not happening you have some issue with the sketches or something's not configured right.
Title: Re: Gateway not showing nodes
Post by: jeremiah on February 09, 2016, 01:24:30 AM
So I have been uploading the MightyHat Sketch through the Pi with avrdude. Using arduino app I open the default sketch and make the setup changes. I then choose "Export Compiled Binary" to the .hex file to put on the Pi. It actually creates 2 files of .hex
MightyHat.ino.with_bootloader.arduino_standard.hex
and
MightyHat.ino.arduino_standard.hex

Is there a correct one to use?

Also, going back to look at the actual hardware i ordered. I am noticing that the Motenio USB is a RFM96W (433mhz)
and my MightyHat is a RFM96 (LoRa 433mhz)

Could that be the issue? I thought the transeiver guide said the LoRa ones talked to all the older versions.
Title: Re: Gateway not showing nodes
Post by: Felix on February 09, 2016, 08:18:32 AM
Well, that would totally explain it. RFM96 (LoRa radios) cannot talk to RFM69.
On this page (https://lowpowerlab.com/moteino/#lora) I explain the differences and I have this statement: "they cannot communicate with any RFM69 radios (except via a bridge module between two such networks is built). In other words, they are a completely different type of radio for a different category of communications."
I do not have a sample sketch for MightyHat with LoRa radios at this time. It was simply an extra feature of the MightyHat to allow RFM95/96 radios to be soldered on them.
Sorry if this is not more transparent or obvious.

The way I program the Hat is I enable output on compilation from File>Preferences, that gives the output hex path.
I copy that hex to my Pi via FTP and then I use avrdude as shown on the MightyHat programming page (https://lowpowerlab.com/mightyhat/#programming).
Title: Re: Gateway not showing nodes
Post by: jeremiah on February 09, 2016, 11:49:34 AM
Any chance I can swap the LoRo tranceiver for a RFM69 on my existing MightyHat? Or do I have to eat the cost of that whole thing an buy a whole new MightyHat?
Title: Re: Gateway not showing nodes
Post by: Felix on February 09, 2016, 12:04:31 PM
Sure you can swap it. You will need to do that carefully not to lift the pads off of it. I use 2 soldering irons with 16mm wide tips to lift the radio at the same time.
If you want to, I can do this for you at no charge, provided you cover the shipping and new radio cost (about $10). That's more economical than getting a new Hat.
Let me know if that offer is something that will work for you.
Title: Re: Gateway not showing nodes
Post by: jeremiah on February 09, 2016, 04:23:08 PM
That would be awesome Felix. I appreciate the offer to do that. Let me know how we can take care of that.
Title: Re: Gateway not showing nodes
Post by: Felix on February 09, 2016, 11:04:44 PM
My pleasure,
Please email me at felix at this domain or through the contact form, or reply to your last order email and I'll get you instructions.