CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

LoRaWAN stack
Goto page 1, 2  Next
 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
Donatello



Joined: 21 Oct 2016
Posts: 22

View user's profile Send private message

LoRaWAN stack
PostPosted: Wed Jun 10, 2020 2:29 am     Reply with quote

Dear All,
I would like to make a LoRaWAN (868MHz) network with EByte LoRa modules. But I need a LoRaWAN stack. I read that Microchip has a plug-in but I was unable to download it. Anyone know a library to use (maybe for PCWHD)?
Thank you

Donatello
Ttelmah



Joined: 11 Mar 2010
Posts: 19513

View user's profile Send private message

PostPosted: Wed Jun 10, 2020 3:02 am     Reply with quote

GitHub has a stack, that should be translatable to CCS.

Thing is how big a chip are you thinking of using?. The stack is not small...
I've been playing with it on the Raspberry Pi, and have found that there
are a number of issues. In the UK, there are two network providers,
and they use different protocols and cover different parts of the country,
so building for use anywhere in the country is hard.
Then the overall reliability is quite poor, with you able to establish a
connection and showing quite good signal strength, but when you actually
try to do anything, the failure rate is abysmal. Had to reset the modem to
re-establish communication at times...
With the limitations on reliability, it is good provided you only need very
small amounts of data. In the EU, limit of 1% network use, and most places
have similar limits. This is not something to use if you need to send anything
more than a simple status message or configuration control at all often.
Remember the assembled device will need approval.

Why not use something like the RN2903, that has the stack internally?.
Much easier to drive than trying to implement a stack yourself. Will save
a lot of time, and code space...
Donatello



Joined: 21 Oct 2016
Posts: 22

View user's profile Send private message

PostPosted: Wed Jun 10, 2020 4:32 am     Reply with quote

Thank you Ttelmah,
I have to transmit a simple data from multiple weather stations to a gateway. In this application LoRa is very convenient.
Without a LoRaWAN, my doubt are:
1) collisions when multiple stations transmit data simultaneously
2) other communications from other companies on the same channel
3) data security and integrity

For the 3, I can add CRC and encode the data with a simple algorithm
For the 2, I thing that the gateway should continuously listen to all the messages in channel and filter those of interest.
For the 1, I can send a message from the gateway to the end device (weather stations), which will respond with the data of interest. But this generates some bandwidth consumption. Furthermore, if there are other transmissions of other company, messages must be continuously transmitted because there will be collisions.

Or I have to give in using a LoRaWAN Transceiver Module but the costs are high.
temtronic



Joined: 01 Jul 2010
Posts: 9226
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Wed Jun 10, 2020 6:09 am     Reply with quote

just a comment....

Can I assume these 'weather stations' have line power and NOT batteries ? ALL wireless tech requires a LOT of energy to transmit data. While your payload (data) may not be large, there's a lot of 'overhead' data that goes along.....

Also the 'distance' spec is kinda misleading, I only could get 1/2 (about 3 miles) not the published 10km (6 miles) so be sure to do real World testing with say 3 or 4 prototypes. Have host send 'hello' to 'A', 'A' resends to 'B', then 'B' to 'C', 'C' to 'D', then 'D' to host. A wireless 'loop of data'.

Unlike the solid copper I use, all wireless methods can fail miserably.
Milentije89



Joined: 07 Apr 2017
Posts: 31

View user's profile Send private message

PostPosted: Wed Jun 10, 2020 9:24 am     Reply with quote

I was doing some testing for last few days with RN2483 modules. Checking how different settings affect range, data rate and other things.

My problem is the size of RN2483. It is too big for the device I have to design. So I am also looking for SX127x library for CCS C. I know it can be ported from other platforms but it would take me a precious time.

I took this as reference, but didn't have enough time to translate it to CCS C.
https://www.arduinolibraries.info/libraries/lo-ra

RFM95/96 or similar modules would fit my project perfectly, just to find some kind of solution for library.

EDIT: In fact, I do not need whole LoRaWAN stack, I just need radio part. Just to be able to make simple P2P communication between 2 devices.
temtronic



Joined: 01 Jul 2010
Posts: 9226
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Wed Jun 10, 2020 10:55 am     Reply with quote

re: It is too big for the device I have to design.

simple ,easy solution ... have the person who dictated the size to show you HOW he would design it !
I've used the 'show me how' reply for the past 30 years to everyone including some very high priced PHDs.... when REALITY is shown, 'they' will see their idea was not possible.
I'm not saying it can't be built 'thumbnail' sized BUT some days you need a reality check.
Still would like to know , is this AC powered or batteries ? If batteries be sure to look at the 'cold weather' specs for current capacity. Most batteries are terrible... can lose 1/3 to 1/2 their capacity when the snow and ice comes !!
Milentije89



Joined: 07 Apr 2017
Posts: 31

View user's profile Send private message

PostPosted: Wed Jun 10, 2020 12:05 pm     Reply with quote

temtronic wrote:
re: It is too big for the device I have to design.

simple ,easy solution ... have the person who dictated the size to show you HOW he would design it !
I've used the 'show me how' reply for the past 30 years to everyone including some very high priced PHDs.... when REALITY is shown, 'they' will see their idea was not possible.
I'm not saying it can't be built 'thumbnail' sized BUT some days you need a reality check.


I can't agree more. Smile I have to revise a lot of things regarding this project.

temtronic wrote:
Still would like to know , is this AC powered or batteries ? If batteries be sure to look at the 'cold weather' specs for current capacity. Most batteries are terrible... can lose 1/3 to 1/2 their capacity when the snow and ice comes !!


