RadioHead does not compile with MKRZERO

FOR FUTURE SEARCHES: Radio Head does NOT work with MRKZERO.

I am trying to set up RF comm. with the those cheap ebay transmitters/receivers. ( FS1000A and XY-MK-5V 433MHz RF modules). My Arduino environment is set up for the MKRZERO board, which is what I have. I have downloaded and added the Radio Head 1.41 as a library following instructions here.

My code is the template from the website. Here it is, just in case:

/*
  433 MHz RF Module Transmitter Demonstration 1
  RF-Xmit-Demo-1.ino
  Demonstrates 433 MHz RF Transmitter Module
  Use with Receiver Demonstration 1
 
  DroneBot Workshop 2018
  https://dronebotworkshop.com
*/
 
// Include RadioHead Amplitude Shift Keying Library
#include <RH_ASK.h>
// Include dependant SPI Library 
#include <SPI.h> 
 
// Create Amplitude Shift Keying Object
RH_ASK rf_driver;
 
void setup()
{
    // Initialize ASK Object
    rf_driver.init();
}
 
void loop()
{
    const char *msg = "Welcome to the Workshop!";
    rf_driver.send((uint8_t *)msg, strlen(msg));
    rf_driver.waitPacketSent();
    delay(1000);
}

I get a long list of errors when I try to compile my sketch, none of them seemingly about a typo/something in the sketch. I've tried other simple sketches but errors persist. Here are the error messages:

Arduino: 1.8.13 (Mac OS X), Board: "Arduino MKRZERO"











In file included from /Users/myusername/Documents/Arduino/libraries/RadioHead/RH_Serial.cpp:6:0:
/Users/myusername/Documents/Arduino/libraries/RadioHead/RH_Serial.h:105:29: error: expected ')' before '&' token
     RH_Serial(HardwareSerial& serial);
                             ^
/Users/myusername/Documents/Arduino/libraries/RadioHead/RH_Serial.h:177:5: error: reference to 'HardwareSerial' is ambiguous
     HardwareSerial& _serial;
     ^~~~~~~~~~~~~~
/Users/myusername/Documents/Arduino/libraries/RadioHead/RH_Serial.h:36:7: note: candidates are: class HardwareSerial
 class HardwareSerial;
       ^~~~~~~~~~~~~~
In file included from /Users/myusername/Library/Arduino15/packages/arduino/hardware/samd/1.8.11/cores/arduino/Uart.h:21:0,
                 from /Users/myusername/Library/Arduino15/packages/arduino/hardware/samd/1.8.11/variants/mkrzero/variant.h:162,
                 from /Users/myusername/Library/Arduino15/packages/arduino/hardware/samd/1.8.11/cores/arduino/Arduino.h:48,
                 from /Users/myusername/Documents/Arduino/libraries/RadioHead/RadioHead.h:533,
                 from /Users/myusername/Documents/Arduino/libraries/RadioHead/RHGenericDriver.h:9,
                 from /Users/myusername/Documents/Arduino/libraries/RadioHead/RH_Serial.h:12,
                 from /Users/myusername/Documents/Arduino/libraries/RadioHead/RH_Serial.cpp:6:
/Users/myusername/Library/Arduino15/packages/arduino/hardware/samd/1.8.11/cores/arduino/api/HardwareSerial.h:87:7: note:                 class arduino::HardwareSerial
 class HardwareSerial : public Stream
       ^~~~~~~~~~~~~~
/Users/myusername/Documents/Arduino/libraries/RadioHead/RH_Serial.cpp:10:21: error: expected constructor, destructor, or type conversion before '(' token
 RH_Serial::RH_Serial(HardwareSerial& serial)
                     ^
/Users/myusername/Documents/Arduino/libraries/RadioHead/RH_Serial.cpp: In member function 'virtual bool RH_Serial::available()':
/Users/myusername/Documents/Arduino/libraries/RadioHead/RH_Serial.cpp:28:27: error: '_serial' was not declared in this scope
     while (!_rxBufValid &&_serial.available())
                           ^~~~~~~
/Users/myusername/Documents/Arduino/libraries/RadioHead/RH_ASK.cpp: In member function 'void RH_ASK::timerSetup()':
/Users/myusername/Documents/Arduino/libraries/RadioHead/RH_ASK.cpp:215:5: error: 'pmc_set_writeprotect' was not declared in this scope
     pmc_set_writeprotect(false);
     ^~~~~~~~~~~~~~~~~~~~
/Users/myusername/Documents/Arduino/libraries/RadioHead/RH_Serial.cpp:28:27: note: suggested alternative: 'Serial'
     while (!_rxBufValid &&_serial.available())
                           ^~~~~~~
                           Serial
