Coder Social home page Coder Social logo

arduino_sciencejournal's Introduction

Arduino_ScienceJournal Library for Arduino

Check Arduino status Compile Examples status Spell Check status

Firmware for the Physics Lab kit and the Arduino Nano 33 BLE Sense.

License

Copyright (c) 2020 Arduino SA. All rights reserved.

This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA

arduino_sciencejournal's People

Contributors

aentinger avatar cmaglie avatar dependabot[bot] avatar facchinm avatar jhansson-ard avatar manuelzomer avatar njh avatar per1234 avatar rocketct avatar sebromero avatar umbynos avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

arduino_sciencejournal's Issues

Unable to connect Nano 33 IoT to Arduino Science Journal App

The official reference (https://www.arduino.cc/reference/en/libraries/arduino_sciencejournal/) states that this library is compatible with the Arduino Nano 33 IoT - Board. As there is no example code provided, I tried to derivate it from the given firmware for the Arduino Nano 33 BLE Sense and came up with this "minimal" code, which I was able to compile and upload to a Nano IoT.

#include <ArduinoBLE.h>

const int VERSION = 0x00000001;

#define UUID(val) ("cfccb0fd-" val "-4da3-afaf-a4305a6b64b3")

#define DEBUG 1

BLEService service (UUID("0000"));
BLEUnsignedIntCharacteristic versionCharacteristic (UUID("0001"), BLERead);
BLEFloatCharacteristic testCharacteristic (UUID("0002"), BLENotify);

String name;
unsigned long lastNotify = 0;

void printSerialMsg(const char * msg) {
  #ifdef DEBUG
  if (Serial) {
    Serial.println(msg);
  }
  #endif
}

void updateSubscribedCharacteristics() {
    if (testCharacteristic.subscribed()) {
    float test = 3.141;
    testCharacteristic.writeValue(test);
  }
}

void setup() {
  #ifdef DEBUG
  Serial.begin(9600);
  while (!Serial);
  Serial.println("Started");
  #endif

  delay(5000);

  if (!BLE.begin()) {
    printSerialMsg("Failed to initialized BLE!");
  }

  String address = BLE.address();
  #ifdef DEBUG
  if (Serial) {
    Serial.print("address = ");
    Serial.println(address);
  }
  #endif
  address.toUpperCase();

  name = "Nano IoT - ";
  name += address[address.length() - 5];
  name += address[address.length() - 4];
  name += address[address.length() - 2];
  name += address[address.length() - 1];

  #ifdef DEBUG
  if (Serial) {
    Serial.print("name = ");
    Serial.println(name);
  }
  #endif

  BLE.setLocalName(name.c_str());
  BLE.setDeviceName(name.c_str());
  BLE.setAdvertisedService(service);

  service.addCharacteristic(versionCharacteristic);
  service.addCharacteristic(testCharacteristic);

  versionCharacteristic.setValue(VERSION);

  BLE.addService(service);
  BLE.advertise();

  digitalWrite(LED_BUILTIN, HIGH);
}

void loop() {
  while (BLE.connected()) {
    unsigned long now = millis();
    if (abs((long) now - (long) lastNotify) >= 100) {
      updateSubscribedCharacteristics();
      lastNotify = now;
    }
  }
}

After compiling and uploading this, I was able to see the advertised services in a BLE scanner (used LightBlue) and could see the Nano IoT as a connected device in my settings.

IMG_2136
IMG_2137

As a consequence, i would have expected the Nano IoT and the testCharacteristic to be listed as sensor in the App, but neither the device nor the characteristic is shown. I have been using the latest version of this library and of the ArduinoBLE library as well. The device used is an iPhone 5s and the latest version of the Arduino Science Journal App is installed.

I was not able to find any documentation on how a service has to be structured such that the App accepts it as a sensor. As you are providing this library for connecting Arduino devices to the App, i´m placing this issue here but if you think it would be more appropiate in the App-repository, feel free to transfer it.

Science Kit UUID128 does not share the same base

HI,

Thank you for the awesome app, though It is a bit odd that service and characteristics used by Science Kit UUID does't share the same UUID base

#define SCIENCE_KIT_UUID(val) ("555a0002-" val "-467a-9538-01f0652c74e8")

To share the same uuid128 base it should look like

#define SCIENCE_KIT_UUID(val) ("555a" val "0000-467a-9538-01f0652c74e8")

Sorry if uuid is deigned this way on the purpose. If it is the case feel free to close this issue.

PhysicsLabFirmware.ino uses Adafruit_LSM9DS1.h

Error compiling for MKR WiFi 1010:

Arduino: 1.8.15 (Mac OS X), Board: "Arduino MKR WiFi 1010"

/Applications/Arduino.app/Contents/Java/arduino-builder -dump-prefs -logger=machine -hardware /Applications/Arduino.app/Contents/Java/hardware -hardware /Users/sebastian/Library/Arduino15/packages -tools /Applications/Arduino.app/Contents/Java/tools-builder -tools /Applications/Arduino.app/Contents/Java/hardware/tools/avr -tools /Users/sebastian/Library/Arduino15/packages -built-in-libraries /Applications/Arduino.app/Contents/Java/libraries -libraries /Users/sebastian/Documents/Arduino.clean/libraries -fqbn=arduino:samd:mkrwifi1010 -vid-pid=2341_804E -ide-version=10815 -build-path /var/folders/j_/rzs8rvxs13q0b2cdp_dfyzsr0000gn/T/arduino_build_769369 -warnings=none -build-cache /var/folders/j_/rzs8rvxs13q0b2cdp_dfyzsr0000gn/T/arduino_cache_958155 -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.CMSIS.path=/Users/sebastian/Library/Arduino15/packages/arduino/tools/CMSIS/4.5.0 -prefs=runtime.tools.CMSIS-4.5.0.path=/Users/sebastian/Library/Arduino15/packages/arduino/tools/CMSIS/4.5.0 -prefs=runtime.tools.CMSIS-Atmel.path=/Users/sebastian/Library/Arduino15/packages/arduino/tools/CMSIS-Atmel/1.2.0 -prefs=runtime.tools.CMSIS-Atmel-1.2.0.path=/Users/sebastian/Library/Arduino15/packages/arduino/tools/CMSIS-Atmel/1.2.0 -prefs=runtime.tools.arm-none-eabi-gcc.path=/Users/sebastian/Library/Arduino15/packages/arduino/tools/arm-none-eabi-gcc/7-2017q4 -prefs=runtime.tools.arm-none-eabi-gcc-7-2017q4.path=/Users/sebastian/Library/Arduino15/packages/arduino/tools/arm-none-eabi-gcc/7-2017q4 -prefs=runtime.tools.openocd.path=/Users/sebastian/Library/Arduino15/packages/arduino/tools/openocd/0.10.0-arduino7 -prefs=runtime.tools.openocd-0.10.0-arduino7.path=/Users/sebastian/Library/Arduino15/packages/arduino/tools/openocd/0.10.0-arduino7 -prefs=runtime.tools.bossac.path=/Users/sebastian/Library/Arduino15/packages/arduino/tools/bossac/1.7.0-arduino3 -prefs=runtime.tools.bossac-1.7.0-arduino3.path=/Users/sebastian/Library/Arduino15/packages/arduino/tools/bossac/1.7.0-arduino3 -prefs=runtime.tools.arduinoOTA.path=/Users/sebastian/Library/Arduino15/packages/arduino/tools/arduinoOTA/1.2.1 -prefs=runtime.tools.arduinoOTA-1.2.1.path=/Users/sebastian/Library/Arduino15/packages/arduino/tools/arduinoOTA/1.2.1 -verbose /Users/sebastian/Documents/Arduino.clean/libraries/Arduino_ScienceJournal/examples/PhysicsLabFirmware/PhysicsLabFirmware.ino
/Applications/Arduino.app/Contents/Java/arduino-builder -compile -logger=machine -hardware /Applications/Arduino.app/Contents/Java/hardware -hardware /Users/sebastian/Library/Arduino15/packages -tools /Applications/Arduino.app/Contents/Java/tools-builder -tools /Applications/Arduino.app/Contents/Java/hardware/tools/avr -tools /Users/sebastian/Library/Arduino15/packages -built-in-libraries /Applications/Arduino.app/Contents/Java/libraries -libraries /Users/sebastian/Documents/Arduino.clean/libraries -fqbn=arduino:samd:mkrwifi1010 -vid-pid=2341_804E -ide-version=10815 -build-path /var/folders/j_/rzs8rvxs13q0b2cdp_dfyzsr0000gn/T/arduino_build_769369 -warnings=none -build-cache /var/folders/j_/rzs8rvxs13q0b2cdp_dfyzsr0000gn/T/arduino_cache_958155 -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.CMSIS.path=/Users/sebastian/Library/Arduino15/packages/arduino/tools/CMSIS/4.5.0 -prefs=runtime.tools.CMSIS-4.5.0.path=/Users/sebastian/Library/Arduino15/packages/arduino/tools/CMSIS/4.5.0 -prefs=runtime.tools.CMSIS-Atmel.path=/Users/sebastian/Library/Arduino15/packages/arduino/tools/CMSIS-Atmel/1.2.0 -prefs=runtime.tools.CMSIS-Atmel-1.2.0.path=/Users/sebastian/Library/Arduino15/packages/arduino/tools/CMSIS-Atmel/1.2.0 -prefs=runtime.tools.arm-none-eabi-gcc.path=/Users/sebastian/Library/Arduino15/packages/arduino/tools/arm-none-eabi-gcc/7-2017q4 -prefs=runtime.tools.arm-none-eabi-gcc-7-2017q4.path=/Users/sebastian/Library/Arduino15/packages/arduino/tools/arm-none-eabi-gcc/7-2017q4 -prefs=runtime.tools.openocd.path=/Users/sebastian/Library/Arduino15/packages/arduino/tools/openocd/0.10.0-arduino7 -prefs=runtime.tools.openocd-0.10.0-arduino7.path=/Users/sebastian/Library/Arduino15/packages/arduino/tools/openocd/0.10.0-arduino7 -prefs=runtime.tools.bossac.path=/Users/sebastian/Library/Arduino15/packages/arduino/tools/bossac/1.7.0-arduino3 -prefs=runtime.tools.bossac-1.7.0-arduino3.path=/Users/sebastian/Library/Arduino15/packages/arduino/tools/bossac/1.7.0-arduino3 -prefs=runtime.tools.arduinoOTA.path=/Users/sebastian/Library/Arduino15/packages/arduino/tools/arduinoOTA/1.2.1 -prefs=runtime.tools.arduinoOTA-1.2.1.path=/Users/sebastian/Library/Arduino15/packages/arduino/tools/arduinoOTA/1.2.1 -verbose /Users/sebastian/Documents/Arduino.clean/libraries/Arduino_ScienceJournal/examples/PhysicsLabFirmware/PhysicsLabFirmware.ino
Using board 'mkrwifi1010' from platform in folder: /Users/sebastian/Library/Arduino15/packages/arduino/hardware/samd/1.8.11
Using core 'arduino' from platform in folder: /Users/sebastian/Library/Arduino15/packages/arduino/hardware/samd/1.8.11
Detecting libraries used...
/Users/sebastian/Library/Arduino15/packages/arduino/tools/arm-none-eabi-gcc/7-2017q4/bin/arm-none-eabi-g++ -mcpu=cortex-m0plus -mthumb -c -g -Os -w -std=gnu++11 -ffunction-sections -fdata-sections -fno-threadsafe-statics -nostdlib --param max-inline-insns-single=500 -fno-rtti -fno-exceptions -w -x c++ -E -CC -DF_CPU=48000000L -DARDUINO=10815 -DARDUINO_SAMD_MKRWIFI1010 -DARDUINO_ARCH_SAMD -DUSE_ARDUINO_MKR_PIN_LAYOUT -D__SAMD21G18A__ -DUSB_VID=0x2341 -DUSB_PID=0x8054 -DUSBCON "-DUSB_MANUFACTURER=\"Arduino LLC\"" "-DUSB_PRODUCT=\"Arduino MKR WiFi 1010\"" -DUSE_BQ24195L_PMIC -I/Users/sebastian/Library/Arduino15/packages/arduino/tools/CMSIS/4.5.0/CMSIS/Include/ -I/Users/sebastian/Library/Arduino15/packages/arduino/tools/CMSIS-Atmel/1.2.0/CMSIS/Device/ATMEL/ -I/Users/sebastian/Library/Arduino15/packages/arduino/hardware/samd/1.8.11/cores/arduino/api/deprecated -I/Users/sebastian/Library/Arduino15/packages/arduino/hardware/samd/1.8.11/cores/arduino/api/deprecated-avr-comp -I/Users/sebastian/Library/Arduino15/packages/arduino/hardware/samd/1.8.11/cores/arduino -I/Users/sebastian/Library/Arduino15/packages/arduino/hardware/samd/1.8.11/variants/mkrwifi1010 /var/folders/j_/rzs8rvxs13q0b2cdp_dfyzsr0000gn/T/arduino_build_769369/sketch/PhysicsLabFirmware.ino.cpp -o /dev/null
Alternatives for ArduinoBLE.h: [[email protected]]
ResolveLibrary(ArduinoBLE.h)
  -> candidates: [[email protected]]
/Users/sebastian/Library/Arduino15/packages/arduino/tools/arm-none-eabi-gcc/7-2017q4/bin/arm-none-eabi-g++ -mcpu=cortex-m0plus -mthumb -c -g -Os -w -std=gnu++11 -ffunction-sections -fdata-sections -fno-threadsafe-statics -nostdlib --param max-inline-insns-single=500 -fno-rtti -fno-exceptions -w -x c++ -E -CC -DF_CPU=48000000L -DARDUINO=10815 -DARDUINO_SAMD_MKRWIFI1010 -DARDUINO_ARCH_SAMD -DUSE_ARDUINO_MKR_PIN_LAYOUT -D__SAMD21G18A__ -DUSB_VID=0x2341 -DUSB_PID=0x8054 -DUSBCON "-DUSB_MANUFACTURER=\"Arduino LLC\"" "-DUSB_PRODUCT=\"Arduino MKR WiFi 1010\"" -DUSE_BQ24195L_PMIC -I/Users/sebastian/Library/Arduino15/packages/arduino/tools/CMSIS/4.5.0/CMSIS/Include/ -I/Users/sebastian/Library/Arduino15/packages/arduino/tools/CMSIS-Atmel/1.2.0/CMSIS/Device/ATMEL/ -I/Users/sebastian/Library/Arduino15/packages/arduino/hardware/samd/1.8.11/cores/arduino/api/deprecated -I/Users/sebastian/Library/Arduino15/packages/arduino/hardware/samd/1.8.11/cores/arduino/api/deprecated-avr-comp -I/Users/sebastian/Library/Arduino15/packages/arduino/hardware/samd/1.8.11/cores/arduino -I/Users/sebastian/Library/Arduino15/packages/arduino/hardware/samd/1.8.11/variants/mkrwifi1010 -I/Users/sebastian/Documents/Arduino.clean/libraries/ArduinoBLE/src /var/folders/j_/rzs8rvxs13q0b2cdp_dfyzsr0000gn/T/arduino_build_769369/sketch/PhysicsLabFirmware.ino.cpp -o /dev/null
Alternatives for Adafruit_LSM9DS1.h: []
ResolveLibrary(Adafruit_LSM9DS1.h)PhysicsLabFirmware:21:10: fatal error: Adafruit_LSM9DS1.h: No such file or directory

  -> candidates: []
 #include <Adafruit_LSM9DS1.h> // click here to install the library: http://librarymanager#Adafruit&LSM9DS1
          ^~~~~~~~~~~~~~~~~~~~
compilation terminated.
Using library ArduinoBLE at version 1.2.1 in folder: /Users/sebastian/Documents/Arduino.clean/libraries/ArduinoBLE 
exit status 1
Adafruit_LSM9DS1.h: No such file or directory

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.