Author Topic: new to Moteino, question about data rate?  (Read 2490 times)

enviraldesign

  • NewMember
  • *
  • Posts: 1
new to Moteino, question about data rate?
« on: July 07, 2015, 08:33:20 PM »
New to moteino's and looking to drive ws28xx pixels wirelessly. I would love to setup a moteino receiving r/g/b data from another moteino, base station of sorts.that sender would be getting it's data over wired serial over usb coming from a pc.

My question is - would transmitting that much data wirelessly be practical? scalable?
What kind of data rates can be expected on average just sending plain ascii?

what about one moteino to 5, or 10?

Thanks!

TomWS

  • Hero Member
  • *****
  • Posts: 1930
Re: new to Moteino, question about data rate?
« Reply #1 on: July 07, 2015, 09:01:55 PM »
New to moteino's and looking to drive ws28xx pixels wirelessly. I would love to setup a moteino receiving r/g/b data from another moteino, base station of sorts.that sender would be getting it's data over wired serial over usb coming from a pc.

My question is - would transmitting that much data wirelessly be practical? scalable?
What kind of data rates can be expected on average just sending plain ascii?

what about one moteino to 5, or 10?

Thanks!
Well, it depends...  :)

How many pixels in a chain, one or 100?
How many Moteinos have unique data?

If all the Moteinos are getting the same data then the time for 250 Moteinos isn't any more than the time for one, you can do a broadcast to all the same data in one transmission.  If you have a 100 Moteinos all receiving DIFFERENT data, then you may have to do some clever stuff...

The limiting factor is that the RFM69 library only supports 64 byte packets.  Now it doesn't take long to transmit a 64 byte packet, but you'd have to do multiple packets if you need to send more than 64 bytes for a full update.

So, like I said, it depends...

The other thing to factor in is that writing WS28xx pixels have VERY critical timing constraints and you can not have anything else going on - like receiving new packets, etc...  So, if your model is:
1. Receive packet.
2. Display the packet.
3. repeat at 1

Then no problem.  If your protocol is to update pixels while randomly receiving packets, sorry, it ain't gonna happen.

Tom

Felix

  • Administrator
  • Hero Member
  • *****
  • Posts: 6866
  • Country: us
    • LowPowerLab
Re: new to Moteino, question about data rate?
« Reply #2 on: July 08, 2015, 08:12:50 AM »
Thanks Tom for your thoughts. I'd like to mention that the max packet length is 61 bytes since the rest are used for the packet header, really not a big difference anyway.

I think the overall basic limitation of throughput in such a FSK transmitter-receiver network is that it takes a few ms to send a packet, a few more to send a long packet like 61 bytes, and there are possible interference the longer the transmission is (better chance a byte gets mis-received then the CRC fails and packet fails and needs to be resent). You could perhaps play around with the bitrate of the radios and go from the default 55Kbps up to 250-300kbps max the radios allow but then you're limiting your range since the sensitivity will decrease.
So these radios are perfect for situations where you got remote sensors that can be quite far away and they only send data from time to time (lets say that can be from 1 second up). The more end nodes you have the more traffic there is and more chances for collisions and that's another factor for decreased throughput. In a battery operated or low traffic node network scenario this is almost never an issue and ACK re-transmissions really take care of any missed packets etc.

Before I can be a real contributor to your specific scenario I would have to ask about the LEDs themselves, I know they are picky about the timings but I don't know how you'd use them and how much data they would need etc. So what kind of data rate are you looking for and in how many nodes?
I haven't played with these LEDs so what modes do these LEDs run in? Just a fixed solid color, or do they pulse/PWM?

TomWS

  • Hero Member
  • *****
  • Posts: 1930
Re: new to Moteino, question about data rate?
« Reply #3 on: July 08, 2015, 09:32:30 AM »
I haven't played with these LEDs so what modes do these LEDs run in? Just a fixed solid color, or do they pulse/PWM?
The pixels themselves are full color 24 bit RGB requiring 3 bytes per pixel.  Pixels are daisy chained to a single GPIO bit and all pixels in the chain need to be updated in one serial stream.  Serial stream bit timing is 800KHz requiring 150ns resolution or better and the library turns off interrupts and bit bangs in assembler for the entire stream before re-enabling interrupts.

They CAN be driven by a 16MHz ATMega328P, but, in my experience, if you want to do anything else and still have real time update of pixels, you'd be better off using a separate HW driver (eg dedicated PIC).

Tom

Felix

  • Administrator
  • Hero Member
  • *****
  • Posts: 6866
  • Country: us
    • LowPowerLab
Re: new to Moteino, question about data rate?
« Reply #4 on: July 08, 2015, 09:45:13 AM »
They CAN be driven by a 16MHz ATMega328P, but, in my experience, if you want to do anything else and still have real time update of pixels, you'd be better off using a separate HW driver (eg dedicated PIC).

From time to time adafruit shows off their little attiny based trinkets driving/PWMing entire strips of these. I think those are 8mhz with very limited memory. So if those can do it then a 16mhz Moteino should be able to as well, assuming some delays for the RF packets. If interrupts are disabled for long, then the sender would need to be aware and keep trying to send a packet a few more times if there is no ACK response, knowing that the target might be busy updating the LEDs data.

TomWS

  • Hero Member
  • *****
  • Posts: 1930
Re: new to Moteino, question about data rate?
« Reply #5 on: July 08, 2015, 03:04:04 PM »
I've successfully driven them from an 8MHz ATmega328P (after modifying Adafruit's library), which is why I don't recommend it.  ;)

Tom

Felix

  • Administrator
  • Hero Member
  • *****
  • Posts: 6866
  • Country: us
    • LowPowerLab
Re: new to Moteino, question about data rate?
« Reply #6 on: July 08, 2015, 03:17:51 PM »
You don't recommend the adafruit library or running at 8mhz?

TomWS

  • Hero Member
  • *****
  • Posts: 1930
Re: new to Moteino, question about data rate?
« Reply #7 on: July 08, 2015, 07:46:30 PM »
You don't recommend the adafruit library or running at 8mhz?
I definitely do NOT recommend Adafruit's library as-is if running at 8MHz!
Other than that, as far as I know, it's the only game in town.  It's got some clever code in it and works well if you're not resource constrained AND not running at 8MHz - their timing doesn't meet spec (or come close) in this case.  I sent in an update but it was never picked up.

Tom