/Users/myusername/Documents/Arduino/libraries/RadioHead/RH_Serial.cpp: In member function 'virtual bool RH_Serial::send(const uint8_t*, uint8_t)':
/Users/myusername/Documents/Arduino/libraries/RadioHead/RH_Serial.cpp:166:5: error: '_serial' was not declared in this scope
     _serial.write(DLE); // Not in FCS
     ^~~~~~~
/Users/myusername/Documents/Arduino/libraries/RadioHead/RH_Serial.cpp:166:5: note: suggested alternative: 'Serial'
     _serial.write(DLE); // Not in FCS
     ^~~~~~~
     Serial
/Users/myusername/Documents/Arduino/libraries/RadioHead/RH_Serial.cpp: In member function 'void RH_Serial::txData(uint8_t)':
/Users/myusername/Documents/Arduino/libraries/RadioHead/RH_Serial.cpp:191:2: error: '_serial' was not declared in this scope
  _serial.write(DLE); // Not in FCS
  ^~~~~~~
/Users/myusername/Documents/Arduino/libraries/RadioHead/RH_Serial.cpp:191:2: note: suggested alternative: 'Serial'
  _serial.write(DLE); // Not in FCS
  ^~~~~~~
  Serial
/Users/myusername/Documents/Arduino/libraries/RadioHead/RH_Serial.cpp:192:5: error: '_serial' was not declared in this scope
     _serial.write(ch);
     ^~~~~~~
/Users/myusername/Documents/Arduino/libraries/RadioHead/RH_Serial.cpp:192:5: note: suggested alternative: 'Serial'
     _serial.write(ch);
     ^~~~~~~
     Serial
/Users/myusername/Documents/Arduino/libraries/RadioHead/RH_ASK.cpp:214:34: error: 'TC1_IRQn' was not declared in this scope
     #define RH_ASK_DUE_TIMER_IRQ TC1_IRQn
                                  ^
/Users/myusername/Documents/Arduino/libraries/RadioHead/RH_ASK.cpp:216:27: note: in expansion of macro 'RH_ASK_DUE_TIMER_IRQ'
     pmc_enable_periph_clk(RH_ASK_DUE_TIMER_IRQ);
                           ^~~~~~~~~~~~~~~~~~~~
/Users/myusername/Documents/Arduino/libraries/RadioHead/RH_ASK.cpp:214:34: note: suggested alternative: 'TC5_IRQn'
     #define RH_ASK_DUE_TIMER_IRQ TC1_IRQn
                                  ^
/Users/myusername/Documents/Arduino/libraries/RadioHead/RH_ASK.cpp:216:27: note: in expansion of macro 'RH_ASK_DUE_TIMER_IRQ'
     pmc_enable_periph_clk(RH_ASK_DUE_TIMER_IRQ);
                           ^~~~~~~~~~~~~~~~~~~~
/Users/myusername/Documents/Arduino/libraries/RadioHead/RH_ASK.cpp:216:5: error: 'pmc_enable_periph_clk' was not declared in this scope
     pmc_enable_periph_clk(RH_ASK_DUE_TIMER_IRQ);
     ^~~~~~~~~~~~~~~~~~~~~
/Users/myusername/Documents/Arduino/libraries/RadioHead/RH_ASK.cpp:212:30: error: 'TC0' was not declared in this scope
     #define RH_ASK_DUE_TIMER TC0
                              ^
/Users/myusername/Documents/Arduino/libraries/RadioHead/RH_ASK.cpp:221:18: note: in expansion of macro 'RH_ASK_DUE_TIMER'
     TC_Configure(RH_ASK_DUE_TIMER, RH_ASK_DUE_TIMER_CHANNEL,
                  ^~~~~~~~~~~~~~~~
/Users/myusername/Documents/Arduino/libraries/RadioHead/RH_ASK.cpp:212:30: note: suggested alternative: 'TC5'
     #define RH_ASK_DUE_TIMER TC0
                              ^
/Users/myusername/Documents/Arduino/libraries/RadioHead/RH_ASK.cpp:221:18: note: in expansion of macro 'RH_ASK_DUE_TIMER'
     TC_Configure(RH_ASK_DUE_TIMER, RH_ASK_DUE_TIMER_CHANNEL,
                  ^~~~~~~~~~~~~~~~
/Users/myusername/Documents/Arduino/libraries/RadioHead/RH_ASK.cpp:222:4: error: 'TC_CMR_WAVE' was not declared in this scope
    TC_CMR_WAVE | TC_CMR_WAVSEL_UP_RC | TC_CMR_TCCLKS_TIMER_CLOCK4);
    ^~~~~~~~~~~
/Users/myusername/Documents/Arduino/libraries/RadioHead/RH_ASK.cpp:222:18: error: 'TC_CMR_WAVSEL_UP_RC' was not declared in this scope
    TC_CMR_WAVE | TC_CMR_WAVSEL_UP_RC | TC_CMR_TCCLKS_TIMER_CLOCK4);
                  ^~~~~~~~~~~~~~~~~~~
