mcci-catena / catena-sketches Goto Github PK
View Code? Open in Web Editor NEWTop-level Arduino sketches for the MCCI Catena family of IoT LPWA Devices
License: MIT License
Top-level Arduino sketches for the MCCI Catena family of IoT LPWA Devices
License: MIT License
git-boot.sh
expects the input file to give fully-qualified strings that are to be used as "urls" for git clone
. However, sometimes one wants to use git/ssh access (for development) and other times one wants to use https (when just installing read-only).
To fix this:
github.com
, gitlab.com
, etc.); the second field is the path to the repository.-g
option to select use of git/ssh (as opposed to the default https) access method for repos specified using "two-part" form.Clean up some typos related to provisioning.
Every sketch needs a README.md explaining (at a minimum):
I just uploaded a successfully compiled catena461x_test01 sketch and after it said upload done the Catena 4612 dismounted from USB and then never came back. The red light on the unit is blinking pretty fast. any thoughts on how to get it back?
The node-red decoder for format 0x15 is incomplete, and if cut/paste naively will simply not work.
Although each use is different, the example should be correct.
Per the documentation ukaze, we need to pull the info out of here that is not specific to the 4450, and put it someplace central. Then this readme will follow the pattern.
Every sketch needs a README.md explaining (at a minimum):
Every sketch needs a README.md explaining (at a minimum):
Our first tester cloned arduino-lmic as "arduino-lmic-master", and this revealed that there are links internally to the source tree that require that the libraries have expected names. We need to document this requirement.
It got cold enough to discover that soil and water temperatures below 0 Celsius result in errors; we didn't handle negative values.
See #38. The output of Si1133 white data, though possibly useful, is not apparently Lux; it's W/m^2. So we need a different data format.
When doing mfg test, we really want the periodic output to highlight missing measurements from the onewire and soil sensors.
Every sketch needs a README.md explaining (at a minimum):
Every sketch needs a README.md explaining (at a minimum):
Tested the Catena4551_test01 Sketch, Lux sensor output is not coming.
Every sketch needs a README.md explaining (at a minimum):
While build the Catena4450m101_Sensor faced some minor issues. Listed it below.
Arduino: 1.8.2 (Windows 7), Board: "Adafruit Feather M0"
C:\Users\velmurugan\Documents\Arduino\libraries\Catena4410-Arduino-Library\src\lib\Catena4410_gk_lorawan_keys.cpp:120:90: fatal error: ../../../catena-lorawan-provisioning/extra/gk_lorawan_keys.project.cpp: No such file or directory
#include "../../../catena-lorawan-provisioning/extra/gk_lorawan_keys.project.cpp"
^
compilation terminated.`
My changes:
Looks like these are needed for 4410 not for 4450.
So, I Remove/rename Catena4420_gk_lorawan_keys.cpp and Catena4410_gk_lorawan_keys.cpp.
To prevent it from compiling. (I know, There is some better way to do that).
From @svelmurugan92:
adjust_millis_forward function not declared.
Issue :
Arduino: 1.8.2 (Windows 7), Board: "Adafruit Feather M0"
E:\ThingsNetwork\Things-Network-Chennai\source\MCCI Catena\Catena4410-Sketches-master (1)\Catena4410-Sketches-master\catena4450m101_sensor\catena4450m101_sensor.ino: In function 'void settleDoneCb(osjob_t*)':
catena4450m101_sensor:551: error: 'adjust_millis_forward' was not declared in this scope
adjust_millis_forward(CATCFG_T_INTERVAL * 1000);
^
exit status 1
adjust_millis_forward' was not declared in this scope
My changes:
I think, Code not able to link proper delay.h file.
So, I copied the adjust_millis_forward function definition before the function call.
I took adjust_millis_forward function definition from file C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino\delay.c
It's missing a using namespace McciCatena;
statement. (We need CI.)
Provisioning is done in one of two ways:
In this case, the programmer decides once and for all how a given CPU is going to be used. This is efficient but inflexible, and doesn't scale well, because all CPUs must be mentioned in a table. Still, for small projects this may be appropriate.
MCCI-Catena4410-Arduino-Library/src/lib/gk_WellKnownCpuBindings.cpp
. This also defines the base platform to be used for this CPU.catena-lorawan-provisioning/extra/gk_lorawan_keys.project.cpp
.If your platform contains a compatible FRAM chip (see, for example, the MCCI Catena 4450), you can dynamically provision your device using USB commands. There are two parts: setting up the FRAM so that the platform is correct, and setting up LoRaWAN.
USB provisioning commands are entered in the box at the top of the Arduino terminal. They can also be entered using any standard terminal program (e.g., TeraTerm). Commands are not echoed. Command lines may be terminated with carriage return or line feed.
The command parser will reply with one or more lines of text, separated by newline (line-feed) characters. The last line will either be "OK" (indicating success) or ?
followed by an error code (for failure). If you get no response, you should assume that the command has not been executed.
The echo
command can be used to check that the command parser is functioning. If you enter the command echo hello world
, the program should display:
hello world
OK
Note: your terminal program might display something like:
hello world
OK
In this case, you should adjust the terminal program settings so that it displays "linefeed" as "cr-lf" or "newline".
If you're using a Feather M0 LoRa with added FRAM, use the sketch Catena4450m101_sensor1 to get started. Download it, and boot. The debug print will complain about not being configured. Don't worry yet.
system configure syseui
yoursyseui
system configure operatingflags 0
system configure operatingflags 1
system configure platformguid 82BF2661-70CB-45AE-B620-CAF695478BC1
system configure platformguid 2281255E-AC5C-48CB-A263-9DC890D16638
Once the platform is set up, you don't have to change it unless you complete reset the FRAM contents.
This provisioning should be repeated whenever the network keys change. Both OTAA and ABP configuration are possible, however, we strongly recommend OTAA, and we leave application of ABP to the interested user.
lorawan configure deveui
thisDevEUI
thisDevEUI
to the value determined in step 1.)lorawan configure appeui
myAppEUI
myAppEUI
to the value determined in step 1.)lorawan configure appkey
thisAppKey
thisAppKey
to the value determined in step 1.) Very important: don't use the same AppKey value for multiple devices, or you'll compromise the security of your device!lorawan configure join 1
Reprovisioning is the same as provisioning, but you should add teh following commands to make sure all prior state is reset:
lorawan configure nwkskey 0
lorawan configure appskey 0
lorawan configure devaddr 0
lorawan configure netid 0
Then continue with provisioning as given above.
The instructions currently don't mention that you need to have an Arduino library named catena-lorawan-provisioning
, with files catena-lorawan-provisioning/gk_lorawan_keys.project.cpp
and catena-lorawan-provisioning/gk_lorawan_keys.4420.cpp
. Only one file is used, depending on whether your project uses class object derived from Catena4410 or from Catena4420. There are two problems:
Consider providing a repo that can be downloaded and configured using a bash script.
The README.md need to be updated to conform to the documentation ukaze.
Every sketch needs a README.md explaining (at a minimum):
Every sketch needs a README.md explaining (at a minimum):
In the catena4450m102_waterlevel sketch, you refer to an RC601 water pressure transducer, which uses an I2C interface.
Do you have a link to this device, or a datasheet? I can't find a reference to it anywhere on the web.
I am using this bluerobotics bar02 sensor but it's quite expensive (although it is super accurate, and low power).
Always looking for alternatives!
Need a guide that guides the developer if things aren't working:
Specifically for the Catena 4410 or Adafruit Feather M0 LoRa:
catena-lorawan-provisioning/gk_lorawan_keys.project.cpp
.MCCI-Catena4410-Arduino-Library/src/lib/gk_WellKnownCpuBindings.cpp
MCCI-Catena4410-Arduino-Library/src/lib/gk_WellKnownCpuBindings.cpp
if you're going to run from battery, as it's much easier to debug.These have diverged. Please converge them.
Russ Nelson had the following suggestions after setting up a 4450 recently.
- Split out the TTN configuration information into a separate page. It's too long for a "Note".
- Also add the note about "If you're in the US, use the us-west handler".
- Changing registration should be a note.
- In place of Changing registration, you should explain what the various blinks mean, and point people to the console.
- Tell them to add the Data Storage Integration, and the Payload Decoder.
- Then tell them to look at the Devices/Data page to see the data coming from their 4450, and that they should expect to see Activation once a minute until it succeeds, and then sensor data every six minutes
You are using this non-standard function in your code, but it's NOT in your libraries??? Nor is it documented in your getting started pages...
where can it be found?? is it from Paul's Stoffregen Teensyduino code base??
Thanks
Experimentation shows that this saves more power compared to the AHB sleep, but you have to detach USB.
In doing Travis, I discovered that catena4450m101_sensor won't build with the stm32 BSP. This is because we haven't fixed the code to be portable. We have fixed the code in catena4450m101_pond. Can we please make the corresponding changes in _sensor, so that we can use the same apps on the newer boards? I think it's probably pretty easy. Once you do that, when I commit changes for #47, everything will build.
The Catena 4612_simple sketch interprets TX error as "not provisioned", and wedges itself. This is not correct; it should check provisioning status, and only stop the LMIC if the LMIC thinks it's not provisioned.
This is set up here:
Catena-Sketches/catena4551_test01/catena4551_test01.ino
Lines 267 to 269 in b67901b
This means that the first entry is "small IR". We don't want small IR as the LUX reading, we want "white" as the Lux reading.
And, in fact, this "lux sensor" is not a lux sensor, it is a W/m^2 sensor. Lux needs to be compensated for frequency. It's possible that the SI1133 does this, but it's not obvious from the datasheet. See http://www.physlink.com/Education/AskExperts/ae409.cfm for more info.
First change is to transmit element [1]
rather than [0]
. Second is to possibly linearize, and third is to possibly change to a proper Lux sensor .
In any case, it is a big error to transmit this with the same data format as Rohm light output, because the engineering units are not commensurate. See #39.
Every sketch needs a README.md explaining (at a minimum):
Bosch has updated the library for BSEC and the latest version is v1.4.7.2.
Sketch catena4460_bsec_ulp.ino has been written based on BSEC software v1.4.6.0, so the sketch has to be updated to work with BSEC v1.4.7.2. Please find the code part need to be updated below:
Catena-Sketches/catena4460_bsec_ulp/catena4460_bsec_ulp.ino
Lines 318 to 327 in 01c3a84
Here in the sensor list, Bosch have changed output (virtual) sensor BSEC_OUTPUT_IAQ_ESTIMATE
to BSEC_OUTPUT_IAQ
in their library bsec_datatypes.h under "BSEC_1.4.7.2_Generic_Release_20190122\Arduino\BSEC\src\inc". Also they have added three other output (virtual) sensors in their library:
BSEC_OUTPUT_STATIC_IAQ = 2, /*!< Unscaled indoor-air-quality estimate */
BSEC_OUTPUT_CO2_EQUIVALENT = 3, /*!< co2 equivalent estimate [ppm] */
BSEC_OUTPUT_BREATH_VOC_EQUIVALENT = 4, /*!< breath VOC concentration estimate [ppm] */
Link for BSEC software: https://www.bosch-sensortec.com/bst/products/all_products/bsec#
Arduino: 1.8.8 (Mac OS X), Board: "MCCI Catena 4450, North America 915 MHz"
catena4450m101_sensor:85:45: error: 'void txFailedDoneCb(osjob_t*)' was declared 'extern' and later 'static' [-fpermissive]
static void txFailedDoneCb(osjob_t *pSendJob);
^
catena4450m101_sensor:599:6: error: previous declaration of 'void txFailedDoneCb(osjob_t*)' [-fpermissive]
^
catena4450m101_sensor:87:40: error: 'void sendBufferDoneCb(void*, bool)' was declared 'extern' and later 'static' [-fpermissive]
static Arduino_LoRaWAN::SendBufferCbFn sendBufferDoneCb;
^
catena4450m101_sensor:574:6: error: previous declaration of 'void sendBufferDoneCb(void*, bool)' [-fpermissive]
^
exit status 1
'void txFailedDoneCb(osjob_t*)' was declared 'extern' and later 'static' [-fpermissive]
This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.
Every sketch needs a README.md explaining (at a minimum):
Every sketch needs a README.md explaining (at a minimum):
Every sketch needs a README.md explaining (at a minimum):
It's a bit tricky to update the Adafruit BSP with the required sleep-mode changes. Please document.
% cd {somewhere}/arduino15/packages/adafruit/hardware/samd/1.0.13
% git remote add mcci https://github.com/mcci-catena/ArduinoCore-samd.git
% git pull mcci
A downlink message on port 1 shall set the sample rate.
The data format is:
bytes 0..1: uint16_t
, big-endian. This sets the reporting rate, in seconds.
byte 2 (optional): uint8_t
: this sets how long the rate setting should persist, in reports. If not present, the default is used (15 reports). If present and zero, the setting persists until the next boot or until a new setting is downloaded. If present and non-zero, the setting persists for that number of reports.
Update the README.md to add required info. The info that's there is mostly fine.
Every sketch needs a README.md explaining (at a minimum):
See mcci-catena/Catena-Arduino-Platform#24 -- the sketches here, and the following material, need to be incorporated into the Arduino platform.
The text from issue #4 -- some of that is now (551b769) in https://github.com/mcci-catena/Catena-Sketches/blob/master/catena4450m101_sensor/README.md, but a paragraph-by-paragraph review is needed.
https://github.com/mcci-catena/Catena-Sketches/blob/master/catena4450m101_sensor/README.md
https://github.com/mcci-catena/Catena-Sketches/blob/master/README.md
Issue #19 (fixes)
Every sketch needs a README.md explaining (at a minimum):
The apps were using the BH1750 in continuous mode. This wastes power.
Every sketch needs a README.md explaining (at a minimum):
Even though the Catena4450 uses a Rohm Lux sensor, the code still #includes
the header file for the TSL2561 Lux sensor. This is a problem because git-boot.sh
doesn't download the relevant library.
Please delete the reference.
git-boot.sh
silently proceeds if any library in the Arduino/libraries folder conflicts with a library specified in git-repos.dat
. It will appear to succeed, but it will leave the old library unchanged. This causes no end of user confusion.
It's not clear what the tool should do, other than failing. The Arduino environment doesn't support side-by-side installs of different library versions for different sketches. Perhaps the suggestion would be similar to what I tell people when helping them get started: move any conflicting library to a new directory Arduino/libraries.hide
. It feels like there's something too-clever-by-half that we could do with symbolic links on Linux and macOS. But that's still not a first-class Windows feature.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.