GithubHelp home page GithubHelp logo

mikenz / feather_m0_lora Goto Github PK

View Code? Open in Web Editor NEW
26.0 26.0 9.0 853 KB

Example Arduino code of using an Adafruit Feather M0 LoRa module to send sensor data.

License: MIT License

Arduino 96.20% C 3.80%

feather_m0_lora's People

Stargazers

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

Watchers

 avatar  avatar  avatar  avatar  avatar

feather_m0_lora's Issues

How can I use with a Feather MO Adalogger and a Radio Featherwing

Good day,

I can make working the library with a Adafruit MO Lora
I configured my pin as the following

lmic_pinmap pins = {
  .nss = 8,			// Connected to pin D10
  .rxen = 0, 			// Needed for NiceRF Lora1276. Not needed for RFM92/RFM95
  .txen = 0, 			// Needed for NiceRF Lora1276. Not needed for RFM92/RFM95
  .rst = 4,  			// Needed on RFM92/RFM95? (probably not)
  .dio = {3, 5, 6},		// Specify pin numbers for DIO0, 1, 2
						// connected to D4, D5, D7
};

I would like now to use a Adafruit MO adaloger with a Radio Featherwing but I do not how and what on my above configuration

Adafruit provide a How To with this configuration

The poblem, it's not the same as my above configuration

I suppose but not sure, I should configure as the following for a Feather MO adalogger with a featherwing

lmic_pinmap pins = {
  .nss = 10,			// Connected to pin D10
  .rxen = 0, 			// Needed for NiceRF Lora1276. Not needed for RFM92/RFM95
  .txen = 0, 			// Needed for NiceRF Lora1276. Not needed for RFM92/RFM95
  .rst = 11,  			// Needed on RFM92/RFM95? (probably not)
  .dio = {3, 5, 6},		// Specify pin numbers for DIO0, 1, 2
						// connected to D4, D5, D7
};

But what about DIO?
I am not sure, but I sggest that I also have to wire as showed here

Someone has an experience with FeatherMO adalogger with Radio Featherwings?

Many thank for your help

set frequency?

Hello, it's really nice of your clear instruction and code that makes it easy to test with the adafruit feather m0 lora boards.

Just a quick question in your code: I am not sure how you set the frequency of the end-node. Are they hidden somewhere or they are just pre-configurated to a certain frequency?

Difficulty to debug and make it working

Helo
I am very new with Lora and I am trying to build a node with a Feather MO Lora board

I connect the pim has it's shown here

I also download the library LoRa-LMIC-1.51 as it's written here , and then I configured the code with

At TTN web site I created a new devise and I saved it as the following
// LoRaWAN Config
// Device Address
devaddr_t DevAddr = 0x26011942; // TTN Device Address

// Network Session Key
unsigned char NwkSkey[16] = { 0x25, 0x64, 0x48, 0xC4, 0x39, 0x57, 0x84, 0x89, 0x57, 0x33, 0xCA, 0x80, 0xF0, 0xF4, 0xA1, 0xD8 }; // TTN Network Session Key
                            
// Application Session Key
unsigned char AppSkey[16] = { 0x9A, 0xCB, 0xE8, 0x23, 0x4D, 0xC5, 0xCB, 0x37, 0xDB, 0x33, 0x85, 0x28, 0xCD, 0x28, 0x16, 0x01 }; // TTN App Session Key

// LoRaWAN Application identifier (AppEUI)
static const u1_t AppEui[8] PROGMEM = { 0x70, 0xB3, 0xD5, 0x7E, 0xF0, 0x00, 0x64, 0x29 }; // TTN Application EUI

I upload my code and here is the print I got
(I add some debug point. All print starting with "DEBUG: ..." are debug I added into the code)

Beginning to send data
seqno 1: Battery: 4.24
LMIC_setTxData2
DEBUG: engineUpdate
DEBUG: End engineUpdate
dataSent2:0
seqno 1: Free Memory: 28735
LMIC_setTxData2
DEBUG: engineUpdate
DEBUG: End engineUpdate
DEBUG: engineUpdate
DEBUG: processDnData
DEBUG: onEvent
DEBUG: EV_TXCOMPLETE
DEBUG: engineUpdate
Sleeping for 92 seconds

But nothing is recorded into my TTN console even if I am close within 5km of a gateway.
How should I exactly configure my devise by TTN?

Into the sketch file, I also observed the followin initLoRaWAN() function;

Is there a way debug if the node joned the nearest gateway?
Is tere a way to have thr following funtion to return true or flase?
Is there a way to know if data has been recorded or not to TTN?
If I am on the train, does the node will send message to a gateway if the train through an area coavered by a gateway? Or does the node have to join first a gateway and a node can not move...

I thank a lot if you tell me more about Feather MO Lora board with the goal to send sensor measurement to TTN

Many thank

void initLoRaWAN() {
	// LMIC init
  sprintln(F("=> os_init"),2);
	os_init();

	// Reset the MAC state. Session and pending data transfers will be discarded.
  sprintln(F("=> LMIC_reset"),2);
	LMIC_reset();

	// by joining the network, precomputed session parameters are be provided.
	sprintln(F("=> Joining network"),2);
	LMIC_setSession(0x1, DevAddr, (uint8_t*)NwkSkey, (uint8_t*)AppSkey);

	// Enabled data rate adaptation
  sprintln(F("=> Enable data rate adaptation)"),2);
	LMIC_setAdrMode(1);

	// Enable link check validation
  sprintln(F("=> Enable link check validation"),2);
	LMIC_setLinkCheckMode(0);

	// Set data rate and transmit power
  sprintln(F("=> Set data rate and transit power"),2);
	LMIC_setDrTxpow(DR_SF12, 21);
}

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.