LowPowerLab Forum

Hardware support => RF - Range - Antennas - RFM69 library => Topic started by: Kitsibas on September 01, 2013, 11:30:23 AM

Title: RFM12B Attiny84a
Post by: Kitsibas on September 01, 2013, 11:30:23 AM
Hi,

Anybody use attiny with RFM12B library? When I try to compile example send sketch gets the following error message:

Code: [Select]
D:\Arduino\arduino-1.0.5\libraries\RFM12B/RFM12B.h:200: error: 'SLEEP_MODE_STANDBY' was not declared in this scope

Any ideas?

Regards!
Title: Re: RFM12B Attiny84a
Post by: iqb on October 30, 2013, 05:57:07 AM
Hi, this is because the standby mode for attiny84 is called (SLEEP_MODE_PWR_SAVE).
You can change this in RFM12B.h. Find:
Code: [Select]
    void SendStart(uint8_t toNodeId, const void* sendBuf, uint8_t sendLen, bool requestACK=false, bool sendACK=false, uint8_t waitMode=SLEEP_MODE_STANDBY);
    void Send(uint8_t toNodeId, const void* sendBuf, uint8_t sendLen, bool requestACK = false, uint8_t waitMode=SLEEP_MODE_STANDBY);


and change it with :
Code: [Select]
	#if defined(__AVR_ATtiny84__)
    void SendStart(uint8_t toNodeId, const void* sendBuf, uint8_t sendLen, bool requestACK=false, bool sendACK=false, uint8_t waitMode=SLEEP_MODE_PWR_SAVE);
    void Send(uint8_t toNodeId, const void* sendBuf, uint8_t sendLen, bool requestACK = false, uint8_t waitMode=SLEEP_MODE_PWR_SAVE);
#else
    void SendStart(uint8_t toNodeId, const void* sendBuf, uint8_t sendLen, bool requestACK=false, bool sendACK=false, uint8_t waitMode=SLEEP_MODE_STANDBY);
    void Send(uint8_t toNodeId, const void* sendBuf, uint8_t sendLen, bool requestACK = false, uint8_t waitMode=SLEEP_MODE_STANDBY);
#endif

This solves the standby issue, but when I try to send a pkt, the compiler returns a few relocation errors I don't know how to handle:
Code: [Select]
c:/arduino/arduino-1.0.5/hardware/tools/avr/bin/../lib/gcc/avr/4.3.2/../../../../avr/lib/avr25/crttn84.o:(.init9+0x2): relocation truncated to fit: R_AVR_13_PCREL against symbol `exit' defined in .fini9 section in c:/arduino/arduino-1.0.5/hardware/tools/avr/bin/../lib/gcc/avr/4.3.2/avr25\libgcc.a(_exit.o)

any suggestions?
Title: Re: RFM12B Attiny84a
Post by: iqb on October 30, 2013, 07:27:23 AM
Problem solved here:
 http://forum.arduino.cc//index.php?PHPSESSID=32l6s2ul15inqi18rt82frhre4&topic=51984.msg371307#msg371307
Title: Re: RFM12B Attiny84a
Post by: Lensdigital on November 01, 2014, 02:16:29 PM
Did anyone actually got Attiny84 working with RFM12b?  I got mine to compile no issues (after modifying library as suggested, thanks!) , it even gets thru radio init, but it's not sending anything out :(
Title: Re: RFM12B Attiny84a
Post by: Spexx on November 07, 2014, 02:19:54 PM
The JeeLib library (https://github.com/jcw) works great with the RFM12B module and an Attiny84.
Here you will find also many helpful information and some sketches for different sensors:
http://nathan.chantrell.net/tinytx-wireless-sensor/ (http://nathan.chantrell.net/tinytx-wireless-sensor/)