/Users/myusername/Documents/Arduino/libraries/RadioHead/RH_ASK.cpp:222:18: note: suggested alternative: 'TCC_WAVE_POL'
    TC_CMR_WAVE | TC_CMR_WAVSEL_UP_RC | TC_CMR_TCCLKS_TIMER_CLOCK4);
                  ^~~~~~~~~~~~~~~~~~~
                  TCC_WAVE_POL
/Users/myusername/Documents/Arduino/libraries/RadioHead/RH_ASK.cpp:222:40: error: 'TC_CMR_TCCLKS_TIMER_CLOCK4' was not declared in this scope
    TC_CMR_WAVE | TC_CMR_WAVSEL_UP_RC | TC_CMR_TCCLKS_TIMER_CLOCK4);
                                        ^~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/myusername/Documents/Arduino/libraries/RadioHead/RH_ASK.cpp:221:5: error: 'TC_Configure' was not declared in this scope
     TC_Configure(RH_ASK_DUE_TIMER, RH_ASK_DUE_TIMER_CHANNEL,
     ^~~~~~~~~~~~
/Users/myusername/Documents/Arduino/libraries/RadioHead/RH_ASK.cpp:223:5: error: 'TC_SetRC' was not declared in this scope
     TC_SetRC(RH_ASK_DUE_TIMER, RH_ASK_DUE_TIMER_CHANNEL, rc);
     ^~~~~~~~
/Users/myusername/Documents/Arduino/libraries/RadioHead/RH_ASK.cpp:225:69: error: 'TC_IER_CPCS' was not declared in this scope
     RH_ASK_DUE_TIMER->TC_CHANNEL[RH_ASK_DUE_TIMER_CHANNEL].TC_IER = TC_IER_CPCS;
                                                                     ^~~~~~~~~~~
/Users/myusername/Documents/Arduino/libraries/RadioHead/RH_ASK.cpp:225:69: note: suggested alternative: 'TCC_PER_PER'
     RH_ASK_DUE_TIMER->TC_CHANNEL[RH_ASK_DUE_TIMER_CHANNEL].TC_IER = TC_IER_CPCS;
                                                                     ^~~~~~~~~~~
                                                                     TCC_PER_PER
/Users/myusername/Documents/Arduino/libraries/RadioHead/RH_ASK.cpp:228:5: error: 'TC_Start' was not declared in this scope
     TC_Start(RH_ASK_DUE_TIMER, RH_ASK_DUE_TIMER_CHANNEL);
     ^~~~~~~~
/Users/myusername/Documents/Arduino/libraries/RadioHead/RH_ASK.cpp: In function 'void TC1_Handler()':
/Users/myusername/Documents/Arduino/libraries/RadioHead/RH_ASK.cpp:504:18: error: 'TC0' was not declared in this scope
     TC_GetStatus(TC0, 1);
                  ^~~
/Users/myusername/Documents/Arduino/libraries/RadioHead/RH_ASK.cpp:504:18: note: suggested alternative: 'TC5'
     TC_GetStatus(TC0, 1);
                  ^~~
                  TC5
/Users/myusername/Documents/Arduino/libraries/RadioHead/RH_ASK.cpp:504:5: error: 'TC_GetStatus' was not declared in this scope
     TC_GetStatus(TC0, 1);
     ^~~~~~~~~~~~
/Users/myusername/Documents/Arduino/libraries/RadioHead/RH_ASK.cpp:504:5: note: suggested alternative: 'PinStatus'
     TC_GetStatus(TC0, 1);
     ^~~~~~~~~~~~
     PinStatus
exit status 1
Error compiling for board Arduino MKRZERO.


This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

I couldn't match the board type to the microprocessor to check, so I am wondering if Radio Head is not compatible with MKRZERO after all? I am not sure if the Pin 12 in Arduino Uno has the same functionality as Pin 12 in MKRZERO, too. I would appreciate pointers to help me use these RF modules with MKRZERO, with or without Radio Head.

Yes. Same on MKR WAN1300. But LoRa works LoRa - Arduino Reference

p.s. 'HardwareSerial' on Due, Teensy and ESP32. On SAMD serial class is 'Uart'.

Thanks! I am not sure if I understand the p.s. , but my central question has been answered, so no need to go deeper for the side note.

We uses RadioHead lib on Due + Dragino Lora shield. And LoRa lib on WAN 1300. Positive.

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.