Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add Arduino UNO R4 MINIMA to boards.h please #506

Open
ckosse opened this issue Jul 27, 2023 · 13 comments
Open

add Arduino UNO R4 MINIMA to boards.h please #506

ckosse opened this issue Jul 27, 2023 · 13 comments

Comments

@ckosse
Copy link

ckosse commented Jul 27, 2023

Hi,

I am new to this and would love to use Firmata with the Arduino UNO R4 MINIMA. Unfortunately, I don't know how to update boards.h accordingly. Any help would be appreciated :)

Thanks!

@Nepharoel626
Copy link

Nepharoel626 commented Aug 2, 2023

I'm new too and face the same problem for the R4 Wifi. Any help or guidance to solve this issue would be highly appreciated! 🙏🏼

@pgrawehr
Copy link
Contributor

Support for the Uno R4 has been added to ConfigurableFirmata. It will be included in the next release (due as soon as I find time)

@speccy88
Copy link

Support for the Uno R4 has been added to ConfigurableFirmata. It will be included in the next release (due as soon as I find time)

did you have time to add support for standard firmata?

Thanks

@pgrawehr
Copy link
Contributor

@speccy88 No, and I think I won't do it. StandardFirmata is good for very old boards with very limited amount of memory. But for anything larger than an Uno R3, I see no advantage in using and supporting StandardFirmata.

@zfields
Copy link
Contributor

zfields commented Aug 28, 2023

@speccy88 I'm happy to do it. If you will provide me with a pointer as to what is missing, then I'll be happy to add it in.

I don't personally have an R4, so I haven't had anything to test it on.

@pgrawehr
Copy link
Contributor

pgrawehr commented Aug 28, 2023

@zfields Here's the change for ConfigurableFirmata. The required update for StandardFirmata should be equivalent.

I have no such board either, but I installed the matching toolbox and it appears to compile.

@zfields
Copy link
Contributor

zfields commented Aug 28, 2023

@speccy88 Will you please try the uno-r4 branch, and confirm it works on your hardware.
#509

I have confirmed that it compiles for both the Uno R4 Minima and Wi-Fi boards, but I do not have hardware to validate it against.

@rvroessel
Copy link

Is there any plan to add support for the new Arduino R4 WIFI to StandardFirmataWifi in the future?

@pgrawehr
Copy link
Contributor

@rvroessel See the comment of zfields above. He has implemented it on a branch, but is waiting for confirmation from somebody that has the hardware.

@rvroessel
Copy link

@rvroessel See the comment of zfields above. He has implemented it on a branch, but is waiting for confirmation from somebody that has the hardware.

I have tested StandardFirmataPlus on the R4 WiFi, and it seems to work well. Thank you for this. I cannot get StandardFirmataWifi to work, because there is no support for UNO R4 WiFi yet.

@pgrawehr
Copy link
Contributor

Ok, understood. Yea, that requires somebody to write the Wifi support code for the R4 Wifi, it seems.

Note that because the number of active mainainers here is very limited, I'm focussing support for new boards on ConfigurableFirmata instead. All the newer boards have enough memory to support the customizable approach.

@julesmoretti
Copy link

julesmoretti commented Sep 8, 2024

If someone could add this, that would be super helpful.

Current Error from Arduino IDE when trying to upload the StandardFirmata:

In file included from /Users/jules/Documents/Arduino/libraries/Firmata/Firmata.h:17:0,
                 from /private/var/folders/p4/9t0h4nrd12v46g5523pshb_h0000gn/T/.arduinoIDE-unsaved202488-57619-faz7js.rn9p8/StandardFirmata/StandardFirmata.ino:28:
/Users/jules/Documents/Arduino/libraries/Firmata/Boards.h:1106:2: error: #error "Please edit Boards.h with a hardware abstraction for this board"
 #error "Please edit Boards.h with a hardware abstraction for this board"
  ^~~~~
exit status 1

Compilation error: exit status 1

From the following link.

Suggestion is to add the following content to boards.h:

#elif defined(ARDUINO_UNOWIFIR4)
#define TOTAL_ANALOG_PINS 6
#define TOTAL_PINS 20 // 14 digital + 6 analog
#define VERSION_BLINK_PIN 13 // or any available pin for LED
#define IS_PIN_DIGITAL(p) ((p) >= 0 && (p) <= 13) // Adjusted for digital pins
#define IS_PIN_ANALOG(p) ((p) >= 14 && (p) <= 19) // Adjusted for analog pins
#define IS_PIN_PWM(p) (((p) == 3) || ((p) >= 5 && (p) <= 9) || ((p) >= 10 && (p) <= 13)) // Adjusted for PWM pins
#define IS_PIN_SERVO(p) (((p) == 3) || ((p) >= 5 && (p) <= 9) || ((p) >= 10 && (p) <= 13)) // Adjusted for servo pins
#define IS_PIN_I2C(p) ((p) == 18 || (p) == 19) // Adjusted for I2C pins
#define IS_PIN_SPI(p) ((p) == SS || (p) == MOSI || (p) == MISO || (p) == SCK) // Adjusted for SPI pins
#define PIN_TO_DIGITAL(p) (p) // Adjusted for digital pins
#define PIN_TO_ANALOG(p) ((p)-14) // Adjusted for analog pins
#define PIN_TO_PWM(p) PIN_TO_DIGITAL(p) // Adjusted for PWM pins
#define PIN_TO_SERVO(p) PIN_TO_DIGITAL(p)

But doing so returns:

Compilation error: 'TOTAL_PORTS' was not declared in this scope

I tried to include a #define TOTAL_PORTS using 3 and 1 to the boards.h but that did not work.

Also the Firmata library from the Arduino IDE 2.5.9 differs from the Github 2.5.9 version. specifically the boards.h file and the readme.

Thank you for the help :)

@pgrawehr
Copy link
Contributor

pgrawehr commented Sep 9, 2024

It seems there are some compilation problems due to compiler updates. Shouldn't be difficult to fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants