Lora point2 point

FYP Starter Pack, ICs, Voltage Regulator, Resistor, Capacitor......

Lora point2 point

Postby dfrdfr7 » Tue Jan 03, 2017 2:34 pm

Hi

Is there any tutorial for Lora point 2 point data transmission about Cytron Lora shield ?
dfrdfr7
Fledgling
 
Posts: 1
Joined: Tue Jan 03, 2017 1:43 am

Re: Lora point2 point

Postby bengchet » Tue Jan 03, 2017 6:02 pm

Hi,

You can refer to example sketch attached below.

For more info, you can refer to this forum.

Hope it helps.

LoRaTX.zip
Sketch for transmit
(1.02 KiB) Downloaded 879 times
LoRaRX.zip
Sketch for receive
(1.1 KiB) Downloaded 786 times
bengchet
Amateur
 
Posts: 237
Joined: Tue Aug 25, 2015 8:29 am

Re: Lora point2 point

Postby Intern USMC » Wed Aug 02, 2017 10:13 am

I am using the 2 LoRa-RFM95 shield to communicate readings from a sensor. The sensor uses an SPI interface to communicate with the Cytron Uno. But then, I cannot turn off the NSS for LoRa-RFM95 by selecting digitalWrite(10, HIGH) to take the sensor reading.

Does the LoRa shield uses a different pin as NSS to communicate with the Cytron Uno? If yes, what pin is used?

By the way, do you have any other suggestions that may let the sensor communicate with the Cytron Uno without disturbing the communication between the LoRa shield and the Cytron Uno?

Thanks,
Intern USMC
Freshie
 
Posts: 5
Joined: Wed Aug 02, 2017 9:59 am

Re: Lora point2 point

Postby bengchet » Wed Aug 02, 2017 10:26 am

Hi,

That will depend on your sensor wiring. Is the sensor in shield form factor or device with manual wiring? If so you can choose any Arduino pin for its CS, of course you will have to change pin configuration as well in your sensor library.

Other case you don't want to change CS pin for sensor, you can change NSS of LoRa Shield by doing some hacking. You will have to bend the pin 10 leg of LoRa shield and connect it to any Arduino pin you like using a male-female jumper wire. Then change the pin configuration in the coding.

Hope it helps.
bengchet
Amateur
 
Posts: 237
Joined: Tue Aug 25, 2015 8:29 am

Re: Lora point2 point

Postby Intern USMC » Tue Aug 15, 2017 4:37 pm

The device uses a manual wiring. Thank you for the suggestion.

I would like to confirm if I can stack a Cytron ethernet shield on top of the Cytron LoRa shield? Both uses SPI and should be able to communicate right?

Thanks
Intern USMC
Freshie
 
Posts: 5
Joined: Wed Aug 02, 2017 9:59 am

Re: Lora point2 point

Postby bengchet » Tue Aug 15, 2017 4:47 pm

Hi,

Yes you can. But by default both shields use pin 10 as CS. So you will have to decide which shield should be using different pin as CS other than pin 10. As I suggested in previous topic, you can change CS/NSS of LoRa shield.

Other case you don't want to change CS pin for sensor, you can change NSS of LoRa Shield by doing some hacking. You will have to bend the pin 10 leg of LoRa shield and connect it to any Arduino pin you like using a male-female jumper wire. Then change the pin configuration in the coding.
bengchet
Amateur
 
Posts: 237
Joined: Tue Aug 25, 2015 8:29 am

Re: Lora point2 point

Postby Intern USMC » Wed Aug 16, 2017 9:51 am

Ok thank you very much for the help :D
Intern USMC
Freshie
 
Posts: 5
Joined: Wed Aug 02, 2017 9:59 am

Re: Lora point2 point

Postby Intern USMC » Mon Aug 21, 2017 3:30 pm

Hello,

Could someone help explain the following line of code? What does it do?

Serial.println(radiopacket.length());
rf95.send((uint8_t*)(radiopacket.c_str()), radiopacket.length()+1);

Does the line (uint8_t*)(radiopacket.c_str()) convert the radiopacket string into uint_8 format?

Thank you,
Intern USMC
Freshie
 
Posts: 5
Joined: Wed Aug 02, 2017 9:59 am

Re: Lora point2 point

Postby bengchet » Tue Aug 22, 2017 4:00 pm

Hi,

CODE: SELECT_ALL_CODE
rf95.send((uint8_t*)(radiopacket.c_str()), radiopacket.length()+1);


This function only accepts bytes array by default. So actually it is just a conventional way to convert a string to bytes array in uint8_t format.
bengchet
Amateur
 
Posts: 237
Joined: Tue Aug 25, 2015 8:29 am

Re: Lora point2 point

Postby Intern USMC » Mon Aug 28, 2017 2:32 pm

Thank you for the help bengchet,

By the way, is it possible to have the circuit diagram for the cytron lora-rfm95 shield?

I am having some problem trying to let the module receive the 2nd message sent. The code works fine with Dragino shield but not with this cytron shield. I would like to find the difference and find a reason why is my cytron lora shield not receiving the 2nd message.

Thank you,
Intern USMC
Freshie
 
Posts: 5
Joined: Wed Aug 02, 2017 9:59 am

Next

Return to Electronic Component

Who is online

Users browsing this forum: No registered users and 1 guest

cron