Arduino_Apollo3 icon indicating copy to clipboard operation
Arduino_Apollo3 copied to clipboard

DA16200 and RingBuffer.h issue

Open ilucwl opened this issue 2 years ago • 7 comments

sandeepmistry provides a great DA16200-WiFi-Library-for-Arduino. In principle, this should work with the redboard Artemis, which I am using. it does not work though. I copy the error code below and which is basically the same no matter which of his examples I use. He kindly checked this and told me "there is a mis-configured include path and the compiler isn’t picking up RingBuffer.h. I suggest you raise an issue with the SparkFun team here: https://github.com/sparkfun/Arduino_Apollo3 - including detailed information on the compile error." I would be grateful for your advice. Iluc

Arduino: 1.8.19 (Mac OS X), Board: "RedBoard Artemis, 460800, SparkFun Variable Loader (Recommended)"

/private/var/folders/pm/jfqmn9xx6v1br34gsbdwzxv00000gn/T/AppTranslocation/277DEBE0-FB20-4A13-8CE0-AE0E949FB77E/d/Arduino.app/Contents/Java/arduino-builder -dump-prefs -logger=machine -hardware /private/var/folders/pm/jfqmn9xx6v1br34gsbdwzxv00000gn/T/AppTranslocation/277DEBE0-FB20-4A13-8CE0-AE0E949FB77E/d/Arduino.app/Contents/Java/hardware -hardware /Users/n.n/Library/Arduino15/packages -tools /private/var/folders/pm/jfqmn9xx6v1br34gsbdwzxv00000gn/T/AppTranslocation/277DEBE0-FB20-4A13-8CE0-AE0E949FB77E/d/Arduino.app/Contents/Java/tools-builder -tools /private/var/folders/pm/jfqmn9xx6v1br34gsbdwzxv00000gn/T/AppTranslocation/277DEBE0-FB20-4A13-8CE0-AE0E949FB77E/d/Arduino.app/Contents/Java/hardware/tools/avr -tools /Users/n.n/Library/Arduino15/packages -built-in-libraries /private/var/folders/pm/jfqmn9xx6v1br34gsbdwzxv00000gn/T/AppTranslocation/277DEBE0-FB20-4A13-8CE0-AE0E949FB77E/d/Arduino.app/Contents/Java/libraries -libraries /Users/n.n/Documents/Arduino/libraries -fqbn=SparkFun:apollo3:sfe_artemis:svl_baud=460800,loader=option_svl -vid-pid=0000_0000 -ide-version=10819 -build-path /var/folders/pm/jfqmn9xx6v1br34gsbdwzxv00000gn/T/arduino_build_509350 -warnings=default -build-cache /var/folders/pm/jfqmn9xx6v1br34gsbdwzxv00000gn/T/arduino_cache_654433 -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.arm-none-eabi-gcc.path=/Users/n.n/Library/Arduino15/packages/SparkFun/tools/arm-none-eabi-gcc/8-2018-q4-major -prefs=runtime.tools.arm-none-eabi-gcc-8-2018-q4-major.path=/Users/n.n/Library/Arduino15/packages/SparkFun/tools/arm-none-eabi-gcc/8-2018-q4-major -verbose /var/folders/pm/jfqmn9xx6v1br34gsbdwzxv00000gn/T/arduino_modified_sketch_556550/AP_SimpleWebServer.ino /private/var/folders/pm/jfqmn9xx6v1br34gsbdwzxv00000gn/T/AppTranslocation/277DEBE0-FB20-4A13-8CE0-AE0E949FB77E/d/Arduino.app/Contents/Java/arduino-builder -compile -logger=machine -hardware /private/var/folders/pm/jfqmn9xx6v1br34gsbdwzxv00000gn/T/AppTranslocation/277DEBE0-FB20-4A13-8CE0-AE0E949FB77E/d/Arduino.app/Contents/Java/hardware -hardware /Users/n.n/Library/Arduino15/packages -tools /private/var/folders/pm/jfqmn9xx6v1br34gsbdwzxv00000gn/T/AppTranslocation/277DEBE0-FB20-4A13-8CE0-AE0E949FB77E/d/Arduino.app/Contents/Java/tools-builder -tools /private/var/folders/pm/jfqmn9xx6v1br34gsbdwzxv00000gn/T/AppTranslocation/277DEBE0-FB20-4A13-8CE0-AE0E949FB77E/d/Arduino.app/Contents/Java/hardware/tools/avr -tools /Users/n.n/Library/Arduino15/packages -built-in-libraries /private/var/folders/pm/jfqmn9xx6v1br34gsbdwzxv00000gn/T/AppTranslocation/277DEBE0-FB20-4A13-8CE0-AE0E949FB77E/d/Arduino.app/Contents/Java/libraries -libraries /Users/n.n/Documents/Arduino/libraries -fqbn=SparkFun:apollo3:sfe_artemis:svl_baud=460800,loader=option_svl -vid-pid=0000_0000 -ide-version=10819 -build-path /var/folders/pm/jfqmn9xx6v1br34gsbdwzxv00000gn/T/arduino_build_509350 -warnings=default -build-cache /var/folders/pm/jfqmn9xx6v1br34gsbdwzxv00000gn/T/arduino_cache_654433 -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.arm-none-eabi-gcc.path=/Users/n.n/Library/Arduino15/packages/SparkFun/tools/arm-none-eabi-gcc/8-2018-q4-major -prefs=runtime.tools.arm-none-eabi-gcc-8-2018-q4-major.path=/Users/n.n/Library/Arduino15/packages/SparkFun/tools/arm-none-eabi-gcc/8-2018-q4-major -verbose /var/folders/pm/jfqmn9xx6v1br34gsbdwzxv00000gn/T/arduino_modified_sketch_556550/AP_SimpleWebServer.ino Using board 'sfe_artemis' from platform in folder: /Users/n.n/Library/Arduino15/packages/SparkFun/hardware/apollo3/2.2.0 Using core 'arduino' from platform in folder: /Users/n.n/Library/Arduino15/packages/SparkFun/hardware/apollo3/2.2.0 Detecting libraries used... /Users/n.n/Library/Arduino15/packages/SparkFun/tools/arm-none-eabi-gcc/8-2018-q4-major/bin/arm-none-eabi-g++ -include /Users/n.n/Library/Arduino15/packages/SparkFun/hardware/apollo3/2.2.0/variants/SFE_ARTEMIS/mbed/mbed_config.h -include /Users/n.n/Library/Arduino15/packages/SparkFun/hardware/apollo3/2.2.0/cores/arduino/sdk/ArduinoSDK.h -iprefix /Users/n.n/Library/Arduino15/packages/SparkFun/hardware/apollo3/2.2.0/cores/ @/Users/n.n/Library/Arduino15/packages/SparkFun/hardware/apollo3/2.2.0/variants/SFE_ARTEMIS/mbed/.cxx-flags -w -x c++ -E -CC -DARDUINO=10819 -DARDUINO_APOLLO3_SFE_ARTEMIS -DARDUINO_ARCH_MBED -DARDUINO_ARCH_APOLLO3 -DMBED_NO_GLOBAL_USING_DIRECTIVE -DCORDIO_ZERO_COPY_HCI @/Users/n.n/Library/Arduino15/packages/SparkFun/hardware/apollo3/2.2.0/variants/SFE_ARTEMIS/mbed/.cxx-symbols -I/Users/n.n/Library/Arduino15/packages/SparkFun/hardware/apollo3/2.2.0/cores/arduino -I/Users/n.n/Library/Arduino15/packages/SparkFun/hardware/apollo3/2.2.0/variants/SFE_ARTEMIS -I/Users/n.n/Library/Arduino15/packages/SparkFun/hardware/apollo3/2.2.0/cores/arduino -I/Users/n.n/Library/Arduino15/packages/SparkFun/hardware/apollo3/2.2.0/cores/arduino/mbed-bridge -I/Users/n.n/Library/Arduino15/packages/SparkFun/hardware/apollo3/2.2.0/cores/arduino/mbed-bridge/core-api -I/Users/n.n/Library/Arduino15/packages/SparkFun/hardware/apollo3/2.2.0/cores/arduino/mbed-bridge/core-api/api/deprecated @/Users/n.n/Library/Arduino15/packages/SparkFun/hardware/apollo3/2.2.0/variants/SFE_ARTEMIS/mbed/.includes /var/folders/pm/jfqmn9xx6v1br34gsbdwzxv00000gn/T/arduino_build_509350/sketch/AP_SimpleWebServer.ino.cpp -o /dev/null Alternatives for DA16200_WiFi.h: [[email protected]] ResolveLibrary(DA16200_WiFi.h) -> candidates: [[email protected]] /Users/n.n/Library/Arduino15/packages/SparkFun/tools/arm-none-eabi-gcc/8-2018-q4-major/bin/arm-none-eabi-g++ -include /Users/n.n/Library/Arduino15/packages/SparkFun/hardware/apollo3/2.2.0/variants/SFE_ARTEMIS/mbed/mbed_config.h -include /Users/n.n/Library/Arduino15/packages/SparkFun/hardware/apollo3/2.2.0/cores/arduino/sdk/ArduinoSDK.h -iprefix /Users/n.n/Library/Arduino15/packages/SparkFun/hardware/apollo3/2.2.0/cores/ @/Users/n.n/Library/Arduino15/packages/SparkFun/hardware/apollo3/2.2.0/variants/SFE_ARTEMIS/mbed/.cxx-flags -w -x c++ -E -CC -DARDUINO=10819 -DARDUINO_APOLLO3_SFE_ARTEMIS -DARDUINO_ARCH_MBED -DARDUINO_ARCH_APOLLO3 -DMBED_NO_GLOBAL_USING_DIRECTIVE -DCORDIO_ZERO_COPY_HCI @/Users/n.n/Library/Arduino15/packages/SparkFun/hardware/apollo3/2.2.0/variants/SFE_ARTEMIS/mbed/.cxx-symbols -I/Users/n.n/Library/Arduino15/packages/SparkFun/hardware/apollo3/2.2.0/cores/arduino -I/Users/n.n/Library/Arduino15/packages/SparkFun/hardware/apollo3/2.2.0/variants/SFE_ARTEMIS -I/Users/n.n/Documents/Arduino/libraries/DA16200_Wi-Fi_Library_for_Arduino/src -I/Users/n.n/Library/Arduino15/packages/SparkFun/hardware/apollo3/2.2.0/cores/arduino -I/Users/n.n/Library/Arduino15/packages/SparkFun/hardware/apollo3/2.2.0/cores/arduino/mbed-bridge -I/Users/n.n/Library/Arduino15/packages/SparkFun/hardware/apollo3/2.2.0/cores/arduino/mbed-bridge/core-api -I/Users/n.n/Library/Arduino15/packages/SparkFun/hardware/apollo3/2.2.0/cores/arduino/mbed-bridge/core-api/api/deprecated @/Users/n.n/Library/Arduino15/packages/SparkFun/hardware/apollo3/2.2.0/variants/SFE_ARTEMIS/mbed/.includes /var/folders/pm/jfqmn9xx6v1br34gsbdwzxv00000gn/T/arduino_build_509350/sketch/AP_SimpleWebServer.ino.cpp -o /dev/null Alternatives for RingBuffer.h: [] ResolveLibrary(RingBuffer.h) -> candidates: [] In file included from /Users/n.n/Documents/Arduino/libraries/DA16200_Wi-Fi_Library_for_Arduino/src/DA16200_WiFi.h:12, from /var/folders/pm/jfqmn9xx6v1br34gsbdwzxv00000gn/T/arduino_modified_sketch_556550/AP_SimpleWebServer.ino:24: /Users/n.n/Documents/Arduino/libraries/DA16200_Wi-Fi_Library_for_Arduino/src/WiFiClient.h:12:10: fatal error: RingBuffer.h: No such file or directory #include <RingBuffer.h> ^~~~~~~~~~~~~~ compilation terminated. Bibliothek DA16200_Wi-Fi_Library_for_Arduino in Version 1.0.0 im Ordner: /Users/n.n/Documents/Arduino/libraries/DA16200_Wi-Fi_Library_for_Arduino wird verwendet exit status 1 Fehler beim Kompilieren für das Board RedBoard Artemis.

