RFM69 transmit binary

Started by ColinR, September 13, 2014, 02:53:17 AM

ColinR

I'd like to transmit values as compactly as possible.

To transmit over RF, typically we're sending ASCII characters, which are presumably put into binary and then decoded on the other end. Transmitting numerical values, this is quite inefficient. For a value range of 0-99, for example, we transmit two characters, which in ASCII is two bytes, which could give us 0-65535. Each ASCII character has something like 37 visible characters (see, for example, http://arduino.cc/en/Tutorial/ASCIITable). One could code these to get thirty-odd values per character, but it's still still a factor of about eight from where we could be.

So, if I want to transmit a value in the format of XXX.XXXX, in ASCII we're talking 8 characters. Using 32 bit per character encoding (if we only use visible characters as above), we could get it in about 4. If we were using non-encoded data, we could do it EASILY in 3.

So the question is: is it possible to transmit raw binary over RFM69 so that more data could be encoded?

Thanks,
C

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

ColinR

Actually, looks like about 95 usable:

http://arduino.cc/en/Reference/ASCIIchart

If you shifted by 32 to put space at zero, you could get 64 values per character and still have some extra characters to reserve special meaning for. Base 64 encoding.

So for # encoded chars:
1 : 0-64
2 : 0-4095
3 : 0-262,143
4 : 0-16,777,215

You could lead with a decimal position and then use as many digits as necessary to represent your value. A poor man's float.

C

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

ColinR

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

Felix

It can be done and there are different schemes to compact binary data etc. The question is how easy is is for the end user to deal with that. In my case I prefer the easy path and just use ASCII.

ColinR

Ascii is fine, unless you need to fit in 61 chars with loads of data!

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

kiwisincebirth

Quote from: ColinR on September 13, 2014, 02:53:17 AMSo the question is: is it possible to transmit raw binary over RFM69 so that more data could be encoded?
Yes it is, see the following example and it companion (struct_recieve), these combine standard types into a C structure which is sent. There isn't any conversion the data is sent as raw bytes.

https://github.com/LowPowerLab/RFM69/tree/master/Examples/Struct_send

ColinR

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