Open vinityadava opened 7 months ago
Um... did you not notice your typo? You're providing the messageList
to beginPacket()
instead of write()
🙃
Yes, it changed during copy paste but the error is same.
So, the other thing I noticed is your messageList
is a bytes()
object.
Maybe try:
LoRa.write(list(map(int, messageList)))
Yes, it is transmitting now successfully. On receiver side this is what we are getting:
Begin LoRa radio
Set RF module to use TCXO as clock reference
Set frequency to 915 Mhz
Set RX gain to power saving gain
Set modulation parameters:
Spreading factor = 7
Bandwidth = 125 kHz
Coding rate = 4/5
Set packet parameters:
Explicit header type
Preamble length = 12
Payload Length = 15
CRC on
Set syncronize word to 0x3444
-- LoRa Receiver --
Traceback (most recent call last):
File "/home/GroundStation/Desktop/reciever.py", line 80, in <module>
message = struct.unpack('!{}f'.format(len(received_data) - struct.calcsize('!')) // struct.calcsize('f'), received_data)
TypeError: object of type 'int' has no len()
Code on reciever end:
LoRa.request()
# Wait for incoming LoRa packet
LoRa.wait()
# Put received packet to message and counter variable
# read() and available() method must be called after request() or listen() method
message = ""
# available() method return remaining received payload length and will decrement each read() or get() method called
while LoRa.available() > 1:
received_data = LoRa.read()
#message = [val / 1e8 for val in received_data]
message = struct.unpack('!{}f'.format(len(received_data) - struct.calcsize('!')) // struct.calcsize('f'), received_data)
counter = LoRa.read()
# Print received message and counter in serial
print(f"{message} {counter}")
# Print packet/signal status including RSSI, SNR, and signalRSSI
print("Packet status: RSSI = {0:0.2f} dBm | SNR = {1:0.2f} dB".format(
LoRa.packetRssi(), LoRa.snr()))
Please help with this.
Is there any proper documentation for send list over lora using this library?
We are trying to send mpu6050 data over lora Sx126x using raspberrypi zerow , in a list of float using struct method. Error:
Code:
Does anyone have the solution for it??