RFM12B Attiny84a

Started by Kitsibas, September 01, 2013, 11:30:23 AM

Kitsibas

Hi,

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

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


Any ideas?

Regards!

iqb

Hi, this is because the standby mode for attiny84 is called (SLEEP_MODE_PWR_SAVE).
You can change this in RFM12B.h. Find:
    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 :
#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:
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?

iqb

Problem solved here:
http://forum.arduino.cc//index.php?PHPSESSID=32l6s2ul15inqi18rt82frhre4&topic=51984.msg371307#msg371307

Lensdigital

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 :(

Spexx

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/