My project is battery powered. It has to work for 2-6 hours. Battery supply will not be the problem in "battery" part, but in dimensions part. Smile

This is not my thread, so I don't want to overtake it from original poster with my problems. I came here just to share my current view point on this problem, and maybe start a productive discussion.
Ttelmah



Joined: 11 Mar 2010
Posts: 19513

View user's profile Send private message

PostPosted: Wed Jun 10, 2020 12:31 pm     Reply with quote

Understand, ypu do need the whole application stack.
Your device has to issue a request to the gateway, accept the reply from
this, then send it's packet, with the correct encryption, and handle the
decryption for stuff sent to it. This is a network, not a point to point
protocol. Requires the network handling code.
Since you will probably only need to handle one type of operation. I'd
guess probably ClassA (lowest power).
The basic application stack source code from Semtech is at GitHub here:
<https://github.com/Lora-net/LoRaMac-node>
A huge amount does depend on how capable your chip is. The code is
not small.
Milentije89



Joined: 07 Apr 2017
Posts: 31

View user's profile Send private message

PostPosted: Wed Jun 10, 2020 3:10 pm     Reply with quote

Donatello, sorry for abusing your thread.

Ttelmah, I am reading a lot of documents because I am getting into LoRa and trying to find answers to lots of questions regarding LoRa and LoRaWAN.
It seems you can help me (and I am sure a lot of others).
What is stopping me to use LoRa for P2P communication? Device that I am looking to design is going to be used in remote areas that are 99% not covered by LoRaWAN infrastructure (LoRaWAN networks).

Nearest example of use case for "my device" is recovering glider/sailplane models that were taken out of sight by uplift winds and thermals. These models can cost many thousands of €/$, so it is not an option to lose one. They are recovered using P2P LoRa comm. (broadcasting GPS position).

If P2P comm. obeys duty cycle, TX power and other norms, why would one need full LoRaWAN stack?

There is ERC Recommendation 70-03 document where we can see some details. LoRa is in ANEX 1, band H. Max TX power and DC are regulated there.

Why I can't use LoRa for P2P if I stick to the rules and limits? Am I missing something big here?
newguy



Joined: 24 Jun 2004
Posts: 1907

View user's profile Send private message

PostPosted: Wed Jun 10, 2020 7:15 pm     Reply with quote

temtronic wrote:
just a comment....

ALL wireless tech requires a LOT of energy to transmit data. While your payload (data) may not be large, there's a lot of 'overhead' data that goes along.....


True, but the whole point of LoRa is to minimize the data you transmit and also minimize the transmission frequency. Once per hour is often enough for most situations.

I've made a family of sensors using the RN2903A. The one that I did a long term power test on managed ~700,000 RF transmissions of 3 bytes each on a pair of alkaline AA cells. Put the sucker to sleep for most of the time and the relatively high current draw for a transmission averages out to next to nothing in the long run.
Ttelmah



Joined: 11 Mar 2010
Posts: 19513

View user's profile Send private message

PostPosted: Thu Jun 11, 2020 12:13 am     Reply with quote

You can use LoRa for P2P, but not LoRaWAN.

LoRa is the physical transport layer. Just a wireless communication standard.
Like RS485.
Then LoRaWAN, is a definition of a protocol 'over' this layer. So like ModBus.
The LoRaWAN protocols would require you to implement a LoRaWAN stack.
But just using LoRa as a local link between units is completely legitimate.

Your original post said:
Quote:

I would like to make a LoRaWAN (868MHz) network


LoRaWAN....

If the units are just talking to each other, design your own basic error
correction, and have the modules talk to one another. However if you
need to go further than the single 'jump' this implies, you will need to
go through a gateway, and if you need to do this, you need to be talking
to this, and the default protocol will then be LoRaWAN....
Milentije89



Joined: 07 Apr 2017
Posts: 31

View user's profile Send private message

PostPosted: Thu Jun 11, 2020 1:28 am     Reply with quote

Ttelmah, Donatello (original poster of this thread) is talking about network (LoRaWAN), I am talking about P2P comm. between only 2 devices. We are two different persons.
That is a problem of communication between all of us in this thread. Smile
Ttelmah



Joined: 11 Mar 2010
Posts: 19513

View user's profile Send private message

PostPosted: Thu Jun 11, 2020 1:52 am     Reply with quote

That is the problem of putting things about a different situation into
someone else's thread....
Spaeth



Joined: 05 Jun 2020
Posts: 27

View user's profile Send private message

LoRaWAN
PostPosted: Fri Nov 06, 2020 10:18 am     Reply with quote

Hello,

I'm also looking for a CCS LoRaWAN library.
At the moment I'm using RFM95 modules sucessfully in LoRa mode, but only point to point.
For another project I think using LoRaWAN together with TTN (The Things Network) would be better. As I allready do have RFM95 modules it would be good to use them also in LoRaWAN. The PIC should be a 8Bit controller.
OK, I could take an RN2483, but the size of an RFM95 is smaller...
It would be good to implement the LoRaWAN stack in the PIC which does all the other things of the job, reading sensors and so on.

I saw a LoRaWAN library supported by Microchip, but how to implement this in the CCS IDE?
Ttelmah



Joined: 11 Mar 2010
Posts: 19513

View user's profile Send private message

PostPosted: Fri Nov 06, 2020 12:25 pm     Reply with quote

See my previous comment about the size of the stack. You need to be
looking at one of the larger PIC18's if you are not going to have a size
problem.
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group