me-no-dev/RasPiArduino

Raspiduino have some bug with Radiolib

siravijbb opened this issue · 1 comments

RaspiArduino has some problem with this library


int counter = 0;

void setup() {
  Serial.begin(9600);
  LoRa.setPins(22, 9, 8);
  while (!Serial);

  Console.println("LoRa Sender");

  if (!LoRa.begin(433E6)) {
    Console.println("Starting LoRa failed!");
    while (1);
  }
}

void loop() {
  Console.print("Sending packet: ");
  Console.println(counter);

  // send packet
  LoRa.beginPacket();
  LoRa.print("hello ");
  LoRa.print(counter);
  LoRa.endPacket();

  counter++;

  delay(5000);
}

Hardware setup
Raspiduino (Raspberry Pi4B which supported raspiduino

Debug mode output
In file included from C:\Users\sirav\Documents\Arduino\libraries\RadioLib\examples\Morse\Morse_Transmit\Morse_Transmit.ino:25:
C:\Users\sirav\Documents\Arduino\libraries\RadioLib\src/RadioLib.h:54:4: warning: #warning "RadioLib might not be compatible with this Arduino board - check supported platforms at https://github.com/jgromes/RadioLib!" [-Wcpp]
54 | #warning "RadioLib might not be compatible with this Arduino board - check supported platforms at https://github.com/jgromes/RadioLib!"
| ^~~~~~~
In file included from sketch\Morse_Transmit.ino.cpp:1:
C:\Program Files (x86)\Arduino\hardware\RaspberryPi\piduino\cores\piduino/Arduino.h:109:19: error: expected unqualified-id before 'unsigned'
109 | #define millis() (unsigned long)(STCV / 1000)
| ^~~~~~~~
C:\Users\sirav\Documents\Arduino\libraries\RadioLib\src/Module.h:329:14: note: in expansion of macro 'millis'
329 | uint32_t millis();
| ^~~~~~
C:\Program Files (x86)\Arduino\hardware\RaspberryPi\piduino\cores\piduino/Arduino.h:109:19: error: expected ')' before 'unsigned'
109 | #define millis() (unsigned long)(STCV / 1000)
| ~^~~~~~~~
C:\Users\sirav\Documents\Arduino\libraries\RadioLib\src/Module.h:329:14: note: in expansion of macro 'millis'
329 | uint32_t millis();
| ^~~~~~
C:\Program Files (x86)\Arduino\hardware\RaspberryPi\piduino\cores\piduino/Arduino.h:108:19: error: expected unqualified-id before 'unsigned'
108 | #define micros() (unsigned long)(STCV)
| ^~~~~~~~
C:\Users\sirav\Documents\Arduino\libraries\RadioLib\src/Module.h:334:14: note: in expansion of macro 'micros'
334 | uint32_t micros();
| ^~~~~~
C:\Program Files (x86)\Arduino\hardware\RaspberryPi\piduino\cores\piduino/Arduino.h:108:19: error: expected ')' before 'unsigned'
108 | #define micros() (unsigned long)(STCV)
| ~^~~~~~~~
C:\Users\sirav\Documents\Arduino\libraries\RadioLib\src/Module.h:334:14: note: in expansion of macro 'micros'
334 | uint32_t micros();
| ^~~~~~
exit status 1
Error compiling for board RaspberryPI B+/2.

Additional info (please complete):

MCU: [e.g. Arduino Uno, ESP8266 etc.]Raspberry Pi4B
Link to Arduino core: (https://github.com/me-no-dev/RasPiArduino)
Wireless module type Raspberry Pi Lan Port (upload using SSH)
Arduino IDE version Lastest
Library version 5.0.0

jgromes has said that "Overall, it seems like the default platform almost worked - almost. Looks like RaspiDuino defines millis() and micros() as preprocessor macros, which seems like a strange choice and will require either fix on RaspiDuino side, or hack on RadioLib side."