Trying to compile hackeeg firmware uses json base64 due sam... board

Trying to compile hackeeg firmware uses json base64 due sam... board

I am using the ide before 2 because im running windows 8 but getting a usb stick today to dual boot to ubuntu also maby the os makes a difference with the json...? i dont know.

But I get errors compiling. I am running windows 8 and will try ubuntu.
the code
[GitHub - starcat-io/hackeeg-driver-arduino: Arduino driver software for the HackEEG shield for the TI ADS1299 EEG system-on-a-chip](https://hackeeg firmware github)
the line
JsonVariant command_name_variant = command_object.getMember(COMMAND_KEY);
the error


Arduino: 1.8.19 (Windows 8.1), Board: "Arduino Due (Native USB Port)"





















C:\Users\User\Desktop\hackeeg-driver-arduino-main\hackeeg_driver\JsonCommand.cpp: In member function 'void JsonCommand::readSerial()':

JsonCommand.cpp:128:63: error: 'class ArduinoJson::V704PB2::JsonObject' has no member named 'getMember'

             JsonVariant command_name_variant = command_object.getMember(COMMAND_KEY);

                                                               ^

JsonCommand.cpp:147:59: error: 'class ArduinoJson::V704PB2::StaticJsonDocument<1024u>' has no member named 'getMember'

             JsonVariant parameters_variant = json_command.getMember(PARAMETERS_KEY);

                                                           ^

In file included from C:\Users\User\Documents\Arduino\libraries\ArduinoJson\src/ArduinoJson.hpp:42:0,

                 from C:\Users\User\Documents\Arduino\libraries\ArduinoJson\src/ArduinoJson.h:9,

                 from C:\Users\User\Desktop\hackeeg-driver-arduino-main\hackeeg_driver\hackeeg_driver.ino:24:

C:\Users\User\Documents\Arduino\libraries\ArduinoJson\src/ArduinoJson/Variant/ConverterImpl.hpp: In instantiation of 'struct ArduinoJson::V704PB2::Converter<char, void>':

C:\Users\User\Documents\Arduino\libraries\ArduinoJson\src/ArduinoJson/Variant/VariantRefBaseImpl.hpp:136:78:   required from 'bool ArduinoJson::V704PB2::detail::VariantRefBase<TDerived>::set(const T&) const [with T = char; TDerived = ArduinoJson::V704PB2::detail::MemberProxy<ArduinoJson::V704PB2::JsonObject, const char*>]'

C:\Users\User\Documents\Arduino\libraries\ArduinoJson\src/ArduinoJson/Object/MemberProxy.hpp:33:5:   required from 'ArduinoJson::V704PB2::detail::MemberProxy< <template-parameter-1-1>, <template-parameter-1-2> >& ArduinoJson::V704PB2::detail::MemberProxy< <template-parameter-1-1>, <template-parameter-1-2> >::operator=(const T&) [with T = char; TUpstream = ArduinoJson::V704PB2::JsonObject; TStringRef = const char*]'

C:\Users\User\Desktop\hackeeg-driver-arduino-main\hackeeg_driver\hackeeg_driver.ino:278:20:   required from here

C:\Users\User\Documents\Arduino\libraries\ArduinoJson\src/ArduinoJson/Variant/ConverterImpl.hpp:24:3: error: static assertion failed: type 'char' is not supported, use 'signed char', 'unsigned char' or another integer type instead

   static_assert(!detail::is_same<T, char>::value,

   ^

exit status 1

'class ArduinoJson::V704PB2::JsonObject' has no member named 'getMember'



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

Hi @josheeg. It seems that recent changes made to the "ArduinoJson" library made it incompatible with the sketch. I found that it will compile if you use an older version of the library.

I'll provide instructions you can follow to install the compatible version of the library:

  1. Select Sketch > Include Library > Manage Libraries... from the Arduino IDE menus to open the "Library Manager" view in the left side panel.
  2. Type ArduinoJson in the "Filter your search..." field.
  3. Scroll down through the list of libraries until you see the "ArduinoJson" entry.
  4. You will see a drop-down version menu at the bottom of the entry. Select "6.19.4" from the menu.
  5. Click the "INSTALL" button at the bottom of the entry.
  6. Wait for the installation process to finish, as indicated by a notification at the bottom right corner of the Arduino IDE window:

    ⓘ Successfully installed library ...

Arduino IDE will periodically display a notification that offers to update the library for you:

Updates are available for some of your libraries.

If you click the "INSTALL MANUALLY" button in the notification, a list of each of the libraries that have available updates will be shown in the Arduino IDE Library Manager. It is generally a good idea to keep your libraries updated since the updates might provide important enhancements or bug fixes. So you should look through the list and update other libraries if appropriate, but you should avoid accepting the update for the "ArduinoJson" library.

1 Like

It compiled now I can work on the hackeeg and BioSignals github designs in kicad 8...

how did you find that out?

The most likely alternative cause of a "class ... has no member named ..." error would probably be a misspelling of the member name in the reference. Since the member name appeared to be correctly spelled, and since that would also imply that the author of the sketch didn't do even the most basic validation (which does happen far too often in the Arduino ecosystem, but seemed less likely in this particular case), I took an educated guess that the cause of the error was a change in the "ArduinoJson" library's API since the time the sketch was written. After that, it was a simple matter of trial and error to find the version of the library that was compatible:

  1. Use Library Manager to install a version of the library.
  2. Compile the sketch.
  3. If the compilation failed, go back to step (1).

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