Official Arduino Release with Reef Angel Controllers

Community contributed apps
Post Reply
binder
Posts: 2865
Joined: Fri Mar 18, 2011 6:20 pm
Location: Illinois
Contact:

Official Arduino Release with Reef Angel Controllers

Post by binder »

We have used a custom build of the Arduino Application for our use with the Reef Angel Controllers. This has worked good in the past, however it has some issues moving forward. Reproducing the build that Roberto does is a bit tedious. Each time a new release of Arduino comes out, we would have to apply the same changes to the new version, then build and release. (I've tried to build it on Mac and Linux and have not had much success. It's always been difficult to repeat the build.)

The webwizard has solved the big problem. This is the method of choice for most users.

Now, on to the point of this post.
For those of us who want to the Arduino application, we now will be able to run the default version that you can download from Arduino. I took some time over the last couple days and figured out how to Add-On our Controllers/Boards to the default boards list AND how to incorporate the Features file generation that was part of the Reef Angel Arduino Build (although you have to manually run it first, before you compile your sketch.)
Updated: The add-on also generates the labels for you based on the lines added to your sketch. It auto-creates the RA_CustomLabels.h file for you each time you run it.

Here's how you can set it up.
  • Add the Controllers
    • Open up Arduino
    • Goto Preferences
    • Look for "Additional Boards Manager URLs" and then click the little window button to open the Add window
    • Add this URL to the list:

      Code: Select all

      https://curtbinder.info/reefangel/package_reefangel.com_controllers_index.json
      (Yes, I'm hosting it on my server)
    • Click Ok to close this window, then click Ok again to close and save the Preferences
    • Goto the Tools menu, select "Board", then "Boards Manager".
    • Search for Reef Angel
    • Click on the Install button listed for the Reef Angel Controllers
  • Add the Features File generation capability
    • Close Arduino
    • Download the tool I created (CBTool) - CBTool-v2.3.1.zip
      Here's the full URL if you want it:

      Code: Select all

      https://curtbinder.info/reefangel/CBTool-v2.3.1.zip
      And the SHA256 sum file as well: sha256 sum
    • Unzip / Extract it and place the folder inside the Arduino/tools/ folder
    • You will now have a folder called CBTool inside the tools folder. Inside the CBTool folder is another folder called tool and inside that will be a file called cbtool.jar.
      Here's the full content:

      Code: Select all

      tools/CBTool/tool/cbtool.jar
      There's only 1 file total.
    • Launch Arduino again
    • Goto Tools -> CB Reef Angel Process Sketch to run the features and labels generation.
  • Verify folders and files exist
    • Make sure you have the following folders in your libraries folder:
      • RA_CustomLabels
      • ReefAngel_Features
    • Check that you have an Arduino/update/feature.txt file. If not, the features generation will not work.
When the Features generation creates the features file, it adds a line at the top to tell when it was generated and for what INO / Sketch file. This can be helpful for those to see when you last generated it (if you even care). It adds the same generated line to the Labels file as well.

You need to run it whenever you make changes to your code that could be adding or removing features. If you are just updating code logic and not changing any features, you might not need to run it again. However, when in doubt, run it.

Updated:I figured out how to get the code to compile after running the the features and labels generation, but have not added the logic to it. The reason is when you goto upload the code, it forces a compilation again. So it takes twice as long to compile and upload.

Lastly, I have only tested compiling my code and it works just fine. I have not had a chance to upload any code (at the time of this post). I will be testing the compilation in the future.
I have also only tested this on a Mac running OS 10.15 (Catalina). In theory, this should work fine on Windows, Mac, and Linux (x86/x64 and arm variants)...ie, every version that Arduino puts out, this should work. So please, if you are interested, test this out. I will be testing the arm64 and x64 versions soon.

Let me know if this helps or if you have any questions.

UPDATE:
I just finished testing the building and uploading. I tested the uploading using Mac 10.15 (Catalina) using Arduino 1.8.10 and on my Pinebook Pro (32bit arm build) using Arduino 1.8.11 for 32bit arm and I could upload just fine to a Reef Angel Plus. I still haven't tested on a linux x64 but that shouldn't matter at all since the other 2 builds work.
UPDATE2:
I improved the code creation and generation. I also added in the custom label generation based on the labels in the code. The labels lines MUST begin with

Code: Select all

// RA_LABEL 
followed by the label you wish to change. Look at the RA_CustomLabels.h file for more details.
An example line would be:

Code: Select all

// RA_LABEL LABEL_PORT11=Skimmer
Last edited by binder on Mon Oct 26, 2020 2:13 pm, edited 4 times in total.
sbidny
Posts: 122
Joined: Mon Sep 17, 2012 12:41 pm
Location: Lincoln Park, Chicago, IL, USA 60614

Re: Official Arduino Release with Reef Angel Controllers

Post by sbidny »

This is awesome. Thank you!
Papajin
Posts: 2
Joined: Fri Mar 15, 2013 8:21 pm
Location: Hanover Park, IL

Re: Official Arduino Release with Reef Angel Controllers

Post by Papajin »

Hey Binder -- So recently I dug out my Reef Angel after letting it sit for several years as I have a new tank project I'm working on, and would like to use it.

The original Arduino app still seems to work, but it's a bit old and runs kind of crappy... and that's when I found your post about using an official release. Unfortunately, I can't seem to get it to work correctly. The Reef Angel controllers show up under the Board selection and I've selected my board (RA Plus), but the Reef Angel Wizard doesn't work at all throwing an error:

Code: Select all

Exception in thread "AWT-EventQueue-0" java.lang.NoSuchMethodError: processing.app.Sketch.getCode(I)Lprocessing/app/SketchCode
When I attempt to compile previously generated code, I get the following error:

Code: Select all

Arduino: 1.8.19 (Windows 10), Board: "Reef Angel Plus Controller"

C:\Users\papajin\Documents\Arduino\libraries\EthernetUtils\EthernetBonjour.cpp:31:13: fatal error: wiring.h: No such file or directory

Multiple libraries were found for "Ethernet.h"

    #include <wiring.h>

             ^~~~~~~~~~

 Used: C:\Users\papajin\Documents\Arduino\libraries\Ethernet

compilation terminated.

 Not used: C:\Program Files (x86)\Arduino\libraries\Ethernet

exit status 1

Error compiling for board Reef Angel Plus Controller.
Any ideas what I may have missed or done wrong here? Is it possible the original RA version still being installed is causing an issue (I'll have to check that)? Anyway, thanks for the work you did here, and hopefully I can get it figured out.

Doug
binder
Posts: 2865
Joined: Fri Mar 18, 2011 6:20 pm
Location: Illinois
Contact:

Re: Official Arduino Release with Reef Angel Controllers

Post by binder »

Sorry for the delayed response, I do not get on the forum much anymore.

The issue is most likely related to old versions of the libraries. There has been some pretty major changes to the libraries over the years and if you had the original Arduino RA app installed, that would install an older version of the libraries. My suggestion is to stop/exit all the Arduino applications. Delete the libraries folder entirely and then download the latest dev branch of the libraries from the ReefAngel github page. Install those in the libraries folder and then re-run the Arduino app and try to compile everything.
Post Reply