Error compiling for board WisBlock Core RAK4631 Board

Hi po. I hope everyone is well.

Newbie here…

I’ve been exploring the RAK4631 Core board with RAK4630 module. I tried to load a simple code I got from the internet, however, I’ve been encountering an error – it never compiles. I’ve been getting, “Error compiling for board WisBlock Core RAK4631 Board”. I already took some steps to resolve this problem but the error still persists.

I’m just hope someone could help me with this?

Thank you!

Here’s my sample code:

#include <Arduino.h>
#include <Adafruit_TinyUSB.h>

void setup() {
  // put your setup code here, to run once:
  Serial.begin(115200);
  pinMode(LED_BLUE, OUTPUT);
  digitalWrite(LED_BLUE, HIGH);
}

void loop() {
  // put your main code here, to run repeatedly:
  digitalWrite(LED_BLUE, HIGH);
  delay(1000);
  digitalWrite(LED_BLUE, LOW);
  delay(1000);
  Serial.println("Hello! I'm Alive");
  }

Hello @adellagas

Are you compiling on Arduino IDE or with PlatformIO on Visual Studio Code?

If PIO, you need to add the RAK4631 to the platform, we have a guide and a quick patch batch in our WisBlock repo.

Hello Sir @beegee I’m compiling on Arduino IDE. I noticed there’s no “RAKwireless RUI nRF Boards” available, is that possible the problem???

Hello,
You need to install the BSP first, here is the guide

Hello again @beegee

Based on RAK4631’s guide (RAK4630 Module Quick Start Guide | RAKwireless Documentation Center) I should install the “RAKwireless RUI nRF Boards” under Boards Manager. But, upon checking there’s no “RAKwireless RUI nRF Boards”. See attached pic:

Is there other way I could install this board?

Thank you so much for the help

There are two different BSP because there are two different versions of the RAK4631:

RAK4631
Open source BSP, that are the ones you installed.
LoRa/LoRaWAN support with open source library SX126x-Arduino

RAK4631-R
RAKwireless developed BSP called RUI3, not open source.
Built-in LoRa/LoRaWAN support.

WisBlock RAK4631 Core module is usually the first one, so you have installed the correct BSP and RAKwireless nRF Boards is the correct. You have now the WisCore RAK4631 in your boards list and use this to compile and run your code.

You were looking into the documentation for the RAK4630 stamp module, which is different.
WisBlock Core RAK4631 is using the RAK4630, but there are differences.

Ohh thank you for that information @beegee . It made sense to me the problem.

So if ever I have RAK4630 module alone, how can I install the “RAKwireless RUI nRF Boards”?

And also, for this problem, can’t I load my sample code to the RAK4631???

Sorry I’m just a newbie in RAK world. But, thank you so much.

For RAK4630 / RAK4631-R BSP the Arduino installation is by using this URL:
** https://raw.githubusercontent.com/RAKWireless/RAKwireless-Arduino-BSP-Index/main/package_rakwireless.com_rui_index.json**

And for open source BSP the Arduino installation is by using this URL:
** https://raw.githubusercontent.com/RAKwireless/RAKwireless-Arduino-BSP-Index/main/package_rakwireless_index.json**

About “can’t I load my sample code”
What exactly happens?
Is the RAK4631 detected as COM port when you connect it to the computer?

I have now RAKwireless RUI nRF Boards installed. Thank you so much @beegee

However, upon compiling my sample code (reflected on post #1) I still got same error “Error compiling for board Wisblock Core RAk4631 Board”.

This is the whole error:

Arduino: 1.8.19 (Windows 10), Board: “WisBlock Core RAK4631 Board, 0.3.2 SoftDevice s140 7.2.0, Level 0 (Release), Enable”

In file included from C:\Program Files (x86)\Arduino\libraries\Adafruit_TinyUSB_Arduino-master\src/tusb_option.h:176,

             from C:\Program Files (x86)\Arduino\libraries\Adafruit_TinyUSB_Arduino-master\src/Adafruit_TinyUSB.h:34,

             from C:\Users\AdrianAristotlePDell\Desktop\Arduino\Multinode\2nd try\3rd Client\Trial\Trial.ino:2:

C:\Program Files (x86)\Arduino\libraries\Adafruit_TinyUSB_Arduino-master\src/tusb_config.h:46:4: error: #error TinyUSB Arduino Library does not support your core yet

46 | #error TinyUSB Arduino Library does not support your core yet

  |    ^~~~~

exit status 1

Error compiling for board WisBlock Core RAK4631 Board.

Honestly, I don’t understand whats the error all about this time.

Why do you have Adafruit_TinyUSB_Arduino-master in your library folder?
This library is included in the BSP and you are getting a conflict, because the library is now doubled (and most likely different version).
Remove the Adafruit_TinyUSB_Arduino-master from your library folder.

And if you have a RAK4631, you have to select the WisBlock RAk4631 board:

Arduino Open Source BSP and RUI3 BSP are not compatible and require different bootloader.
If you want to use RUI3, you will have to change the bootloader as explained in our [documentation]

Hi Sir @beegee I’m currently trying a multinode application, wherein my two RAK4631 will serve as end nodes. And I got still the “Error compiling for board WisBlock Core RAk4631 Board”. I followed your abovementioned advices and it worked for my sample code, but, failed when I tried to my current multinode set up.

Here’s my code:

#include <SPI.h>
#include <RH_RF95.h>

RH_RF95 rf95;

void setup()
{
  Serial.begin(9600);
  while (!Serial) ; // Wait for serial port to be available
  if (!rf95.init())
    Serial.println("init failed");
  rf95.setFrequency(915.0);
}

void loop()
{
  uint8_t buf[RH_RF95_MAX_MESSAGE_LEN];
  uint8_t len = sizeof(buf);
  if (rf95.waitAvailableTimeout(3000))
  {
    // Should be a reply message for us now
    if (rf95.recv(buf, &len))
    {
      int dataLength;
      String Request = (char*)buf;
      if (Request == "G3") {
        Serial.println("Slave 3 Got Request from the Master!");
        Serial.print("Response to the Master: ");
        String data = ("Nice to meet you!");
        int dataLength = data.length();dataLength++;
        uint8_t total[dataLength]; //variable for data to send
        //data.toCharArray(total, dataLength); //change type data from string ke uint8_t
        Serial.println(data);
        Serial.println();
        rf95.send(total, dataLength); //send data
        rf95.waitPacketSent();
      }
    }
  }
  else
  {
    Serial.println("No reply, is rf95_server running?");
  }
  delay(400);
}

Here’s the error I’ve gotten:

Arduino: 1.8.19 (Windows 10), Board: “WisBlock Core RAK4631 Board, 0.3.2 SoftDevice s140 6.1.1, Level 0 (Release)”

C:\Program Files (x86)\Arduino\libraries\RadioHead\RHHardwareSPI.cpp: In member function ‘virtual void RHHardwareSPI::begin()’:

C:\Program Files (x86)\Arduino\libraries\RadioHead\RHHardwareSPI.cpp:98:21: error: invalid conversion from ‘uint8_t’ {aka ‘unsigned char’} to ‘BitOrder’ [-fpermissive]

98 | SPI.setBitOrder(bitOrder);

  |                     ^~~~~~~~

  |                     |

  |                     uint8_t {aka unsigned char}

In file included from C:\Program Files (x86)\Arduino\libraries\RadioHead/RadioHead.h:731,

             from C:\Program Files (x86)\Arduino\libraries\RadioHead/RHGenericSPI.h:10,

             from C:\Program Files (x86)\Arduino\libraries\RadioHead/RHHardwareSPI.h:10,

             from C:\Program Files (x86)\Arduino\libraries\RadioHead\RHHardwareSPI.cpp:7:

C:\Users\AdrianAristotlePDell\AppData\Local\Arduino15\packages\rakwireless\hardware\nrf52\0.21.20\libraries\SPI/SPI.h:85:31: note: initializing argument 1 of ‘void SPIClass::setBitOrder(BitOrder)’

85 | void setBitOrder(BitOrder order);

  |                      ~~~~~~~~~^~~~~

exit status 1

Error compiling for board WisBlock Core RAK4631 Board.

Do you have any suggestions that I could try? I’ve been fixing this for 2 days already but I haven’t seen concerns similar to this one in the internet.

Thank you so much.

The RAK4631 has a SX1262 LoRa transceiver.
The RadioHead library does not support this transceiver and might not be compatible with the nRF52 in addition. If you need a compatible LoRa P2P library, use the SX126x-Arduino library. It supports the RAK4631 directly.

In addition it looks like you are using the RUI3 BSP instead of the Arduino BSP.
The RUI3 BSP has complete LoRa and LoRaWAN functions built-in, there is no need for external LoRa libraries. RUI3 API LoRa

If you want to use RUI3 API you have to flash a different bootloader on the RAK4631, otherwise it will not work Updating RAK4631 to RUI3

Hello Sir @beegee I’m using RAK4631 connected to RAK5005-0. Based on what I’ve read, you will use RUI3 BSP if your dealing RAK4631-R Core Board, is that right Sir? So if ever Sir, I don’t need to flash different bootloader to the one I’m currently using?

Also, this the arduino board I’m using, this is Arduino BSP Sir right?
image

Thank you again Sir

Correct, if you use Arduino BSP you can use the default Bootloader.

Your image is so blurred, I cannot read anything there.

Ay my apologies for the picture. Here’s a clearer one.

Thank you sir @beegee

One curious question, could RUI3 BSP work with my RAK4631?? Or is it something that only works for RAK4631-R?

From hardware side RAK4631 and RAK4631-R are identical.
The difference is in the bootloader and in the BSP. We have tutorials in our documentation center how to switch from Open Source BSP to RUI3:

Updating RAK4631 to RUI3
Converting RAK4631-R to RAK4631

Ohhh okayyy. That cleared up some of my questions Sir @beegee . But, is it possible to use RAK4630 or RAK4631 connected to RAK5005-O, for a multi node application? For example, I will set one of the RAK 4630/RAK4631 to be the server node who will receive and request data from several RAK4630/RAK4631 end nodes? That is what I’m trying to achieve.

Just to make things clear:

RAK4630 is a stamp module that is used on the RAK4631 WisBlock Core module. That leads often to confusion, because the sticker still says RAK4630.
The difference is that the RAK4630 is to be soldered on a PCB, while the RAK4631 has a connector for the WisBlock Base Boards.

For your application, you can do this by using LoRa P2P, but not using LoRaWAN. LoRaWAN requires multi channel gateways and a LoRaWAN server.

But when using LoRa P2P you can setup one device as server node that can request data from multiple slave nodes.

Thank you for the clarification Sir @beegee . Actually, I already differentiated the difference between RAK4630 and RAK4631

For your application, you can do this by using LoRa P2P, but not using LoRaWAN. LoRaWAN requires multi channel gateways and a LoRaWAN server.

Ohh I see. I also tried the transmitter and receiver LoRaP2P codes from this github repo LoRa P2P and so far it worked. So, right know I’m looking for a sample documentation or forum discussion if someone already tried a multinode set up using RAK4630, and I cant seem to find any in the internet that I could pattern or get idea from.

By any chance, does RAK have sample Quick Start or Github repo for a multinode application? Sorry for asking since I’m not really expert in coding so I am just modifying and relying heavily in the codes available out there.

Thank you so much.

Quickstart Guides are in our Documentation Center, but they concentrate more on LoRaWAN.

We have a lot of example code in our WisBlock repo, but again mainly for LoRaWAN.

There are not much examples available that use LoRa P2P.