Page 1 of 2

Lora point2 point

PostPosted: Tue Jan 03, 2017 2:34 pm
by dfrdfr7
Hi

Is there any tutorial for Lora point 2 point data transmission about Cytron Lora shield ?

Re: Lora point2 point

PostPosted: Tue Jan 03, 2017 6:02 pm
by bengchet
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 563 times
LoRaRX.zip
Sketch for receive
(1.1 KiB) Downloaded 507 times

Re: Lora point2 point

PostPosted: Wed Aug 02, 2017 10:13 am
by Intern USMC
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,

Re: Lora point2 point

PostPosted: Wed Aug 02, 2017 10:26 am
by bengchet
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.

Re: Lora point2 point

PostPosted: Tue Aug 15, 2017 4:37 pm
by Intern USMC
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

Re: Lora point2 point

PostPosted: Tue Aug 15, 2017 4:47 pm
by bengchet
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.

Re: Lora point2 point

PostPosted: Wed Aug 16, 2017 9:51 am
by Intern USMC
Ok thank you very much for the help :D

Re: Lora point2 point

PostPosted: Mon Aug 21, 2017 3:30 pm
by Intern USMC
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,

Re: Lora point2 point

PostPosted: Tue Aug 22, 2017 4:00 pm
by bengchet
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.

Re: Lora point2 point

PostPosted: Mon Aug 28, 2017 2:32 pm
by Intern USMC
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,