ilucwl avatar Mar 31 '22 19:03 ilucwl

Hello, We just released v2.2.1 which should address this issue, can you let me know if its still a problem after updating?

Wenn0101 avatar Mar 31 '22 20:03 Wenn0101

Just tried this on 2.2.1, but that does not solve the issue. Actually, the DA16200_WiFi_library is only compatible with SAMD processor (and thus library structure). Hence it is not uncommon that it does not work on Artemis.

I am not sure it works, but in order to compile on Artemis, you have to make 2 changes in the library.

In WiFiClient.h (line 12) change :

#include <RingBuffer.h>

to

#include "core-api/api/RingBuffer.h"

In WiFi.cpp, at the top just below

#define WIFI_DEFAULT_TIMEOUT (30 * 1000) // 30 seconds

add

#define SERIAL_PORT_HARDWARE Serial1

so it looks like

#define WIFI_DEFAULT_TIMEOUT (30 * 1000) // 30 seconds
#define SERIAL_PORT_HARDWARE        Serial1

Now it will compile, but again.. not sure it works as it is only tested for SAMD. I assume you will let us know :-)

regards, Paul

paulvha avatar Apr 01 '22 08:04 paulvha

Dear Wenn0101 and Paul,

Much appreciation for your swift replies. First I updated to version 2.2.1. This led again to a compiler error, albeit a different one (annex A). Please note that I marked one line of warning with some ##### and provided a translation. This error code was in German and looks like machine translated. I did my best to translate it to English.

