Best Gateway Design

Started by Quobu, January 02, 2014, 04:00:11 AM

schulz

#15
Quote from: Felix on January 02, 2014, 05:09:47 PM
My RFM69 library is interrupt based with polling for received packets. IOW you put the transceiver in RX mode, when a packet is received an interrupt takes care of reading the packet into a local buffer, then you have to poll that buffer using the library functions to see if a packet is ready. If you do lots of other stuff with the ethernet, then you might get packets overwritten, and hence lost sensor data. But that might not happen depending on how much traffic there is ... it's all a tradeoff.

This is kind of related, but I'm curious if anybody has any stats on running networks of Moteino's and how much data one node can handle.  My setup (which I'm guessing is fairly common) is 1 Gateway node being yelled at by a bunch of Moteino's. 

How many incoming messages can a single Moteino reasonably be expected to handle?   

Felix

It can handle a lot. Basically each node "listens" before it sends to make sure there's no other RF traffic or noise, this is to avoid collisions So if there is a lot of traffic, there might be slight delays (on the order of tens of ms at most). The sendWithRetry() function can be used to retry a send until it gets an ACK, so really you should get a message through with a very high percentage of success.

NixHydra

@Quobu,

   If you have a look at the following link this should answer your question, does a Hope RFM69W/HW Arduino shield exist?
You should find a couple of photos and the Eagle schematic and pcb files.

   http://jeelabs.net/boards/6/topics/2934?page=2

   cheers,


schulz

Quote from: Felix on January 10, 2014, 09:03:04 PM
Basically each node "listens" before it sends to make sure there's no other RF traffic or noise, this is to avoid collisions

Thanks Felix.

If I'm reading this right that's a feature of the RFM69 library (Specifically the canSend function), not something built into the hardware right?

Felix

Quote from: schulz on January 13, 2014, 04:22:55 PM
If I'm reading this right that's a feature of the RFM69 library (Specifically the canSend function), not something built into the hardware right?
Correct.

BeagleNode

Another perspective.

While I make no claims that my gateway is in any way a "best" design it has been working reliably for just over a year.  I started with JeeNodes and have only recently discovered Moteino.  All of my currently functioning nodes are JeeNodes with a 915MHz RFM12B radio.  My gateway is a JeeNode with the ENC28J60 Ethernet shield.  I have about 10 remote nodes at this time.  When the gateway receives a packet from a remote node it checks the node and data index combination against a reference list.  If there is a match it sends the data to my Linux webserver by way of a php page.  That page takes the input from the JeeNode gateway (ID and data) and stores it in a MySQL database.  To prevent filling the database with useless duplicate data I only store the data if it has changed by more than a configurable delta.  It also gets stored ~once/hour even if it has not changed.  If no data has been stored in the last hour I get a text message so I can respond.  My data is only important to me so I choose to limit the text message to my normal waking hours!  I have had to reset the gateway a couple times.

I have some php based web pages using RGraph to display the saved data. 

I'm sure the Raspberry Pi adds capability but it clearly is not necessary.  It is great to have so many choices...

John

thinkpeace

I will be using the ChipKit WF32 as a gateway.  I already ported the RFM12B library to it, and will be porting the RFM69W.

The WF32 is a PIC32MX Arduino compatible board with 512K Flash, 128K SRAM, WiFi module, microSD and costs only $69.  You can get an RFM12B or RFM69 module for about $7 or $8.

I thought about using a Moteino connected to a microcontroller, but that would add another layer of software, which could be avoided by connecting the RF module directly to the gateway micontroller.

By using a board that is Arduino compatible, I can use some of the same code on the Moteino as on the gateway - so less code to maintain.  The gateway is using JSON messages to communicate with the server.  I'm using the aJson library for that, https://github.com/interactive-matter/aJson.  It makes it easy to parse and format JSON messages.

Read more about the RFM12B library here:
http://lowpowerlab.com/forum/index.php/topic,283.0.html


ColinR

If you're interested in sqlite/python backend and jquery/jquerymobile/html5 frontend, let me know. I have libraries I'm about to release in with a GPL-compatible license that will save you some time. They'll be attached to a commercial gateway product that will be continually developed and supported. Should be an easy port to MySQL or other dbs if you have a favored flavor.

Colin
CuPID Controls :: Open Source browser-based sensor and device control
Interfaceinnovations.org/cupidcontrols.html
cupidcontrols.com

mk

ColinR, I am interested in your libraries.  Can you post a link?

rav

Quote from: BeagleNode on January 15, 2014, 09:00:17 AM
Another perspective.

While I make no claims that my gateway is in any way a "best" design it has been working reliably for just over a year.  I started with JeeNodes and have only recently discovered Moteino.  All of my currently functioning nodes are JeeNodes with a 915MHz RFM12B radio.  My gateway is a JeeNode with the ENC28J60 Ethernet shield.  I have about 10 remote nodes at this time.  When the gateway receives a packet from a remote node it checks the node and data index combination against a reference list.  If there is a match it sends the data to my Linux webserver by way of a php page.  That page takes the input from the JeeNode gateway (ID and data) and stores it in a MySQL database.  To prevent filling the database with useless duplicate data I only store the data if it has changed by more than a configurable delta.  It also gets stored ~once/hour even if it has not changed.  If no data has been stored in the last hour I get a text message so I can respond.  My data is only important to me so I choose to limit the text message to my normal waking hours!  I have had to reset the gateway a couple times.

I have some php based web pages using RGraph to display the saved data. 

I'm sure the Raspberry Pi adds capability but it clearly is not necessary.  It is great to have so many choices...

John

I also wanted similar solution but was not sure whether ENC28J60 would work with Moteino. I only need to send HTTP GET request to my website which can extract the values of RF signal and would be able to store the values in MySQL.
I think having additional device may not not required if I can send the signal to website with just 5$ ENC28J60.
I just ordered 3 moteino and would try to test with ENC28J60 and if it works then it would very powerful and cheap solution for my requirements.