xreef / EByte_LoRa_E220_micropython_library

MicroPython LoRa EBYTE E220 LLCC68 device library complete and tested with Arduino, esp8266, esp32, STM32 and Raspberry Pi Pico (rp2040 boards).
https://www.mischianti.org/category/my-libraries/lora-e220-llcc68-devices/
Other
12 stars 1 forks source link

Data size no match with Raspberry Pi pico #3

Closed WotoAOT closed 5 months ago

WotoAOT commented 6 months ago

Hello,

I have connected the E220-900T22D module to the Raspberry Pi pico as follows: Pico ----- E220 1 -------- 4 (TxD) 2 -------- 3 (RxD) 15 ------- 5 (AUX) 21 ------- 1 (M0) 19 ------- 2 (M1)

I use the UART0 on the Pico (pin 1 and 2). I have also connected a 4.7kOhm pull-up resistor to each of TxD, RxD and AUX.

Unfortunately, I always get the following message:

Initialisation: {} Success Retrieve configuration: {} Data size not match!

Traceback (most recent call last): File "", line 29, in File "/lib/LoraWanE220/lora_e220.py", line 245, in print_configuration AttributeError: 'NoneType' object has no attribute '_COMMAND'

What could be the reason?

best regards Woto

xreef commented 6 months ago

Hi, Normally we get that error when the wiring isn't correct. Try to check it. Bye Renzo

xreef commented 6 months ago

You can try to follow the schema of e32 with pico https://mischianti.org/ebyte-lora-e32-micropython-exploring-library-2/ Bye Renzo

WotoAOT commented 6 months ago

Hello Renzo, Thank you very much. It works now. So that I can use 868Mhz, I have to change the value from 23 to 18 in the lib lora_e220.py line 165, is that correct? Or is there a command for this?

best regards, Woto

WotoAOT commented 6 months ago

I have set the line to self.CHAN = 18 but the frequency is still 873 Mhz.

xreef commented 6 months ago

Can you open a forum topic with the code you use please? Thanks Renzo

WotoAOT commented 6 months ago

Hello Renzo, Yes, but I'm new here and don't know how to create a forum topic. Here is my code:

from machine import UART

from LoraWanE220.lora_e220 import LoRaE220, print_configuration from LoraWanE220.lora_e220_operation_constant import ResponseStatusCode

uart1 = UART(1)

lora = LoRaE220('900T22D', uart1, aux_pin=2, m0_pin=10, m1_pin=11)

code = lora.begin() print("Initialisation: {}", ResponseStatusCode.get_description(code))

code, configuration = lora.get_configuration()

print("Retrieve configuration: {}", ResponseStatusCode.get_description(code))

print_configuration(configuration)

WotoAOT commented 5 months ago

Hello Renzo,

i have opened a new topic in the forum. I think that setting the channel is not implemented in the library.

Best regards Woto

xreef commented 5 months ago

https://mischianti.org/forums/topic/data-size-no-match-with-raspberry-pi-pico/#post-29077