I then followed Paul's advice. It was compiled without error, only the above-mentioned warning message was included. The serial monitor, however, brought the bad news ... see annex B.

I seem to be unlucky or is there still a glimmer of hope? I really appreciate your looking into it.

Best,

Iluc annex B.txt annex A.txt

ilucwl avatar Apr 01 '22 20:04 ilucwl

German is not a problem for me (living in the Netherlands).

It will be hard to diagnose as I do not own an DA16200. Not sure you shared the complete output of the sketch in AnnexB. I would have expected some welcome messages.

Instead of flooding this github issue, drop me an email on [email protected]. Maybe we can debug it. Wenn010 1 can close it or leave it open to get the final results.

regards, Paul

paulvha avatar Apr 02 '22 08:04 paulvha

I can get myself some hardware to try it out myself. I should be able to try it out on monday or tuesday, if you all don't have it figured out already 😄

Wenn0101 avatar Apr 02 '22 09:04 Wenn0101

Some more info after looking more into the code:

  1. For some reason the Sparkfun Examples use SoftWareSerial, where the switch on the DA16200 needs to be set to SW. However in this case we use Serial1 and thus make sure the switch on the DA16200 is set to HW. Be aware that the Apollo3 V2.x.x. does not have SoftwareSerial by default as part of the library.

  2. The Power and Wakeup pins look incorrect. At the bottom in WiFi.cpp it states WiFiClass WiFi(SERIAL_PORT_HARDWARE, 5, 2); That would mean that PowerPin is pin 5 and Wakeup is pin 2.

However looking at the schematics and examples for the Sparkfun version that should be WiFiClass WiFi(SERIAL_PORT_HARDWARE, 4, 5); PowerPin being pin4 Wakeup pin being pin 5 This puzzles me a little. Which (other) board would use pin 5 and pin 2 ? Am I reading this wrong ?

  1. Also make sure that for each sketch the 'arduino_secrets.h' is filled with the right information about the SSD and password.

regards, Paul

paulvha avatar Apr 02 '22 16:04 paulvha

quick update. Due o time constraints for ilucwl we have not made good progress. All in looks to me now it fails with begin() or APbegin(). The aspect they have in common is that 'init()' is called and I suspect there some error. Also look to the previous post about the pin-confusion. illucwl expects to have more time by end of the month.

regards, Paul

paulvha avatar Apr 07 '22 13:04 paulvha